update: the history of the package is CHANGELOG.md, from which the build writes debian/changelog, the build, publish and development scripts are in Python, and the development tools keep their settings and credentials in .lm-dev-config.
Release / release (push) Failing after 14m43s
Release / release (push) Failing after 14m43s
This commit is contained in:
1 parent
a7bfabcb89
commit
6911d16fa3
26 files changed
+1966
-2105
No files matched your search
+35
-18
@@ -30,7 +30,7 @@ export LXD_POOL=...
|
||||
```
|
||||
|
||||
```sh
|
||||
./build.sh
|
||||
./build.py
|
||||
bin/lm-dev-run.py core nat s2s
|
||||
```
|
||||
|
||||
@@ -54,7 +54,7 @@ its end. Its first instance is its Vault, `lm-vault` on the bridge `lmt-vault` (
|
||||
reached by the Mac and the instances on the LXD host's address, port 8200, through a proxy
|
||||
device; every secret reaches an instance through it (see Secrets). The administrator password and
|
||||
the pre-shared key are generated per run and kept in the scenario's Vault, as `<server>/admin` and
|
||||
`<server>/config`; with `--keep` they stay there. The run leaves `.env` as it is.
|
||||
`<server>/config`; with `--keep` they stay there.
|
||||
The run prints PASS, FAIL or SKIP per check and exits non-zero on a failure; WireGuard is skipped
|
||||
when the host kernel has no WireGuard module.
|
||||
|
||||
@@ -91,25 +91,41 @@ and alice's password and OpenVPN profile take this way; the admin password is al
|
||||
`<name>/admin`. A WireGuard client's private key is made in the client and never leaves it.
|
||||
|
||||
A user's TOTP token is the key `<vm>-<user>` of the TOTP engine. The VM has the Vault generate it
|
||||
with `lm-dev-vault totp` and enrols its secret with its current code; the secret is never on the
|
||||
Mac and cannot be read back from the Vault, which gives the codes (`totp/code/<vm>-<user>`).
|
||||
with `lm-dev-vault totp` and enrols its secret with its current code; the secret cannot be read
|
||||
back from the Vault, which gives the codes (`totp/code/<vm>-<user>`). For the administrator of a VM
|
||||
made by `lm-dev-vm.py`, the Mac also reads the key's otpauth URL from the VM before the VM removes
|
||||
its copy, and keeps it as `otp_url` with the password, to add the token to an authenticator app.
|
||||
`lm-dev-vm.py remove` deletes the VM's role, policy, secrets and TOTP keys.
|
||||
|
||||
The Vault's web UI is at `/ui` of its address, `http://<vault-address>:8200/ui`; it signs in with
|
||||
the root token of `vault-<project>.json`.
|
||||
|
||||
The state the scripts keep across clean-ups of `tmp/` is in `.lm-dev-config/` at the repository's
|
||||
root, mode 0700, its files 0600, ignored by git: the project's state and repository key, the
|
||||
Vault's address, unseal key and root token (`vault-<project>.json`). `tmp/` holds
|
||||
only what can go: logs and files removed right after use.
|
||||
root, mode 0700, its files 0600, ignored by git: the scripts' settings (`settings.json`), the
|
||||
project's state and repository key, the Vault's address, unseal key and root token
|
||||
(`vault-<project>.json`) and the administrator of each VM `lm-dev-vm.py` made, its `username`,
|
||||
`password` and the otpauth URL of its TOTP token, `otp_url` (`vm-<project>-<vm>.json`). `tmp/` holds only what can go: logs and files removed right after use.
|
||||
|
||||
Each variable of the option tables below, and `LXD_DEV_BUILD_SERIAL`, the serial of the last dev
|
||||
build (see `lm-dev-build.py` below), is read from the environment, else from `settings.json`, a
|
||||
JSON object of the variables and their values, else it takes its default. A variable without a
|
||||
default, such as `LXD_REMOTE`, is required: without its option, the script stops and names it.
|
||||
|
||||
```json
|
||||
{
|
||||
"LXD_REMOTE": "my-remote",
|
||||
"LXD_POOL": "default",
|
||||
"LXD_FORWARD_ADDRESS": "192.0.2.10"
|
||||
}
|
||||
```
|
||||
|
||||
## A VM to work with
|
||||
|
||||
`lm-dev-vm.py create` launches one server VM, `lm-dev` by default, on the LXD remote and leaves
|
||||
it running. The VM is created in a project, the test project `lm-dev` by default, with that
|
||||
project's default profile, and takes its address from DHCP. It gets the package with the
|
||||
administrator `admin` and a generated password, set as `ADMIN_USERNAME` and `ADMIN_PASSWORD` in the
|
||||
repository's `.env`, a TOTP token for `admin` in the project's Vault unless `--no-otp` is given,
|
||||
administrator `admin` and a generated password, kept as `username` and `password` in
|
||||
`.lm-dev-config/vm-<project>-<vm>.json`, a TOTP token for `admin` in the project's Vault unless `--no-otp` is given,
|
||||
and a configuration from `configs/`, `core.json` by default; `@ETH0@` is the interface of the VM's
|
||||
default route.
|
||||
|
||||
@@ -141,8 +157,8 @@ bin/lm-dev-vm.py remove
|
||||
|
||||
`create` needs the project's Vault (`lm-dev-lxd-project.py vault create`): the VM gets its
|
||||
AppRole there, and reads the preseed and the configuration, kept as `<vm>/preseed` and
|
||||
`<vm>/config`, and creates the TOTP key `<vm>-admin` with it. `remove` deletes the VM, its forward
|
||||
and what the Vault keeps for it; `.env` is left as it is. Options:
|
||||
`<vm>/config`, and creates the TOTP key `<vm>-admin` with it. `remove` deletes the VM, its forward,
|
||||
its `vm-<project>-<vm>.json` and what the Vault keeps for it. Options:
|
||||
|
||||
| Option | Variable | Default | Meaning |
|
||||
|---|---|---|---|
|
||||
@@ -228,12 +244,12 @@ bin/lm-dev-lxd-project.py remove
|
||||
| `--ovn-ranges` | `LXD_UPLINK_OVN_RANGES` | required by `uplink setup` | LAN addresses for OVN routers |
|
||||
| `--routes` | `LXD_UPLINK_ROUTES` | required by `uplink setup` | A LAN subnet for network forwards |
|
||||
|
||||
`lm-dev-build.py` builds and publishes the next dev build. Its version is the newest changelog
|
||||
entry's with `~dev<N>` before the Debian revision, `0.41.0~dev7-1` for `0.41.0-1`, so the release
|
||||
of that entry is newer than its dev builds. `N` is that of the last dev build, kept in
|
||||
`.dev-build.serial` of the repository; each build that succeeds writes its own, one higher, and
|
||||
`release.py` writes 0 when it releases, so the next entry's builds start at `~dev1`. `./build.sh`
|
||||
builds it, with `CONTAINER_RUNTIME` and `DOCKER_CONTEXT` from the environment; the build is moved to `out/dev/`, copied into the repository and published there. A
|
||||
`lm-dev-build.py` builds and publishes the next dev build. Its version is the Debian version of
|
||||
the newest entry of `CHANGELOG.md` with `~dev<N>` before the Debian revision, `0.41.0~dev7-1` for
|
||||
`0.41.0`, so the release of that entry is newer than its dev builds. `N` is that of the last dev build,
|
||||
`LXD_DEV_BUILD_SERIAL`, 0 by default; each build that succeeds writes its own, one higher, into
|
||||
`.lm-dev-config/settings.json`, and `release.py` writes 0 there when it releases, so the next
|
||||
entry's builds start at `~dev1`. `./build.py` builds it, with `CONTAINER_RUNTIME` and `DOCKER_CONTEXT` from the environment; the build is moved to `out/dev/`, copied into the repository and published there. A
|
||||
VM of the project then gets it with Check update and Upgrade in the Manager, or `apt-get update`
|
||||
and `apt-get upgrade`.
|
||||
|
||||
@@ -249,7 +265,8 @@ read from its state file, so the script takes no `--remote`.
|
||||
`bin/lm-dev-otp-register.py` enrols a new TOTP token for a user of a VM, `admin` of `lm-dev` by
|
||||
default, replacing a token the user had. The project's Vault generates the key `<vm>-<user>` in its
|
||||
TOTP engine and hands it to the VM (see Secrets), where the package's `linuxmanager_users` stores
|
||||
it. `bin/lm-dev-otp-code.py` prints the user's current code, read from the Vault, for the Manager's
|
||||
it. A new token of the VM's administrator replaces `otp_url` in `vm-<project>-<vm>.json`.
|
||||
`bin/lm-dev-otp-code.py` prints the user's current code, read from the Vault, for the Manager's
|
||||
sign-in, SSH or `sudo`.
|
||||
|
||||
```sh
|
||||
|
||||
Reference in new issue
Block a user