From d2a248ed2ddd7b88dcfa291265a24eeb842a330e Mon Sep 17 00:00:00 2001 From: Qubasa Date: Mon, 13 May 2024 00:09:24 +0200 Subject: [PATCH] Renamed machines.md to deploy.md --- .../{machines.md => deploy.md} | 36 ++++++++++--------- .../{networking.md => mesh-vpn.md} | 0 docs/site/getting-started/secrets.md | 4 +-- templates/new-clan/flake.nix | 6 ++++ .../new-clan/machines/jon/configuration.nix | 1 + .../new-clan/machines/sara/configuration.nix | 1 + 6 files changed, 29 insertions(+), 19 deletions(-) rename docs/site/getting-started/{machines.md => deploy.md} (93%) rename docs/site/getting-started/{networking.md => mesh-vpn.md} (100%) diff --git a/docs/site/getting-started/machines.md b/docs/site/getting-started/deploy.md similarity index 93% rename from docs/site/getting-started/machines.md rename to docs/site/getting-started/deploy.md index c4bbc921b..038712f3b 100644 --- a/docs/site/getting-started/machines.md +++ b/docs/site/getting-started/deploy.md @@ -128,9 +128,6 @@ This process involves preparing a suitable hardware and disk partitioning config clan machines install [MACHINE] --png [PATH] ``` - !!!note - If you are using our template `[MACHINE]` would be `jon` - === "**SSH access**" Replace `` with the **target computers' ip address**: @@ -139,28 +136,37 @@ This process involves preparing a suitable hardware and disk partitioning config clan machines install [MACHINE] ``` - !!!note - Building and deploying time will depend on hardware and connection speed. + +If you are using our template `[MACHINE]` would be `jon` !!! success - Your machine is all set up. 🎉 🚀 - ## Update Your Machines Clan CLI enables you to remotely update your machines over SSH. This requires setting up a target address for each target machine. ### Setting the Target Host -Replace `host_or_ip` with the actual hostname or IP address of your target machine: - -```bash -clan config --machine my-machine clan.networking.targetHost root@host_or_ip +Replace `root@jon` with the actual hostname or IP address of your target machine: +```nix hl_lines="9" +buildClan { + # ... + machines = { + # "jon" will be the hostname of the machine + "jon" = { + # Set this for clan commands use ssh i.e. `clan machines update` + # If you change the hostname, you need to update this line to root@ + # This only works however if you have avahi running on your admin machine else use IP + clan.networking.targetHost = pkgs.lib.mkDefault "root@jon"; + }; + }; +}; ``` + !!! warning The use of `root@` in the target address implies SSH access as the `root` user. Ensure that the root login is secured and only used when necessary. @@ -170,7 +176,7 @@ clan config --machine my-machine clan.networking.targetHost root@host_or_ip Execute the following command to update the specified machine: ```bash -clan machines update my-machine +clan machines update jon ``` You can also update all configured machines simultaneously by omitting the machine name: @@ -204,11 +210,7 @@ This is useful for machines that are not always online or are not part of the re ## What's next ? -- [**Mesh VPN**](./networking.md): Configuring a secure mesh network. +- [**Mesh VPN**](./mesh-vpn.md): Configuring a secure mesh network. --- -# TODO: -* TODO: How to join others people zerotier - * `services.zerotier.joinNetworks = [ "network-id" ]` -* Controller needs to approve over webinterface or cli diff --git a/docs/site/getting-started/networking.md b/docs/site/getting-started/mesh-vpn.md similarity index 100% rename from docs/site/getting-started/networking.md rename to docs/site/getting-started/mesh-vpn.md diff --git a/docs/site/getting-started/secrets.md b/docs/site/getting-started/secrets.md index e770552d5..9267b5b58 100644 --- a/docs/site/getting-started/secrets.md +++ b/docs/site/getting-started/secrets.md @@ -57,7 +57,7 @@ If you followed the quickstart tutorial all necessary secrets are initialized at ## Whats next? -- [Deployment](machines.md): How to remotely deploy your machine +- [Deployment](deploy.md): How to remotely deploy your machine --- @@ -329,6 +329,6 @@ you can now remove `sops.secrets. = { };` unless you need to specify mo ## Whats next? -- [Deployment](machines.md): How to remotely deploy your machine +- [Deployment](deploy.md): How to remotely deploy your machine --- diff --git a/templates/new-clan/flake.nix b/templates/new-clan/flake.nix index e3b80f068..a87e490fb 100644 --- a/templates/new-clan/flake.nix +++ b/templates/new-clan/flake.nix @@ -19,6 +19,7 @@ # local> mkdir -p ./machines/machine1 # local> Edit ./machines/machine1/configuration.nix to your liking machines = { + # "jon" will be the hostname of the machine jon = { imports = [ ./modules/shared.nix @@ -31,6 +32,8 @@ clanCore.machineIcon = null; # Optional, a path to an image file # Set this for clan commands use ssh i.e. `clan machines update` + # If you change the hostname, you need to update this line to root@ + # This only works however if you have avahi running on your admin machine else use IP clan.networking.targetHost = pkgs.lib.mkDefault "root@jon"; # ssh root@flash-installer.local lsblk --output NAME,ID-LINK,FSTYPE,SIZE,MOUNTPOINT @@ -46,6 +49,7 @@ # the controller can be offline and routing still works. clan.networking.zerotier.controller.enable = true; }; + # "sara" will be the hostname of the machine sara = { imports = [ ./modules/shared.nix @@ -58,6 +62,8 @@ clanCore.machineIcon = null; # Optional, a path to an image file # Set this for clan commands use ssh i.e. `clan machines update` + # If you change the hostname, you need to update this line to root@ + # This only works however if you have avahi running on your admin machine else use IP clan.networking.targetHost = pkgs.lib.mkDefault "root@sara"; # ssh root@flash-installer.local lsblk --output NAME,ID-LINK,FSTYPE,SIZE,MOUNTPOINT diff --git a/templates/new-clan/machines/jon/configuration.nix b/templates/new-clan/machines/jon/configuration.nix index 24b3ae712..e70188d62 100644 --- a/templates/new-clan/machines/jon/configuration.nix +++ b/templates/new-clan/machines/jon/configuration.nix @@ -30,5 +30,6 @@ in "disk" ]; uid = 1000; + openssh.authorizedKeys.keys = config.users.users.root.openssh.authorizedKeys.keys; }; } diff --git a/templates/new-clan/machines/sara/configuration.nix b/templates/new-clan/machines/sara/configuration.nix index e45a4455a..2d5eb2460 100644 --- a/templates/new-clan/machines/sara/configuration.nix +++ b/templates/new-clan/machines/sara/configuration.nix @@ -31,5 +31,6 @@ in "disk" ]; uid = 1000; + openssh.authorizedKeys.keys = config.users.users.root.openssh.authorizedKeys.keys; }; }