diff --git a/src/pages/selfhosted/maintenance/backup.mdx b/src/pages/selfhosted/maintenance/backup.mdx index d13483f2b..8c5d994e1 100644 --- a/src/pages/selfhosted/maintenance/backup.mdx +++ b/src/pages/selfhosted/maintenance/backup.mdx @@ -24,7 +24,7 @@ The steps below use `backup/` as the target directory and assume the default qui | `proxy.env`, `traefik-dynamic.yaml` | Install directory | [Reverse proxy](/manage/reverse-proxy) enabled | Proxy access token and the Traefik routing rules that pass TLS through to the proxy. | | `crowdsec/` directory | Install directory | [CrowdSec](/selfhosted/maintenance/crowdsec) enabled | CrowdSec configuration, mounted into the container at `/etc/crowdsec`. | | `nginx-netbird.conf`, `caddyfile-netbird.txt`, `npm-advanced-config.txt` | Install directory | External reverse proxy chosen during setup | Snippets for your own reverse proxy. Harmless to copy if present. | -| `.env`, or the secret store that sets `NB_AUTH_SECRET` or `NB_STORE_ENCRYPTION_KEY` | Install directory, or your secret store | Either variable set on `netbird-server` | The only copy of these secrets once they are removed from `config.yaml`. See [Keeping secrets out of the config file](/selfhosted/maintenance/configuration-files#keeping-secrets-out-of-the-config-file). Without the encryption key the restored database cannot be read, and without `server.authSecret` the server does not start (unless it uses external relays). **Required.** | +| `.env`, or the secret store that sets `NB_AUTH_SECRET` or `NB_STORE_ENCRYPTION_KEY` | Install directory, or your secret store | Either variable set on `netbird-server` | The only copy of these secrets once they are removed from `config.yaml`. See [Keeping secrets out of the config file](/selfhosted/maintenance/configuration-files#keeping-secrets-out-of-the-config-file). Without the encryption key the restored database cannot be read, and without `server.authSecret` the server does not start (unless it uses external relays or `server.peerAuth.required` is `true`). **Required.** | | `/var/lib/netbird` in `netbird-server` | Docker volume `netbird_data` | Always | Management database (SQLite by default), encryption keys and state. **Required.** | | `/var/lib/crowdsec/data` in `crowdsec` | Docker volume `crowdsec_db` | CrowdSec enabled | CrowdSec LAPI database, including the bouncer key that `proxy.env` references. Without it the restored proxy cannot authenticate to CrowdSec. | | `/certs` in `proxy` | Docker volume `netbird_proxy_certs` | Reverse proxy enabled | Certificates for proxied services. Optional: the proxy reissues them, but restoring avoids a burst of Let's Encrypt requests. | diff --git a/src/pages/selfhosted/maintenance/configuration-files.mdx b/src/pages/selfhosted/maintenance/configuration-files.mdx index 756a0c37f..4e8b93bab 100644 --- a/src/pages/selfhosted/maintenance/configuration-files.mdx +++ b/src/pages/selfhosted/maintenance/configuration-files.mdx @@ -548,14 +548,14 @@ Two of the secrets in `config.yaml` can be moved out of it: `server.authSecret`, | Variable | Overrides | Notes | |---|---|---| -| `NB_AUTH_SECRET` | `server.authSecret` | External relays use it only when `server.relays.secret` is empty. See [External relays and self-hosted Enterprise](#external-relays-and-self-hosted-enterprise). | +| `NB_AUTH_SECRET` | `server.authSecret` | External relays use it only when `server.relays.secret` is empty. See [External relays and self-hosted Enterprise](#external-relays-and-self-hosted-enterprise). With the built-in relay, leave it unset or empty when `server.peerAuth.required` is `true`: with both, the server refuses to start. See [Refuse unauthenticated peers](/selfhosted/maintenance/peer-authentication#refuse-unauthenticated-peers). | | `NB_STORE_ENCRYPTION_KEY` | `server.store.encryptionKey` | On self-hosted Enterprise, also the key its integrations use. See [External relays and self-hosted Enterprise](#external-relays-and-self-hosted-enterprise). | These variables require NetBird v0.83.0 or later. Earlier versions of the combined server ignore both. On them, a secret you remove from `config.yaml` is missing: without `server.authSecret` the server refuses to start (unless it uses external relays), and without `server.store.encryptionKey` it starts with a newly generated key and cannot read the data already in the database. -A variable that is set and not empty overrides the `config.yaml` field; an unset or empty one does not. If neither the variable nor `config.yaml` supplies a value, the server refuses to start without `server.authSecret` (unless `server.relays.addresses` points at external relays). Without an encryption key it generates a new one on every start, so data already in the database cannot be read. +A variable that is set and not empty overrides the `config.yaml` field; an unset or empty one does not. If neither the variable nor `config.yaml` supplies a value, the server refuses to start without `server.authSecret` (unless `server.relays.addresses` points at external relays or `server.peerAuth.required` is `true`). Without an encryption key it generates a new one on every start, so data already in the database cannot be read. Docker Compose reads a `.env` file next to `docker-compose.yml`, so the service can reference variables from it: @@ -566,7 +566,7 @@ netbird-server: - NB_STORE_ENCRYPTION_KEY=${NB_STORE_ENCRYPTION_KEY} ``` -If `.env` lacks an entry, the reference expands to an empty string and the server falls back to `config.yaml`. If you also removed the field from `config.yaml`, the server has no value: without the encryption key it starts with a newly generated key and cannot read the data already in the database, and without `server.authSecret` it refuses to start (unless it uses external relays). +If `.env` lacks an entry, the reference expands to an empty string and the server falls back to `config.yaml`. If you also removed the field from `config.yaml`, the server has no value: without the encryption key it starts with a newly generated key and cannot read the data already in the database, and without `server.authSecret` it refuses to start (unless it uses external relays or `server.peerAuth.required` is `true`). Add `.env` to your `.gitignore`. Once you remove the fields from `config.yaml`, `.env` is the only copy of these secrets, so include it in your [backups](/selfhosted/maintenance/backup).