diff --git a/docs/admins/03-Installer.md b/docs/admins/03-Installer.md index f28d5e6a..9e657563 100644 --- a/docs/admins/03-Installer.md +++ b/docs/admins/03-Installer.md @@ -15,7 +15,7 @@ In this tutorial we will guide you through building and flashing it to a bootabl 2. Identify your flash drive with `lsblk` - ```shellSession + ```bash $ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS sdb 8:0 1 117,2G 0 disk @@ -84,7 +84,7 @@ See: Guide for Wifi Below ### Whats next? -- [Deploying](): Deploying a Machine configuration +- [Deploying Machines](./02-machines.md): Deploying a Machine configuration - [WiFi](#optional-connect-to-wifi): Guide for connecting to Wifi. --- diff --git a/docs/admins/04-networking.md b/docs/admins/04-networking.md index 1a0ed690..308a3b4d 100644 --- a/docs/admins/04-networking.md +++ b/docs/admins/04-networking.md @@ -24,7 +24,7 @@ crucial. }; ``` 3. **Update the Controller Machine**: Execute the following: - ```console + ```bash $ clan machines update ``` Your machine is now operational as the VPN controller. @@ -43,24 +43,24 @@ To introduce a new machine to the VPN, adhere to the following steps: } ``` 2. **Update the New Machine**: Execute: - ```console + ```bash $ clan machines update ``` Replace `` with the designated new machine name. 3. **Retrieve the ZeroTier ID**: On the `new_machine`, execute: - ```console + ```bash $ sudo zerotier-cli info ``` Example Output: `200 info d2c71971db 1.12.1 OFFLINE`, where `d2c71971db` is the ZeroTier ID. 4. **Authorize the New Machine on Controller**: On the controller machine, execute: - ```console + ```bash $ sudo zerotier-members allow ``` Substitute `` with the ZeroTier ID obtained previously. 5. **Verify Connection**: On the `new_machine`, re-execute: - ```console + ```bash $ sudo zerotier-cli info ``` The status should now be "ONLINE" e.g., `200 info 47303517ef 1.12.1 ONLINE`. diff --git a/docs/admins/03-install-iso.md b/docs/admins/05-install-iso.md similarity index 98% rename from docs/admins/03-install-iso.md rename to docs/admins/05-install-iso.md index 0e712838..9304a4de 100644 --- a/docs/admins/03-install-iso.md +++ b/docs/admins/05-install-iso.md @@ -20,7 +20,7 @@ nix build git+https://git.clan.lol/clan/clan-core.git#install-iso 2. Identify your flash drive with `lsblk`. - ```shellSession + ```bash $ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS sdb 8:0 1 117,2G 0 disk @@ -106,13 +106,13 @@ After writing the installer to the USB drive, use it to boot the target machine. 2. List available networks. Double press tab after station for device autocompletion. In this case `wlan0` is the only network wifi device. - ```shellSession + ```bash [iwd] station wlan0 get-networks ``` 3. Connect to a Wifi network. Replace `SSID` with the wlan network name. - ```shellSession + ```bash [iwd] station wlan0 connect SSID ``` diff --git a/docs/admins/06-secrets.md b/docs/admins/06-secrets.md index 7d09b815..447aafcc 100644 --- a/docs/admins/06-secrets.md +++ b/docs/admins/06-secrets.md @@ -53,13 +53,13 @@ sops/ New machines in Clan come with age keys stored in `./sops/machines/`. To list these machines: -```shellSession +```bash $ clan secrets machines list ``` For existing machines, add their keys: -```shellSession +```bash $ clan secrets machines add ``` @@ -67,7 +67,7 @@ $ clan secrets machines add To fetch an age key from an SSH host key: -```shellSession +```bash $ ssh-keyscan | nix shell nixpkgs#ssh-to-age -c ssh-to-age ``` @@ -75,19 +75,19 @@ $ ssh-keyscan | nix shell nixpkgs#ssh-to-age -c ssh-to-age By default, secrets are encrypted for your key. To specify which users and machines can access a secret: -```shellSession +```bash $ clan secrets set --machine --machine --user --user ``` You can add machines/users to existing secrets without modifying the secret: -```shellSession +```bash $ clan secrets machines add-secret ``` ## 4. Adding Secrets -```shellSession +```bash $ clan secrets set mysecret Paste your secret: ``` @@ -96,13 +96,13 @@ Paste your secret: ## 5. Retrieving Stored Secrets -```shellSession +```bash $ clan secrets get mysecret ``` ### List all Secrets -```shellSession +```bash $ clan secrets list ``` @@ -120,19 +120,19 @@ Here's how to get started: Assign users to a new group, e.g., `admins`: - ```shellSession + ```bash $ clan secrets groups add admins ``` 2. **Listing Groups**: - ```shellSession + ```bash $ clan secrets groups list ``` 3. **Assigning Secrets to Groups**: - ```shellSession + ```bash $ clan secrets groups add-secret ``` @@ -182,7 +182,7 @@ commonly allows to put all secrets in a yaml or json documents. If you already happened to use sops-nix, you can migrate by using the `clan secrets import-sops` command by importing these documents: -```shellSession +```bash % clan secrets import-sops --prefix matchbox- --group admins --machine matchbox nixos/matchbox/secrets/secrets.yaml ``` diff --git a/docs/admins/07-backups.md b/docs/admins/07-backups.md index 425ab4af..cebd25e3 100644 --- a/docs/admins/07-backups.md +++ b/docs/admins/07-backups.md @@ -20,7 +20,7 @@ such as USB hard drives or network-attached storage. It uses a tool called rsnap First, figure out which device you'll use for backups. You can see all connected devices by running this command in your terminal: -```console +```bash lsblk --output NAME,PTUUID,FSTYPE,SIZE,MOUNTPOINT ``` @@ -58,7 +58,7 @@ Replace `/dev/sda2` with your device and `/mnt/hdd` with your preferred mount po 4. **Create Backups:** To create a backup, run: - ```console + ```bash clan backups create mymachine ``` @@ -66,7 +66,7 @@ Replace `/dev/sda2` with your device and `/mnt/hdd` with your preferred mount po 5. **Listing Backups:** To see available backups, run: - ```console + ```bash clan backups list mymachine ``` @@ -132,18 +132,18 @@ Ensure the path to the public key is correct. Backups are automatically performed nightly. To check the next scheduled backup, use: - ```console + ```bash systemctl list-timers | grep -E 'NEXT|borg' ``` - **Listing Backups:** To see available backups, run: - ```console + ```bash clan backups list mymachine ``` - **Manual Backups:** You can also initiate a backup manually: - ```console + ```bash clan backups create mymachine ``` diff --git a/pkgs/clan-cli/README.md b/pkgs/clan-cli/README.md index 96affeb6..ba7eed99 100644 --- a/pkgs/clan-cli/README.md +++ b/pkgs/clan-cli/README.md @@ -22,13 +22,13 @@ After you can use the local bin wrapper to test things in the cli: By default tests run in parallel using pytest-parallel. pytest-parallel however breaks `breakpoint()`. To disable it, use this: -```console +```bash pytest -n0 -s ``` You can also run a single test like this: -```console +```bash pytest -n0 -s tests/test_secrets_cli.py::test_users ``` @@ -36,12 +36,12 @@ pytest -n0 -s tests/test_secrets_cli.py::test_users Run all impure checks -```console +```bash nix run .#impure-checks ``` Run all checks -```console +```bash nix flake check ```