feature: the VPN, the router, the name server and WebDAV are components switched on the System tab and installed on demand, Caddy from the Ubuntu archive is a dependency and serves every HTTP and HTTPS port, HTTPS is chosen at install, its certificate is of the Servers Issuing CA or self-signed by default, of ACME or of another CA, the issuing CAs are in one tab, a locked account is unlocked again, the name of a CA is fixed once the CA exists, and a run of setup is no longer cut short by a change.
Release / release (push) Failing after 8s
Release / release (push) Failing after 8s
This commit is contained in:
1 parent
a649331aa2
commit
a7bfabcb89
97 files changed
+4498
-1834
No files matched your search
@@ -1,9 +1,11 @@
|
||||
# linux-manager
|
||||
|
||||
A Debian package that configures a Linux host or virtual machine as a server managed by the
|
||||
Ubuntu Linux Manager. Every component is installed; the router (`router.enabled`) and the VPN
|
||||
(`vpn.enabled`) are switched on in the configuration, and the rest is the core. Without the
|
||||
router the server needs one network interface, and the VPN clients reach the server's networks
|
||||
Ubuntu Linux Manager. The core is always installed; the installable components, the VPN
|
||||
(`vpn.enabled`), the router (`router.enabled`), the name server (`dns.enabled`) and WebDAV
|
||||
(`sites.webdav`), are switched on the Manager's System tab or in the configuration, and their
|
||||
software is installed from the Ubuntu archive when they are switched on (see Components). Without
|
||||
the router the server needs one network interface, and the VPN clients reach the server's networks
|
||||
through NAT from its address. The package provides:
|
||||
|
||||
- site-to-site IKEv2 IPSec, with the router on, with pre-shared key or certificate authentication (strongSwan swanctl)
|
||||
@@ -39,7 +41,7 @@ service that applies it.
|
||||
|
||||
```
|
||||
/etc/linux-manager/linux-manager.json the configuration
|
||||
systemctl restart linux-manager-setup apply it
|
||||
linux-manager-config-edit apply apply it
|
||||
```
|
||||
|
||||
If the host runs Docker, the recommended order is Docker first and the package second. The
|
||||
@@ -51,7 +53,7 @@ host that already runs Docker, and for installing Docker later, are under [Docke
|
||||
```sh
|
||||
apt-get install linux-manager # answer "none" to the platform question
|
||||
$EDITOR /etc/linux-manager/linux-manager.json
|
||||
systemctl restart linux-manager-setup
|
||||
linux-manager-config-edit apply
|
||||
```
|
||||
|
||||
Answering `none` to the platform question defers everything: no further questions are
|
||||
@@ -73,6 +75,7 @@ linux-manager linux-manager/internal_interface string eth1
|
||||
linux-manager linux-manager/int_addr string 10.1.1.4
|
||||
linux-manager linux-manager/int_gateway_ip string 10.1.1.1
|
||||
linux-manager linux-manager/local_fqdn string router.example.com
|
||||
linux-manager linux-manager/https_enabled boolean true
|
||||
linux-manager linux-manager/local_cidrs string 10.0.0.0/24
|
||||
linux-manager linux-manager/remote_addrs string peer.example.net
|
||||
linux-manager linux-manager/remote_id string peer.example.net
|
||||
@@ -109,8 +112,8 @@ must have the type shown below; an unknown section or setting is an error.
|
||||
|---|---|---|---|---|
|
||||
| `general` | `platform` | string | `none` | `none`, `generic`, `azure` or `gcp`. `none` defers configuration entirely |
|
||||
| `general` | `mode` | string | `manual` | How much you supply: `manual`, `interfaces` or `auto` |
|
||||
| `router` | `enabled` | boolean | `false` | The router component: routing between the two NICs and site-to-site. Off, the server needs only `interfaces.external`, and `site_to_site` must be empty |
|
||||
| `vpn` | `enabled` | boolean | `false` | The VPN component: IKEv2, OpenVPN and WireGuard. Off, `p2s.enabled`, `openvpn.enabled` and `wireguard.enabled` must be false. With the router off, the VPN clients reach `local.cidrs` through NAT from the server's address |
|
||||
| `router` | `enabled` | boolean | `false` | The router component: routing between the two NICs and site-to-site, its packages installed when it is switched on (see Components). Off, the server needs only `interfaces.external`, and `site_to_site` must be empty |
|
||||
| `vpn` | `enabled` | boolean | `false` | The VPN component: IKEv2, OpenVPN and WireGuard, its packages installed when it is switched on (see Components). Off, `p2s.enabled`, `openvpn.enabled` and `wireguard.enabled` must be false. With the router off, the VPN clients reach `local.cidrs` through NAT from the server's address |
|
||||
| `interfaces` | `external` | string | | Name of the NIC facing the untrusted network |
|
||||
| `interfaces` | `internal` | string | | Name of the NIC facing the protected network |
|
||||
| `wan` | `local_fqdn` | string | | This server's name or IP address: its IKE identity in `fqdn` mode, the name resolved in `public_ip` mode, the name of HTTPS, IKEv2 and OpenVPN, and the primary name server of its domains |
|
||||
@@ -133,10 +136,10 @@ must have the type shown below; an unknown section or setting is an error.
|
||||
| `docker` | `mode` | string | `auto` | `auto` secures Docker when its service is installed, `on` requires it, `off` removes the rules |
|
||||
| `docker` | `exposed_ports` | list | | TCP ports and port ranges (`8000:8100`) reachable from the external interface; at most 15, a range counting as two |
|
||||
| `web` | `enabled` | boolean | `true` | The status web service |
|
||||
| `web` | `listen` | string | `both` | The interfaces the status web service listens on: `internal`, `external` or `both` |
|
||||
| `web` | `port` | integer | `7081` | TCP port of the status web service |
|
||||
| `web` | `listen` | string | `both` | The interfaces the firewall opens `web.port` on: `internal`, `external` or `both` |
|
||||
| `web` | `port` | integer | `7081` | TCP port of the status web service, served by Caddy over plain HTTP |
|
||||
| `web` | `database` | string | | A PostgreSQL connection string for the refresh tokens; without it, the `linux-manager` database on this host that the web service creates |
|
||||
| `web` | `trusted_proxies` | list | the address the call came in on | Addresses whose `X-Forwarded-For` header names the client for the `/auth` rate limit and the Client IP of the status |
|
||||
| `web` | `trusted_proxies` | list | `127.0.0.1`, where Caddy and the Manager call from | Addresses whose `X-Forwarded-For` header names the client for the `/auth` rate limit and the Client IP of the status |
|
||||
| `web` | `status_content` | string | `basic` | What `/` and `/status` show: `basic`, `standard` or `full` (see Status web service) |
|
||||
| `web` | `shell` | boolean | `false` | `/shell` opens a login shell for a member of `admins` with console login (see The shell) |
|
||||
| `web` | `shell_idle_minutes` | integer | `15` | Minutes without a keystroke after which a shell is closed, 1 to 1440 |
|
||||
@@ -144,37 +147,45 @@ must have the type shown below; an unknown section or setting is an error.
|
||||
| `web` | `shell_auth_timeout` | integer | `15` | Minutes after the last use of a shell in which a new shell opens without signing in again, 0 (always sign in) to 1440 |
|
||||
| `ssh` | `ldap_login` | boolean | `false` | sshd accepts the directory password of the console accounts in the directory (see Console login and SSH) |
|
||||
| `https` | `enabled` | boolean | `true` | Caddy serves the status web service and the Manager over HTTPS for `wan.local_fqdn` |
|
||||
| `https` | `email` | string | | The e-mail address of the Let's Encrypt account |
|
||||
| `https` | `email` | string | | The e-mail address of the ACME account |
|
||||
| `https` | `web_port` | integer | `7444` | HTTPS port of the status web service |
|
||||
| `https` | `manager_port` | integer | `7443` | HTTPS port of the Manager |
|
||||
| `https` | `acme_staging` | boolean | `false` | Caddy takes its certificates from Let's Encrypt's staging environment alone, whose certificates no browser trusts and whose rate limits are higher, for routers rebuilt often (see HTTPS) |
|
||||
| `https` | `caddy_source` | string | `ubuntu` | Where Caddy is installed from: `ubuntu`, the Ubuntu archive, or `upstream`, Caddy's own repository (see HTTPS) |
|
||||
| `https` | `disable_auto_redirect` | boolean | `false` | The Manager answers on its plain HTTP port instead of redirecting there to its HTTPS address while `enabled` is `true`; the status page never redirects |
|
||||
| `https` | `certificate` | string | `self-signed` | Where the certificate of `wan.local_fqdn` comes from: `self-signed`, `ca`, `acme` or `external`; empty in a new installation's file, for its first setup to choose `ca` or `self-signed` and write it here (see HTTPS) |
|
||||
| `https` | `self_signed_days` | integer | `365` | Days the self-signed certificate is valid, 1 to 3650 |
|
||||
| `https` | `acme_provider` | string | `letsencrypt` | The ACME CA of the server and of the web sites with `tls` `acme`: `letsencrypt`, `zerossl` or `custom` (see HTTPS) |
|
||||
| `https` | `acme_url` | string | | The `https://` ACME directory URL of `custom` |
|
||||
| `https` | `acme_eab_key_id` | string | | The EAB key ID of `custom`; the EAB credentials are used once both it and `acme_eab_mac_key` are set |
|
||||
| `https` | `acme_eab_mac_key` | string | | The EAB MAC key of `custom` |
|
||||
| `https` | `zerossl_api_key` | string | | The ZeroSSL API key; without it the EAB credentials come from `email` |
|
||||
| `https` | `acme_staging` | boolean | `false` | With `letsencrypt`, Caddy takes its certificates from Let's Encrypt's staging environment, whose certificates no browser trusts and whose rate limits are higher, for routers rebuilt often (see HTTPS) |
|
||||
| `oidc` | `enabled` | boolean | `false` | The OpenID Provider at the status web service's HTTPS site, which needs `web.enabled`, `https.enabled` and `wan.local_fqdn` (see OpenID Provider) |
|
||||
| `sites` | `enabled` | boolean | `false` | Caddy serves the web sites (see Web sites) |
|
||||
| `sites` | `upload_max_mb` | integer | `512` | The largest upload of a site's file or zip archive, in MiB, 1 to 10240 |
|
||||
| `sites` | `webdav` | boolean | `false` | WebDAV of the sites' folders, which needs `https.enabled` and `wan.local_fqdn` (see WebDAV) |
|
||||
| `sites` | `webdav_port` | integer | `7445` | HTTPS port of WebDAV |
|
||||
| `dns` | `enabled` | boolean | `false` | The primary name server of the server's domains, `wan.local_fqdn`, which must then be a DNS name (see Name server) |
|
||||
| `dns` | `secondary` | string | | The secondary name server of every domain, a host name other than `wan.local_fqdn`; it may transfer the domains |
|
||||
| `dns` | `secondary` | string | | The optional secondary name server of every domain, a host name other than `wan.local_fqdn`; it may transfer the domains; empty, `wan.local_fqdn` is the only name server |
|
||||
| `dns` | `listen` | string | `external` | The interfaces the name server answers on: `internal`, `external` or `both` |
|
||||
| `dns` | `ttl` | integer | `300` | The default TTL of the records, 60 to 86400 seconds: used where neither the record nor its domain has one |
|
||||
| `pki` | `root` | string | `local` | Where the root CA comes from: `local`, `offline` or `simple-ca`; fixed once the root exists (see Certificates) |
|
||||
| `pki` | `simple_ca_url` | string | | The `https://` URL of the Simple CA service, with `root` `simple-ca` |
|
||||
| `pki` | `root_name` | string | `Linux Manager Root CA` | Common name of the root CA, when the server creates it |
|
||||
| `pki` | `root_name` | string | `Linux Manager Root CA` | Common name of the root CA, when the server creates it; fixed once the root exists |
|
||||
| `pki` | `root_days` | integer | `7300` | Days the root CA's certificate is valid |
|
||||
| `pki` | `ca_days` | integer | `3650` | Days an issuing CA's certificate is valid |
|
||||
| `pki` | `key` | string | `rsa-4096` | Key of the root and the issuing CAs: `rsa-2048`, `rsa-3072`, `rsa-4096`, `ec-p256` or `ec-p384` |
|
||||
| `pki` | `crl_days` | integer | `7` | Days the CRLs of the issuing CAs are valid |
|
||||
| `pki` | `root_crl_days` | integer | `180` | Days the root CRL is valid, when the server signs it |
|
||||
| `pki` | `publish` | list | `http` | Where the CA certificates and CRLs are published: `http`, `http-80`, `https`, `https-default` (see Certificates) |
|
||||
| `pki` | `p2s_name` | string | `Linux Manager VPN CA` | Common name of the P2S issuing CA |
|
||||
| `pki` | `s2s_name` | string | `Linux Manager Site-to-Site CA` | Common name of the site-to-site issuing CA |
|
||||
| `pki` | `p2s_name` | string | `Linux Manager VPN CA` | Common name of the P2S issuing CA; fixed once the CA exists, from when the VPN is first on |
|
||||
| `pki` | `s2s_name` | string | `Linux Manager Site-to-Site CA` | Common name of the site-to-site issuing CA; fixed once the CA exists, from when the router is first on |
|
||||
| `pki` | `servers_name` | string | `Linux Manager Servers CA` | Common name of the Servers Issuing CA; fixed by the first setup, which creates the CA |
|
||||
| `pki` | `issuing_cas` | object | | The general-purpose issuing CAs, each a name and `{name, templates, acme}` (see Certificates) |
|
||||
| `pki` | `templates` | object | | Certificate templates, each a name and the options it changes or defines (see Certificates) |
|
||||
| `pki` | `extended_key_usages` | object | | Custom extended key usages templates may give, each a name and its OID in dotted form (see Certificates) |
|
||||
| `metrics` | `enabled` | boolean | `true` | The metrics service: collection, history and `/metrics` |
|
||||
| `metrics` | `listen` | string | `internal` | The interfaces `/metrics` is served on: `internal`, `external` or `both` |
|
||||
| `metrics` | `port` | integer | `9464` | TCP port of `/metrics` |
|
||||
| `metrics` | `listen` | string | `internal` | The interfaces the firewall opens `metrics.port` on: `internal`, `external` or `both` |
|
||||
| `metrics` | `port` | integer | `9464` | TCP port of `/metrics`, served by Caddy over plain HTTP |
|
||||
| `metrics` | `https_port` | integer | `9465` | HTTPS port of `/metrics`, served by Caddy while `https.enabled` is true |
|
||||
| `metrics` | `service_account` | string | `metrics` | The service account `/metrics` takes, which `linux-manager-setup` adds and keeps |
|
||||
| `metrics` | `otlp_endpoint` | string | | An OTLP/HTTP URL the metrics are pushed to every minute, for example `https://collector.example.com:4318/v1/metrics` |
|
||||
@@ -318,7 +329,7 @@ Installing Docker first is the recommended order. After installing the package:
|
||||
`"docker": { "exposed_ports": ["443"] }`. The default is none: once the rules are applied,
|
||||
every published port that is not listed is unreachable from the external interface, and
|
||||
remains reachable through the IPsec tunnel.
|
||||
3. Apply the configuration with `systemctl restart linux-manager-setup`. Docker is running, so
|
||||
3. Apply the configuration with `linux-manager-config-edit apply`. Docker is running, so
|
||||
this also restarts `linux-manager-docker`, which installs the rules.
|
||||
4. Check the result:
|
||||
|
||||
@@ -330,7 +341,7 @@ Installing Docker first is the recommended order. After installing the package:
|
||||
### When Docker is installed after the package
|
||||
|
||||
The Docker rules are not applied when Docker starts for the first time, so run
|
||||
`systemctl restart linux-manager-setup` after installing Docker, then check as above. A reboot or a
|
||||
`linux-manager-config-edit apply` after installing Docker, then check as above. A reboot or a
|
||||
restart of Docker applies them as well.
|
||||
|
||||
The rules sit in their own chain, `LINUX-MANAGER-DOCKER`, entered by one jump at the top of
|
||||
@@ -365,6 +376,7 @@ linux-manager-config-edit set web.trusted_proxies 127.0.0.1,10.0.0.4
|
||||
linux-manager-config-edit set site_to_site.branch.addrs branch.example.net
|
||||
linux-manager-config-edit remove site_to_site.branch
|
||||
linux-manager-config-edit set --restart oidc.enabled true
|
||||
linux-manager-config-edit apply
|
||||
```
|
||||
|
||||
`show` prints the file as indented JSON and does not change it. `set` takes a setting as
|
||||
@@ -374,15 +386,16 @@ a whole number, `true` or `false`, a list separated by commas (an empty value is
|
||||
or a string; an unknown setting is refused. `remove site_to_site.NAME` removes a connection. It
|
||||
checks the whole configuration as `linux-manager-setup` does, and only then writes the file,
|
||||
indented, with mode 0600, and reminds that `linux-manager-setup` applies it; with `--restart`, `set`
|
||||
and `remove` restart `linux-manager-setup` and wait until it has applied the change, and exit with
|
||||
status 1 when it fails. The status web service
|
||||
and `remove` have `linux-manager-setup` run and wait until it has applied the change, and exit with
|
||||
status 1 when it fails. `apply` does the same without a change, as described under
|
||||
[Applying changes](#applying-changes). The status web service
|
||||
writes the file the same way, and a lock keeps the two from overwriting each other's change. A
|
||||
refused request exits with status 2, any other failure with 1.
|
||||
|
||||
## Bash completion
|
||||
|
||||
Bash completes the commands, options and arguments of `linux-manager-user`, `linux-manager-group`,
|
||||
`linux-manager-role`, `linux-manager-token`, `linux-manager-config-edit`, `linux-manager-backup`, `linux-manager-ca`, `linux-manager-caddy`
|
||||
`linux-manager-role`, `linux-manager-token`, `linux-manager-config-edit`, `linux-manager-backup`, `linux-manager-ca`
|
||||
and `linux-manager-site` with the Tab key. The package installs a file per command in
|
||||
`/usr/share/bash-completion/completions`, which the `bash-completion` package, recommended by
|
||||
`linux-manager`, loads on the first Tab after the command. For root, who can read them, the
|
||||
@@ -396,10 +409,45 @@ linux-manager-config-edit set oidc.<Tab>
|
||||
linux-manager-user passwd <Tab>
|
||||
```
|
||||
|
||||
## Components
|
||||
|
||||
The installable components are switched on the Manager's System tab, through the web service's
|
||||
`/components`, or in the configuration, and their packages come from the Ubuntu archive, which the
|
||||
package only suggests:
|
||||
|
||||
| Component | Setting | Packages |
|
||||
|---|---|---|
|
||||
| VPN | `vpn.enabled` | `strongswan-swanctl`, `charon-systemd`, `libstrongswan-extra-plugins`, `libcharon-extra-plugins`, `openvpn`, `openvpn-auth-ldap`, `wireguard-tools`, `dnsmasq-base` |
|
||||
| Router | `router.enabled` | `strongswan-swanctl`, `charon-systemd`, `libstrongswan-extra-plugins`, `libcharon-extra-plugins` |
|
||||
| Name server | `dns.enabled` | `pdns-server`, `pdns-backend-pgsql` |
|
||||
| WebDAV | `sites.webdav` | `rclone` |
|
||||
|
||||
While a component is on and any of its packages is missing, or marked as installed automatically,
|
||||
which `apt autoremove` would remove, `linux-manager-setup` starts
|
||||
`linux-manager-install@<component>.service`. It installs them with `apt-get install`, which marks
|
||||
them as installed by hand, waiting for dpkg's lock, and runs setup again, which serves the
|
||||
component; until then setup skips it. A failed installation leaves its unit failed; switching the
|
||||
component on again tries once more. Switching a component off stops it and removes no package.
|
||||
The router needs a second network interface: the System tab offers it only then, and switching it
|
||||
on sets `interfaces.internal` and, in `manual` mode, `local.int_addr` and `local.int_gateway_ip`.
|
||||
|
||||
```sh
|
||||
curl -H "Authorization: Bearer $TOKEN" http://127.0.0.1:7081/components
|
||||
curl -X PUT -H "Authorization: Bearer $TOKEN" -d '{"enabled": true}' http://127.0.0.1:7081/components/vpn
|
||||
```
|
||||
|
||||
`GET /components` gives `components`, each with `name`, `enabled` and `state` (`not installed`,
|
||||
`installing`, `installed` or `failed`); the router's also has `available`, `interfaces` (the
|
||||
interfaces besides the external one), `mode`, `internal_interface`, `int_addr` and
|
||||
`int_gateway_ip`. `PUT /components/<name>` takes `enabled` and, for the router switched on,
|
||||
`internal_interface`, `int_addr` and `int_gateway_ip`; the configuration's validation refuses a
|
||||
change it does not allow, such as the VPN off while IKEv2, OpenVPN or WireGuard is on (400), and
|
||||
the router without a second interface is 409. Both need an administrator's token.
|
||||
|
||||
## Applying changes
|
||||
|
||||
```sh
|
||||
systemctl restart linux-manager-setup
|
||||
linux-manager-config-edit apply
|
||||
```
|
||||
|
||||
The service also runs at boot. With platform `none` it does nothing and says so.
|
||||
@@ -411,7 +459,13 @@ access is configured. It then starts `strongswan`, `wg-quick@wg0` and
|
||||
restarting them only when their inputs changed, and
|
||||
restarts the remote access clients' resolver only when its configuration changed. Turning a
|
||||
feature off in the configuration stops its service and removes its files. Every step is
|
||||
idempotent, so restarting with no changes does nothing.
|
||||
idempotent, so a run with no changes does nothing.
|
||||
|
||||
`apply` waits for the run and exits with status 1 when it fails. The Manager, the commands of the
|
||||
package and the installation of a component ask for a run the same way: a run in progress is not
|
||||
cut short, it runs once more when it ends, however many runs were asked for during it. Without a
|
||||
run in progress, `linux-manager-setup` is restarted. A plain `systemctl restart
|
||||
linux-manager-setup` stops a run in progress, which then leaves its work to the next run.
|
||||
|
||||
To regenerate the configuration files and PKI without starting, stopping or reloading
|
||||
anything:
|
||||
@@ -423,7 +477,7 @@ anything:
|
||||
This does still write to the system: it renders into `/etc/swanctl/`,
|
||||
`/etc/systemd/resolved.conf.d/` and `/etc/wireguard/`, creates what the PKI is missing and
|
||||
adds the root CA to the host trust store. What it leaves alone is routes, firewall rules and
|
||||
services - that is what `systemctl restart linux-manager-setup` adds.
|
||||
services - that is what `linux-manager-config-edit apply` adds.
|
||||
|
||||
## Certificates
|
||||
|
||||
@@ -460,11 +514,14 @@ The root signs the issuing CAs only (path length 1), and the issuing CAs sign th
|
||||
present, and the users' certificates. IKEv2 and OpenVPN accept client certificates of
|
||||
this CA only.
|
||||
- `s2s`, named `pki.s2s_name`, signs the server's site-to-site certificate and the certificates
|
||||
of its peers.
|
||||
- The general-purpose CAs of `pki.issuing_cas`, each a name and `{"name": common name,
|
||||
"templates": [...], "acme": false}`. The name starts with a lowercase letter, has at most 31
|
||||
lowercase letters, digits and hyphens, and is not `root`, `p2s` or `s2s`; `templates` are the
|
||||
templates the CA issues.
|
||||
of its peers, with the template `mtls`.
|
||||
- `servers`, the Servers Issuing CA, named `pki.servers_name`, signs mTLS certificates, with both the
|
||||
server and the client purposes, and the server's HTTPS certificate while `https.certificate`
|
||||
is `ca`.
|
||||
- The custom CAs of `pki.issuing_cas`, each a name and `{"name": common name,
|
||||
"templates": [...], "acme": false}`, such as one for code signing. The name starts with a
|
||||
lowercase letter, has at most 31 lowercase letters, digits and hyphens, and is not `root`,
|
||||
`upstream`, `p2s`, `s2s` or `servers`; `templates` are the templates the CA issues.
|
||||
|
||||
Once a platform is chosen, `linux-manager-setup` creates what is missing: the root, as `pki.root`
|
||||
says (see The root), each issuing CA, the server's certificates once `wan.local_fqdn` is set, and
|
||||
@@ -509,9 +566,9 @@ The built-in templates:
|
||||
|---|---|---|---|---|---|
|
||||
| `vpn-server` | digital signature, key encipherment | server auth, IKE intermediate | `dns` | `dns`, `ip` | `p2s`, for the server only |
|
||||
| `vpn-user` | digital signature | client auth | `name` | `dns`, `email` | `p2s`, for the users only |
|
||||
| `site-to-site` | digital signature, key encipherment | server auth, client auth | `dns` | `dns`, `ip` | `s2s` |
|
||||
| `server` | digital signature, key encipherment | server auth | `dns` | `dns`, `ip` | general-purpose CAs |
|
||||
| `client` | digital signature | client auth | `name` | `dns`, `email` | general-purpose CAs |
|
||||
| `mtls` | digital signature, key encipherment | server auth, client auth | `dns` | `dns`, `ip` | `s2s`, `servers` |
|
||||
| `server` | digital signature, key encipherment | server auth | `dns` | `dns`, `ip` | custom CAs |
|
||||
| `client` | digital signature | client auth | `name` | `dns`, `email` | custom CAs |
|
||||
|
||||
`pki.templates` changes options of the built-in templates, which cannot be removed, and adds
|
||||
templates of its own, named like the issuing CAs:
|
||||
@@ -610,6 +667,9 @@ openssl x509 -req -in p2s.csr -CA root-cert.pem -CAkey root-key.pem -CAcreateser
|
||||
linux-manager-ca ca import p2s p2s.pem
|
||||
```
|
||||
|
||||
The imported certificate must keep the common name of the CSR, as setup refuses a CA whose name
|
||||
differs from its configured one.
|
||||
|
||||
The server cannot sign the root CRL. Sign it offline and upload it before the current one
|
||||
expires, as OpenVPN refuses every client while a CRL of a client's chain has expired:
|
||||
|
||||
@@ -987,9 +1047,10 @@ modules shipped with the package; the configuration file accepts any module inst
|
||||
|
||||
## Status web service
|
||||
|
||||
The `linux-manager-web` service shows the state of the server on the addresses of the interfaces
|
||||
`web.listen` names, the internal, the external or both (the default), and on `127.0.0.1`, where
|
||||
Caddy calls it (see HTTPS), with `web.port` (7081 by default). Its pages `/` and `/status` need no authentication and show no
|
||||
The `linux-manager-web` service shows the state of the server. It listens on `127.0.0.1:7091`
|
||||
only, behind Caddy, which serves it over plain HTTP on `web.port` (7081 by default), open in the
|
||||
firewall on the interfaces `web.listen` names, the internal, the external or both (the default),
|
||||
and over HTTPS (see HTTPS). Its pages `/` and `/status` need no authentication and show no
|
||||
configuration: no key, identity, subnet, or address but the client's. They show as much as
|
||||
`web.status_content` says, read at each request:
|
||||
|
||||
@@ -1000,8 +1061,8 @@ configuration: no key, identity, subnet, or address but the client's. They show
|
||||
| `full` | Also each service and its state, Docker, how many site-to-site connections are set up and how many of them are established (`site_to_site`: `connections` and `established`, `null` when swanctl cannot be asked), IKEv2, OpenVPN and WireGuard |
|
||||
|
||||
The Client IP is the address the request came from: the last entry of `X-Forwarded-For` for a
|
||||
request from one of `web.trusted_proxies`, by default the address the request came in on, so
|
||||
behind Caddy or a Ubuntu Linux Manager on the server it is the browser's. `/status` names the content in
|
||||
request from one of `web.trusted_proxies`, by default `127.0.0.1`, where Caddy and the
|
||||
Ubuntu Linux Manager on the server call from, so it is the browser's. `/status` names the content in
|
||||
`content` and the Client IP in `client_ip`; `/` keeps the time and the link to `/status`.
|
||||
|
||||
The service first makes its signing key, the OpenID Provider's key and the refresh tokens'
|
||||
@@ -1112,8 +1173,8 @@ directory). A passkey that does not sign, is not the user's, or of a disabled, l
|
||||
account gets 401 too (see Passkeys). `/auth`, `/auth/passkey/complete` and `/auth/refresh` take
|
||||
at most 10 calls a minute from one client address,
|
||||
and answer 429 with `Retry-After` beyond that; for a call from one of `web.trusted_proxies`, by
|
||||
default the address the call came in on, the client address is the last entry of
|
||||
`X-Forwarded-For`.
|
||||
default `127.0.0.1`, where Caddy and the Manager call from, the client address is the last entry
|
||||
of `X-Forwarded-For`.
|
||||
|
||||
Refresh tokens are kept, as their SHA-256, in PostgreSQL: by default in the database and role
|
||||
`linux-manager` on the server, which the web service creates on its first run with a password in
|
||||
@@ -1455,17 +1516,23 @@ A change is made, checked and applied as for `/site-to-site`.
|
||||
|
||||
A change is made, checked and applied as for `/site-to-site`.
|
||||
|
||||
### The /https/settings API
|
||||
### The /https API
|
||||
|
||||
`/https/settings` shows the settings of HTTPS and changes the CA of Caddy's certificates, with the
|
||||
same token as `/users`.
|
||||
`/https` shows the settings of HTTPS and the server's certificate, changes where the certificate
|
||||
comes from and the ACME CA, and imports a certificate of another CA, with the same token as
|
||||
`/users`. The secrets `acme_eab_mac_key` and `zerossl_api_key` are answered as `<name>_set`.
|
||||
|
||||
| Request | Body | Answer |
|
||||
| --- | --- | --- |
|
||||
| `GET /https/settings` | | `{"settings"}`: the `https` section |
|
||||
| `PUT /https/settings` | `{"acme_staging"}`; any other setting of the `https` section is 400, as it is changed on the server with `linux-manager-config-edit` | `{"settings"}` |
|
||||
| `GET /https/settings` | | `{"settings", "certificate"}`: the `https` section, and `{"source", "served", "subject", "issuer", "sans", "expires", "pending"}`, `served` being the source of the certificate Caddy serves, `self-signed` while the chosen one is not available, and `pending` whether a CSR waits |
|
||||
| `PUT /https/settings` | any of `certificate`, `self_signed_days`, `acme_provider`, `acme_url`, `acme_eab_key_id`, `acme_eab_mac_key`, `zerossl_api_key`, `acme_staging`; any other setting is 400, as it is changed on the server with `linux-manager-config-edit` | `{"settings"}` |
|
||||
| `POST /https/csr` | | `{"csr"}`: a new CSR for `wan.local_fqdn`, replacing a pending one |
|
||||
| `PUT /https/certificate` | `{"certificate"}`, PEM, the certificate signed for the CSR followed by its chain | `{"subject", "issuer", "expires"}` |
|
||||
| `PUT /https/pfx` | `{"pfx", "password"}`, the PKCS#12 file in base64 | `{"subject", "issuer", "expires"}` |
|
||||
|
||||
A change is made, checked and applied as for `/site-to-site`.
|
||||
A change of the settings is made, checked and applied as for `/site-to-site`; an import restarts
|
||||
`linux-manager-setup` too. An import needs `https.certificate` `external`; a refused one is 400,
|
||||
and one without a pending CSR 409.
|
||||
|
||||
### The /remote-access API
|
||||
|
||||
@@ -1508,7 +1575,7 @@ The answer of `GET /ca` holds:
|
||||
- **`settings`:** the `pki` section.
|
||||
- **`templates`:** every template, the built-in ones included, with all its options.
|
||||
- **`extended_key_usages`:** every extended key usage templates may give, name -> `{"oid", "builtin"}`.
|
||||
- **`status`:** `root` (`source`, `pki.root`, `state`, `active` or `pending`, `subject`, `expires`, `crl_next_update`, `crl_source`, `signed`, `uploaded` or `fetched`, `simple_ca_url`, `upstream`, the Simple CA issuing CA `{"name", "subject", "expires", "crl_next_update"}` or null, and `token_expires`), `authorities`, one per issuing CA (`name`, `common_name`, `state`: `active`, `pending` or `missing`, `builtin`, `templates`, `acme`, `subject`, `expires`, `key`, `crl_next_update`, `acme_url`), `retired` and `warnings`.
|
||||
- **`status`:** `root` (`source`, `pki.root`, `state`, `active` or `pending`, `subject`, `expires`, `crl_next_update`, `crl_source`, `signed`, `uploaded` or `fetched`, `simple_ca_url`, `upstream`, the Simple CA issuing CA `{"name", "subject", "expires", "crl_next_update"}` or null, and `token_expires`), `authorities`, one per issuing CA (`name`, `common_name`, `state`: `active`, `pending`, `off`, a built-in CA whose component is off, or `missing`, `builtin`, `component`, the section that switches a built-in CA, `templates`, `acme`, `subject`, `expires`, `key`, `crl_next_update`, `acme_url`), `retired` and `warnings`.
|
||||
- **`certificates`:** the certificates issued, newest first, each `{"serial", "ca", "kind", "template", "subject", "sans", "created", "expires", "revoked", "reason", "state"}`; `kind` is `ca`, `router`, `user` or `external`, and `state` `valid`, `expired` or `revoked`.
|
||||
|
||||
A change of the settings is made, checked and applied as for `/site-to-site`; an imported root or
|
||||
@@ -1529,72 +1596,105 @@ and the facts for `/config` from `/run/linux-manager/web.json` (readable by root
|
||||
|
||||
## HTTPS
|
||||
|
||||
Caddy serves the status web service on `https.web_port` (7444 by
|
||||
default), the Manager on `https.manager_port` (7443), and
|
||||
while metrics are enabled the metrics service on `metrics.https_port` (9465), all for `wan.local_fqdn`, while `https.enabled` is `true` and `wan.local_fqdn` is set. It obtains
|
||||
and renews the certificate from Let's Encrypt with the HTTP challenge, so `wan.local_fqdn` must
|
||||
resolve to the server's public address and port 80 must be reachable from the internet; the
|
||||
certificate and the ACME account are kept in `/var/lib/caddy`. Port 80 answers the challenge only;
|
||||
it does not redirect to HTTPS. Caddy's default CAs are Let's Encrypt and ZeroSSL, which it takes
|
||||
when Let's Encrypt refuses, such as for its rate limit of 5 certificates a week for the same name.
|
||||
Caddy, a dependency of the package, serves every HTTP and HTTPS port of the server's services; the
|
||||
services listen on `127.0.0.1` only. Over plain HTTP it serves the status web service on
|
||||
`web.port` (7081 by default), the Manager on its `port` (7080), and while metrics are enabled the
|
||||
metrics service on `metrics.port` (9464). While `https.enabled` is `true` and `wan.local_fqdn` is
|
||||
set, it also serves the status web service on `https.web_port` (7444), the Manager on
|
||||
`https.manager_port` (7443), and while metrics are enabled the metrics service on
|
||||
`metrics.https_port` (9465), all for `wan.local_fqdn`.
|
||||
|
||||
While `https.acme_staging` is `true`, Caddy's only CA is Let's Encrypt's staging environment, for
|
||||
routers that are rebuilt often. Its rate limits are far higher, but no browser or client trusts
|
||||
its certificates, so they are for tests only. The setting applies to every certificate Caddy
|
||||
obtains from an ACME CA, those of the web sites with `tls` `acme` included.
|
||||
The installer asks whether to serve over HTTPS (`https_enabled`) and, with HTTPS, whether to keep
|
||||
the Manager on plain HTTP (`https_disable_auto_redirect`). While HTTPS is on, Caddy answers the
|
||||
Manager's plain HTTP port with a redirect (308) to the same path at
|
||||
`https://<wan.local_fqdn>:<https.manager_port>`, unless `https.disable_auto_redirect` is `true`.
|
||||
The status page never redirects and stays available over plain HTTP on `web.port` whether HTTPS
|
||||
is on or not.
|
||||
|
||||
### The server's certificate
|
||||
|
||||
`https.certificate` says where the certificate of `wan.local_fqdn` comes from; it is `self-signed`
|
||||
when the file does not set it, and ACME only when it is set to `acme`. The file a new installation
|
||||
writes has it empty, and that installation's first setup chooses it and writes it into the file:
|
||||
`ca` when the root CA and the Servers Issuing CA are available, as with a root the server creates,
|
||||
else `self-signed`, as with an offline root, a Simple CA root that has not signed yet, or a
|
||||
directory that cannot be reached. A source chosen later, in the Manager or the file, stays.
|
||||
|
||||
| Source | The certificate |
|
||||
|---|---|
|
||||
| `acme` | obtained and renewed by Caddy from the ACME CA of `https.acme_provider`, with the HTTP challenge, so `wan.local_fqdn` resolves to the server's public address and port 80 is reachable from the internet; kept in `/var/lib/caddy` |
|
||||
| `self-signed` (the default) | made by the server, valid for `https.self_signed_days`, and made again when a third of it is left or `wan.local_fqdn` changes |
|
||||
| `ca` | issued and renewed by the Servers Issuing CA, `servers`, of the server's PKI (see Certificates), with the template `mtls` |
|
||||
| `external` | another CA's certificate, imported, from a CSR the server makes or as a PFX file |
|
||||
|
||||
A certificate other than ACME's is kept in the server's directory, `cn=https,ou=pki` (a router
|
||||
certificate of `servers` for `ca`), and written for Caddy to `/etc/caddy/linux-manager-https/`.
|
||||
While the chosen certificate is not available, such as before an import or while `servers` waits for
|
||||
an offline root, the server serves a self-signed one and warns. Port 80 is opened for the HTTP
|
||||
challenge only with `acme`.
|
||||
|
||||
```sh
|
||||
linux-manager-config-edit set --restart https.acme_staging true
|
||||
linux-manager-config-edit set --restart https.certificate external
|
||||
linux-manager-ca https csr > router.csr # signed by the other CA into router.pem, with its chain
|
||||
linux-manager-ca https import router.pem
|
||||
linux-manager-ca https import-pfx router.pfx # or a PFX file; its password on standard input
|
||||
linux-manager-ca https status
|
||||
```
|
||||
|
||||
The Manager switches it on the Overview, and `PUT /https/settings` changes it (see The
|
||||
/https/settings API).
|
||||
An imported certificate must be valid and name `wan.local_fqdn`, directly or with a wildcard, and
|
||||
the CSR's key or the PFX's key must be its key. The server warns 30 days before it expires; a new
|
||||
CSR or PFX replaces it.
|
||||
|
||||
### The ACME CA
|
||||
|
||||
`https.acme_provider` is the ACME CA of the server's certificate with `acme`, and of the web sites
|
||||
with `tls` `acme` whatever the source:
|
||||
|
||||
| Provider | The CA |
|
||||
|---|---|
|
||||
| `letsencrypt` (the default) | Let's Encrypt; with `https.acme_staging` `true`, its staging environment, whose rate limits are far higher but whose certificates no browser trusts, for routers rebuilt often and tests |
|
||||
| `zerossl` | ZeroSSL; its EAB credentials come from `https.zerossl_api_key` when it is set, else from the e-mail address `https.email` |
|
||||
| `custom` | the ACME directory `https.acme_url`, such as HashiCorp Vault, a Caddy ACME server or Simple CA, with the EAB credentials `https.acme_eab_key_id` and `https.acme_eab_mac_key` when it needs them |
|
||||
|
||||
The CA that issued the HTTPS certificate of a custom ACME directory is installed in the system's
|
||||
trust store, which Caddy uses. `https.email` is the e-mail address of the ACME account.
|
||||
|
||||
The Manager changes the source and the provider on the Server tab of the Certificates page, whose
|
||||
HTTPS certificate row makes the CSR and imports the certificates, and `/https` changes them
|
||||
(see The /https API).
|
||||
|
||||
### Caddy's configuration
|
||||
|
||||
`linux-manager-setup` writes Caddy's configuration to `/etc/caddy/linux-manager.Caddyfile` (root, group
|
||||
`caddy`, the group Caddy runs as, mode 0640), which the
|
||||
package's drop-in `/usr/lib/systemd/system/caddy.service.d/linux-manager.conf` makes `caddy.service`
|
||||
read; `caddy.service` does not start before the file exists, and `/etc/caddy/Caddyfile` is not
|
||||
used. Setup starts Caddy, reloads it when the file changes, and stops it and removes the file when
|
||||
HTTPS is off and no web site is served (see Web sites). In the firewall it opens port 80 on the external interface and the HTTPS ports on the
|
||||
internal and the external interface, and ports 80 and 443 on both when `pki.publish` has `http-80`
|
||||
and `https-default`, on which Caddy serves only the CA files (see Certificates). Caddy calls both services on `127.0.0.1`, where they listen
|
||||
whatever `web.listen` and the manager's `listen` say, and passes the client's address in
|
||||
`X-Forwarded-For`, which the manager trusts from `127.0.0.1` and the web service by default, as
|
||||
the address the call came in on; a `web.trusted_proxies` that is set must list `127.0.0.1`. The plain HTTP ports stay as
|
||||
`web.listen` and the manager's `listen` set them. `docker.exposed_ports` may not take port 80 or
|
||||
the HTTPS ports while `https.enabled` is `true`.
|
||||
`caddy`, the group Caddy runs as, mode 0640), which the package's drop-in
|
||||
`/usr/lib/systemd/system/caddy.service.d/linux-manager.conf` makes `caddy.service` read;
|
||||
`caddy.service` does not start before the file exists, and `/etc/caddy/Caddyfile` is not used.
|
||||
Setup starts Caddy once the server is configured (`general.platform` other than `none`) and
|
||||
reloads it when the file changes.
|
||||
|
||||
Caddy listens on every address, and the firewall decides who reaches it: `web.port` is open on the
|
||||
interfaces `web.listen` names, the Manager's port on those of its `listen`, and `metrics.port` on
|
||||
those of `metrics.listen`, where `internal` is the external interface without the router. Port
|
||||
80 is open on the external interface while ACME needs it, the HTTPS ports on the internal and the
|
||||
external interface, and ports 80 and 443 on both when `pki.publish` has `http-80` and
|
||||
`https-default`, on which Caddy serves only the CA files (see Certificates).
|
||||
|
||||
Caddy calls the services on `127.0.0.1`: the status web service on port 7091, the Manager on
|
||||
7090, the metrics service on 9474 and WebDAV on 7446, and passes the client's address in
|
||||
`X-Forwarded-For`, which every service trusts from `127.0.0.1`; a `web.trusted_proxies` that is
|
||||
set must list `127.0.0.1`. The OpenID Provider answers only calls of Caddy's HTTPS site, which
|
||||
carry `X-Forwarded-Proto: https`. Caddy removes the `Server` header of its own answers and of the
|
||||
services', so no answer names the software or its version. `docker.exposed_ports` and the web
|
||||
sites may not take Caddy's ports or the loopback ports.
|
||||
|
||||
```bash
|
||||
curl https://router.example.com:7444/status
|
||||
```
|
||||
|
||||
### Installing Caddy
|
||||
### Caddy
|
||||
|
||||
The package does not depend on Caddy; `linux-manager-setup` has it installed, while HTTPS is on,
|
||||
from the source `https.caddy_source` names:
|
||||
|
||||
- `ubuntu`, the default: the `caddy` package of the Ubuntu archive.
|
||||
- `upstream`: Caddy's own repository, `https://dl.cloudsmith.io/public/caddy/stable/deb/debian`,
|
||||
whose source the package writes to `/etc/apt/sources.list.d/caddy-stable.sources` with its key,
|
||||
downloaded over HTTPS, in `/etc/apt/keyrings/caddy-stable.asc`.
|
||||
|
||||
apt runs in `linux-manager-caddy.service`, which waits for dpkg's lock, so setup run by a package
|
||||
installation does not wait for itself; the unit runs `linux-manager-caddy apply` and then setup
|
||||
again, which serves with the new Caddy. `linux-manager-caddy status` shows the configured source, the
|
||||
source in effect and the versions.
|
||||
|
||||
A router installed with `ubuntu` is switched to upstream's Caddy with:
|
||||
|
||||
```sh
|
||||
linux-manager-caddy use-upstream
|
||||
```
|
||||
|
||||
It sets `https.caddy_source` to `upstream`, configures the repository and replaces Caddy, printing
|
||||
each step. Upstream versions sort above Ubuntu's, so once the repository is configured apt keeps
|
||||
upstream's Caddy, and `ubuntu` has no effect; setup says so. Going back is a downgrade nothing
|
||||
does on its own: remove the source and the key, run `apt-get update`, and install Ubuntu's version
|
||||
with `apt-get install --allow-downgrades caddy=<version>`, the version `apt-cache policy caddy`
|
||||
lists for the archive.
|
||||
Caddy is a dependency of the package, the `caddy` package of the Ubuntu archive, installed with
|
||||
`linux-manager` and kept up to date with the system's packages.
|
||||
|
||||
## OpenID Provider
|
||||
|
||||
@@ -1788,7 +1888,7 @@ Ubuntu Linux Manager, each change applied by restarting `linux-manager-setup`. A
|
||||
| `hosts` | The host names (or IP addresses) Caddy answers on the port, the names TLS clients send as SNI; none answers any name |
|
||||
| `port` | The TCP port, 443 by default |
|
||||
| `listen` | `internal`, `external` (the default) or `both`: the interfaces whose firewall opens the port |
|
||||
| `tls` | `none` (plain HTTP), `acme` (Let's Encrypt, the default), `ca` (certificates of an issuing CA of `pki.issuing_cas`, named by `ca`) or `file` (`certificate` and `private_key`, PEM) |
|
||||
| `tls` | `none` (plain HTTP), `acme` (the ACME CA of `https.acme_provider`, the default), `ca` (certificates of an issuing CA of `pki.issuing_cas`, named by `ca`) or `file` (`certificate` and `private_key`, PEM) |
|
||||
| `index_file` | The file served for a folder, `index.html` by default |
|
||||
| `spa` | Whether a path without a file is served the site's `index_file`, for single-page applications |
|
||||
| `editors` | The group whose members may change the site's files besides the admins |
|
||||
@@ -1796,7 +1896,8 @@ Ubuntu Linux Manager, each change applied by restarting `linux-manager-setup`. A
|
||||
| `dns_address` | With `dns` `router`, the server's address in the records: `public` (the default, `wan.public_address`), `internal` or `external` |
|
||||
|
||||
A site may not take a port of the server's own services (SSH, `web.port`, the HTTPS ports, the
|
||||
metrics ports, the Manager's, `sites.webdav_port`, 7446, 53, the bootstrap ports, a TCP
|
||||
metrics ports, the Manager's, `sites.webdav_port`, the loopback ports 7090, 7091, 9474 and 7446, 53,
|
||||
the bootstrap ports, a TCP
|
||||
`openvpn.port` and `docker.exposed_ports`). It may use `wan.local_fqdn` as a host name, on a port
|
||||
of its own, such as 443, which the server's services leave free; its record is then kept where the
|
||||
domain of `wan.local_fqdn` is, so `dns` `router` takes neither it, nor wildcards or addresses, and
|
||||
@@ -1806,8 +1907,8 @@ names of their own, the same `listen` and the same kind of TLS (plain HTTP or HT
|
||||
which setup opens on the external interface. The certificate of `file` must be the key's and name
|
||||
the hosts; it is written to `/etc/caddy/linux-manager-sites/<name>` (root, group `caddy`, 0640). An
|
||||
issuing CA of `ca` is given to Caddy as the ACME servers' CAs are, in `/etc/caddy/linux-manager-pki`;
|
||||
its certificates are trusted by clients that trust the server's root. Caddy runs while HTTPS is
|
||||
ready or a site is served; while the sites cannot be read, setup leaves the Caddyfile as it is.
|
||||
its certificates are trusted by clients that trust the server's root. While the sites cannot be
|
||||
read, setup leaves the Caddyfile as it is.
|
||||
|
||||
```sh
|
||||
linux-manager-config-edit set --restart sites.enabled true
|
||||
@@ -1839,8 +1940,8 @@ interfaces. A user signs in with the name and password of the server's directory
|
||||
TOTP code for an enrolled user; an admin sees a folder for every site, any other user the folders of
|
||||
the sites whose `editors` group the user is a member of, and no folder means no access. rclone writes
|
||||
an upload to its cache in `/var/cache/linux-manager-webdav` and to the site's folder a few seconds
|
||||
later. rclone is installed from the Ubuntu archive by `linux-manager-install@webdav.service` when it is
|
||||
missing.
|
||||
later. WebDAV is a component (see Components): rclone is installed from the Ubuntu archive by
|
||||
`linux-manager-install@webdav.service` while `sites.webdav` is true and rclone is missing.
|
||||
|
||||
```sh
|
||||
linux-manager-config-edit set --restart sites.webdav true
|
||||
@@ -1853,9 +1954,10 @@ primary name server of the server's domains, on port 53 of the addresses of `dns
|
||||
(`internal`, `external`, the default, or `both`), which the firewall opens for UDP and TCP. The
|
||||
domains and records are in the database `linux-manager-dns` (password in `/etc/linux-manager/dns-database.secret`),
|
||||
read by PowerDNS's gpgsql backend; setup writes the settings
|
||||
`/etc/powerdns/pdns.d/linux-manager.conf` (root, group `pdns`, 0640) and installs `pdns-server` and
|
||||
`pdns-backend-pgsql` from the Ubuntu archive with `linux-manager-install@dns.service` when they are
|
||||
missing, without the recommended bind backend.
|
||||
`/etc/powerdns/pdns.d/linux-manager.conf` (root, group `pdns`, 0640). The name server is a component
|
||||
(see Components): `pdns-server` and `pdns-backend-pgsql` are installed from the Ubuntu archive with
|
||||
`linux-manager-install@dns.service` while `dns.enabled` is true and they are missing, without the
|
||||
recommended bind backend.
|
||||
|
||||
| Setting | Meaning |
|
||||
| --- | --- |
|
||||
@@ -1890,8 +1992,8 @@ through `/dns`; the SOA's serial grows only when the records change. While IKEv2
|
||||
WireGuard is enabled, dnsmasq answers their clients on port 53 of the addresses of
|
||||
`p2s.dns_listen`, by default the internal address, so `dns.listen` must not share an interface with
|
||||
it. The parent zone of each domain must delegate it to `wan.local_fqdn` and `dns.secondary`, with
|
||||
glue records for those of them inside the domain. While `dns.secondary` is not set, the domains have
|
||||
`wan.local_fqdn` as their only name server, and setup warns.
|
||||
glue records for those of them inside the domain. The secondary is optional: while `dns.secondary`
|
||||
is not set, the domains have `wan.local_fqdn` as their only name server.
|
||||
|
||||
```sh
|
||||
linux-manager-config-edit set dns.secondary ns2.provider.net
|
||||
@@ -2052,7 +2154,7 @@ sudo apt-get install rclone
|
||||
sudo rclone config --config /etc/linux-manager/rclone.conf
|
||||
sudo chmod 0600 /etc/linux-manager/rclone.conf
|
||||
sudo linux-manager-config-edit set backup.rclone_remote azure:backups/router
|
||||
sudo systemctl restart linux-manager-setup
|
||||
sudo linux-manager-config-edit apply
|
||||
```
|
||||
|
||||
The two modes:
|
||||
@@ -2112,8 +2214,8 @@ only page of a user who is not a member of `admins`. Administrators switch betwe
|
||||
the Overview, Metrics, Logs, Backup and System tabs), Identities (`/user-manager`: the Users, Groups and Service
|
||||
Accounts tabs), Connectivity (`/site-to-site-manager`: the Status, Network and Connections tabs), Remote
|
||||
Access (`/remote-access-manager`: the IKEv2, OpenVPN and WireGuard tabs), Certificates
|
||||
(`/ca-manager`), Web Sites (`/sites-manager`: the Sites, Files and DNS tabs) and
|
||||
Docker (`/docker-manager`) with the page menu at the
|
||||
(`/ca-manager`), Web Sites (`/sites-manager`: the Sites and Files tabs), DNS (`/dns-manager`, while the name
|
||||
server is on) and Docker (`/docker-manager`) with the page menu at the
|
||||
right end of the header, a button naming the page shown. The button with the signed-in user's
|
||||
name, left of Sign out, opens the account page, and the terminal icon left of it the Shell
|
||||
(`/shell`); pressed on its page, each returns to the page it was opened from.
|
||||
@@ -2153,21 +2255,21 @@ name, left of Sign out, opens the account page, and the terminal icon left of it
|
||||
Level 3. They sign in to the Manager, and open a shell on the Shell page in place of the password
|
||||
and code.
|
||||
|
||||
- **Certificates** (`/ca-manager`, in the page menu of administrators): the server's two-level CA, from its `/ca`, in tabs:
|
||||
- **Certificates** (`/ca-manager`, in the page menu of administrators): the server's HTTPS and its two-level CA, from its `/ca`, in tabs:
|
||||
- **Server:** the first tab, from the server's `/config` and `/https/settings`, shown also while the PKI cannot be read: whether HTTPS is on and for which name, with a chip while the certificate has another source than ACME and a settings button for the certificate's source, the ACME CA with a chip while Caddy takes Let's Encrypt's staging CA and a settings button for it (both through the server's `/https/settings`), the server's certificate when it is not ACME's, with Generate CSR, Import certificate and Import PFX for one of another CA, and Caddy, which serves every HTTP and HTTPS port: its version and the state of `caddy.service`.
|
||||
- **Root:** the root CA's source, state, subject, expiry and CRL, with Simple CA its issuing CA that signs the server's and the expiry of the token, with Download root CA, the root's certificate alone; Import root certificate while an offline root waits for it, Upload CRL for a CRL of the offline root, and Enter setup code for a new Simple CA token; the general information: where certificates and CRLs are published, the CA key type, the lifetimes, and the CRL validity; the certificates of the issuing CAs, each active one with a download icon for its CA bundle, and the retired ones.
|
||||
- **Templates:** the certificate templates with their key, lifetime, subject, usages, alternative names, certificate policies and the CAs that issue them; Add template, Edit on each, Remove on one of the server's own and Reset on a changed built-in one, which brings back its defaults. A template's extended key usages are chosen from those of the next tab, and its certificate policies are OIDs typed in.
|
||||
- **Extended key usages:** the usages templates may give, with their OIDs and the templates that give them; the built-in ones are shown and not changed, and custom ones are added with a name and an OID, and changed or removed.
|
||||
- **P2S Issuing CA** and **S2S Issuing CA:** the CA's common name, state (active, or pending while it waits for the offline root), expiry, CRL and templates, and the certificates it issued. An active CA gives its CA bundle, the issuing CA followed by the root, with Download CA bundle; a pending CA gives its CSR with the openssl extensions to sign it with, and takes the certificate signed by the root.
|
||||
- **Issuing CAs:** the general-purpose CAs with their state, expiry, CRL, templates and ACME directory URL; Add issuing CA, and Edit and Remove on each: its name, fixed once it exists, its common name, the templates it issues and its ACME server; an active CA's download icon gives its CA bundle. A removed CA is retired by the server, which revokes its certificate on the root CRL. Below, their certificates, filtered by CA. - **Certificates:** each with its kind, template, names, expiry and state; a certificate of another system or of the server is revoked after a confirmation with a reason.
|
||||
- **Issue** (above the tabs): from a CSR, saving the certificate with its chain, or with a key the server makes, saving a PFX file protected by a password; the server keeps no copy of the key.
|
||||
- **Settings** (above the tabs): the source of the root, shown, the Simple CA URL, the names, lifetimes, key type, CRL validity and publishing endpoints.
|
||||
- **Issuing CAs:** the built-in P2S, S2S and Servers (`servers`) CAs and the custom CAs, with their state (active, pending while they wait for the offline root or Simple CA, or off while the VPN or the router a built-in CA belongs to is off), expiry, CRL, templates and ACME directory URL; an active CA's download icon gives its CA bundle, the issuing CA followed by the CAs above it, and a pending CA waiting for the offline root gives its CSR with the openssl extensions to sign it with and takes the certificate signed by the root. Add issuing CA, and Edit and Remove on each custom CA: its name, fixed once it exists, its common name, the templates it issues and its ACME server. A removed CA is retired by the server, which revokes its certificate on the root CRL. Below, the certificates of all of them, filtered by CA, each with its kind, template, names, expiry and state; a certificate of another system or of the server is revoked after a confirmation with a reason.
|
||||
- **Issue** (above the tabs but on Server): from a CSR, saving the certificate with its chain, or with a key the server makes, saving a PFX file protected by a password; the server keeps no copy of the key.
|
||||
- **Settings** (above the tabs but on Server): the source of the root, shown, the Simple CA URL, the names, lifetimes, key type, CRL validity and publishing endpoints.
|
||||
- **Warnings** (above the tabs): what the server says needs attention, such as a CRL about to expire.
|
||||
|
||||
- **Overview**: the server's overall status, ok or degraded, on the title bar of the Status panel;
|
||||
at the top of that panel, a table of `linux-manager`
|
||||
with the installed version and, when the repository has a newer one, that version; Check update
|
||||
is always in its top right corner, and Upgrade is added beside it when an update is found. Then
|
||||
IKEv2, OpenVPN and WireGuard, read from the server's authenticated `/status/full`, and from its `/config` the status web service and its port, whether HTTPS is on and for which name, with a chip while Caddy takes Let's Encrypt's staging CA and a settings button that switches it (`https.acme_staging`, through the server's `/https/settings`), and Caddy, its HTTPS proxy: its version, whether it comes from Ubuntu or upstream (switched on the server with `linux-manager-caddy use-upstream`) with the configured `https.caddy_source` when that differs, and the state of `caddy.service`. The Services panel shows the state of each of the server's
|
||||
IKEv2, OpenVPN and WireGuard, read from the server's authenticated `/status/full`, and from its `/config` the status web service and its port. The Services panel shows the state of each of the server's
|
||||
systemd services and of Caddy, with a chip on its title bar telling whether the server's services are active. The Addresses panel links, opening in a new tab, to the status page over HTTPS and over plain HTTP on the addresses `web.listen` names, and to the Manager over HTTPS, and shows the issuer and the discovery URL of the server's OpenID Provider, each with an icon that copies it, or off while the provider is disabled. Further panels
|
||||
show each PostgreSQL cluster of the
|
||||
router with its main settings and its databases with their sizes, and one Configuration panel
|
||||
@@ -2288,7 +2390,7 @@ name, left of Sign out, opens the account page, and the terminal icon left of it
|
||||
`/sites` and `/dns`, in tabs:
|
||||
- **Sites:** the Settings panel shows whether the sites are served, the largest upload and
|
||||
WebDAV with its URL and a copy icon, edited with Settings. The list shows each site with its
|
||||
URLs, linked, its port, the interfaces whose firewall opens it, its TLS (none, Let's Encrypt,
|
||||
URLs, linked, its port, the interfaces whose firewall opens it, its TLS (none, ACME,
|
||||
an issuing CA of the server or a certificate and key) and its editors group, searched by name,
|
||||
host name and group; Add and Edit take the name, fixed once added, the host names, one per
|
||||
line, the port, the interfaces, the TLS with the issuing CA or the PEM certificate chain and
|
||||
@@ -2300,12 +2402,13 @@ name, left of Sign out, opens the account page, and the terminal icon left of it
|
||||
with a progress bar; while Extract zip archives is on, a `.zip` file is extracted there
|
||||
instead. New folder, Rename, Remove and Download. A file larger than the server's largest
|
||||
upload is not sent.
|
||||
- **DNS:** the server's primary name server: its settings with whether PowerDNS is installed
|
||||
and runs, the server's FQDN as the primary name server, edited with Settings (enabled,
|
||||
secondary name server, public IP address, interfaces, TTL); the domains, added with Add
|
||||
domain (domain, TTL), edited and removed with their icons; and for the selected domain the
|
||||
records it serves, and its manual records, added with Add record (name, type, content and
|
||||
TTL) and removed with their icon.
|
||||
- **DNS** (`/dns-manager`, in the page menu while the name server is on): the server's primary
|
||||
name server: its settings with whether PowerDNS is installed and runs, the server's FQDN as the
|
||||
primary name server, edited with Settings (optional secondary name server, public IP address,
|
||||
interfaces, TTL; the name server is switched on the System tab); the domains, added with Add
|
||||
domain (domain, TTL), edited and removed with their icons; and for the selected domain the
|
||||
records it serves, and its manual records, added with Add record (name, type, content and TTL)
|
||||
and removed with their icon.
|
||||
- **Docker** (`/docker-manager`): the state of `docker.service` and of the server's Docker rules,
|
||||
the ports exposed on the external interface and the rules of the `LINUX-MANAGER-DOCKER` chain,
|
||||
from the server's `/status/full` and `/config`. The page menu leaves the page out while
|
||||
@@ -2330,7 +2433,7 @@ name, left of Sign out, opens the account page, and the terminal icon left of it
|
||||
- **Warnings:** shown when the PBS client or rclone the settings need is not installed on the server.
|
||||
|
||||
Restoring is done on the server with `linux-manager-backup restore`. The Overview tab has a Backup panel with the result of the last run, the next run and Run now.
|
||||
- **System**: the server's operating system. The System updates panel lists the packages `apt-get upgrade` would upgrade, each with its installed and its new version, from `/api/system-updates`; Check update is always in its top right corner, and Upgrade is added beside it when a package can be upgraded. Upgrade runs `apt-get upgrade -y` after a confirmation and shows its output in a dialog, as Upgrade on the Overview tab does, with Reload page and Reboot when they apply.
|
||||
- **System**: the server's operating system. The System updates panel lists the packages `apt-get upgrade` would upgrade, each with its installed and its new version, from `/api/system-updates`; Check update is always in its top right corner, and Upgrade is added beside it when a package can be upgraded. Upgrade runs `apt-get upgrade -y` after a confirmation and shows its output in a dialog, as Upgrade on the Overview tab does, with Reload page and Reboot when they apply. The Components panel lists the VPN, the router, the name server and WebDAV from the server's `/components`, each on or off and with its packages not installed, installing, installed or failed; Enable switches one on and the server installs its packages, Disable switches it off after a confirmation and keeps them. The router is offered only while the server has a second network interface, and its Enable asks for the internal interface and, in `manual` mode, its address and gateway. The name server and WebDAV are switched only there; their settings dialogs keep their other settings.
|
||||
|
||||
### How it works
|
||||
|
||||
@@ -2363,10 +2466,11 @@ It serves the application from `/usr/share/linux-manager/manager/web`.
|
||||
manager relays the WebSocket's bytes both ways until either side closes. `POST /api/shell`, which
|
||||
gives the ticket the handshake needs, and `POST /api/shell/passkey`, which begins the passkey
|
||||
proof it may take, pass as every other call does.
|
||||
- `/api/info` gives the version of the package and the URL of the server's status page, without a
|
||||
session. On the server, while `router_url` and `terraform_dir` are not set and the status web
|
||||
service listens on the address the call came in on, the URL has the name or address the browser
|
||||
used and `web.port`, for example `http://router.example.com:7081`, and for a page opened over
|
||||
- `/api/info` gives the URL of the server's status page and `manager`, the `port` and `listen` of
|
||||
the manager's plain HTTP site, without a session, and the version of the package only with one,
|
||||
so the sign-in page shows no version. On the server, while `router_url` and `terraform_dir` are not set and the status web
|
||||
service is enabled, the URL has the name or address the browser used and `web.port`, Caddy's
|
||||
plain HTTP site, for example `http://router.example.com:7081`, and for a page opened over
|
||||
the server's HTTPS proxy `https` and `https.web_port`, for example
|
||||
`https://router.example.com:7444`; otherwise it is `router_url`.
|
||||
- `/api/updates`, with a session, gives the installed and the candidate version of `linux-manager`
|
||||
@@ -2409,17 +2513,20 @@ It serves the application from `/usr/share/linux-manager/manager/web`.
|
||||
| 411 | The upload of a site's file has no `Content-Length` |
|
||||
|
||||
The server's rate limit of sign-ins counts the browser's address when the manager's address is
|
||||
in the server's `web.trusted_proxies`; by default that is the server's address the call came in
|
||||
on, which is the address a manager on the server calls from, so it needs nothing more.
|
||||
in the server's `web.trusted_proxies`; by default that is `127.0.0.1`, which is the address a
|
||||
manager on the server calls from, so it needs nothing more.
|
||||
|
||||
On the server, the server's Caddy serves the manager over HTTPS on `https.manager_port` of
|
||||
`linux-manager.json` (7443 by default) for `wan.local_fqdn`, with a certificate from Let's Encrypt,
|
||||
and calls it on `127.0.0.1`, where the manager also listens. For a call from `127.0.0.1` with
|
||||
`X-Forwarded-For`, the manager takes the browser's address from the last entry of that header.
|
||||
On the server, the manager listens on `127.0.0.1:7090` only. The server's Caddy serves it over
|
||||
plain HTTP on `port` (7080 by default), open in the firewall on the interfaces `listen` names, or
|
||||
redirects there to its HTTPS address while HTTPS is on (see HTTPS), and over HTTPS on
|
||||
`https.manager_port` of `linux-manager.json` (7443 by default) for `wan.local_fqdn`, with the
|
||||
certificate of `https.certificate`. For a call from `127.0.0.1` with `X-Forwarded-For`, the
|
||||
manager takes the browser's address from the last entry of that header.
|
||||
|
||||
The service needs nothing else to start and keeps running. Every 30 seconds it works out where to
|
||||
listen and starts, moves or stops a server on each address to match, so a change of `listen`,
|
||||
`bind` or `port` takes effect within 30 seconds, or when the service restarts. Each request
|
||||
listen and starts, moves or stops a server on each address to match, so a change of `bind` or
|
||||
`port` off the server takes effect within 30 seconds, or when the service restarts; on the
|
||||
server, `listen` and `port` take effect with the next run of `linux-manager-setup`. Each request
|
||||
reads the settings again.
|
||||
|
||||
Before it listens, it creates its sessions database on the server when it is missing and connects
|
||||
@@ -2433,11 +2540,11 @@ PostgreSQL is not running yet.
|
||||
|
||||
| Setting | Meaning | Default |
|
||||
|---------|---------|---------|
|
||||
| `router_url` | The server's status web service | `http://<first address of the web service>:<web.port>`, the internal address when it listens on both |
|
||||
| `router_url` | The server's status web service | On the server, `http://127.0.0.1:7091`, the web service behind Caddy |
|
||||
| `database` | A PostgreSQL connection string for the sessions | The `linux-manager-ui` database on the server |
|
||||
| `listen` | The interfaces to listen on when `bind` is not set: `internal`, `external` or `both`, and always `127.0.0.1` | `both` |
|
||||
| `bind` | The one address to listen on; the server's HTTPS proxy reaches the manager only when it is `127.0.0.1` | none, `listen` applies |
|
||||
| `port` | The port to listen on, HTTP | `7080` |
|
||||
| `listen` | On the server, the interfaces the firewall opens `port` on: `internal`, `external` or `both` | `both` |
|
||||
| `bind` | The one address to listen on, with `port`, off the server, as `dev.sh` sets it | none; on the server `127.0.0.1:7090` |
|
||||
| `port` | The port of `bind`; on the server, Caddy's plain HTTP port of the manager, which redirects to the HTTPS address while HTTPS is on unless `https.disable_auto_redirect` is `true` | `7080` |
|
||||
| `terraform_dir` | A Terraform root directory whose outputs give `router_url` when it is not set; `dev.sh` sets it | none |
|
||||
| `iac_tool` | The tool that reads the outputs of `terraform_dir`: `terraform` or `tofu` | `terraform` |
|
||||
|
||||
|
||||
Reference in new issue
Block a user