Skip to content

Commit

Permalink
Make a few pages linter compatible
Browse files Browse the repository at this point in the history
Also update ignored files for prettier
  • Loading branch information
nblock committed Oct 2, 2024
1 parent 02bb866 commit 05d694b
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 81 deletions.
6 changes: 1 addition & 5 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -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
54 changes: 27 additions & 27 deletions docs/ref/remote-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,46 +39,46 @@ headscale apikeys expire --prefix "<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="<HEADSCALE ADDRESS>:<PORT>"
export HEADSCALE_CLI_API_KEY="<API KEY FROM PREVIOUS STAGE>"
```
```shell
export HEADSCALE_CLI_ADDRESS="<HEADSCALE ADDRESS>:<PORT>"
export HEADSCALE_CLI_API_KEY="<API KEY FROM PREVIOUS STAGE>"
```

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

Expand Down
49 changes: 25 additions & 24 deletions docs/setup/install/container.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 \
Expand All @@ -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:<VERSION>
restart: unless-stopped
container_name: headscale
ports:
- "127.0.0.1:8080:8080"
- "127.0.0.1:9090:9090"
volumes:
# Please change <CONFIG_PATH> to the fullpath of the config folder just created
- <CONFIG_PATH>:/etc/headscale
command: serve
```

1. Verify headscale is running:
Follow the container logs:
```yaml
version: "3.7"
services:
headscale:
image: headscale/headscale:<VERSION>
restart: unless-stopped
container_name: headscale
ports:
- "127.0.0.1:8080:8080"
- "127.0.0.1:9090:9090"
volumes:
# Please change <CONFIG_PATH> to the fullpath of the config folder just created
- <CONFIG_PATH>:/etc/headscale
command: serve
```

1. Verify headscale is running:

Follow the container logs:

```shell
docker logs --follow headscale
Expand All @@ -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 \
Expand Down
50 changes: 25 additions & 25 deletions docs/setup/install/official.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 VERSION>/headscale_<HEADSCALE VERSION>_linux_<ARCH>
```
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
Expand Down

0 comments on commit 05d694b

Please sign in to comment.