From 05d694b437e4e93142d251bd2e0430cd9d7f694f Mon Sep 17 00:00:00 2001 From: Florian Preinstorfer Date: Wed, 2 Oct 2024 13:20:08 +0200 Subject: [PATCH] Make a few pages linter compatible Also update ignored files for prettier --- .prettierignore | 6 +--- docs/ref/remote-cli.md | 54 ++++++++++++++++----------------- docs/setup/install/container.md | 49 +++++++++++++++--------------- docs/setup/install/official.md | 50 +++++++++++++++--------------- 4 files changed, 78 insertions(+), 81 deletions(-) diff --git a/.prettierignore b/.prettierignore index d455d02cc1b..4b873f4915f 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,6 +1,2 @@ .github/workflows/test-integration-v2* -docs/dns-records.md -docs/running-headscale-container.md -docs/running-headscale-linux-manual.md -docs/running-headscale-linux.md -docs/running-headscale-openbsd.md +docs/about/features.md diff --git a/docs/ref/remote-cli.md b/docs/ref/remote-cli.md index cfa8d90570c..041d46c4192 100644 --- a/docs/ref/remote-cli.md +++ b/docs/ref/remote-cli.md @@ -39,46 +39,46 @@ headscale apikeys expire --prefix "" ## Download and configure headscale -1. Download the latest [`headscale` binary from GitHub's release page](https://github.com/juanfont/headscale/releases): +1. Download the latest [`headscale` binary from GitHub's release page](https://github.com/juanfont/headscale/releases): -2. Put the binary somewhere in your `PATH`, e.g. `/usr/local/bin/headscale` +1. Put the binary somewhere in your `PATH`, e.g. `/usr/local/bin/headscale` -3. Make `headscale` executable: +1. Make `headscale` executable: - ```shell - chmod +x /usr/local/bin/headscale - ``` + ```shell + chmod +x /usr/local/bin/headscale + ``` -4. Configure the CLI through environment variables +1. Configure the CLI through environment variables - ```shell - export HEADSCALE_CLI_ADDRESS=":" - export HEADSCALE_CLI_API_KEY="" - ``` + ```shell + export HEADSCALE_CLI_ADDRESS=":" + export HEADSCALE_CLI_API_KEY="" + ``` - for example: + for example: - ```shell - export HEADSCALE_CLI_ADDRESS="headscale.example.com:50443" - export HEADSCALE_CLI_API_KEY="abcde12345" - ``` + ```shell + export HEADSCALE_CLI_ADDRESS="headscale.example.com:50443" + export HEADSCALE_CLI_API_KEY="abcde12345" + ``` - This will tell the `headscale` binary to connect to a remote instance, instead of looking - for a local instance (which is what it does on the server). + This will tell the `headscale` binary to connect to a remote instance, instead of looking + for a local instance (which is what it does on the server). - The API key is needed to make sure that you are allowed to access the server. The key is _not_ - needed when running directly on the server, as the connection is local. + The API key is needed to make sure that you are allowed to access the server. The key is _not_ + needed when running directly on the server, as the connection is local. -5. Test the connection +1. Test the connection - Let us run the headscale command to verify that we can connect by listing our nodes: + Let us run the headscale command to verify that we can connect by listing our nodes: - ```shell - headscale nodes list - ``` + ```shell + headscale nodes list + ``` - You should now be able to see a list of your nodes from your workstation, and you can - now control the headscale server from your workstation. + You should now be able to see a list of your nodes from your workstation, and you can + now control the headscale server from your workstation. ## Behind a proxy diff --git a/docs/setup/install/container.md b/docs/setup/install/container.md index ef0b309f75a..81e7f7b750d 100644 --- a/docs/setup/install/container.md +++ b/docs/setup/install/container.md @@ -13,15 +13,15 @@ not work with alternatives like [Podman](https://podman.io). The Docker image ca ## Configure and run headscale -1. Prepare a directory on the host Docker node in your directory of choice, used to hold headscale configuration and the [SQLite](https://www.sqlite.org/) database: +1. Prepare a directory on the host Docker node in your directory of choice, used to hold headscale configuration and the [SQLite](https://www.sqlite.org/) database: ```shell mkdir -p ./headscale/config cd ./headscale ``` -1. Download the example configuration for your chosen version and save it as: `/etc/headscale/config.yaml`. Adjust the - configuration to suit your local environment. See [Configuration](../../ref/configuration.md) for details. +1. Download the example configuration for your chosen version and save it as: `/etc/headscale/config.yaml`. Adjust the + configuration to suit your local environment. See [Configuration](../../ref/configuration.md) for details. ```shell sudo mkdir -p /etc/headscale @@ -32,7 +32,7 @@ not work with alternatives like [Podman](https://podman.io). The Docker image ca `--volume $(pwd)/lib:/var/lib/headscale` and `--volume $(pwd)/run:/var/run/headscale` in the next step. -1. Start the headscale server while working in the host headscale directory: +1. Start the headscale server while working in the host headscale directory: ```shell docker run \ @@ -52,25 +52,26 @@ not work with alternatives like [Podman](https://podman.io). The Docker image ca Example `docker-compose.yaml` - ```yaml - version: "3.7" - - services: - headscale: - image: headscale/headscale: - restart: unless-stopped - container_name: headscale - ports: - - "127.0.0.1:8080:8080" - - "127.0.0.1:9090:9090" - volumes: - # Please change to the fullpath of the config folder just created - - :/etc/headscale - command: serve - ``` - -1. Verify headscale is running: - Follow the container logs: + ```yaml + version: "3.7" + + services: + headscale: + image: headscale/headscale: + restart: unless-stopped + container_name: headscale + ports: + - "127.0.0.1:8080:8080" + - "127.0.0.1:9090:9090" + volumes: + # Please change to the fullpath of the config folder just created + - :/etc/headscale + command: serve + ``` + +1. Verify headscale is running: + + Follow the container logs: ```shell docker logs --follow headscale @@ -88,7 +89,7 @@ not work with alternatives like [Podman](https://podman.io). The Docker image ca curl http://127.0.0.1:9090/metrics ``` -1. Create a user ([tailnet](https://tailscale.com/kb/1136/tailnet/)): +1. Create a user ([tailnet](https://tailscale.com/kb/1136/tailnet/)): ```shell docker exec -it headscale \ diff --git a/docs/setup/install/official.md b/docs/setup/install/official.md index b33f76738ec..d3f307f53a3 100644 --- a/docs/setup/install/official.md +++ b/docs/setup/install/official.md @@ -9,34 +9,34 @@ It is recommended to use our DEB packages to install headscale on a Debian based user to run headscale, provide a default configuration and ship with a systemd service file. Supported distributions are Ubuntu 20.04 or newer, Debian 11 or newer. -1. Download the [latest headscale package](https://github.com/juanfont/headscale/releases/latest) for your platform (`.deb` for Ubuntu and Debian). +1. Download the [latest headscale package](https://github.com/juanfont/headscale/releases/latest) for your platform (`.deb` for Ubuntu and Debian). ```shell HEADSCALE_VERSION="" # See above URL for latest version, e.g. "X.Y.Z" (NOTE: do not add the "v" prefix!) HEADSCALE_ARCH="" # Your system architecture, e.g. "amd64" wget --output-document=headscale.deb \ - "https://github.com/juanfont/headscale/releases/download/v${HEADSCALE_VERSION}/headscale_${HEADSCALE_VERSION}_linux_${HEADSCALE_ARCH}.deb" + "https://github.com/juanfont/headscale/releases/download/v${HEADSCALE_VERSION}/headscale_${HEADSCALE_VERSION}_linux_${HEADSCALE_ARCH}.deb" ``` -1. Install headscale: +1. Install headscale: ```shell sudo apt install ./headscale.deb ``` -1. [Configure headscale by editing the configuration file](../../ref/configuration.md): +1. [Configure headscale by editing the configuration file](../../ref/configuration.md): ```shell sudo nano /etc/headscale/config.yaml ``` -1. Enable and start the headscale service: +1. Enable and start the headscale service: ```shell sudo systemctl enable --now headscale ``` -1. Verify that headscale is running as intended: +1. Verify that headscale is running as intended: ```shell sudo systemctl status headscale @@ -54,63 +54,63 @@ This section describes the installation of headscale according to the [Requireme assumptions](../requirements.md#assumptions). Headscale is run by a dedicated user and the service itself is managed by systemd. -1. Download the latest [`headscale` binary from GitHub's release page](https://github.com/juanfont/headscale/releases): +1. Download the latest [`headscale` binary from GitHub's release page](https://github.com/juanfont/headscale/releases): ```shell sudo wget --output-document=/usr/local/bin/headscale \ https://github.com/juanfont/headscale/releases/download/v/headscale__linux_ ``` -1. Make `headscale` executable: +1. Make `headscale` executable: ```shell sudo chmod +x /usr/local/bin/headscale ``` -1. Add a dedicated user to run headscale: +1. Add a dedicated user to run headscale: ```shell sudo useradd \ - --create-home \ - --home-dir /var/lib/headscale/ \ - --system \ - --user-group \ - --shell /usr/sbin/nologin \ - headscale + --create-home \ + --home-dir /var/lib/headscale/ \ + --system \ + --user-group \ + --shell /usr/sbin/nologin \ + headscale ``` -1. Download the example configuration for your chosen version and save it as: `/etc/headscale/config.yaml`. Adjust the - configuration to suit your local environment. See [Configuration](../../ref/configuration.md) for details. +1. Download the example configuration for your chosen version and save it as: `/etc/headscale/config.yaml`. Adjust the + configuration to suit your local environment. See [Configuration](../../ref/configuration.md) for details. ```shell sudo mkdir -p /etc/headscale sudo nano /etc/headscale/config.yaml ``` -1. Copy [headscale's systemd service file](../../packaging/headscale.systemd.service) to - `/etc/systemd/system/headscale.service` and adjust it to suit your local setup. The following parameters likely need - to be modified: `ExecStart`, `WorkingDirectory`, `ReadWritePaths`. +1. Copy [headscale's systemd service file](../../packaging/headscale.systemd.service) to + `/etc/systemd/system/headscale.service` and adjust it to suit your local setup. The following parameters likely need + to be modified: `ExecStart`, `WorkingDirectory`, `ReadWritePaths`. -1. In `/etc/headscale/config.yaml`, override the default `headscale` unix socket with a path that is writable by the - `headscale` user or group: +1. In `/etc/headscale/config.yaml`, override the default `headscale` unix socket with a path that is writable by the + `headscale` user or group: ```yaml unix_socket: /var/run/headscale/headscale.sock ``` -1. Reload systemd to load the new configuration file: +1. Reload systemd to load the new configuration file: ```shell systemctl daemon-reload ``` -1. Enable and start the new headscale service: +1. Enable and start the new headscale service: ```shell systemctl enable --now headscale ``` -1. Verify that headscale is running as intended: +1. Verify that headscale is running as intended: ```shell systemctl status headscale