diff --git a/README.md b/README.md index 83b162a5..94c4b241 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ Suggestions/PRs welcomed! ## Running headscale -Please have a look at the documentation under (`docs/`). +Please have a look at the documentation under [`docs/`](docs/). ## Disclaimer diff --git a/docs/Configuration.md b/docs/Configuration.md index 56791a9a..6074f2b4 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -1,9 +1,13 @@ # Configuration reference -Headscale's configuration file is named `config.json` or `config.yaml`. Headscale will look for it in `/etc/headscale`, `~/.headscale` and finally the directory from where the Headscale binary is executed. +Headscale will look for a configuration file named `config.yaml` (or `config.json`) in the following order: + +- `/etc/headscale` +- `~/.headscale` +- current working directory ```yaml -server_url: http://192.168.1.12:8080 +server_url: http://headscale.mydomain.net listen_addr: 0.0.0.0:8080 ip_prefix: 100.64.0.0/10 ``` diff --git a/docs/Running.md b/docs/Running.md index 6f165edd..888ddbfd 100644 --- a/docs/Running.md +++ b/docs/Running.md @@ -19,11 +19,10 @@ POSTGRES_USER=foo -e POSTGRES_PASSWORD=bar -p 5432:5432 -d postgres ``` -3. Set some stuff up (headscale Wireguard keys & the config.json file) +3. Create a WireGuard Private key and headscale configuration ```shell wg genkey > private.key - wg pubkey < private.key > public.key # not needed # Postgres cp config.json.postgres.example config.json @@ -44,7 +43,14 @@ ```shell touch db.sqlite - docker run -v $(pwd)/private.key:/private.key -v $(pwd)/config.json:/config.json -v $(pwd)/derp.yaml:/derp.yaml -v $(pwd)/db.sqlite:/db.sqlite -p 127.0.0.1:8080:8080 headscale/headscale:x.x.x headscale namespaces create myfirstnamespace + docker run \ + -v $(pwd)/private.key:/private.key \ + -v $(pwd)/config.json:/config.json \ + -v $(pwd)/derp.yaml:/derp.yaml \ + -v $(pwd)/db.sqlite:/db.sqlite \ + -p 127.0.0.1:8080:8080 \ + headscale/headscale:x.x.x \ + headscale namespaces create myfirstnamespace ``` or if your server is already running in docker: @@ -64,7 +70,13 @@ the db.sqlite mount is only needed if you use sqlite ```shell - docker run -v $(pwd)/private.key:/private.key -v $(pwd)/config.json:/config.json -v $(pwd)/derp.yaml:/derp.yaml -v $(pwd)/db.sqlite:/db.sqlite -p 127.0.0.1:8080:8080 headscale/headscale:x.x.x headscale serve + docker run \ + -v $(pwd)/private.key:/private.key \ + -v $(pwd)/config.json:/config.json \ + -v $(pwd)/derp.yaml:/derp.yaml \ + -v $(pwd)/db.sqlite:/db.sqlite \ + -p 127.0.0.1:8080:8080 \ + headscale/headscale:x.x.x headscale serve ``` 6. If you used tailscale.com before in your nodes, make sure you clear the tailscald data folder @@ -89,7 +101,12 @@ ``` or docker: ```shell - docker run -v $(pwd)/private.key:/private.key -v $(pwd)/config.json:/config.json -v $(pwd)/derp.yaml:/derp.yaml headscale/headscale:x.x.x headscale -n myfirstnamespace nodes register YOURMACHINEKEY + docker run \ + -v $(pwd)/private.key:/private.key \ + -v $(pwd)/config.json:/config.json \ + -v $(pwd)/derp.yaml:/derp.yaml \ + headscale/headscale:x.x.x \ + headscale -n myfirstnamespace nodes register YOURMACHINEKEY ``` or if your server is already running in docker: ```shell @@ -107,7 +124,13 @@ Alternatively, you can use Auth Keys to register your machines: or docker: ```shell - docker run -v $(pwd)/private.key:/private.key -v $(pwd)/config.json:/config.json -v$(pwd)/derp.yaml:/derp.yaml -v $(pwd)/db.sqlite:/db.sqlite headscale/headscale:x.x.x headscale -n myfirstnamespace preauthkeys create --reusable --expiration 24h + docker run \ + -v $(pwd)/private.key:/private.key \ + -v $(pwd)/config.json:/config.json \ + -v$(pwd)/derp.yaml:/derp.yaml \ + -v $(pwd)/db.sqlite:/db.sqlite \ + headscale/headscale:x.x.x \ + headscale -n myfirstnamespace preauthkeys create --reusable --expiration 24h ``` or if your server is already running in docker: