Fix/improve documentation formatting (#1575)

* Fix docs formatting

* .prettierignore add docu

---------

Co-authored-by: ohdearaugustin <ohdearaugustin@users.noreply.github.com>
This commit is contained in:
Maja Bojarska 2024-03-22 19:55:20 +01:00 committed by GitHub
parent 74ff14eb30
commit 4d9021047f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 341 additions and 337 deletions

View file

@ -1 +1,6 @@
.github/workflows/test-integration-v2* .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

View file

@ -32,7 +32,9 @@ dns_config:
... ...
``` ```
2. Restart your headscale instance. 1. Restart your headscale instance.
!!! warning
Beware of the limitations listed later on! Beware of the limitations listed later on!

View file

@ -22,27 +22,27 @@ mkdir -p ./headscale/config
cd ./headscale cd ./headscale
``` ```
2. Create an empty SQlite datebase in the headscale directory: 1. Create an empty SQlite datebase in the headscale directory:
```shell ```shell
touch ./config/db.sqlite touch ./config/db.sqlite
``` ```
3. **(Strongly Recommended)** Download a copy of the [example configuration](https://github.com/juanfont/headscale/blob/main/config-example.yaml) from the headscale repository. 1. **(Strongly Recommended)** Download a copy of the [example configuration](https://github.com/juanfont/headscale/blob/main/config-example.yaml) from the headscale repository.
Using wget: - Using `wget`:
```shell ```shell
wget -O ./config/config.yaml https://raw.githubusercontent.com/juanfont/headscale/main/config-example.yaml wget -O ./config/config.yaml https://raw.githubusercontent.com/juanfont/headscale/main/config-example.yaml
``` ```
Using curl: - Using `curl`:
```shell ```shell
curl https://raw.githubusercontent.com/juanfont/headscale/main/config-example.yaml -o ./config/config.yaml curl https://raw.githubusercontent.com/juanfont/headscale/main/config-example.yaml -o ./config/config.yaml
``` ```
**(Advanced)** If you would like to hand craft a config file **instead** of downloading the example config file, create a blank `headscale` configuration in the headscale directory to edit: - **(Advanced)** If you would like to hand craft a config file **instead** of downloading the example config file, create a blank `headscale` configuration in the headscale directory to edit:
```shell ```shell
touch ./config/config.yaml touch ./config/config.yaml
@ -73,7 +73,7 @@ Alternatively, you can mount `/var/lib` and `/var/run` from your host system by
`--volume $(pwd)/lib:/var/lib/headscale` and `--volume $(pwd)/run:/var/run/headscale` `--volume $(pwd)/lib:/var/lib/headscale` and `--volume $(pwd)/run:/var/run/headscale`
in the next step. in the next step.
4. Start the headscale server while working in the host headscale directory: 1. Start the headscale server while working in the host headscale directory:
```shell ```shell
docker run \ docker run \
@ -84,7 +84,6 @@ docker run \
--publish 127.0.0.1:9090:9090 \ --publish 127.0.0.1:9090:9090 \
headscale/headscale:<VERSION> \ headscale/headscale:<VERSION> \
headscale serve headscale serve
``` ```
Note: use `0.0.0.0:8080:8080` instead of `127.0.0.1:8080:8080` if you want to expose the container externally. Note: use `0.0.0.0:8080:8080` instead of `127.0.0.1:8080:8080` if you want to expose the container externally.
@ -109,11 +108,9 @@ services:
# pls change [config_path] to the fullpath of the config folder just created # pls change [config_path] to the fullpath of the config folder just created
- [config_path]:/etc/headscale - [config_path]:/etc/headscale
command: headscale serve command: headscale serve
``` ```
5. Verify `headscale` is running: 1. Verify `headscale` is running:
Follow the container logs: Follow the container logs:
```shell ```shell
@ -132,7 +129,7 @@ Verify `headscale` is available:
curl http://127.0.0.1:9090/metrics curl http://127.0.0.1:9090/metrics
``` ```
6. Create a user ([tailnet](https://tailscale.com/kb/1136/tailnet/)): 1. Create a user ([tailnet](https://tailscale.com/kb/1136/tailnet/)):
```shell ```shell
docker exec headscale \ docker exec headscale \

View file

@ -20,13 +20,13 @@ wget --output-document=/usr/local/bin/headscale \
https://github.com/juanfont/headscale/releases/download/v<HEADSCALE VERSION>/headscale_<HEADSCALE VERSION>_linux_<ARCH> https://github.com/juanfont/headscale/releases/download/v<HEADSCALE VERSION>/headscale_<HEADSCALE VERSION>_linux_<ARCH>
``` ```
2. Make `headscale` executable: 1. Make `headscale` executable:
```shell ```shell
chmod +x /usr/local/bin/headscale chmod +x /usr/local/bin/headscale
``` ```
3. Prepare a directory to hold `headscale` configuration and the [SQLite](https://www.sqlite.org/) database: 1. Prepare a directory to hold `headscale` configuration and the [SQLite](https://www.sqlite.org/) database:
```shell ```shell
# Directory for configuration # Directory for configuration
@ -45,13 +45,13 @@ useradd \
headscale headscale
``` ```
4. Create an empty SQLite database: 1. Create an empty SQLite database:
```shell ```shell
touch /var/lib/headscale/db.sqlite touch /var/lib/headscale/db.sqlite
``` ```
5. Create a `headscale` configuration: 1. Create a `headscale` configuration:
```shell ```shell
touch /etc/headscale/config.yaml touch /etc/headscale/config.yaml
@ -59,7 +59,7 @@ touch /etc/headscale/config.yaml
**(Strongly Recommended)** Download a copy of the [example configuration][config-example.yaml](https://github.com/juanfont/headscale/blob/main/config-example.yaml) from the headscale repository. **(Strongly Recommended)** Download a copy of the [example configuration][config-example.yaml](https://github.com/juanfont/headscale/blob/main/config-example.yaml) from the headscale repository.
6. Start the headscale server: 1. Start the headscale server:
```shell ```shell
headscale serve headscale serve
@ -74,15 +74,14 @@ Alternatively use terminal emulators like [tmux](https://github.com/tmux/tmux) o
To run `headscale` in the background, please follow the steps in the [SystemD section](#running-headscale-in-the-background-with-systemd) before continuing. To run `headscale` in the background, please follow the steps in the [SystemD section](#running-headscale-in-the-background-with-systemd) before continuing.
7. Verify `headscale` is running: 1. Verify `headscale` is running:
Verify `headscale` is available: Verify `headscale` is available:
```shell ```shell
curl http://127.0.0.1:9090/metrics curl http://127.0.0.1:9090/metrics
``` ```
8. Create a user ([tailnet](https://tailscale.com/kb/1136/tailnet/)): 1. Create a user ([tailnet](https://tailscale.com/kb/1136/tailnet/)):
```shell ```shell
headscale users create myfirstuser headscale users create myfirstuser
@ -118,7 +117,7 @@ tailscale up --login-server <YOUR_HEADSCALE_URL> --authkey <YOUR_AUTH_KEY>
## Running `headscale` in the background with SystemD ## Running `headscale` in the background with SystemD
:warning: **Deprecated**: This part is very outdated and you should use the [pre-packaged Headscale for this](./running-headscale-linux.md :warning: **Deprecated**: This part is very outdated and you should use the [pre-packaged Headscale for this](./running-headscale-linux.md)
This section demonstrates how to run `headscale` as a service in the background with [SystemD](https://www.freedesktop.org/wiki/Software/systemd/). This section demonstrates how to run `headscale` as a service in the background with [SystemD](https://www.freedesktop.org/wiki/Software/systemd/).
This should work on most modern Linux distributions. This should work on most modern Linux distributions.
@ -165,25 +164,25 @@ or run all headscale commands as the headscale user:
su - headscale su - headscale
``` ```
2. In `/etc/headscale/config.yaml`, override the default `headscale` unix socket with path that is writable by the `headscale` user or group: 1. In `/etc/headscale/config.yaml`, override the default `headscale` unix socket with path that is writable by the `headscale` user or group:
```yaml ```yaml
unix_socket: /var/run/headscale/headscale.sock unix_socket: /var/run/headscale/headscale.sock
``` ```
3. Reload SystemD to load the new configuration file: 1. Reload SystemD to load the new configuration file:
```shell ```shell
systemctl daemon-reload systemctl daemon-reload
``` ```
4. Enable and start the new `headscale` service: 1. Enable and start the new `headscale` service:
```shell ```shell
systemctl enable --now headscale systemctl enable --now headscale
``` ```
5. Verify the headscale service: 1. Verify the headscale service:
```shell ```shell
systemctl status headscale systemctl status headscale

View file

@ -27,31 +27,31 @@ wget --output-document=headscale.deb \
https://github.com/juanfont/headscale/releases/download/v<HEADSCALE VERSION>/headscale_<HEADSCALE VERSION>_linux_<ARCH>.deb https://github.com/juanfont/headscale/releases/download/v<HEADSCALE VERSION>/headscale_<HEADSCALE VERSION>_linux_<ARCH>.deb
``` ```
2. Install Headscale: 1. Install Headscale:
```shell ```shell
sudo dpkg --install headscale.deb sudo dpkg --install headscale.deb
``` ```
3. Enable Headscale service, this will start Headscale at boot: 1. Enable Headscale service, this will start Headscale at boot:
```shell ```shell
sudo systemctl enable headscale sudo systemctl enable headscale
``` ```
4. Configure Headscale by editing the configuration file: 1. Configure Headscale by editing the configuration file:
```shell ```shell
nano /etc/headscale/config.yaml nano /etc/headscale/config.yaml
``` ```
5. Start Headscale: 1. Start Headscale:
```shell ```shell
sudo systemctl start headscale sudo systemctl start headscale
``` ```
6. Check that Headscale is running as intended: 1. Check that Headscale is running as intended:
```shell ```shell
systemctl status headscale systemctl status headscale

View file

@ -15,12 +15,13 @@ describing how to make `headscale` run properly in a server environment.
## Install `headscale` ## Install `headscale`
1. Install from ports (Not Recommend) 1. Install from ports (not recommended)
As of OpenBSD 7.2, there's a headscale in ports collection, however, it's severely outdated(v0.12.4). !!! info
You can install it via `pkg_add headscale`.
2. Install from source on OpenBSD 7.2 As of OpenBSD 7.2, there's a headscale in ports collection, however, it's severely outdated(v0.12.4). You can install it via `pkg_add headscale`.
1. Install from source on OpenBSD 7.2
```shell ```shell
# Install prerequistes # Install prerequistes
@ -46,7 +47,7 @@ chmod a+x headscale
cp headscale /usr/local/sbin cp headscale /usr/local/sbin
``` ```
3. Install from source via cross compile 1. Install from source via cross compile
```shell ```shell
# Install prerequistes # Install prerequistes
@ -82,13 +83,13 @@ mkdir -p /etc/headscale
mkdir -p /var/lib/headscale mkdir -p /var/lib/headscale
``` ```
2. Create an empty SQLite database: 1. Create an empty SQLite database:
```shell ```shell
touch /var/lib/headscale/db.sqlite touch /var/lib/headscale/db.sqlite
``` ```
3. Create a `headscale` configuration: 1. Create a `headscale` configuration:
```shell ```shell
touch /etc/headscale/config.yaml touch /etc/headscale/config.yaml
@ -96,7 +97,7 @@ touch /etc/headscale/config.yaml
**(Strongly Recommended)** Download a copy of the [example configuration][config-example.yaml](https://github.com/juanfont/headscale/blob/main/config-example.yaml) from the headscale repository. **(Strongly Recommended)** Download a copy of the [example configuration][config-example.yaml](https://github.com/juanfont/headscale/blob/main/config-example.yaml) from the headscale repository.
4. Start the headscale server: 1. Start the headscale server:
```shell ```shell
headscale serve headscale serve
@ -104,14 +105,14 @@ headscale serve
This command will start `headscale` in the current terminal session. This command will start `headscale` in the current terminal session.
--- ***
To continue the tutorial, open a new terminal and let it run in the background. To continue the tutorial, open a new terminal and let it run in the background.
Alternatively use terminal emulators like [tmux](https://github.com/tmux/tmux). Alternatively use terminal emulators like [tmux](https://github.com/tmux/tmux).
To run `headscale` in the background, please follow the steps in the [rc.d section](#running-headscale-in-the-background-with-rcd) before continuing. To run `headscale` in the background, please follow the steps in the [rc.d section](#running-headscale-in-the-background-with-rcd) before continuing.
5. Verify `headscale` is running: 1. Verify `headscale` is running:
Verify `headscale` is available: Verify `headscale` is available:
@ -119,7 +120,7 @@ Verify `headscale` is available:
curl http://127.0.0.1:9090/metrics curl http://127.0.0.1:9090/metrics
``` ```
6. Create a user ([tailnet](https://tailscale.com/kb/1136/tailnet/)): 1. Create a user ([tailnet](https://tailscale.com/kb/1136/tailnet/)):
```shell ```shell
headscale users create myfirstuser headscale users create myfirstuser
@ -176,25 +177,25 @@ rc_reload=NO
rc_cmd $1 rc_cmd $1
``` ```
2. `/etc/rc.d/headscale` needs execute permission: 1. `/etc/rc.d/headscale` needs execute permission:
```shell ```shell
chmod a+x /etc/rc.d/headscale chmod a+x /etc/rc.d/headscale
``` ```
3. Start `headscale` service: 1. Start `headscale` service:
```shell ```shell
rcctl start headscale rcctl start headscale
``` ```
4. Make `headscale` service start at boot: 1. Make `headscale` service start at boot:
```shell ```shell
rcctl enable headscale rcctl enable headscale
``` ```
5. Verify the headscale service: 1. Verify the headscale service:
```shell ```shell
rcctl check headscale rcctl check headscale