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*
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!

View File

@ -22,27 +22,27 @@ mkdir -p ./headscale/config
cd ./headscale
```
2. Create an empty SQlite datebase in the headscale directory:
1. Create an empty SQlite datebase in the headscale directory:
```shell
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
wget -O ./config/config.yaml https://raw.githubusercontent.com/juanfont/headscale/main/config-example.yaml
```
Using curl:
- Using `curl`:
```shell
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
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`
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
docker run \
@ -84,7 +84,6 @@ docker run \
--publish 127.0.0.1:9090:9090 \
headscale/headscale:<VERSION> \
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.
@ -109,11 +108,9 @@ services:
# pls change [config_path] to the fullpath of the config folder just created
- [config_path]:/etc/headscale
command: headscale serve
```
5. Verify `headscale` is running:
1. Verify `headscale` is running:
Follow the container logs:
```shell
@ -132,7 +129,7 @@ Verify `headscale` is available:
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
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>
```
2. Make `headscale` executable:
1. Make `headscale` executable:
```shell
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
# Directory for configuration
@ -45,13 +45,13 @@ useradd \
headscale
```
4. Create an empty SQLite database:
1. Create an empty SQLite database:
```shell
touch /var/lib/headscale/db.sqlite
```
5. Create a `headscale` configuration:
1. Create a `headscale` configuration:
```shell
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.
6. Start the headscale server:
1. Start the headscale server:
```shell
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.
7. Verify `headscale` is running:
1. Verify `headscale` is running:
Verify `headscale` is available:
```shell
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
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
: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 should work on most modern Linux distributions.
@ -165,25 +164,25 @@ or run all headscale commands as the headscale user:
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
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
systemctl daemon-reload
```
4. Enable and start the new `headscale` service:
1. Enable and start the new `headscale` service:
```shell
systemctl enable --now headscale
```
5. Verify the headscale service:
1. Verify the headscale service:
```shell
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
```
2. Install Headscale:
1. Install Headscale:
```shell
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
sudo systemctl enable headscale
```
4. Configure Headscale by editing the configuration file:
1. Configure Headscale by editing the configuration file:
```shell
nano /etc/headscale/config.yaml
```
5. Start Headscale:
1. Start Headscale:
```shell
sudo systemctl start headscale
```
6. Check that Headscale is running as intended:
1. Check that Headscale is running as intended:
```shell
systemctl status headscale

View File

@ -15,12 +15,13 @@ describing how to make `headscale` run properly in a server environment.
## 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).
You can install it via `pkg_add headscale`.
!!! info
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
# Install prerequistes
@ -46,7 +47,7 @@ chmod a+x headscale
cp headscale /usr/local/sbin
```
3. Install from source via cross compile
1. Install from source via cross compile
```shell
# Install prerequistes
@ -82,13 +83,13 @@ mkdir -p /etc/headscale
mkdir -p /var/lib/headscale
```
2. Create an empty SQLite database:
1. Create an empty SQLite database:
```shell
touch /var/lib/headscale/db.sqlite
```
3. Create a `headscale` configuration:
1. Create a `headscale` configuration:
```shell
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.
4. Start the headscale server:
1. Start the headscale server:
```shell
headscale serve
@ -104,14 +105,14 @@ headscale serve
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.
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.
5. Verify `headscale` is running:
1. Verify `headscale` is running:
Verify `headscale` is available:
@ -119,7 +120,7 @@ Verify `headscale` is available:
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
headscale users create myfirstuser
@ -176,25 +177,25 @@ rc_reload=NO
rc_cmd $1
```
2. `/etc/rc.d/headscale` needs execute permission:
1. `/etc/rc.d/headscale` needs execute permission:
```shell
chmod a+x /etc/rc.d/headscale
```
3. Start `headscale` service:
1. Start `headscale` service:
```shell
rcctl start headscale
```
4. Make `headscale` service start at boot:
1. Make `headscale` service start at boot:
```shell
rcctl enable headscale
```
5. Verify the headscale service:
1. Verify the headscale service:
```shell
rcctl check headscale