default the host's swarmctl to the gateway; login takes a callback port
This commit is contained in:
parent
ef817ed5a0
commit
58236e1b7f
3 changed files with 183 additions and 67 deletions
|
|
@ -129,7 +129,7 @@ minute it rewrites every agent's key, so a rewrite that failed converges. Ids
|
|||
are 8 lowercase letters, the same in every agent's key, never reused, and so
|
||||
never equal to a hive schedule's numeric id.
|
||||
|
||||
`swarmctl schedule` calls these routes over the controller's socket:
|
||||
`swarmctl schedule` calls these routes:
|
||||
|
||||
| method | path | body |
|
||||
| -------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------- |
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ token. Its access token carries `authelia.bearer.authz` with the audience
|
|||
`https://<swarm>/api/`, so the gateway admits it at the controller's API and
|
||||
nowhere else, under the same access rule as a browser session there.
|
||||
Revocation is per account: once authelia stops accepting the account, the
|
||||
gateway refuses its token too. See [`swarmctl/README.md`](../../../swarmctl/README.md#remote-use-swarmctl-login).
|
||||
gateway refuses its token too. See [`swarmctl/README.md`](../../../swarmctl/README.md#reaching-the-controller-swarmctl-login).
|
||||
|
||||
## What this doesn't do
|
||||
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ swarm-level operator CLI
|
|||
* `--users-file <PATH>` — Host-side path of authelia's users database — that is, the path inside the container, prefixed with the container's root.
|
||||
|
||||
This is the only user store: it's read before every change and written in place, and `swarm-authelia-bridge` writes the same file.
|
||||
* `--swarm <URL>` — The swarm's domain, as `https://<domain>` or the bare domain. Given, the `agent`, `schedule` and `forge` verbs, and the agent checks and steps of `setup`, go through its gateway as the account `swarmctl login` logged in, instead of over the controller's socket. Falls back to `SWARMCTL_SWARM`; `login` then falls back to `SWARMCTL_LOGIN_DEFAULT_SWARM`, which the swarm-controller nix module sets to its host's own swarm
|
||||
* `--swarm <URL>` — The swarm's domain, as `https://<domain>` or the bare domain. Given, the `agent`, `schedule` and `forge` verbs, and the agent checks and steps of `setup`, go through its gateway as the account `swarmctl login` logged in, instead of over the controller's socket. Falls back to `SWARMCTL_SWARM`; `login` then falls back to `SWARMCTL_LOGIN_DEFAULT_SWARM`. The swarm-controller nix module sets both to its host's own swarm, so there the verbs use the gateway and need `swarmctl login` once; an empty `SWARMCTL_SWARM` or `--swarm ""` puts them back on the controller's socket
|
||||
* `--ca-file <PATH>` — A PEM CA certificate to trust beside the system roots, for a swarm whose gateway serves a certificate from the swarm's own CA. Falls back to `SWARMCTL_CA_FILE`
|
||||
|
||||
|
||||
|
|
@ -744,7 +744,15 @@ With no `--swarm` or `SWARMCTL_SWARM`, logs in to `SWARMCTL_LOGIN_DEFAULT_SWARM`
|
|||
|
||||
Opens the swarm's SSO login in your browser (and prints the URL) and receives the answer on a loopback port, so run it where that browser runs. swarmctl keeps the login, mode 0600, under `$XDG_STATE_HOME/swarmctl/` and refreshes it as it's used. To log out, delete that file.
|
||||
|
||||
**Usage:** `swarmctl login`
|
||||
On a host with no browser, forward the callback port from the machine that has one: `ssh -L 8765:127.0.0.1:8765 <host>`, then run `swarmctl login --callback-port 8765` on the host and open the printed URL in that machine's browser.
|
||||
|
||||
**Usage:** `swarmctl login [OPTIONS]`
|
||||
|
||||
###### **Options:**
|
||||
|
||||
* `--callback-port <PORT>` — The loopback port the login listens on for the browser's answer. Defaults to a free one, which the login prints
|
||||
|
||||
Default value: `0`
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue