diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index c1f7640da8..8fb8472100 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -6,12 +6,12 @@ Fill this in for any change. A specialised template carries extra prompts for it area; to open one, append its `template=` parameter to the pull request creation URL, for example `?quick_pull=1&template=server.md`. -* [Server](PULL_REQUEST_TEMPLATE/server.md) - `web-*` roles -* [Workstation](PULL_REQUEST_TEMPLATE/workstation.md) - `dsk-*` roles -* [System](PULL_REQUEST_TEMPLATE/system.md) - `sys-*`, `svc-*`, `dev-*`, `drv-*` -* [Pipeline](PULL_REQUEST_TEMPLATE/pipeline.md) - CI/CD -* [Agents](PULL_REQUEST_TEMPLATE/agents.md) - agent instruction files -* [Documentation](PULL_REQUEST_TEMPLATE/documentation.md) - docs only +- [Server](PULL_REQUEST_TEMPLATE/server.md) - `web-*` roles +- [Workstation](PULL_REQUEST_TEMPLATE/workstation.md) - `dsk-*` roles +- [System](PULL_REQUEST_TEMPLATE/system.md) - `sys-*`, `svc-*`, `dev-*`, `drv-*` +- [Pipeline](PULL_REQUEST_TEMPLATE/pipeline.md) - CI/CD +- [Agents](PULL_REQUEST_TEMPLATE/agents.md) - agent instruction files +- [Documentation](PULL_REQUEST_TEMPLATE/documentation.md) - docs only --- @@ -25,8 +25,8 @@ Briefly describe the change and the effect it has. List what this change touches. -* Primary role(s), module(s) or file(s): -* Related services, timers, packages, inventories, or workflows: +- Primary role(s), module(s) or file(s): +- Related services, timers, packages, inventories, or workflows: --- @@ -46,9 +46,9 @@ roles: Select the semantic version impact of this change: -* [ ] **Major** - Breaking change -* [ ] **Minor** - New backwards-compatible feature -* [ ] **Patch** - Small improvement or compatible adjustment +- [ ] **Major** - Breaking change +- [ ] **Minor** - New backwards-compatible feature +- [ ] **Patch** - Small improvement or compatible adjustment --- @@ -58,11 +58,11 @@ Explain what changed and why. Key points: -* What problem does this solve? -* How does it integrate with the existing stack? -* Were variables, defaults, and shared logic kept DRY? -* Are there migration or compatibility implications? -* Which alternatives were considered? +- What problem does this solve? +- How does it integrate with the existing stack? +- Were variables, defaults, and shared logic kept DRY? +- Are there migration or compatibility implications? +- Which alternatives were considered? --- @@ -70,9 +70,9 @@ Key points: Describe how the change was validated locally. -* [ ] Fresh deploy or targeted rerun tested -* [ ] Idempotency verified -* [ ] Relevant tests or lints run +- [ ] Fresh deploy or targeted rerun tested +- [ ] Idempotency verified +- [ ] Relevant tests or lints run --- @@ -80,14 +80,14 @@ Describe how the change was validated locally. Indicate whether this change has security implications. -* [ ] No relevant security impact -* [ ] Security impact present +- [ ] No relevant security impact +- [ ] Security impact present If security impact is present, explain: -* Affected auth, TLS, permissions, secrets, services, or exposed surfaces: -* Risk reduction, new exposure, migration, or compatibility considerations: -* Security-specific validation performed: +- Affected auth, TLS, permissions, secrets, services, or exposed surfaces: +- Risk reduction, new exposure, migration, or compatibility considerations: +- Security-specific validation performed: --- @@ -96,15 +96,15 @@ If security impact is present, explain: Help reviewers focus on the riskiest parts of this PR. For repository-wide contribution and review expectations, see [CONTRIBUTING.md](../CONTRIBUTING.md). -* Highest-risk files, roles, or flows: -* Idempotency, compatibility, or rollout concerns: -* Specific feedback requested from reviewers: +- Highest-risk files, roles, or flows: +- Idempotency, compatibility, or rollout concerns: +- Specific feedback requested from reviewers: --- ## Definition of Done (DoD) -* [ ] The implementation follows the Definition of Done, and the contribution guidelines in [CONTRIBUTING.md](../CONTRIBUTING.md) were considered and applied during implementation. +- [ ] The implementation follows the Definition of Done, and the contribution guidelines in [CONTRIBUTING.md](../CONTRIBUTING.md) were considered and applied during implementation. --- diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 398d459d15..d3f92854fe 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -180,6 +180,13 @@ The `tor` input decides what the onion axis is allowed to do at all: | `exclusive` | as `enforced`, and rows that cannot take an onion are dropped | | `disabled` | no row takes the onion | +The `vpn` input does the same for the WireGuard mesh on swarm rows: `auto` +rotates it, `enforced` meshes every swarm row and `disabled` none. A compose +row never takes the mesh. `meshes` names the WireGuard layout a meshed row +deploys, empty meaning `INFINITO_SWARM_MESHES` from `default.env`; pointing it at +an `inventories/examples/*/wireguard.yml` with `vpn: enforced` and `mode: swarm` +is how an example is deployed in CI. + `distros`, `filesystem` and `architectures` narrow the pools the other axes draw from. All three default to empty, which means the whole declared set. That is what a sweep wants, because the rows are spread over the pool rather than all @@ -248,6 +255,7 @@ reproduces by re-running the same sweep: |---|---| | mode | `(position + sweep) % len(modes the role offers)` | | tor | `(position + sweep // 2) % 2` | +| vpn (swarm rows) | `(position // 2 + sweep // 4) % 2` | | distro | `(position + sweep) % len(distro pool)` | | filesystem | `(position // len(distro pool) + sweep) % len(filesystem pool)` | | architecture | `(position + sweep) % len(architecture pool)` | diff --git a/.github/workflows/call-orchestrator.yml b/.github/workflows/call-orchestrator.yml index e46d3af666..c8c4f79181 100644 --- a/.github/workflows/call-orchestrator.yml +++ b/.github/workflows/call-orchestrator.yml @@ -87,6 +87,16 @@ on: required: false type: string default: "auto" + vpn: + description: "WireGuard axis of the deploy matrix: 'auto' rotates the mesh over the swarm rows, 'enforced' meshes all of them, 'disabled' meshes none." + required: false + type: string + default: "auto" + meshes: + description: "WireGuard layout a meshed swarm row deploys, e.g. an inventories/examples/*/wireguard.yml. Empty: INFINITO_SWARM_MESHES from default.env." + required: false + type: string + default: "" trusted_pr: description: "True when the PR carries the maintainer 'πŸ›‘οΈ Trusted' label; skips the fork-prereq wait." required: false @@ -195,6 +205,8 @@ jobs: filesystem: ${{ inputs.filesystem }} architectures: ${{ inputs.architectures }} tor: ${{ inputs.tor }} + vpn: ${{ inputs.vpn }} + meshes: ${{ inputs.meshes }} test-deploy-chunk-1: name: 🧱 Chunk 1 @@ -228,6 +240,8 @@ jobs: filesystem: ${{ inputs.filesystem }} architectures: ${{ inputs.architectures }} tor: ${{ inputs.tor }} + vpn: ${{ inputs.vpn }} + meshes: ${{ inputs.meshes }} test-deploy-chunk-2: name: 🧱 Chunk 2 @@ -263,6 +277,8 @@ jobs: filesystem: ${{ inputs.filesystem }} architectures: ${{ inputs.architectures }} tor: ${{ inputs.tor }} + vpn: ${{ inputs.vpn }} + meshes: ${{ inputs.meshes }} test-deploy-chunk-3: name: 🧱 Chunk 3 @@ -300,6 +316,8 @@ jobs: filesystem: ${{ inputs.filesystem }} architectures: ${{ inputs.architectures }} tor: ${{ inputs.tor }} + vpn: ${{ inputs.vpn }} + meshes: ${{ inputs.meshes }} test-runner-smoke: needs: diff --git a/.github/workflows/call-test-deploy.yml b/.github/workflows/call-test-deploy.yml index 02111e48ac..55b90a2454 100644 --- a/.github/workflows/call-test-deploy.yml +++ b/.github/workflows/call-test-deploy.yml @@ -65,6 +65,15 @@ on: required: false type: string default: auto + vpn: + required: false + type: string + default: auto + meshes: + description: "WireGuard layout a meshed swarm row deploys. Empty: INFINITO_SWARM_MESHES from default.env." + required: false + type: string + default: "" disable: description: "Comma-separated provider keys removed from the test inventory; used when the matrix row carries none of its own." required: false @@ -123,6 +132,17 @@ on: type: choice default: auto options: [auto, enforced, exclusive, disabled] + vpn: + description: "πŸš‡ WireGuard axis; see .github/workflows/README.md for what each value does" + required: false + type: choice + default: auto + options: [auto, enforced, disabled] + meshes: + description: "πŸ•ΈοΈ WireGuard layout meshed swarm rows deploy. Empty: the development lab's" + required: false + type: string + default: "" disable: description: "🚫 Provider keys removed from the test inventory (comma-separated)" required: false @@ -204,6 +224,7 @@ jobs: INFINITO_PRIORITY: ${{ inputs.priority }} INFINITO_MODES: ${{ inputs.modes }} INFINITO_TOR: ${{ inputs.tor }} + INFINITO_VPN: ${{ inputs.vpn }} INFINITO_CI_SWEEP: ${{ inputs.sweep }} INFINITO_CI_CHUNK: ${{ inputs.index }} INFINITO_CI_OFFSET: ${{ inputs.offset }} @@ -223,6 +244,7 @@ jobs: PLAN_MODES: ${{ inputs.modes }} PLAN_LIFECYCLES: ${{ inputs.lifecycles }} PLAN_TOR: ${{ inputs.tor }} + PLAN_VPN: ${{ inputs.vpn }} PLAN_OFFSET: ${{ inputs.offset }} run: | source scripts/meta/env/load.sh @@ -235,6 +257,7 @@ jobs: --modes "${PLAN_MODES}" \ --lifecycles "${PLAN_LIFECYCLES}" \ --tor "${PLAN_TOR}" \ + --vpn "${PLAN_VPN}" \ --offset "${PLAN_OFFSET}" \ >> "$GITHUB_STEP_SUMMARY" @@ -309,9 +332,9 @@ jobs: set -euo pipefail echo "GITHUB_REPOSITORY_OWNER=$(scripts/meta/resolve/repository/owner.sh)" >> "$GITHUB_ENV" - - name: πŸ“¦ Install jq + - name: πŸ“¦ Install jq and iproute2 shell: bash - run: ./scripts/install/apt.sh jq + run: ./scripts/install/apt.sh jq iproute2 - name: "πŸ” Resolve SWARM_NAME (mandatory; default to the matrix app)" if: ${{ matrix.mode == 'swarm' }} @@ -347,6 +370,8 @@ jobs: env: variant: ${{ matrix.variant }} disable: ${{ matrix.disable || inputs.disable }} + INFINITO_SWARM_VPN: ${{ matrix.vpn }} + INFINITO_SWARM_MESHES: ${{ inputs.meshes }} run: ./scripts/tests/deploy/distros.sh "${{ env.SCRIPTS }}/00_one.sh" 2>&1 | tee "/tmp/ansible-${{ matrix.apps }}.log" - name: πŸš€ Deploy app diff --git a/.github/workflows/entry-manual-steer.yml b/.github/workflows/entry-manual-steer.yml index 8ba5054d9f..5c7030331d 100644 --- a/.github/workflows/entry-manual-steer.yml +++ b/.github/workflows/entry-manual-steer.yml @@ -1,5 +1,5 @@ name: "πŸ•ΉοΈ Manual" -run-name: "πŸ•ΉοΈ ${{ inputs.chunk_gate && 'πŸ›‘ ' || '' }}${{ inputs.offset != '0' && inputs.offset != '' && format('⏩{0} ', inputs.offset) || '' }}${{ inputs.workspace != 'auto' && format('πŸ§‘β€πŸ’»{0} ', inputs.workspace == 'true' && '是' || '否') || '' }}${{ inputs.tor != 'auto' && format('{0} ', inputs.tor == 'disabled' && '🌐' || inputs.tor == 'enforced' && 'πŸ§…εΌΊεˆΆ' || 'πŸ§…η‹¬ε ') || '' }}${{ inputs.filesystem != '' && format('πŸ—„οΈ{0} ', inputs.filesystem) || '' }}${{ inputs.architectures != '' && format('πŸ—οΈ{0} ', inputs.architectures) || '' }}${{ inputs.distros != '' && format('🐧{0} ', inputs.distros) || '' }}${{ inputs.lifecycles != '' && format('♻️{0} ', inputs.lifecycles) || '' }}${{ inputs.mode != 'auto' && format('πŸš€{0} ', inputs.mode) || '' }}${{ inputs.priority != '' && format('⭐{0} ', inputs.priority) || '' }}${{ inputs.whitelist != '' && format('🎯{0}', inputs.whitelist) || 'πŸ”€ diff (origin/main)' }}" +run-name: "πŸ•ΉοΈ ${{ inputs.chunk_gate && 'πŸ›‘ ' || '' }}${{ inputs.offset != '0' && inputs.offset != '' && format('⏩{0} ', inputs.offset) || '' }}${{ inputs.workspace != 'auto' && format('πŸ§‘β€πŸ’»{0} ', inputs.workspace == 'true' && '是' || '否') || '' }}${{ inputs.tor != 'auto' && format('{0} ', inputs.tor == 'disabled' && '🌐' || inputs.tor == 'enforced' && 'πŸ§…εΌΊεˆΆ' || 'πŸ§…η‹¬ε ') || '' }}${{ inputs.vpn != 'auto' && format('{0} ', inputs.vpn == 'disabled' && 'πŸ›£οΈ' || 'πŸš‡εΌΊεˆΆ') || '' }}${{ inputs.filesystem != '' && format('πŸ—„οΈ{0} ', inputs.filesystem) || '' }}${{ inputs.architectures != '' && format('πŸ—οΈ{0} ', inputs.architectures) || '' }}${{ inputs.distros != '' && format('🐧{0} ', inputs.distros) || '' }}${{ inputs.lifecycles != '' && format('♻️{0} ', inputs.lifecycles) || '' }}${{ inputs.mode != 'auto' && format('πŸš€{0} ', inputs.mode) || '' }}${{ inputs.priority != '' && format('⭐{0} ', inputs.priority) || '' }}${{ inputs.whitelist != '' && format('🎯{0}', inputs.whitelist) || 'πŸ”€ diff (origin/main)' }}" concurrency: group: global-ci-${{ github.repository }}-${{ github.ref_name }} @@ -58,6 +58,20 @@ on: - "enforced" - "exclusive" - "disabled" + vpn: + description: "πŸš‡ WireGuard axis for swarm; auto rotates, the others hold every row" + required: false + default: "auto" + type: choice + options: + - "auto" + - "enforced" + - "disabled" + meshes: + description: "πŸ•ΈοΈ WireGuard layout meshed swarm rows deploy. Empty: the development lab's" + required: false + default: "" + type: string offset: description: "⏩ Where chunk 0 starts: a row count, or a token like web-app-x#2" required: false @@ -124,4 +138,6 @@ jobs: workspace: ${{ inputs.workspace }} workspace_track: ${{ inputs.workspace_track }} tor: ${{ inputs.tor }} + vpn: ${{ inputs.vpn }} + meshes: ${{ inputs.meshes }} secrets: inherit diff --git a/.markdownlint-cli2.jsonc b/.markdownlint-cli2.jsonc index 06f5549299..073d11cac8 100644 --- a/.markdownlint-cli2.jsonc +++ b/.markdownlint-cli2.jsonc @@ -1,16 +1,7 @@ { - // markdownlint-cli2 config β€” see https://github.com/DavidAnson/markdownlint-cli2 - // Strategy: keep semantic rules, drop cosmetic ones that would generate - // hundreds of baseline findings on the existing tree. Tighten later by - // removing entries from the disabled list. "config": { "default": true, - // Hard-fail rules we keep on: - // MD025 (single H1), MD041 (first line H1), MD026 (no trailing - // heading punctuation), MD034 (no bare URLs), MD040 (fenced code - // language) β€” all match our documentation.md / readme_md.md. - // - // Rules disabled for the initial baseline: + "MD004": { "style": "dash" }, "MD013": false, "MD007": false, "MD024": { "siblings_only": true }, diff --git a/CHANGELOG.md b/CHANGELOG.md index cc6b7d8ff2..e994c583c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,174 @@ # Changelog +## [16.0.1] - 2026-10-18 + +Fixed: + +- Changelog: every entry uses dash bullets, so the file lints clean again +- Lint: Markdown lists must use dash bullets; MD004 now pins that style + +Upgrade notes: + +- 16.0.0 was never published; its two upgrade notes apply to this release +- Moodle: [web-installed plugins](roles/web-app-moodle/README.md#updates) are not carried to 5.3 +- Zammad: Elasticsearch 9 rebuilds the search index on the first deploy + +Contributors: + +- [Kevin Veen-Birkenbach](https://veen.world): the Markdown list style fix + +## [16.0.0] - 2026-10-18 + +Added: + +- WireGuard: new *svc-net-wireguard* role (beta) builds per-host mesh tunnels +- Mesh: every role can put its hosts into WireGuard meshes via inventory +- Mesh: full meshes without a hub, hub and spoke, controller as a spoke +- Mesh CLI: writes the mesh *host_vars* of an inventory and rotates its keys +- Swarm: nodes advertise and mount NFS over their primary mesh address +- Inventory: credentials can be generated across hosts +- Deploy: CLI end-to-end tests run after a deploy; roles declare them +- Update: a version pin can declare its own upstream source, addons too +- Plugins: memory parameters follow the container limit via one lookup +- Stalwart: bans and failed logins appear in the container output +- Playbooks: playbooks under *playbooks/* load the root *group_vars* + +Changed: + +- Moodle: runs 5.3; existing 4.5 sites are upgraded on deploy +- OpenTalk: runs product version 26.2.1 +- Bluesky: PDS 0.4.66, so AppView proxy calls carry *lxm* +- Nextcloud: held at 34 until *integration_openproject* supports 35 +- Nextcloud: BPM Files, News and Recognize are optional addons +- Memory: PHP, Postgres and Snipe-IT limits follow the container size +- Hugo: builds with the official Hugo image as the image's own user +- BigBlueButton: the release set follows one version source + +Version jumps (net since 15.0.0): + +- *svc-ai-ollama*: 0.35.0 to 0.40.6 +- *svc-db-elasticsearch*: 9.5.3 to 9.5.5 +- *svc-db-qdrant*: v1.19.1 to v1.19.2 +- *svc-net-tor-smtp*: 3.14-slim to 3.15-slim +- *svc-runner*: BuildKit v0.33.1 to v0.34.0 +- *sys-ctl-hlth-csp*: csp-checker 3.0.4 to 3.1.0 +- *test-e2e-playwright*: Playwright v1.63.0-noble to v1.64.1-noble +- *web-app-baserow*: 2.3.4 to 2.4.1 +- *web-app-bigbluebutton*: dockerize v0.15.1 to v0.15.2 +- *web-app-bluesky*: PDS 0.4.0 to 0.4.66, AppView 1.134.0 to 1.135.0 +- *web-app-checkmk*: 2.4.0p32 to 2.4.0p37 +- *web-app-chess*: v1.0.1 to v1.2.2 +- *web-app-erpnext*: v16.37.0 to v16.51.1 +- *web-app-espocrm*: 10.0.9 to 10.0.10 +- *web-app-fediwall*: 1.31.6-alpine to 1.31.7-alpine +- *web-app-flowise*: better-sqlite3 12.11.1 to 13.0.3 +- *web-app-funkwhale*: 2.0.11 to 2.0.12 +- *web-app-gitea*: 1.27.3 to 28.1.0, MCP server 1.6.0 to 1.9.0 +- *web-app-gitlab*: v19.4.1 to v19.5.0 +- *web-app-hermes*: v2026.9.7 to v2026.9.24 +- *web-app-hugo*: builder exts-0.148.0 to v0.168.0 +- *web-app-hugo*: hugoDocs source v0.148.0 to v0.165.0 +- *web-app-jenkins*: 2.568.3-lts to 2.580.1-lts +- *web-app-jira*: 11.3.11 to 11.3.12 +- *web-app-keycloak*: 26.8.0 to 26.8.1 +- *web-app-lam*: 9.6 to 9.7 +- *web-app-littlejs*: 1.31.6-alpine to 1.31.7-alpine +- *web-app-matrix*: Synapse v1.162.0 to v1.163.0 +- *web-app-matrix*: Element v1.12.30 to v1.12.32 +- *web-app-mattermost*: 11.11.0 to 12.0.0 +- *web-app-moodle*: 4.5.11 to 5.3.0, OIDC plugin v4.5.8 to v5.2.1 +- *web-app-n8n*: 1.100.1 to 2.44.3 +- *web-app-nextcloud*: context_agent 2.8.0 to 2.9.1 +- *web-app-nextcloud*: proxy 1.31.5-alpine to 1.31.7-alpine +- *web-app-openbao*: 2.6.2 to 2.7.1 +- *web-app-opentalk*: frontend v2.9.0 to v2.9.2 (product 26.2.1) +- *web-app-opentalk*: controller v0.34.1 to v0.34.5 +- *web-app-opentalk*: recorder v0.16.2 to v0.17.5 +- *web-app-opentalk*: LiveKit v1.13.7 to v1.13.10 +- *web-app-penpot*: 2.17.2 to 2.18.3 +- *web-app-pihole*: 2026.09.0 to 2026.10.0 +- *web-app-pixelfed*: 20260917 to 20261017 +- *web-app-pretix*: 2026.7.0 to 2026.8.0 +- *web-app-prometheus*: v3.14.0 to v3.15.0 +- *web-app-prometheus*: cAdvisor v0.52.1 to v0.55.1 +- *web-app-prometheus*: blackbox exporter v0.28.0 to v0.29.0 +- *web-app-semaphore*: v2.19.14 to v2.19.16 +- *web-app-socialhome*: 2026.10.2 to 2026.10.17 +- *web-app-stalwart*: v0.16.24 to v0.16.26, web UI v1.0.5 to v1.0.11 +- *web-app-suitecrm*: 8.9.1 to 8.10.2 +- *web-app-taiga*: gateway 1.31.6-alpine to 1.31.7-alpine +- *web-app-wordpress*: 7.1.0 to 7.1.3, MCP adapter v0.5.0 to v0.7.1 +- *web-app-xwiki*: OIDC authenticator 2.19.6 to 2.29.0 +- *web-app-xwiki*: LDAP authenticator 9.15.7 to 9.16.6 +- *web-app-xwiki*: AI LLM 0.7 to 0.10 +- *web-app-zammad*: Elasticsearch 8.13.4 to 9.5.5 +- *web-svc-collabora*: 26.04.2.1.1 to 26.04.5.1.1 +- *web-svc-coturn*: gateway 1.31.6-alpine to 1.31.7-alpine +- *web-svc-logout*: v1.4.1 to v1.4.2 +- *web-svc-onlyoffice*: 9.4.0 to 10.0.0 +- *backup-docker-to-local* (*baudolo*): 7.0.2 to 7.1.1 +- *community.general*: 13.4.0 to 13.5.0 +- *community.docker*: 5.3.0 to 5.4.0 +- *hetzner.hcloud*: 7.1.0 to 7.2.0 +- *ruff* (dev): 0.16.9 to 0.17.0 +- *@playwright/test* (dev): ^1.63.0 to ^1.64.0 +- *eslint* (dev): ^10.9.1 to ^10.12.0 +- *eslint-plugin-playwright* (dev): ^2.10.5 to ^2.12.1 +- *globals* (dev): ^17.12.0 to ^17.13.0 +- *stylelint* (dev): ^17.15.0 to ^17.16.0 + +Fixed: + +- Zammad: init waits for search in swarm; disk watermarks fit the disk +- Zammad: the deploy stops when Elasticsearch allocates no shard +- Nextcloud: OnlyOffice server URL is written last and checked in time +- Nextcloud: Talk server lists are written as typed arrays +- Keycloak: concurrent *kcadm* jobs no longer lose the config lock +- SuiteCRM: sessions live in Redis so replicas share them +- SuiteCRM: external auth provisioning can create its user +- n8n: SSO hook, MCP provisioning and API paging work under n8n 2 +- Stalwart: address bans expire; bots use app passwords under SSO +- OpenProject: the migration probe no longer creates tables +- Prometheus: probes are judged per target and reach apps on their vhosts +- Collabora: the WOPI host follows Nextcloud's domain and TLS state +- Odoo: the OAuth addon works on Odoo 20 +- Mobilizon: four migrations are patched for PostgreSQL 18 +- OpenBao: the LDAP auth method ships as an external plugin +- Penpot: the frontend waits for its backend; its probe needs no curl +- Pixelfed: the OIDC token exchange uses Tor on an onion issuer +- Matrix: Synapse metrics are published in the ansible flavor +- Matomo: the CSP allows the inline handler of the core top bar +- Moodle: the code tree is replaced only after a complete copy +- XWiki: an add-on off its pinned version is upgraded +- Bridgy Fed: builds on Python 3.14 until cbor2 supports 3.15 +- Tor: the onion apex no longer redirects to a clearnet homepage +- Health: the CSP crawler follows redirects to this node +- Health: the journal check reads long messages, skips container logs +- Services: a stale unit result no longer fails a deploy +- Cache: the applications carrier stays valid across nested app loads +- Docker: the installed apt key is kept when its refresh is refused +- Mail: a connection dropped before the greeting is retried +- Admin: */usr/local/bin* stays on the administrator's sudo path +- User: the login banner stays off non-interactive stdout +- CI: a change under *tests/* no longer deploys every role +- CI: workspace and runner images are pulled through the GHCR mirror + +Upgrade notes: + +- Moodle: [web-installed plugins](roles/web-app-moodle/README.md#updates) are not carried to 5.3 +- Zammad: Elasticsearch 9 rebuilds the search index on the first deploy + +Contributors: + +- [Evangelos Tsakoudis](https://evangelostsak.com): WireGuard role and meshes +- [Kevin Veen-Birkenbach](https://veen.world): app fixes, version sources, CI +- [Prageeth Panicker](https://github.com/pragepani): the journal check fix + ## [15.0.0] - 2026-10-03 **Breaking Changes** -* **Stalwart replaces Mailu as the default mail provider.** *MAIL_PROVIDER* now defaults to +- **Stalwart replaces Mailu as the default mail provider.** *MAIL_PROVIDER* now defaults to *web-app-stalwart*, and every application switches its mail settings on only while the configured provider is deployed. An inventory that keeps Mailu must set *MAIL_PROVIDER: web-app-mailu*, otherwise its applications stop sending mail. Mailu is now @@ -15,7 +179,7 @@ folders, flags and dates, and re-runs skip what is already there. See [web-app-stalwart](roles/web-app-stalwart/README.md). -* **PostgreSQL 18 on the official image.** PGDG archived the Debian 11 repository that the +- **PostgreSQL 18 on the official image.** PGDG archived the Debian 11 repository that the old *postgis/postgis:17-3.5* base installed from, so every build of the shared database image failed. *svc-db-postgres* and the per-application database now run the official multi-arch *postgres:18* image, and the data volume mounts at */var/lib/postgresql*. @@ -23,14 +187,14 @@ this release and restore it into the new cluster afterwards. PostGIS is installed only for a role that declares it. -* **Major versions arrive with the image updates.** MariaDB moves from 12.3 to 13.0 and +- **Major versions arrive with the image updates.** MariaDB moves from 12.3 to 13.0 and upgrades its system tables on start. Odoo moves from 19.0 to 20.0 and does not migrate an existing database across major versions on its own, so back up Odoo before you deploy. XWiki moves from 17.10 to 18.8, and the OpenLDAP base from Debian 12 to 13. **For Users** -* **Stalwart mail server.** The new *web-app-stalwart* role runs SMTP, submission, IMAP, +- **Stalwart mail server.** The new *web-app-stalwart* role runs SMTP, submission, IMAP, POP3, JMAP, ManageSieve, CalDAV, CardDAV and WebDAV in one server, with spam filtering, DKIM and DMARC signing and a web admin interface, plus Roundcube webmail and a ClamAV scan of incoming mail. Domains, accounts, TLS, Keycloak sign-in, DKIM keys and DNS records are @@ -39,23 +203,23 @@ Stalwart without single sign-on for the life of the process, and the server wrote no logs at all. Both are fixed. See [web-app-stalwart](roles/web-app-stalwart/README.md). -* **Mail to and from onion addresses.** The new *svc-net-tor-smtp* role accepts mail for +- **Mail to and from onion addresses.** The new *svc-net-tor-smtp* role accepts mail for *.onion* recipients and delivers it over Tor. The applications reach an onion mail provider too: 27 roles now resolve the provider's onion host inside their containers and skip STARTTLS towards it, since no certificate can exist for an onion name and Tor already encrypts the link. GitLab's test suite checks that a password reset mail actually arrives. -* **GitLab migrations no longer run out of locks.** GitLab's database migration failed on +- **GitLab migrations no longer run out of locks.** GitLab's database migration failed on PostgreSQL 18 with "out of shared memory". The shared and the per-application PostgreSQL now allow 256 locks per transaction. -* **Backups survive a file truncated mid-copy.** *baudolo* 7.0.2 lets the stopped checksum +- **Backups survive a file truncated mid-copy.** *baudolo* 7.0.2 lets the stopped checksum copy replace a live pre-copy that a writing container broke by truncating files under rsync, which used to abort the backup. **For Developers** -* **The mail provider is a service, not a role name.** Stalwart declares *provides: email* +- **The mail provider is a service, not a role name.** Stalwart declares *provides: email* and Mailu *covers: [email]*. The new *mail_provider* lookup returns the configured provider while it is deployed, otherwise the first deployed role offering *email*, and reads the cluster-wide groups so swarm workers agree with the manager. The port-collision lint @@ -63,19 +227,19 @@ lint fails every role that reads the *email* lookup without emitting *container_extra_hosts*. -* **Deprecated roles are untested.** A role in the *deprecated* lifecycle stage is no longer +- **Deprecated roles are untested.** A role in the *deprecated* lifecycle stage is no longer deployed or tested by CI and cannot block a release, so Stalwart stopped pulling Mailu into its deploy round. The allowed lifecycle values now have one source, the stage list in [lifecycle.md](docs/contributing/design/role/services/lifecycle.md). -* **Release pushes on main.** A push to *main* whose head commit starts with +- **Release pushes on main.** A push to *main* whose head commit starts with *Release version* cancels the running *main* pipeline, so the release starts at once. A release-tagged commit deploys every chunk instead of stopping at the first failed one, and still ends red when any chunk fails, which keeps a broken release from being published. A new integration test requires every release tag from v13.0.0 on to sit on that subject, and the test job now checks out the full history with tags. -* **Cancelling CI runs.** Pull request runs fail fast: the first failed row cancels its +- **Cancelling CI runs.** Pull request runs fail fast: the first failed row cancels its siblings in the deploy and workspace matrices, while push and manual runs keep every row. Identical deploy rows from different runs queue behind each other again, keyed on every matrix axis. A cancel now also stops jobs that used to run after a failure: @@ -83,61 +247,61 @@ *report-main-failures* still report a cancelled run. CodeRabbit reviews draft pull requests too. -* **Onion port probe runs everywhere.** A role with more than one onion-forwarded port wrote +- **Onion port probe runs everywhere.** A role with more than one onion-forwarded port wrote an unquoted port list into *test.env*, so sourcing it left the list empty and the probe passed without checking anything. The list is quoted now, and a unit test sources the rendered file in compose and swarm mode. -* **Agent sandbox.** *git commit --amend* is denied, the host's credential files stay +- **Agent sandbox.** *git commit --amend* is denied, the host's credential files stay unreadable inside the sandbox, sandboxed commands may reach local services on 127.0.0.1 to 127.0.0.12 and localhost, and third-party plugins are no longer switched on for every contributor. -* **Ansible collections from Git first.** The automated retune made Git the preferred +- **Ansible collections from Git first.** The automated retune made Git the preferred source for Ansible collections, with Galaxy as the fallback, after Galaxy's median install time reached three times Git's. -* Image and dependency version jumps (net since 14.2.0): - * *svc-db-postgres*: postgis/postgis 17-3.5 to postgres 18 - * *svc-db-mariadb*: 12.3 to 13.0 - * *svc-db-redis*: 8.10.1-alpine to 8.10.2-alpine - * *svc-db-openldap* (Debian base): 12.15-slim to 13.7-slim - * *svc-ai-ollama*: 0.34.2 to 0.35.0 - * *svc-runner* (BuildKit): v0.33.0 to v0.33.1 - * *svc-net-tor-smtp*: newly on python 3.14-slim - * *web-app-stalwart*: newly pinned to Stalwart v0.16.24, Roundcube 1.7.4-apache, ClamAV +- Image and dependency version jumps (net since 14.2.0): + - *svc-db-postgres*: postgis/postgis 17-3.5 to postgres 18 + - *svc-db-mariadb*: 12.3 to 13.0 + - *svc-db-redis*: 8.10.1-alpine to 8.10.2-alpine + - *svc-db-openldap* (Debian base): 12.15-slim to 13.7-slim + - *svc-ai-ollama*: 0.34.2 to 0.35.0 + - *svc-runner* (BuildKit): v0.33.0 to v0.33.1 + - *svc-net-tor-smtp*: newly on python 3.14-slim + - *web-app-stalwart*: newly pinned to Stalwart v0.16.24, Roundcube 1.7.4-apache, ClamAV 1.5.4 and postgres 18 - * *web-app-dashboard* (port-ui): 2.1.3 to 2.2.2 - * *web-app-erpnext*: v16.35.0 to v16.37.0 - * *web-app-espocrm*: 10.0.8 to 10.0.9 - * *web-app-gitlab*: v19.3.2 to v19.4.1 (all six CNG component images) - * *web-app-joomla*: 6.1.3-php8.3-apache to 6.1.4-php8.3-apache - * *web-app-keycloak*: 26.7.4 to 26.8.0, oauth2-proxy v7.15.4 to v7.15.5 - * *web-app-magento*: OpenSearch 3.8.0 to 3.9.0 - * *web-app-matomo*: 5.13.0 to 5.14.0 - * *web-app-matrix*: Synapse v1.160.0 to v1.162.0, Element v1.12.28 to v1.12.30 - * *web-app-odoo*: 19.0 to 20.0 - * *web-app-peertube*: v8.3.0 to v8.3.1 - * *web-app-seaweedfs*: 4.46 to 4.48 - * *web-app-shopware*: OpenSearch 3.8.0 to 3.9.0 - * *web-app-snipe-it*: v8.7.2-alpine to v8.8.0-alpine - * *web-app-socialhome*: 2026.9.18 to 2026.10.2 - * *web-app-xwiki*: 17.10.13 to 18.8.0 - * *web-app-bluesky* (view): 1.132.0 to 1.134.0 - * *web-app-discourse*: v2026.8.0 to v2026.9.0 - * *web-svc-logout*: universal-logout v1.3.1 to v1.4.1 - * *web-svc-xmpp*: 26.07 to 26.09 - * *pkgmgr*: v1.16.1 to v2.0.2 - * *backup-docker-to-local* (*baudolo*): 7.0.1 to 7.0.2 - * *ruff* (dev): 0.16.7 to 0.16.9 - * *brace-expansion* (dev): ^5.0.9 to ^5.0.12 + - *web-app-dashboard* (port-ui): 2.1.3 to 2.2.2 + - *web-app-erpnext*: v16.35.0 to v16.37.0 + - *web-app-espocrm*: 10.0.8 to 10.0.9 + - *web-app-gitlab*: v19.3.2 to v19.4.1 (all six CNG component images) + - *web-app-joomla*: 6.1.3-php8.3-apache to 6.1.4-php8.3-apache + - *web-app-keycloak*: 26.7.4 to 26.8.0, oauth2-proxy v7.15.4 to v7.15.5 + - *web-app-magento*: OpenSearch 3.8.0 to 3.9.0 + - *web-app-matomo*: 5.13.0 to 5.14.0 + - *web-app-matrix*: Synapse v1.160.0 to v1.162.0, Element v1.12.28 to v1.12.30 + - *web-app-odoo*: 19.0 to 20.0 + - *web-app-peertube*: v8.3.0 to v8.3.1 + - *web-app-seaweedfs*: 4.46 to 4.48 + - *web-app-shopware*: OpenSearch 3.8.0 to 3.9.0 + - *web-app-snipe-it*: v8.7.2-alpine to v8.8.0-alpine + - *web-app-socialhome*: 2026.9.18 to 2026.10.2 + - *web-app-xwiki*: 17.10.13 to 18.8.0 + - *web-app-bluesky* (view): 1.132.0 to 1.134.0 + - *web-app-discourse*: v2026.8.0 to v2026.9.0 + - *web-svc-logout*: universal-logout v1.3.1 to v1.4.1 + - *web-svc-xmpp*: 26.07 to 26.09 + - *pkgmgr*: v1.16.1 to v2.0.2 + - *backup-docker-to-local* (*baudolo*): 7.0.1 to 7.0.2 + - *ruff* (dev): 0.16.7 to 0.16.9 + - *brace-expansion* (dev): ^5.0.9 to ^5.0.12 **Contributors** -* [Alejandro Roman Ibanez](https://github.com/AlejandroRomanIbanez): Stalwart as the default +- [Alejandro Roman Ibanez](https://github.com/AlejandroRomanIbanez): Stalwart as the default mail provider in compose and swarm mode, the Tor SMTP gateway, onion mail delivery for every mail-sending role, the Mailu import and the provider resolution -* [Kevin Veen-Birkenbach](https://veen.world): PostgreSQL 18, release-aware CI cancellation +- [Kevin Veen-Birkenbach](https://veen.world): PostgreSQL 18, release-aware CI cancellation and chunk gating, the release tag test, the Mailu deprecation and the untested deprecated stage, the agent sandbox policy, review and version maintenance @@ -145,7 +309,7 @@ **For Users** -* **Secrets management with OpenBao.** The new *web-app-openbao* role deploys OpenBao at +- **Secrets management with OpenBao.** The new *web-app-openbao* role deploys OpenBao at *openbao.*. It stores application credentials, API keys and machine identities. People sign in through Keycloak, or through LDAP when OpenLDAP is deployed. Their *administrator*, *operator* or *reader* group decides what they can reach, and signing in @@ -158,45 +322,45 @@ the store cannot be read without it, so back up the inventory together with the volume. See [web-app-openbao](roles/web-app-openbao/README.md). -* **LDAP import, export and Multi edit finish again in LAM.** The Content Security Policy +- **LDAP import, export and Multi edit finish again in LAM.** The Content Security Policy blocked the inline script that checks on LAM's background jobs, so these tools stayed "in progress" forever. That script is allowed again. -* **Swarm deploys no longer abort on a network that already exists.** Some networks are +- **Swarm deploys no longer abort on a network that already exists.** Some networks are created before their application's stack, as Prometheus does for every application it scrapes. Those networks now carry the stack label, so the application's own deploy uses the existing network instead of failing with "network with name already exists". **For Developers** -* **Alert rules live in the role that owns the metric.** A role ships its Prometheus rules +- **Alert rules live in the role that owns the metric.** A role ships its Prometheus rules in *templates/prometheus/alert_rules.yml.j2*. The new *alert_rule_roles* lookup includes them only for roles that Prometheus actually scrapes, so a rules file needs no activation check of its own. It must start at the *groups:* item level. OpenBao's seal alert is the first rule to use it. -* **Video for hand-built Playwright contexts.** A context created with +- **Video for hand-built Playwright contexts.** A context created with *browser.newContext()* ignored the project's video setting, so its artefact had a trace but no video. Spread *recordVideoOptions(testInfo)* from *personas/utils/env.js* into the context options to record one. -* Image and dependency version jumps (net since 14.1.0): - * *web-app-pgadmin*: 9.17 to 9.18 +- Image and dependency version jumps (net since 14.1.0): + - *web-app-pgadmin*: 9.17 to 9.18 **Contributors** -* [Evangelos Tsakoudis](https://evangelostsak.com): the OpenBao role with its seal, +- [Evangelos Tsakoudis](https://evangelostsak.com): the OpenBao role with its seal, credential rotation, recovery and RBAC end-to-end suite, role-local Prometheus alert rules, and the LAM and swarm network fixes that work uncovered -* [Alejandro Roman Ibanez](https://github.com/AlejandroRomanIbanez): video recording for +- [Alejandro Roman Ibanez](https://github.com/AlejandroRomanIbanez): video recording for hand-built Playwright contexts -* [Kevin Veen-Birkenbach](https://veen.world): review and version maintenance +- [Kevin Veen-Birkenbach](https://veen.world): review and version maintenance ## [14.1.0] - 2026-09-21 **For Users** -* **Local models reach the gateway again.** Upstream re-pushed the *svc-ai-lmstudio* CPU +- **Local models reach the gateway again.** Upstream re-pushed the *svc-ai-lmstudio* CPU image with a server that listens on loopback only, so the role stayed green while litellm could not connect and the AI features of Mattermost, Matrix, xWiki, Moodle and Zammad failed their warm-up. The server binds the container network again and stays unpublished. @@ -207,7 +371,7 @@ **For Developers** -* **CI deploys only the variants a change reaches.** An image bump in a provider no longer +- **CI deploys only the variants a change reaches.** An image bump in a provider no longer redeploys the variants of its consumers that switch that provider off. The diff-derived whitelist, used by the weekly update PRs, Dependabot and every other diff-driven run, narrows each affected role to the variants whose round closure still reaches a changed @@ -216,37 +380,37 @@ not return now warns instead of aborting the run; role names are still checked against *roles/* before the run starts. -* **One instruction file for every agent.** *AGENTS.md* now holds every agent rule, and +- **One instruction file for every agent.** *AGENTS.md* now holds every agent rule, and *CLAUDE.md* and *GEMINI.md* are gone. The rules they carried bind every runtime anyway, and the PR templates, scope tables, requirement documents and docs that named the old files now name *AGENTS.md*. -* Image and dependency version jumps (net since 14.0.0): - * *svc-ai-ollama*: 0.34.0 to 0.34.2 - * *svc-net-tor* (Debian base): 13.6-slim to 13.7-slim - * *web-app-baserow*: 2.3.3 to 2.3.4 - * *web-app-erpnext*: v16.34.2 to v16.35.0 - * *web-app-funkwhale* (front, api): 2.0.10 to 2.0.11 - * *web-app-jitsi* (web, prosody, jicofo, jvb): stable-9646 to stable-11031 - * *web-app-keycloak*: 26.7.3 to 26.7.4 - * *web-app-opentalk* (LiveKit): v1.13.6 to v1.13.7 - * *web-app-opentalk* (RabbitMQ): 4.3.5 to 4.3.6 - * *web-app-peertube*: v8.2.4 to v8.3.0 - * *web-app-pihole*: 2026.07.2 to 2026.09.0 - * *web-app-prometheus* (Alertmanager): v0.34.0 to v0.34.1 - * Ansible collection *hetzner.hcloud*: 7.0.1 to 7.1.0 - * *ruff* (dev): 0.16.6 to 0.16.7 +- Image and dependency version jumps (net since 14.0.0): + - *svc-ai-ollama*: 0.34.0 to 0.34.2 + - *svc-net-tor* (Debian base): 13.6-slim to 13.7-slim + - *web-app-baserow*: 2.3.3 to 2.3.4 + - *web-app-erpnext*: v16.34.2 to v16.35.0 + - *web-app-funkwhale* (front, api): 2.0.10 to 2.0.11 + - *web-app-jitsi* (web, prosody, jicofo, jvb): stable-9646 to stable-11031 + - *web-app-keycloak*: 26.7.3 to 26.7.4 + - *web-app-opentalk* (LiveKit): v1.13.6 to v1.13.7 + - *web-app-opentalk* (RabbitMQ): 4.3.5 to 4.3.6 + - *web-app-peertube*: v8.2.4 to v8.3.0 + - *web-app-pihole*: 2026.07.2 to 2026.09.0 + - *web-app-prometheus* (Alertmanager): v0.34.0 to v0.34.1 + - Ansible collection *hetzner.hcloud*: 7.0.1 to 7.1.0 + - *ruff* (dev): 0.16.6 to 0.16.7 **Contributors** -* [Kevin Veen-Birkenbach](https://veen.world): LM Studio reachability and startup, +- [Kevin Veen-Birkenbach](https://veen.world): LM Studio reachability and startup, variant-narrowed CI selection, the single agent instruction file, and version maintenance ## [14.0.0] - 2026-09-19 **For Users** -* **AI assistance inside the applications you already run.** A gateway role, +- **AI assistance inside the applications you already run.** A gateway role, *svc-ai-litellm*, fronts OpenAI, Anthropic and OpenRouter from declared keys, with *svc-ai-ollama* and the new *svc-ai-lmstudio* serving local models from one shared catalogue, so inference can stay inside the deployment. Sixteen applications use it for @@ -257,7 +421,7 @@ [svc-ai-litellm](roles/svc-ai-litellm/README.md) and [svc-ai-lmstudio](roles/svc-ai-lmstudio/README.md). -* **Your tools reachable from your assistants.** About twenty applications now speak MCP. +- **Your tools reachable from your assistants.** About twenty applications now speak MCP. Gitea, GitLab, Mattermost, Nextcloud, n8n, Baserow, Jenkins, Home Assistant, Moodle, Snipe-IT and WordPress serve their own endpoints; ten more get one through a locked-down sidecar. Open WebUI, Flowise and the agents discover what the deployment offers and @@ -266,7 +430,7 @@ reader and writer roles are separate, and each provider authenticates callers as its own service account. See [svc-ai-mcp-adapter](roles/svc-ai-mcp-adapter/README.md). -* **Agents as employees, with a kernel between them and the host.** *web-app-hermes* and +- **Agents as employees, with a kernel between them and the host.** *web-app-hermes* and *web-app-openclaw* deploy agents behind the single sign-on gate, wired to the gateway's models and to the MCP servers discovery hands them, each proving on deploy that it can actually reach them. *svc-virt-kata* runs that tier under a kernel-isolating container @@ -276,11 +440,11 @@ [web-app-openclaw](roles/web-app-openclaw/README.md) and [svc-virt-kata](roles/svc-virt-kata/README.md). -* **Home automation joins the platform.** *web-app-homeassistant* deploys the automation +- **Home automation joins the platform.** *web-app-homeassistant* deploys the automation hub, exposes it as an MCP server so agents can drive it, persists the token it mints, and is reachable over tor. See [web-app-homeassistant](roles/web-app-homeassistant/README.md). -* **Changing a password changes it everywhere.** A user declares how its password must be +- **Changing a password changes it everywhere.** A user declares how its password must be generated, the inventory pins one for every declared user, a new generator produces API-key shapes, the deploy rotates credentials between its two passes, and a reset command exists. Applications that persist an administrator password at install now realign it when @@ -288,7 +452,7 @@ Checkmk, xWiki, n8n, Matrix and the dedicated MariaDB and Postgres engines. Checkmk keeps a 401 fatal so a wrong password cannot lock the account out. -* **Onions, firewall and name resolution.** *svc-net-firewall* owns the packet filter as one +- **Onions, firewall and name resolution.** *svc-net-firewall* owns the packet filter as one nftables table per role. Tor carries mail to a .onion in both deploy modes, rejects forged sources on the guarded ports, and binds its dnsmasq listeners statically so a failed re-enumeration can no longer drop every one of them. The deployment declares its own @@ -297,7 +461,7 @@ requires an explicit onion decision. See [svc-net-firewall](roles/svc-net-firewall/README.md). -* **Application fixes you will notice.** Nextcloud installs an OnlyOffice release upstream +- **Application fixes you will notice.** Nextcloud installs an OnlyOffice release upstream actually published, keeps social login working over tor, and makes its OIDC account an administrator. Element shows invites again through the new room list. Moodle survives the container roll during installation. Mattermost keeps its configuration in Postgres instead @@ -307,7 +471,7 @@ allowed-origins claim out of the access token, and no longer caches LDAP federation past a fresh grant. The platform's own health mail no longer eats the sender quota. -* **Operating a deployment.** New make targets reach a single deployed application: +- **Operating a deployment.** New make targets reach a single deployed application: *compose-app-exec*, *compose-app-logs* and *compose-app-restart*. Diagnostics collect the logs an application writes to a file, including from busybox containers. Health probes use a fast start cadence with a window that outlasts a real boot, so a slow starter is no @@ -316,7 +480,7 @@ **For Developers** -* **MCP is declared, not wired.** A role states an *mcp* block in *meta/services.yml*, and +- **MCP is declared, not wired.** A role states an *mcp* block in *meta/services.yml*, and the vocabulary, discovery and rendering layer derives endpoints, clients, credentials and network edges from it. A client-provider pairing is declared once, on the provider; *sys-svc-mcp-reconcile* converges clients from the complete provider set; a refused pairing @@ -326,14 +490,14 @@ its delegation rules and a machine-checkable audit live under [docs/contributing/design/role/services/mcp.md](docs/contributing/design/role/services/mcp.md). -* **Registry and variant changes.** A variant can dictate the configuration of the providers +- **Registry and variant changes.** A variant can dictate the configuration of the providers it pulls in, and an MCP round decides for itself what it carries, which is the breaking change in this release. Fifteen moving pins gained names the registry can order, every MCP provider is registered as a shared service, *meta/schema.yml* finished its rename to *meta/secrets.yml*, role scripts are sorted into per-language folders, and *meta/addons* is now an accepted declaration site for pins and plugins. -* **Lints that fail closed.** Five properties that used to pass silently now fail. The PHP +- **Lints that fail closed.** Five properties that used to pass silently now fail. The PHP and Ruby that roles ship are syntax-checked, and so are shell scripts that ship as Jinja templates. *sys-service* owns every systemd unit a role installs. Healthcheck timings are judged against what the base image was measured to hold, a variable-free healthcheck @@ -342,7 +506,7 @@ declared non-secret, *no_log* is required on every task carrying one and forbidden in the test roles, and a JavaScript default for an unset environment variable is rejected. -* **Pins that cannot age unnoticed.** Image pins are classified and pull references built +- **Pins that cannot age unnoticed.** Image pins are classified and pull references built from the class, a moving tag declares itself with the marker it already carries, and a role's images move as one release or not at all. The updater reads addon declarations, orders vendor patch counters and five-component versions, reads a release line written @@ -351,7 +515,7 @@ mirror list with failover, a short timeout and a health test serves both the package cache and the image builds. *js-yaml* was lifted to 4.3.2 for GHSA-2883-xcg3-v3hh. -* **CI selects, resumes and proves.** A fourth deploy chunk stops a short priority chunk +- **CI selects, resumes and proves.** A fourth deploy chunk stops a short priority chunk stranding budget, a manual run can set the chunk size the formula would derive, and a retrigger can override the chunk gate. Retriggering works by role and by what never got a verdict, resumes behind the green window rather than the deployed one, retires suites the @@ -360,7 +524,7 @@ *services.yml* declares. Distro images build concurrently on one runner, the matrix job folds into the image job, and the deploy chunks no longer wait on the DNS test. -* **Swarm, measured rather than assumed.** The deploy waits for its own update instead of +- **Swarm, measured rather than assumed.** The deploy waits for its own update instead of guessing after it, refuses to call a stack converged while it is still updating, survives a task that failed and came back, reports what converged rather than only what did not, and says why the convergence probe refused. Placement is constrained to a role's declared @@ -370,14 +534,14 @@ kata-capable only when the app is sandboxed, NFS detaches before the node containers die, and the sandbox tier gets a second node. -* **Faster gates.** Per-host setup runs once per host instead of once per application, a +- **Faster gates.** Per-host setup runs once per host instead of once per application, a role's volumes are answered from its own file instead of a whole-tree build, the Keycloak RBAC root group resolves once rather than once per app, the Playwright fixture copy the tree copy already made is dropped, logout helpers wait for a control instead of sleeping, and the OIDC login helper stops waiting out probes that cannot match. Onion timeouts scale by tor flavor instead of a flat multiplier, and every Playwright timeout has one source. -* **Documentation and agent instructions.** Six new requirement documents cover the LLM +- **Documentation and agent instructions.** Six new requirement documents cover the LLM gateway and model backends, agent employees, Home Assistant, the robot role, the MCP proxy expansion and native AI gateway integration. The MCP design docs are nested under their own folder with an audit the lints can check. The role README template asks the reader for a @@ -385,40 +549,40 @@ dash. Documentation generators are gathered under *cli/build/docs*, and a new CLI edits role bonds in a matrix instead of hunting through files. -* Image and dependency version jumps (net since 13.0.0): - * *svc-ai-ollama*: 0.32.15 to 0.34.0 - * *svc-db-elasticsearch*: 9.5.2 to 9.5.3 - * *svc-db-qdrant*: v1.19.0 to v1.19.1 - * *sys-ctl-hlth-csp* (csp-checker): 2.2.1 to 3.0.4 - * *sys-lint* (shfmt): v3.13.1 to v3.14.1 - * *test-e2e-playwright*: v1.62.1-noble to v1.63.0-noble - * *web-app-bluesky* (view): 1.131.1 to 1.132.0 - * *web-app-bookwyrm*: v0.9.2 to v0.9.3 - * *web-app-confluence*: 10.2.15 to 10.2.18 - * *web-app-dashboard*: 2.0.0 to 2.1.3 - * *web-app-erpnext*: v16.32.3 to v16.34.2 - * *web-app-espocrm*: 10.0.6 to 10.0.8 - * *web-app-funkwhale*: 2.0.9 to 2.0.10 - * *web-app-gitea*: 1.27.2 to 1.27.3 - * *web-app-gitlab* (webservice, sidekiq, workhorse, gitaly, shell, rails): v19.3.0 to v19.3.2 - * *web-app-jira*: 11.3.10 to 11.3.11 - * *web-app-keycloak*: 26.7.2 to 26.7.3 - * *web-app-matrix* (Synapse): v1.159.0 to v1.160.0 - * *web-app-matrix* (Element): v1.12.26 to v1.12.28 - * *web-app-mattermost*: 11.10.1 to 11.11.0 - * *web-app-n8n*: 1.95.3 to 1.100.1 - * *web-app-nextcloud* (proxy): 1.31.3-alpine to 1.31.5-alpine - * *web-app-opentalk* (LiveKit): v1.13.5 to v1.13.6 - * *web-app-opentalk* (RabbitMQ): 4.3.4 to 4.3.5 - * *web-app-penpot* (frontend, backend, exporter): 2.17.1 to 2.17.2 - * *web-app-seaweedfs*: 4.44 to 4.46 - * *web-app-semaphore*: v2.19.8 to v2.19.14 - * *web-app-socialhome*: 2026.6.16 to 2026.9.18 - * *web-app-yourls*: 1.10.4-apache to 1.10.6-apache - * *web-app-zammad*: 6.5.0 to 7.1.2 - * *web-svc-coturn*: 4.17.2 to 4.18.0 +- Image and dependency version jumps (net since 13.0.0): + - *svc-ai-ollama*: 0.32.15 to 0.34.0 + - *svc-db-elasticsearch*: 9.5.2 to 9.5.3 + - *svc-db-qdrant*: v1.19.0 to v1.19.1 + - *sys-ctl-hlth-csp* (csp-checker): 2.2.1 to 3.0.4 + - *sys-lint* (shfmt): v3.13.1 to v3.14.1 + - *test-e2e-playwright*: v1.62.1-noble to v1.63.0-noble + - *web-app-bluesky* (view): 1.131.1 to 1.132.0 + - *web-app-bookwyrm*: v0.9.2 to v0.9.3 + - *web-app-confluence*: 10.2.15 to 10.2.18 + - *web-app-dashboard*: 2.0.0 to 2.1.3 + - *web-app-erpnext*: v16.32.3 to v16.34.2 + - *web-app-espocrm*: 10.0.6 to 10.0.8 + - *web-app-funkwhale*: 2.0.9 to 2.0.10 + - *web-app-gitea*: 1.27.2 to 1.27.3 + - *web-app-gitlab* (webservice, sidekiq, workhorse, gitaly, shell, rails): v19.3.0 to v19.3.2 + - *web-app-jira*: 11.3.10 to 11.3.11 + - *web-app-keycloak*: 26.7.2 to 26.7.3 + - *web-app-matrix* (Synapse): v1.159.0 to v1.160.0 + - *web-app-matrix* (Element): v1.12.26 to v1.12.28 + - *web-app-mattermost*: 11.10.1 to 11.11.0 + - *web-app-n8n*: 1.95.3 to 1.100.1 + - *web-app-nextcloud* (proxy): 1.31.3-alpine to 1.31.5-alpine + - *web-app-opentalk* (LiveKit): v1.13.5 to v1.13.6 + - *web-app-opentalk* (RabbitMQ): 4.3.4 to 4.3.5 + - *web-app-penpot* (frontend, backend, exporter): 2.17.1 to 2.17.2 + - *web-app-seaweedfs*: 4.44 to 4.46 + - *web-app-semaphore*: v2.19.8 to v2.19.14 + - *web-app-socialhome*: 2026.6.16 to 2026.9.18 + - *web-app-yourls*: 1.10.4-apache to 1.10.6-apache + - *web-app-zammad*: 6.5.0 to 7.1.2 + - *web-svc-coturn*: 4.17.2 to 4.18.0 -* Moving tags that now carry a release, one per role: *web-app-discourse* master to +- Moving tags that now carry a release, one per role: *web-app-discourse* master to v2026.8.0, *web-app-jenkins* lts to 2.568.3-lts, *web-app-openwebui* main to 0.11.0, *web-app-pretix* stable to 2026.7.0, *web-app-xwiki* lts-postgres-tomcat to 17.10.13-postgres-tomcat, *web-app-pixelfed* latest to 20260917, *web-app-matrix* (upstream @@ -434,16 +598,16 @@ **Contributors** -* [Kevin Veen-Birkenbach](https://veen.world): LLM gateway and model backends, the declared +- [Kevin Veen-Birkenbach](https://veen.world): LLM gateway and model backends, the declared MCP layer and its sidecar, agent employees and the kernel-isolated tier, Home Assistant, credential declaration and rotation, firewall/tor/DNS ownership, variant-dictated provider configuration, the fail-closed lints, CI selection and resume, swarm convergence, and version maintenance -* [Prageeth Panicker](https://github.com/pragepani): .ansible cache directory ignored +- [Prageeth Panicker](https://github.com/pragepani): .ansible cache directory ignored ## [13.0.0] - 2026-08-26 -* **Tor as a first-class deployment axis.** The new *svc-net-tor* role routes onion +- **Tor as a first-class deployment axis.** The new *svc-net-tor* role routes onion names through Tor via DNS instead of per-app proxies, offers a chutney flavor for private-net test deployments, and ties its dnsmasq listener to ownership rather than the deploy mode. Applications follow: server-side OIDC discovery and token exchange @@ -454,7 +618,7 @@ onion marker plus enforced and exclusive modes, and lint now requires the onion in every variant. See the [svc-net-tor](roles/svc-net-tor/README.md) README. -* **Single sign-on across protocols and domains.** Keycloak imports a SAML client for +- **Single sign-on across protocols and domains.** Keycloak imports a SAML client for every app that asks for one; SuiteCRM authenticates against it via SAML instead of a proxy, and Shopware provisions its admin through AdminOpenAuth with the front and back channel split. Sessions are shared across app domains, the issuer is pinned to @@ -462,7 +626,7 @@ the logout sweep runs where the visitor is looking. Directory users are read through one lookup so seeding cannot diverge. -* **One CI chain instead of four workflows.** The deploy workflows collapse into a +- **One CI chain instead of four workflows.** The deploy workflows collapse into a single chunk chain gated by one validation job, with every variant getting its own row and rotating distro, filesystem and tor axes. Selection tokens pin deploy axes, retriggers reproduce the exact selection of the source run in every mode, and the @@ -471,14 +635,14 @@ runs are force-cancelled, and a mid-run budget SIGKILL is counted as skipped rather than green. Apt call sites are bounded so a stalled mirror cannot burn a job budget. -* **Restore verified against real dumps.** The *recover* CLI replays a generation's +- **Restore verified against real dumps.** The *recover* CLI replays a generation's database and cluster dumps, reads the generation's own layout instead of guessing it, and places each dump by the engine the backup observed rather than by name alone. The *svc-bkp-volume-2-local* drill now empties every volume it claims to test, fails on a database that was never dumped, and stops the backup timers before it goes destructive. Baudolo is pinned per host, its contract read from baudolo itself. -* **A probe for every container.** Health checks are composed from prefixes and are +- **A probe for every container.** Health checks are composed from prefixes and are mandatory: every declared image either carries a probe or states why it cannot have one, enforced from both sides. Probes hit the port the container actually binds, no longer derive an HTTP Host from a kernel hostname, and are defined once instead of per @@ -486,7 +650,7 @@ resolver answers rather than just its socket, probe the daemon.json upstreams, and record the whole boot instead of the last 10 000 lines. -* **Single points of truth, enforced by lint.** The new *sys-lint* role pins the +- **Single points of truth, enforced by lint.** The new *sys-lint* role pins the GitHub-release lint tools. Every mount target has one spot in *meta/volumes.yml* and container paths are derived from it, *default.env* is the enforced source of the primary domain, *container_backup* is rejected where no volume exists, and role @@ -494,103 +658,103 @@ output, comments are checked in every file rather than only changed ones, and every shipped script requires a mirrored unit test. -* **Tests in every language the project ships.** The quality gate parses each shipped +- **Tests in every language the project ships.** The quality gate parses each shipped language and runs its unit suite; the PHP and Ruby interpreters are baked into the image, and the JavaScript, PHP and Ruby suites are reported in the CI summary alongside Python. Playwright stages the persona flows once per run and mounts them read-only, and the workspace environment suite splits into base, compose and swarm tracks. -* **Swarm and proxy operation.** Convergence gates read one budget sized for a real +- **Swarm and proxy operation.** Convergence gates read one budget sized for a real stack, print every task row when a stack fails to converge, and give up on a terminal task; the deployment mode a stack was deployed with is resolved instead of assumed. OpenResty reloads a vhost, lua or redirect config instead of redeploying the task. GitLab ships its config trees as swarm configs rather than host binds, and role templates expand through a lookup instead of inline Jinja. -* **New and reshaped roles.** *sys-svc-nss* is split out of *sys-hostname*, +- **New and reshaped roles.** *sys-svc-nss* is split out of *sys-hostname*, *web-svc-mirror* serves frontend assets as a privacy proxy, PeerTube becomes clearnet-only, and roles that could not run were deleted rather than repaired. CLI tools install via pip instead of pkgmgr. -* **Image and dependency version jumps (net since 12.0.0):** +- **Image and dependency version jumps (net since 12.0.0):** *Applications* - * *web-app-erpnext*: v16.26.2 to v16.32.3 - * *web-app-gitlab*: v19.1.2 to v19.3.0 (all six CNG component images) - * *web-app-semaphore*: v2.18.25 to v2.19.8 - * *web-app-nextcloud*: PHP 33-fpm-alpine to 34-fpm-alpine, nginx 1.31.2 to 1.31.3 - * *web-app-shopware*: 6.7.8.2 to 6.7.13.0, OpenSearch 3.7.0 to 3.8.0 - * *web-app-matomo*: 5.11.2 to 5.13.0 - * *web-app-matrix*: Synapse v1.156.0 to v1.159.0, Element v1.12.23 to v1.12.26 - * *web-app-mattermost*: 11.9.0 to 11.10.1 - * *web-app-keycloak*: 26.7.0 to 26.7.2, oauth2-proxy v7.15.3 to v7.15.4 - * *web-app-gitea*: 1.26.4 to 1.27.2 - * *web-app-funkwhale*: 2.0.6 to 2.0.9 (api and front) - * *web-app-penpot*: 2.16.2 to 2.17.1 (frontend, backend, exporter) - * *web-app-espocrm*: 10.0.2 to 10.0.6 - * *web-app-opencloud*: 7.2.1 to 7.2.4 - * *web-app-seaweedfs*: 4.39 to 4.44 - * *web-app-snipe-it*: v8.6.3-alpine to v8.7.2-alpine - * *web-app-wordpress*: 7.0.1 to 7.1.0 - * *web-app-peertube*: v8.2.2 to v8.2.4 - * *web-app-joomla*: 6.1.2-php8.3-apache to 6.1.3-php8.3-apache - * *web-app-jira*: 11.3.8 to 11.3.10 - * *web-app-confluence*: 10.2.14 to 10.2.15 - * *web-app-baserow*: 2.3.1 to 2.3.3 - * *web-app-flowise*: 3.1.3 to 3.1.4 - * *web-app-mailu*: 1.5.3 to 1.5.4 - * *web-app-pgadmin*: 9.16 to 9.17 - * *web-app-prometheus*: Prometheus v3.13.1 to v3.14.0, Alertmanager v0.33.1 to + - *web-app-erpnext*: v16.26.2 to v16.32.3 + - *web-app-gitlab*: v19.1.2 to v19.3.0 (all six CNG component images) + - *web-app-semaphore*: v2.18.25 to v2.19.8 + - *web-app-nextcloud*: PHP 33-fpm-alpine to 34-fpm-alpine, nginx 1.31.2 to 1.31.3 + - *web-app-shopware*: 6.7.8.2 to 6.7.13.0, OpenSearch 3.7.0 to 3.8.0 + - *web-app-matomo*: 5.11.2 to 5.13.0 + - *web-app-matrix*: Synapse v1.156.0 to v1.159.0, Element v1.12.23 to v1.12.26 + - *web-app-mattermost*: 11.9.0 to 11.10.1 + - *web-app-keycloak*: 26.7.0 to 26.7.2, oauth2-proxy v7.15.3 to v7.15.4 + - *web-app-gitea*: 1.26.4 to 1.27.2 + - *web-app-funkwhale*: 2.0.6 to 2.0.9 (api and front) + - *web-app-penpot*: 2.16.2 to 2.17.1 (frontend, backend, exporter) + - *web-app-espocrm*: 10.0.2 to 10.0.6 + - *web-app-opencloud*: 7.2.1 to 7.2.4 + - *web-app-seaweedfs*: 4.39 to 4.44 + - *web-app-snipe-it*: v8.6.3-alpine to v8.7.2-alpine + - *web-app-wordpress*: 7.0.1 to 7.1.0 + - *web-app-peertube*: v8.2.2 to v8.2.4 + - *web-app-joomla*: 6.1.2-php8.3-apache to 6.1.3-php8.3-apache + - *web-app-jira*: 11.3.8 to 11.3.10 + - *web-app-confluence*: 10.2.14 to 10.2.15 + - *web-app-baserow*: 2.3.1 to 2.3.3 + - *web-app-flowise*: 3.1.3 to 3.1.4 + - *web-app-mailu*: 1.5.3 to 1.5.4 + - *web-app-pgadmin*: 9.16 to 9.17 + - *web-app-prometheus*: Prometheus v3.13.1 to v3.14.0, Alertmanager v0.33.1 to v0.34.0, node-exporter v1.12.0 to v1.12.1 - * *web-app-opentalk*: LiveKit v1.13.3 to v1.13.5, RabbitMQ 4.3.2 to 4.3.4; the + - *web-app-opentalk*: LiveKit v1.13.3 to v1.13.5, RabbitMQ 4.3.2 to 4.3.4; the frontend (v2.9.0), controller (v0.34.1) and recorder (v0.16.2) stay pinned until the set is released as a bundle and *recorder.toml* is migrated - * *web-app-magento*: OpenSearch 3.7.0 to 3.8.0; PHP held at 8.4-fpm and MariaDB at + - *web-app-magento*: OpenSearch 3.7.0 to 3.8.0; PHP held at 8.4-fpm and MariaDB at 11.4, both deliberately fenced against the image bot - * *web-app-socialhome*: newly pinned to 2026.6.16 - * *web-app-bluesky* and *web-app-bridgy-fed*: upstream git refs pinned to commits + - *web-app-socialhome*: newly pinned to 2026.6.16 + - *web-app-bluesky* and *web-app-bridgy-fed*: upstream git refs pinned to commits *Services and infrastructure* - * *svc-ai-ollama*: 0.31.2 to 0.32.15 - * *svc-db-elasticsearch*: 9.4.3 to 9.5.2 - * *svc-db-qdrant*: v1.18.2 to v1.19.0 - * *svc-runner*: Ubuntu 24.04 to 26.04 - * *sys-ctl-hlth-csp*: 2.1.2 to 2.2.1 - * *web-svc-coturn*: 4.14.0 to 4.17.2 - * *web-svc-logout*: *latest* to universal-logout v1.3.1 - * *web-svc-xmpp*: 26.04 to 26.07 - * *test-e2e-playwright*: v1.61.1-noble to v1.62.1-noble - * *svc-net-tor*: newly on debian trixie-slim - * *svc-bkp-volume-2-local*: newly on alpine 3.24 + - *svc-ai-ollama*: 0.31.2 to 0.32.15 + - *svc-db-elasticsearch*: 9.4.3 to 9.5.2 + - *svc-db-qdrant*: v1.18.2 to v1.19.0 + - *svc-runner*: Ubuntu 24.04 to 26.04 + - *sys-ctl-hlth-csp*: 2.1.2 to 2.2.1 + - *web-svc-coturn*: 4.14.0 to 4.17.2 + - *web-svc-logout*: *latest* to universal-logout v1.3.1 + - *web-svc-xmpp*: 26.04 to 26.07 + - *test-e2e-playwright*: v1.61.1-noble to v1.62.1-noble + - *svc-net-tor*: newly on debian trixie-slim + - *svc-bkp-volume-2-local*: newly on alpine 3.24 *Toolchain and dependencies* - * *backup-docker-to-local* (*baudolo*): pinned to 7.0.1, via 6.0.0 and 7.0.0 - * *ruff*: 0.16.0 to 0.16.4 - * *@playwright/test*: ^1.61.1 to ^1.62.1 - * *eslint*: ^10.6.0 to ^10.9.0, *globals*: ^17.7.0 to ^17.9.0 - * *stylelint*: ^16.0.0 added - * *brace-expansion*: overridden to ^5.0.9, past three DoS advisories - * *keycloak-js*: 24.0.5 to 26.2.4, loaded as an ES module - * *bootstrap*: 5.3.3 to 5.3.8, *@fortawesome/fontawesome-free*: 6.5.1 to 7.3.1 - * *roles/sys-lint* pins the GitHub-release tools: actionlint v1.7.12, + - *backup-docker-to-local* (*baudolo*): pinned to 7.0.1, via 6.0.0 and 7.0.0 + - *ruff*: 0.16.0 to 0.16.4 + - *@playwright/test*: ^1.61.1 to ^1.62.1 + - *eslint*: ^10.6.0 to ^10.9.0, *globals*: ^17.7.0 to ^17.9.0 + - *stylelint*: ^16.0.0 added + - *brace-expansion*: overridden to ^5.0.9, past three DoS advisories + - *keycloak-js*: 24.0.5 to 26.2.4, loaded as an ES module + - *bootstrap*: 5.3.3 to 5.3.8, *@fortawesome/fontawesome-free*: 6.5.1 to 7.3.1 + - *roles/sys-lint* pins the GitHub-release tools: actionlint v1.7.12, hadolint v2.15.1, shfmt v3.13.1 **Renamed** -* Role credential declarations move from *meta/credentials.yml* to *meta/secrets.yml*, +- Role credential declarations move from *meta/credentials.yml* to *meta/secrets.yml*, addressed at *secrets.credentials* like every other meta file. -* The NSS half of *sys-hostname* becomes its own role, *sys-svc-nss*. +- The NSS half of *sys-hostname* becomes its own role, *sys-svc-nss*. **Contributors** -* [Kevin Veen-Birkenbach](https://veen.world): Tor deployment axis, SAML and +- [Kevin Veen-Birkenbach](https://veen.world): Tor deployment axis, SAML and cross-domain SSO, CI chunk chain, generation-level recovery, health-check and lint enforcement, multi-language test suites ## [12.0.0] - 2026-08-08 -* **Docker Swarm as a second deployment mode.** Roles can now be deployed across +- **Docker Swarm as a second deployment mode.** Roles can now be deployed across multiple hosts instead of being limited to a single Compose stack. New *svc-swarm-node* initializes the cluster, while *svc-swarm-manager* marks the Raft managers in the inventory. Shared state is provided through @@ -602,7 +766,7 @@ [svc-swarm-node](roles/svc-swarm-node/README.md) and [svc-storage-nfs-server](roles/svc-storage-nfs-server/README.md) READMEs. -* **Central engines and object storage.** A new *engine* lookup extends the existing +- **Central engines and object storage.** A new *engine* lookup extends the existing shared-database pattern to non-RDBMS services. Consumers can use centrally provisioned Redis, Memcached, RabbitMQ, Elasticsearch, Typesense, Qdrant and Unbound instances with isolated credentials, or retain an embedded sidecar. @@ -610,7 +774,7 @@ SeaweedFS and MinIO, with lazy provider inclusion and object-storage integration across fourteen application roles. -* **Backup and disaster recovery.** *svc-bkp-container-2-local* is superseded by +- **Backup and disaster recovery.** *svc-bkp-container-2-local* is superseded by *svc-bkp-volume-2-local*, making backup policy explicit per volume. The role prefers filesystem snapshots when available and can prepare btrfs hosts for snapshot-based backups itself. New *svc-bkp-nfs-2-local* protects the shared NFS export, @@ -620,19 +784,19 @@ disaster-recovery drill continuously verify the path. Rsync no longer retains superseded files as *~* copies. -* **Deployment and packaging foundations.** A host deployment mode joins Compose and +- **Deployment and packaging foundations.** A host deployment mode joins Compose and Swarm in the deployment tooling. The former *sys-package*, *sys-aur* and *sys-aur-install* roles were replaced by a distribution-independent package registry. Volume metadata now uses one canonical schema, single-file mounts become Swarm configs, and service placement, replica counts, dependencies, addresses and health probes resolve through deployment-aware lookups. -* **Isolated development worktrees.** Parallel branches can use independent stacks +- **Isolated development worktrees.** Parallel branches can use independent stacks while sharing one cache layer, preventing containers and network state from colliding. New *swarm-app-exec*, *swarm-diagnostic*, zombie-cluster and cross-mode roundtrip targets improve live inspection and Compose/Swarm parity testing. -* **CI and diagnostics.** Deployment runs are planned separately per mode and divided +- **CI and diagnostics.** Deployment runs are planned separately per mode and divided into starred priority and regular lines, with branch-new roles scheduled first. Matrix entries serialize across branches, large lines serialize their deployment modes, and failed roles can be retriggered on the original distribution set; @@ -647,13 +811,13 @@ Docker's data-root filesystem so ext4, btrfs and ZFS-specific paths receive real coverage. -* **Testing and documentation tooling.** New *test-e2e-cli* exercises the command-line +- **Testing and documentation tooling.** New *test-e2e-cli* exercises the command-line interface end to end. Lint and test jobs publish per-target and per-test summaries, failed target logs are replayed after the summary, and the complexity matrix shows whether a role already exists on *origin/main*. Generated role READMEs now provide consistent status tables, quick-start instructions and dependency diagrams. -* **New lint contracts.** Port variables must resolve through lookups, scheduler +- **New lint contracts.** Port variables must resolve through lookups, scheduler services must declare *replicas: 1*, and volume-owning stack roles must declare their backup policy. *role_path* is forbidden in shell and command bodies. Deployment-mode defaults, container-inspection resolvers, asynchronous-task @@ -661,13 +825,13 @@ directives and documented *nocheck* exceptions are recognized instead of producing false positives. -* **Image delivery and frontend dependencies.** Image references now resolve from +- **Image delivery and frontend dependencies.** Image references now resolve from *meta/services.yml* as their single source of truth, replacing unpinned *latest* tags. *web-app-bigbluebutton* pins its component images separately. *web-svc-cdn* builds and serves mirrored frontend packages through an internal one-shot service, with the package-cache CA trusted by build containers. -* **Application improvements.** Penpot gained hardened OIDC, LDAP and native-login +- **Application improvements.** Penpot gained hardened OIDC, LDAP and native-login variants, SeaweedFS-backed asset tests and Swarm-ready health checks. Pi-hole received its v6-compatible login and password flow, Keycloak RBAC integration and expanded persona coverage. Further deployment, replication and startup fixes landed @@ -675,294 +839,294 @@ Matomo, MediaWiki, Nextcloud, OpenProject, Pixelfed, Semaphore, Taiga, WordPress, XWiki and the internal CDN. -* **Lifecycle promotions:** *web-app-checkmk*, *web-app-jellyfin*, *web-app-n8n*, +- **Lifecycle promotions:** *web-app-checkmk*, *web-app-jellyfin*, *web-app-n8n*, *svc-registry-docker* and *svc-registry-cache* advance to *beta*. -* **Image and dependency version jumps (net since 11.6.0):** - * *web-app-gitlab*: omnibus *gitlab-ee* 19.1.1 to CNG component images v19.1.2 - * *web-app-mattermost*: 11.8.3 to 11.9.0 - * *web-app-opentalk*: v2.8.1 to v2.9.0 - * *web-app-prometheus*: v3.13.0 to v3.13.1 - * *web-app-joomla*: 6.1.1-php8.3-apache to 6.1.2-php8.3-apache - * *web-app-baserow*: 2.3.0 to 2.3.1 - * *web-app-magento*: PHP 8.5-fpm to 8.4-fpm - * *backup-docker-to-local*: 3.1.1 to 3.1.3 - * *baudolo*: pinned to 3.4.1 +- **Image and dependency version jumps (net since 11.6.0):** + - *web-app-gitlab*: omnibus *gitlab-ee* 19.1.1 to CNG component images v19.1.2 + - *web-app-mattermost*: 11.8.3 to 11.9.0 + - *web-app-opentalk*: v2.8.1 to v2.9.0 + - *web-app-prometheus*: v3.13.0 to v3.13.1 + - *web-app-joomla*: 6.1.1-php8.3-apache to 6.1.2-php8.3-apache + - *web-app-baserow*: 2.3.0 to 2.3.1 + - *web-app-magento*: PHP 8.5-fpm to 8.4-fpm + - *backup-docker-to-local*: 3.1.1 to 3.1.3 + - *baudolo*: pinned to 3.4.1 **Removed** -* *sys-package*, *sys-aur* and *sys-aur-install*, superseded by the +- *sys-package*, *sys-aur* and *sys-aur-install*, superseded by the distribution-independent package registry. -* *svc-bkp-container-2-local*, superseded by the volume-oriented backup roles. +- *svc-bkp-container-2-local*, superseded by the volume-oriented backup roles. **Contributors** -* [Kevin Veen-Birkenbach](https://veen.world): Swarm and NFS deployment mode, +- [Kevin Veen-Birkenbach](https://veen.world): Swarm and NFS deployment mode, central engines and object storage, backup and recovery rework, CI pipeline, linting and tooling ## [11.6.0] - 2026-07-08 -* New *web-app-n8n* role: n8n workflow automation (Community Edition). SSO is wired through a trusted-header edge hook that is copied and mounted only when SSO is enabled (native SSO is enterprise-only in CE), LDAP sign-in is supported, and per-scenario Playwright coverage exercises the CE edge-SSO model. Ships at lifecycle *alpha*; subnet and port collisions with the new *web-app-semaphore* role were resolved on the way in. See the [web-app-n8n README](roles/web-app-n8n/README.md). +- New *web-app-n8n* role: n8n workflow automation (Community Edition). SSO is wired through a trusted-header edge hook that is copied and mounted only when SSO is enabled (native SSO is enterprise-only in CE), LDAP sign-in is supported, and per-scenario Playwright coverage exercises the CE edge-SSO model. Ships at lifecycle *alpha*; subnet and port collisions with the new *web-app-semaphore* role were resolved on the way in. See the [web-app-n8n README](roles/web-app-n8n/README.md). -* CI fixes: resolved four CI failures across the *web-app-n8n*, *web-app-pihole* and *web-app-mastodon* roles. +- CI fixes: resolved four CI failures across the *web-app-n8n*, *web-app-pihole* and *web-app-mastodon* roles. -* Routine maintenance: dependabot bumps of *docker/login-action* 4.3.0 to 4.4.0 and *eslint-plugin-playwright* 2.10.4 to 2.10.5; removed a stray *.claude/settings.local.json*. +- Routine maintenance: dependabot bumps of *docker/login-action* 4.3.0 to 4.4.0 and *eslint-plugin-playwright* 2.10.4 to 2.10.5; removed a stray *.claude/settings.local.json*. -* Image and dependency version jumps (net since 11.5.0): - * *web-app-baserow*: 2.2.2 to 2.3.0 - * *web-app-semaphore*: v2.18.16 to v2.18.21 - * *web-app-pihole*: 2026.06.0 to 2026.07.2 - * *web-app-seaweedfs*: 4.37 to 4.38 - * *web-app-opencloud*: 7.2.0 to 7.2.1 - * *web-app-mattermost*: 11.8.2 to 11.8.3 - * *web-app-decidim*: 0.31.5 to 0.31.6 - * *web-app-prometheus* (Alertmanager): v0.33.0 to v0.33.1 - * *web-app-bluesky* (git ref): 1.126.0 to 1.127.0 +- Image and dependency version jumps (net since 11.5.0): + - *web-app-baserow*: 2.2.2 to 2.3.0 + - *web-app-semaphore*: v2.18.16 to v2.18.21 + - *web-app-pihole*: 2026.06.0 to 2026.07.2 + - *web-app-seaweedfs*: 4.37 to 4.38 + - *web-app-opencloud*: 7.2.0 to 7.2.1 + - *web-app-mattermost*: 11.8.2 to 11.8.3 + - *web-app-decidim*: 0.31.5 to 0.31.6 + - *web-app-prometheus* (Alertmanager): v0.33.0 to v0.33.1 + - *web-app-bluesky* (git ref): 1.126.0 to 1.127.0 **Contributors** -* [Prageeth Panicker](https://github.com/pragepani): web-app-n8n role (workflow automation, edge-header SSO, LDAP, Playwright) -* [Kevin Veen-Birkenbach](https://veen.world): n8n review, CI fixes and version maintenance +- [Prageeth Panicker](https://github.com/pragepani): web-app-n8n role (workflow automation, edge-header SSO, LDAP, Playwright) +- [Kevin Veen-Birkenbach](https://veen.world): n8n review, CI fixes and version maintenance ## [11.5.0] - 2026-07-04 -* Three new web-app roles, each with SSO/LDAP wiring and per-scenario Playwright coverage: - * *web-app-semaphore*: Semaphore UI with OIDC SSO + LDAP. The break-glass admin is sourced from the users model, OIDC admin seeding is idempotent, and the OIDC callback strips a trailing base-URL slash. Shipped at lifecycle *beta*. See the [web-app-semaphore README](roles/web-app-semaphore/README.md). - * *web-app-checkmk*: Checkmk behind oauth2-proxy SSO with LDAP; the SSO variant injects a reachable logout control. See the [web-app-checkmk README](roles/web-app-checkmk/README.md). - * *web-app-jellyfin*: Jellyfin media server; LDAP and OIDC auth are modelled as *meta/addons* with per-addon integration hooks and specs. See the [web-app-jellyfin README](roles/web-app-jellyfin/README.md). +- Three new web-app roles, each with SSO/LDAP wiring and per-scenario Playwright coverage: + - *web-app-semaphore*: Semaphore UI with OIDC SSO + LDAP. The break-glass admin is sourced from the users model, OIDC admin seeding is idempotent, and the OIDC callback strips a trailing base-URL slash. Shipped at lifecycle *beta*. See the [web-app-semaphore README](roles/web-app-semaphore/README.md). + - *web-app-checkmk*: Checkmk behind oauth2-proxy SSO with LDAP; the SSO variant injects a reachable logout control. See the [web-app-checkmk README](roles/web-app-checkmk/README.md). + - *web-app-jellyfin*: Jellyfin media server; LDAP and OIDC auth are modelled as *meta/addons* with per-addon integration hooks and specs. See the [web-app-jellyfin README](roles/web-app-jellyfin/README.md). -* Users-model rework: the per-user *reserved* flag is replaced by an *accounts* list (*host*/*mailbox*/*identity*) with role-derived defaults, so inventory-only users keep their LDAP/Keycloak accounts. A new *forward* field makes Mailu create *username@domain* forward aliases via a new create-only alias task. Mailbox creation and password rotation now gate on *mailbox* in *accounts*, the Mailu RBAC role *mail-bot* is renamed *bot*, and *svc-db-openldap* always provisions the identity subset. +- Users-model rework: the per-user *reserved* flag is replaced by an *accounts* list (*host*/*mailbox*/*identity*) with role-derived defaults, so inventory-only users keep their LDAP/Keycloak accounts. A new *forward* field makes Mailu create *username@domain* forward aliases via a new create-only alias task. Mailbox creation and password rotation now gate on *mailbox* in *accounts*, the Mailu RBAC role *mail-bot* is renamed *bot*, and *svc-db-openldap* always provisions the identity subset. -* Fixes: *web-app-odoo* restarts after auth provisioning so workers drop stale config; *web-app-roulette-wheel* builds with *npm ci* against the app lockfile; *web-app-discourse* allows *data:* script sources in the CSP. +- Fixes: *web-app-odoo* restarts after auth provisioning so workers drop stale config; *web-app-roulette-wheel* builds with *npm ci* against the app lockfile; *web-app-discourse* allows *data:* script sources in the CSP. -* New lint: git branch names are validated against the naming convention. Agent docs gained a hard pre-redeploy verification gate in the role iteration loop. +- New lint: git branch names are validated against the naming convention. Agent docs gained a hard pre-redeploy verification gate in the role iteration loop. -* Routine maintenance: dependabot bumps of *actions/checkout* 6 to 7, *docker/login-action* 4.1.0 to 4.3.0 and *docker/setup-buildx-action* 4.0.0 to 4.2.0; *skills-lock.json* refresh. +- Routine maintenance: dependabot bumps of *actions/checkout* 6 to 7, *docker/login-action* 4.1.0 to 4.3.0 and *docker/setup-buildx-action* 4.0.0 to 4.2.0; *skills-lock.json* refresh. -* Image and dependency version jumps (net since 11.4.0): - * *web-app-mediawiki*: 1.45 to 1.46 - * *web-app-erpnext*: v16.25.0 to v16.26.2 - * *web-app-peertube*: v8.2.1 to v8.2.2 - * *web-app-prometheus*: v3.12.0 to v3.13.0 - * *web-app-opentalk* (LiveKit): v1.13.2 to v1.13.3 - * *web-app-semaphore*: pinned v2.18.16 (new role) +- Image and dependency version jumps (net since 11.4.0): + - *web-app-mediawiki*: 1.45 to 1.46 + - *web-app-erpnext*: v16.25.0 to v16.26.2 + - *web-app-peertube*: v8.2.1 to v8.2.2 + - *web-app-prometheus*: v3.12.0 to v3.13.0 + - *web-app-opentalk* (LiveKit): v1.13.2 to v1.13.3 + - *web-app-semaphore*: pinned v2.18.16 (new role) **Contributors** -* [Kevin Veen-Birkenbach](https://veen.world): Semaphore, Checkmk and Jellyfin roles, users-model rework, fixes and version maintenance +- [Kevin Veen-Birkenbach](https://veen.world): Semaphore, Checkmk and Jellyfin roles, users-model rework, fixes and version maintenance ## [11.4.0] - 2026-07-01 -* Self-hosted CI runners: new *svc-runner* role plus *cli/deploy/runner* command spin up N containerised GitHub Actions runners on any server, adding to the 20 GitHub-hosted ones. Each runner is isolated (own subnet, ports, inventory, Docker volume, DNS) and auto-re-registers. Runs on Debian, Ubuntu and Arch, supports Docker-in-Docker, and ships a full in-runner E2E deploy test. See the *svc-runner* README. +- Self-hosted CI runners: new *svc-runner* role plus *cli/deploy/runner* command spin up N containerised GitHub Actions runners on any server, adding to the 20 GitHub-hosted ones. Each runner is isolated (own subnet, ports, inventory, Docker volume, DNS) and auto-re-registers. Runs on Debian, Ubuntu and Arch, supports Docker-in-Docker, and ships a full in-runner E2E deploy test. See the *svc-runner* README. -* Fork PRs can now scope the CI matrix: a 🧩 *Subset* label reads a *roles:* block from the PR body and narrows the deploy whitelist. Gives forks the maintainer-only manual dispatch they could not trigger before. Without the label nothing changes. See [the fork-PR pipeline](docs/contributing/artefact/git/pipeline.md). +- Fork PRs can now scope the CI matrix: a 🧩 *Subset* label reads a *roles:* block from the PR body and narrows the deploy whitelist. Gives forks the maintainer-only manual dispatch they could not trigger before. Without the label nothing changes. See [the fork-PR pipeline](docs/contributing/artefact/git/pipeline.md). -* GitHub-hosted runner fixes: free disk before deploys and drop a dead 404 URL from the external tests. +- GitHub-hosted runner fixes: free disk before deploys and drop a dead 404 URL from the external tests. -* *make local* reinstall now works correctly when all services are disabled. +- *make local* reinstall now works correctly when all services are disabled. -* Image and dependency version jumps (net since 11.3.0): - * *web-app-funkwhale*: 2.0.4 to 2.0.6 - * *web-app-mobilizon*: 5.2.3 to 5.2.4 - * *web-app-bluesky* (git ref): 1.125.0 to 1.126.0 +- Image and dependency version jumps (net since 11.3.0): + - *web-app-funkwhale*: 2.0.4 to 2.0.6 + - *web-app-mobilizon*: 5.2.3 to 5.2.4 + - *web-app-bluesky* (git ref): 1.125.0 to 1.126.0 **Contributors** -* [Alejandro Roman Ibanez](https://github.com/AlejandroRomanIbanez): self-hosted containerised CI runners -* [Kevin Veen-Birkenbach](https://veen.world): Subset-label CI scoping, runner disk fixes, version maintenance +- [Alejandro Roman Ibanez](https://github.com/AlejandroRomanIbanez): self-hosted containerised CI runners +- [Kevin Veen-Birkenbach](https://veen.world): Subset-label CI scoping, runner disk fixes, version maintenance ## [11.3.0] - 2026-06-29 -* Security: resolved all 80 open CodeQL/code-scanning alerts and added recurrence guards. Broke an unsafe import cycle in *cli/administration/deploy/development* via a leaf *env.py*; hardened *web-app-bluesky* *server.js* (cookie prototype-pollution guard, log sanitisation, HTML-escaped exceptions, ReDoS-bounded handle regex) and *web-app-baserow* SSO open-redirect handling; required TLS β‰₯ 1.2 in network diagnose probes; validated *actionlint* tar members against path traversal; rewrote *decidim*/*apt-purge* regexes to avoid catastrophic backtracking; anchored six Playwright URL regexes and pinned *crs-k/stale-branches* to a SHA. Guards: an *import-linter* contract, a lint requiring justified bandit *noqa*, and ruff *BLE001* as a ratchet. +- Security: resolved all 80 open CodeQL/code-scanning alerts and added recurrence guards. Broke an unsafe import cycle in *cli/administration/deploy/development* via a leaf *env.py*; hardened *web-app-bluesky* *server.js* (cookie prototype-pollution guard, log sanitisation, HTML-escaped exceptions, ReDoS-bounded handle regex) and *web-app-baserow* SSO open-redirect handling; required TLS β‰₯ 1.2 in network diagnose probes; validated *actionlint* tar members against path traversal; rewrote *decidim*/*apt-purge* regexes to avoid catastrophic backtracking; anchored six Playwright URL regexes and pinned *crs-k/stale-branches* to a SHA. Guards: an *import-linter* contract, a lint requiring justified bandit *noqa*, and ruff *BLE001* as a ratchet. -* CI flakiness and fork-PR fixes: added *.first()* to the Odoo *sale_management* spec to end a strict-mode violation; made Nextcloud GitLab-OAuth Organization provisioning and the Jenkins/Moodle systemd steps defensive with *retries/until*; restored *secrets: inherit* on the fork image mirror so fork PRs authenticate to Docker Hub; and adjusted stale-branches for *crs-k/stale-branches@v9.0.1* (stale 350 / delete 360 days). See [the fork-PR pipeline](docs/contributing/artefact/git/pipeline.md) and [the workflow catalog](docs/contributing/tools/github/actions/workflows.md). +- CI flakiness and fork-PR fixes: added *.first()* to the Odoo *sale_management* spec to end a strict-mode violation; made Nextcloud GitLab-OAuth Organization provisioning and the Jenkins/Moodle systemd steps defensive with *retries/until*; restored *secrets: inherit* on the fork image mirror so fork PRs authenticate to Docker Hub; and adjusted stale-branches for *crs-k/stale-branches@v9.0.1* (stale 350 / delete 360 days). See [the fork-PR pipeline](docs/contributing/artefact/git/pipeline.md) and [the workflow catalog](docs/contributing/tools/github/actions/workflows.md). -* Routine maintenance: *.gitignore* now excludes local Claude agent artefacts (*launch.json*, *routines*, *workflows*), and dependabot bumps of *actions/stale* 9 β†’ 10 and *eslint* 10.5.0 β†’ 10.6.0. +- Routine maintenance: *.gitignore* now excludes local Claude agent artefacts (*launch.json*, *routines*, *workflows*), and dependabot bumps of *actions/stale* 9 β†’ 10 and *eslint* 10.5.0 β†’ 10.6.0. -* Image and dependency version jumps (net since 11.2.0): - * *web-app-seaweedfs*: 4.36 to 4.37 - * *pkgmgr* (package-manager git ref): v1.15.2 to v1.16.0 +- Image and dependency version jumps (net since 11.2.0): + - *web-app-seaweedfs*: 4.36 to 4.37 + - *pkgmgr* (package-manager git ref): v1.15.2 to v1.16.0 **Contributors** -* [Kevin Veen-Birkenbach](https://veen.world): code-scanning alert resolution and recurrence guards, CI/fork-PR fixes and version maintenance +- [Kevin Veen-Birkenbach](https://veen.world): code-scanning alert resolution and recurrence guards, CI/fork-PR fixes and version maintenance ## [11.2.0] - 2026-06-28 -* Per-role update PRs: the Docker-image-version and repository-ref updaters now open one pull request per affected role instead of a single combined PR, and they recompute the diff against the latest *main* at run time β€” the update jobs check out *main* rather than the triggering commit, so a queued or stale run no longer proposes already-merged changes or bundles unrelated roles. Each role gets its own branch (*update/---*) and a role-scoped duplicate check, while the *skills-lock.json* updater deliberately stays a single PR. See [the update workflow catalog](docs/contributing/tools/github/actions/workflows.md). +- Per-role update PRs: the Docker-image-version and repository-ref updaters now open one pull request per affected role instead of a single combined PR, and they recompute the diff against the latest *main* at run time β€” the update jobs check out *main* rather than the triggering commit, so a queued or stale run no longer proposes already-merged changes or bundles unrelated roles. Each role gets its own branch (*update/---*) and a role-scoped duplicate check, while the *skills-lock.json* updater deliberately stays a single PR. See [the update workflow catalog](docs/contributing/tools/github/actions/workflows.md). -* Fork-PR CI hardening (follow-up to the 11.1.0 trusted-fork flow): the privileged *pull_request_target* image producer and mirror now set *allow-unsafe-pr-checkout* so *actions/checkout* stops refusing the merged fork ref it had begun rejecting. Untrusted fork builds run without organization secrets β€” they authenticate to GHCR with the per-job *GITHUB_TOKEN* only and mirror Docker Hub anonymously β€” while the maintainer-trusted path keeps full credentials and builds the raw PR head. The trust switch moved to the *πŸ›‘οΈ Trusted* label. See [the fork-PR pipeline](docs/contributing/artefact/git/pipeline.md) and [the GHCR authentication reference](docs/contributing/tools/ghcr/authentication.md). +- Fork-PR CI hardening (follow-up to the 11.1.0 trusted-fork flow): the privileged *pull_request_target* image producer and mirror now set *allow-unsafe-pr-checkout* so *actions/checkout* stops refusing the merged fork ref it had begun rejecting. Untrusted fork builds run without organization secrets β€” they authenticate to GHCR with the per-job *GITHUB_TOKEN* only and mirror Docker Hub anonymously β€” while the maintainer-trusted path keeps full credentials and builds the raw PR head. The trust switch moved to the *πŸ›‘οΈ Trusted* label. See [the fork-PR pipeline](docs/contributing/artefact/git/pipeline.md) and [the GHCR authentication reference](docs/contributing/tools/ghcr/authentication.md). -* Buildx setup resilience: the CI image build pre-pulls and pins the *moby/buildkit* image with a retry loop before *docker/setup-buildx-action*, so a transient *registry-1.docker.io* timeout during the buildkit bootstrap no longer aborts the build β€” buildx falls back to the locally cached image once it is present. +- Buildx setup resilience: the CI image build pre-pulls and pins the *moby/buildkit* image with a retry loop before *docker/setup-buildx-action*, so a transient *registry-1.docker.io* timeout during the buildkit bootstrap no longer aborts the build β€” buildx falls back to the locally cached image once it is present. -* Cleanup-workflow fixes (follow-up to the 11.1.0 cleanup automation): the *crs-k/stale-branches* action is pinned to *v9.0.1* (the previous *@v8* was unresolvable and failed the job) and its non-existent *protected-branches* input is replaced with the action's real *branches-filter-regex*; the GHCR CI-image cleanup script now reports what it scans, keeps and deletes with a per-package summary and a *DRY_RUN* mode, so a no-op run is no longer indistinguishable from a broken one. +- Cleanup-workflow fixes (follow-up to the 11.1.0 cleanup automation): the *crs-k/stale-branches* action is pinned to *v9.0.1* (the previous *@v8* was unresolvable and failed the job) and its non-existent *protected-branches* input is replaced with the action's real *branches-filter-regex*; the GHCR CI-image cleanup script now reports what it scans, keeps and deletes with a per-package summary and a *DRY_RUN* mode, so a no-op run is no longer indistinguishable from a broken one. -* Routine maintenance: YAML normalization of the *web-app-pihole* role's *meta/services.yml* (document start, list indentation) and an autoformat pass. +- Routine maintenance: YAML normalization of the *web-app-pihole* role's *meta/services.yml* (document start, list indentation) and an autoformat pass. -* Image and dependency version jumps (net since 11.1.0): - * *web-app-matomo*: 5.3.2 to 5.11.2 - * *web-app-mattermost*: 11.8.1 to 11.8.2 - * *web-app-opentalk* (LiveKit): v1.13.1 to v1.13.2 +- Image and dependency version jumps (net since 11.1.0): + - *web-app-matomo*: 5.3.2 to 5.11.2 + - *web-app-mattermost*: 11.8.1 to 11.8.2 + - *web-app-opentalk* (LiveKit): v1.13.1 to v1.13.2 **Contributors** -* [Kevin Veen-Birkenbach](https://veen.world): per-role update PRs, fork-PR CI hardening, buildx retry, cleanup-workflow fixes and version maintenance +- [Kevin Veen-Birkenbach](https://veen.world): per-role update PRs, fork-PR CI hardening, buildx retry, cleanup-workflow fixes and version maintenance ## [11.1.0] - 2026-06-27 -* Trusted fork PRs: a maintainer-applied *trusted-pr* label runs a fork PR as deliberately released code β€” the orchestrator skips the fork-prerequisite wait and the privileged *pull_request_target* build switches its source from the base merge ref to the raw PR head, while the built image keeps the merge-SHA tag so every downstream consumer is unchanged. The label is the only switch (applying a label is collaborator-only on GitHub, so fork authors cannot grant it), build-orchestration scripts always come from the base repository, and both unlabeled fork PRs and same-repository PRs are untouched. See [the fork-PR pipeline](docs/contributing/artefact/git/pipeline.md) and [the contributor fork workflow](docs/contributing/artefact/git/pull-request.md). +- Trusted fork PRs: a maintainer-applied *trusted-pr* label runs a fork PR as deliberately released code β€” the orchestrator skips the fork-prerequisite wait and the privileged *pull_request_target* build switches its source from the base merge ref to the raw PR head, while the built image keeps the merge-SHA tag so every downstream consumer is unchanged. The label is the only switch (applying a label is collaborator-only on GitHub, so fork authors cannot grant it), build-orchestration scripts always come from the base repository, and both unlabeled fork PRs and same-repository PRs are untouched. See [the fork-PR pipeline](docs/contributing/artefact/git/pipeline.md) and [the contributor fork workflow](docs/contributing/artefact/git/pull-request.md). -* Fork main-branch sync: the push entry workflow now synchronizes the current repository's *main* from a configured source repository (default *infinito-nexus/core*) before CI scope and deploy discovery run, so a fork branch push sees only its own changes against an up-to-date base. The source is overridable or disablable through the *CI_SYNC_MAIN_SOURCE_REPOSITORY* repository variable, and the sync force-overwrites *main*, so a synced repository must not be used as a working branch. See [the Actions configuration reference](docs/contributing/tools/github/actions/configuration.md). +- Fork main-branch sync: the push entry workflow now synchronizes the current repository's *main* from a configured source repository (default *infinito-nexus/core*) before CI scope and deploy discovery run, so a fork branch push sees only its own changes against an up-to-date base. The source is overridable or disablable through the *CI_SYNC_MAIN_SOURCE_REPOSITORY* repository variable, and the sync force-overwrites *main*, so a synced repository must not be used as a working branch. See [the Actions configuration reference](docs/contributing/tools/github/actions/configuration.md). -* Package-changelog generator hardening: the Debian changelog and the Fedora spec *%changelog* are mirrored from CHANGELOG.md without tripping their native parsers β€” every change line is indented for Debian, every body line gains a dash continuation for RPM, and the archived-releases notice is folded into the oldest kept entry instead of trailing after the final entry. Previously the un-indented bodies made *dpkg-buildpackage* abort the Debian package build with an empty maintainer. The *Changelog* title is also preserved when the active window is trimmed. See [the release procedure](docs/contributing/actions/release.md). +- Package-changelog generator hardening: the Debian changelog and the Fedora spec *%changelog* are mirrored from CHANGELOG.md without tripping their native parsers β€” every change line is indented for Debian, every body line gains a dash continuation for RPM, and the archived-releases notice is folded into the oldest kept entry instead of trailing after the final entry. Previously the un-indented bodies made *dpkg-buildpackage* abort the Debian package build with an empty maintainer. The *Changelog* title is also preserved when the active window is trimmed. See [the release procedure](docs/contributing/actions/release.md). -* New packaging lint: a *lint-packages* check, wired into *make lint* and its own CI workflow, validates the generated *debian/changelog* with *dpkg-parsechangelog*, the Fedora spec with *rpmspec* and the Arch *PKGBUILD* with a *bash -n* syntax pass, failing on any parser warning rather than only on a non-zero exit. A complementary *test-lint* check asserts that both package changelogs list every released version and that their inline window matches CHANGELOG.md. See [the workflow catalog](docs/contributing/tools/github/actions/workflows.md). +- New packaging lint: a *lint-packages* check, wired into *make lint* and its own CI workflow, validates the generated *debian/changelog* with *dpkg-parsechangelog*, the Fedora spec with *rpmspec* and the Arch *PKGBUILD* with a *bash -n* syntax pass, failing on any parser warning rather than only on a non-zero exit. A complementary *test-lint* check asserts that both package changelogs list every released version and that their inline window matches CHANGELOG.md. See [the workflow catalog](docs/contributing/tools/github/actions/workflows.md). -* Repository cleanup automation: a scheduled cleanup workflow plus a GHCR helper prune stale CI images so the container registry does not accumulate per-commit build artefacts. +- Repository cleanup automation: a scheduled cleanup workflow plus a GHCR helper prune stale CI images so the container registry does not accumulate per-commit build artefacts. -* Routine maintenance: YAML normalization of the *web-app-pihole* role variables (document start, single-space keys). +- Routine maintenance: YAML normalization of the *web-app-pihole* role variables (document start, single-space keys). **Contributors** -* [Kevin Veen-Birkenbach](https://veen.world): trusted-fork-PR flow, fork main sync, package-changelog generator and packaging lint, cleanup automation +- [Kevin Veen-Birkenbach](https://veen.world): trusted-fork-PR flow, fork main sync, package-changelog generator and packaging lint, cleanup automation ## [11.0.0] - 2026-06-27 -* Unified addon syntax (requirement 026): every role-level plugin, browser/GNOME extension, Matrix bridge and cross-role integration was migrated to a single declarative *meta/addons/* contract, replacing the per-role ad-hoc plugin definitions. 86 addon files now describe addons for *desk-chromium*, *desk-firefox*, *desk-gnome*, *web-app-discourse*, *web-app-friendica*, *web-app-joomla*, *web-app-mediawiki*, *web-app-pretix*, *web-app-wordpress*, *web-app-xwiki*, *web-app-nextcloud*, *web-app-odoo* and *web-app-matrix*. Each service-coupled addon gets a *tasks/addons* integration hook and its own Playwright spec (87 per-addon specs added), addon flags are gated on actual partner deployment through a new *addon_env_flags* lookup, and a lint requires a hook plus a spec for every coupled addon. The cross-role integration matrix is regenerated from a dedicated data module (*integration_matrix_data.py*). -* New centralized API single-point-of-truth: an *api* lookup plugin plus a global API dict so API tokens and endpoints (Cloudflare, the Nextcloud proprietary OAuth integrations) resolve from one place instead of scattered role lookups. -* Real Nextcloud integration coupling: end-to-end tests now assert genuine two-way OAuth/API coupling for *gitlab*, *mattermost*, *openproject*, *zammad*, *peertube*, *discourse*, *github*, *google*, *jira*, *mastodon*, *matrix*, *moodle* and *suitecrm*, rather than the mere presence of a connect button. All integration OAuth credentials are stored Nextcloud-encrypted via ICrypto (sensitive app values), OpenProject and Zammad secrets survive a re-deploy, and OpenWebUI/Ollama is wired in as a real *integration_openai* chat backend. Bridges with no Nextcloud-33 plugin (Moodle, SuiteCRM) are disabled. -* Nextcloud deploy-variant rebalancing: Discourse and OnlyOffice are each isolated into their own loosely-coupled partner variant, the matrix is repacked to five variants overriding only the dynamic flags, LDAP is enabled wherever SSO is on, and the database is shared outside variant 1. The GitLab 19 OAuth app now carries an organization, and *fileslibreofficeedit* is gated on OnlyOffice absence. -* Storage- and runtime-aware CI variant matrix: variant bundles are split per runner by a storage-aware job splitter driven by an explicit variant CSV, behind a unified variant selector (*variant_select.py*). The default per-bundle storage cap is centralized at 350GB, per-variant memory budgets are guarded against the host budget, shared database providers are enforced by a shared-false-once lint, and the full variant matrix always runs (the earlier runtime time-cut was removed). -* Container resource governance: self-run and shared-provider services declare explicit compose mem/pids limits, container limits were right-sized across roles, and Node-heap services respect a floor via a new *node_max_old_space_size* lookup (Nextcloud whiteboard raised to 1g). A reworked *ressources* CLI emits per-variant and all-role resource summaries, the footprint tool gains a *min_storage* column, and shared services carry a *bond* integration-importance factor. -* Matrix bridges modernized: Signal, Telegram, WhatsApp and Slack bridges migrate to bridgev2 config, the dead mautrix-facebook/instagram bridges are replaced by mautrix-meta, bridge specs are gated by the deployed addon, Synapse loads the bridge registrations from a mounted directory, and the role now tracks *matrix-docker-ansible-deploy* from the spantaleev upstream. -* CA-trust and OIDC-over-self-signed-TLS hardening: the internal CA is installed into the OS bundle for PHP libcurl OIDC (*web-app-pixelfed*, *web-app-joomla*, plus a WordPress must-use plugin), the CA-trust wrapper is kept on probe timeout instead of degrading to env-only, and the CA injection is bounded so it cannot hang the handler. HSTS is now emitted on every response including non-2xx, *ansible-vault encrypt_string* reads plaintext from stdin so leading-dash values encrypt, and Mastodon allows inline *script-src-elem* for its server-rendered SPA. -* Image and dependency version jumps (net since 10.1.1): - * *web-app-erpnext*: v16.23.1 to v16.25.0 - * *web-app-gitlab*: 19.1.0-ee.0 to 19.1.1-ee.0 - * *web-app-opencloud*: 4.0.7 to 7.2.0 - * *web-app-seaweedfs*: 4.35 to 4.36 - * *web-app-matomo*: unpinned *latest* to pinned 5.3.2 (matches the bootstrap installer) - * *web-app-nextcloud* proxy (nginx): unpinned *alpine* to pinned 1.31.2-alpine - * *web-app-nextcloud* whiteboard: unpinned *latest* to pinned v1.5.9 - * *svc-ai-ollama*: switched to the official *ollama* image so inference works - * *web-app-pretix* and *web-app-xwiki*: their inline plugin/extension version pins (2.3.1; 2.19.6, 9.15.7, 1.0) were removed as those addons moved into *meta/addons* - * Dev/CI dependencies: *globals* 15.15.0 to 17.7.0, *@playwright/test* 1.61.0 to 1.61.1, *actions/cache* 5 to 6 - * Intermediate bot bumps were corrected back down: Mattermost 11.8.2 to 11.8.1 and Nextcloud 34 to 33 (kept at 33 because of plugin incompatibilities, same pin as 10.0.0) +- Unified addon syntax (requirement 026): every role-level plugin, browser/GNOME extension, Matrix bridge and cross-role integration was migrated to a single declarative *meta/addons/* contract, replacing the per-role ad-hoc plugin definitions. 86 addon files now describe addons for *desk-chromium*, *desk-firefox*, *desk-gnome*, *web-app-discourse*, *web-app-friendica*, *web-app-joomla*, *web-app-mediawiki*, *web-app-pretix*, *web-app-wordpress*, *web-app-xwiki*, *web-app-nextcloud*, *web-app-odoo* and *web-app-matrix*. Each service-coupled addon gets a *tasks/addons* integration hook and its own Playwright spec (87 per-addon specs added), addon flags are gated on actual partner deployment through a new *addon_env_flags* lookup, and a lint requires a hook plus a spec for every coupled addon. The cross-role integration matrix is regenerated from a dedicated data module (*integration_matrix_data.py*). +- New centralized API single-point-of-truth: an *api* lookup plugin plus a global API dict so API tokens and endpoints (Cloudflare, the Nextcloud proprietary OAuth integrations) resolve from one place instead of scattered role lookups. +- Real Nextcloud integration coupling: end-to-end tests now assert genuine two-way OAuth/API coupling for *gitlab*, *mattermost*, *openproject*, *zammad*, *peertube*, *discourse*, *github*, *google*, *jira*, *mastodon*, *matrix*, *moodle* and *suitecrm*, rather than the mere presence of a connect button. All integration OAuth credentials are stored Nextcloud-encrypted via ICrypto (sensitive app values), OpenProject and Zammad secrets survive a re-deploy, and OpenWebUI/Ollama is wired in as a real *integration_openai* chat backend. Bridges with no Nextcloud-33 plugin (Moodle, SuiteCRM) are disabled. +- Nextcloud deploy-variant rebalancing: Discourse and OnlyOffice are each isolated into their own loosely-coupled partner variant, the matrix is repacked to five variants overriding only the dynamic flags, LDAP is enabled wherever SSO is on, and the database is shared outside variant 1. The GitLab 19 OAuth app now carries an organization, and *fileslibreofficeedit* is gated on OnlyOffice absence. +- Storage- and runtime-aware CI variant matrix: variant bundles are split per runner by a storage-aware job splitter driven by an explicit variant CSV, behind a unified variant selector (*variant_select.py*). The default per-bundle storage cap is centralized at 350GB, per-variant memory budgets are guarded against the host budget, shared database providers are enforced by a shared-false-once lint, and the full variant matrix always runs (the earlier runtime time-cut was removed). +- Container resource governance: self-run and shared-provider services declare explicit compose mem/pids limits, container limits were right-sized across roles, and Node-heap services respect a floor via a new *node_max_old_space_size* lookup (Nextcloud whiteboard raised to 1g). A reworked *ressources* CLI emits per-variant and all-role resource summaries, the footprint tool gains a *min_storage* column, and shared services carry a *bond* integration-importance factor. +- Matrix bridges modernized: Signal, Telegram, WhatsApp and Slack bridges migrate to bridgev2 config, the dead mautrix-facebook/instagram bridges are replaced by mautrix-meta, bridge specs are gated by the deployed addon, Synapse loads the bridge registrations from a mounted directory, and the role now tracks *matrix-docker-ansible-deploy* from the spantaleev upstream. +- CA-trust and OIDC-over-self-signed-TLS hardening: the internal CA is installed into the OS bundle for PHP libcurl OIDC (*web-app-pixelfed*, *web-app-joomla*, plus a WordPress must-use plugin), the CA-trust wrapper is kept on probe timeout instead of degrading to env-only, and the CA injection is bounded so it cannot hang the handler. HSTS is now emitted on every response including non-2xx, *ansible-vault encrypt_string* reads plaintext from stdin so leading-dash values encrypt, and Mastodon allows inline *script-src-elem* for its server-rendered SPA. +- Image and dependency version jumps (net since 10.1.1): + - *web-app-erpnext*: v16.23.1 to v16.25.0 + - *web-app-gitlab*: 19.1.0-ee.0 to 19.1.1-ee.0 + - *web-app-opencloud*: 4.0.7 to 7.2.0 + - *web-app-seaweedfs*: 4.35 to 4.36 + - *web-app-matomo*: unpinned *latest* to pinned 5.3.2 (matches the bootstrap installer) + - *web-app-nextcloud* proxy (nginx): unpinned *alpine* to pinned 1.31.2-alpine + - *web-app-nextcloud* whiteboard: unpinned *latest* to pinned v1.5.9 + - *svc-ai-ollama*: switched to the official *ollama* image so inference works + - *web-app-pretix* and *web-app-xwiki*: their inline plugin/extension version pins (2.3.1; 2.19.6, 9.15.7, 1.0) were removed as those addons moved into *meta/addons* + - Dev/CI dependencies: *globals* 15.15.0 to 17.7.0, *@playwright/test* 1.61.0 to 1.61.1, *actions/cache* 5 to 6 + - Intermediate bot bumps were corrected back down: Mattermost 11.8.2 to 11.8.1 and Nextcloud 34 to 33 (kept at 33 because of plugin incompatibilities, same pin as 10.0.0) **Contributors** -* [Kevin Veen-Birkenbach](https://veen.world): unified addon syntax, API single-point-of-truth, Nextcloud integrations and variant rebalancing, CI variant bundling, resource governance, Matrix bridge migration and version maintenance +- [Kevin Veen-Birkenbach](https://veen.world): unified addon syntax, API single-point-of-truth, Nextcloud integrations and variant rebalancing, CI variant bundling, resource governance, Matrix bridge migration and version maintenance ## [10.1.1] - 2026-06-24 -* Disabled the *email* service in the *web-app-pihole* role by pinning *services.email* to a static *enabled: false* / *shared: false* with the matching *dynamic-flag* and *email* nocheck suppressions, removing the now-static email overrides from *meta/variants.yml*, and adding *javascript* true/false variant pins to keep the dynamic-flag matrix-coverage guard green. +- Disabled the *email* service in the *web-app-pihole* role by pinning *services.email* to a static *enabled: false* / *shared: false* with the matching *dynamic-flag* and *email* nocheck suppressions, removing the now-static email overrides from *meta/variants.yml*, and adding *javascript* true/false variant pins to keep the dynamic-flag matrix-coverage guard green. **Contributors** -* [Kevin Veen-Birkenbach](https://veen.world): Pi-hole email service disablement +- [Kevin Veen-Birkenbach](https://veen.world): Pi-hole email service disablement ## [10.1.0] - 2026-06-23 -* New Pi-hole role (*web-app-pihole*) that ships the upstream Pi-hole DNS sinkhole and network-wide ad blocker, with its admin web interface gated behind *oauth2-proxy* and Keycloak RBAC and a native admin-password login (the *FTLCONF* web API password) available as a fallback variant. The upstream resolver and timezone are configurable, the role waits on the Pi-hole HTTP endpoint during deploy, and it is exercised end-to-end with Playwright covering the OAuth2, native-login and guest-access scenarios. The role ships at lifecycle beta. -* Routine maintenance: Docker image version bumps, a dependabot update of *globals* from 15.15.0 to 17.7.0, and minor *services.yml* self-provider flag corrections for ERPNext, GitLab, SeaweedFS and the Playwright end-to-end role. +- New Pi-hole role (*web-app-pihole*) that ships the upstream Pi-hole DNS sinkhole and network-wide ad blocker, with its admin web interface gated behind *oauth2-proxy* and Keycloak RBAC and a native admin-password login (the *FTLCONF* web API password) available as a fallback variant. The upstream resolver and timezone are configurable, the role waits on the Pi-hole HTTP endpoint during deploy, and it is exercised end-to-end with Playwright covering the OAuth2, native-login and guest-access scenarios. The role ships at lifecycle beta. +- Routine maintenance: Docker image version bumps, a dependabot update of *globals* from 15.15.0 to 17.7.0, and minor *services.yml* self-provider flag corrections for ERPNext, GitLab, SeaweedFS and the Playwright end-to-end role. **Contributors** -* [Prageeth Panicker](https://github.com/pragepani): Pi-hole role and its Playwright test suite -* [Kevin Veen-Birkenbach](https://veen.world): Pi-hole role hardening and review +- [Prageeth Panicker](https://github.com/pragepani): Pi-hole role and its Playwright test suite +- [Kevin Veen-Birkenbach](https://veen.world): Pi-hole role hardening and review ## [10.0.1] - 2026-06-19 -* Mark the *web-app-erpnext* role's own *erpnext* provider service with the *playwright-service-flag* self-provider suppression in *meta/services.yml*, fixing the Playwright service-flag integration guard that 10.0.0 tripped by exposing ERPNext as a consumable shared service. +- Mark the *web-app-erpnext* role's own *erpnext* provider service with the *playwright-service-flag* self-provider suppression in *meta/services.yml*, fixing the Playwright service-flag integration guard that 10.0.0 tripped by exposing ERPNext as a consumable shared service. **Contributors** -* [Kevin Veen-Birkenbach](https://veen.world): ERPNext self-provider test fix +- [Kevin Veen-Birkenbach](https://veen.world): ERPNext self-provider test fix ## [10.0.0] - 2026-06-19 -* New engine-agnostic object-store service (*web-app-seaweedfs*, backed by either *SeaweedFS* or *MinIO*) that exposes a shared S3 endpoint, now consumed across 14 web-app roles for media and asset storage. Nextcloud, Decidim, Shopware, PeerTube, Pixelfed, Taiga, Fider, Akaunting, Mobilizon and Matrix route their uploads to the central bucket, each exercised end-to-end with a SeaweedFS consumer check that requires a fresh object key per upload. -* Trusted-header single-sign-on bridges (wave 1) for *web-app-openproject*, *web-app-snipe-it*, *web-app-postmarks* and *web-app-yourls*, with *web-app-baserow* and *web-app-bookwyrm* migrating to the header bridge and dropping their LDAP configuration. The shared proxy (*sys-svc-proxy*) now strips forgeable identity headers on every location to close trusted-header injection. -* ERPNext is exposed as a consumable shared service and renders the Keycloak SSO button on */login* under gunicorn *--preload*. Nextcloud is provisioned on the SeaweedFS S3 object store with a dedicated consumer end-to-end test and has its OIDC plugins gated as mandatory; the upgrade to version 34 is deliberately not carried out because of plugin incompatibilities, so it stays pinned at 33. -* Extensive deploy and end-to-end hardening, much of it reproduced in Docker-in-Docker: native username and password login fallbacks for the no-SSO admin persona across Akaunting, Snipe-IT, YOURLS and OpenProject; OpenProject linked to the LDAP auth source for header SSO to fix a trusted-header 401, with all rails-runner Ruby extracted to dedicated files under *files/ruby/*; Shopware retries asset and theme builds against a restarting SeaweedFS; Mailu retries user creation and waits for antispam readiness before DKIM keygen; YOURLS creates its database schema on deploy; and OpenProject boots db:migrate under Ruby 4.0. -* Routine maintenance: Docker image and git-reference bumps, skills-lock refreshes, and dependabot updates (actions/checkout 6 to 7, @playwright/test 1.60.0 to 1.61.0, eslint 10.4.1 to 10.5.0). +- New engine-agnostic object-store service (*web-app-seaweedfs*, backed by either *SeaweedFS* or *MinIO*) that exposes a shared S3 endpoint, now consumed across 14 web-app roles for media and asset storage. Nextcloud, Decidim, Shopware, PeerTube, Pixelfed, Taiga, Fider, Akaunting, Mobilizon and Matrix route their uploads to the central bucket, each exercised end-to-end with a SeaweedFS consumer check that requires a fresh object key per upload. +- Trusted-header single-sign-on bridges (wave 1) for *web-app-openproject*, *web-app-snipe-it*, *web-app-postmarks* and *web-app-yourls*, with *web-app-baserow* and *web-app-bookwyrm* migrating to the header bridge and dropping their LDAP configuration. The shared proxy (*sys-svc-proxy*) now strips forgeable identity headers on every location to close trusted-header injection. +- ERPNext is exposed as a consumable shared service and renders the Keycloak SSO button on */login* under gunicorn *--preload*. Nextcloud is provisioned on the SeaweedFS S3 object store with a dedicated consumer end-to-end test and has its OIDC plugins gated as mandatory; the upgrade to version 34 is deliberately not carried out because of plugin incompatibilities, so it stays pinned at 33. +- Extensive deploy and end-to-end hardening, much of it reproduced in Docker-in-Docker: native username and password login fallbacks for the no-SSO admin persona across Akaunting, Snipe-IT, YOURLS and OpenProject; OpenProject linked to the LDAP auth source for header SSO to fix a trusted-header 401, with all rails-runner Ruby extracted to dedicated files under *files/ruby/*; Shopware retries asset and theme builds against a restarting SeaweedFS; Mailu retries user creation and waits for antispam readiness before DKIM keygen; YOURLS creates its database schema on deploy; and OpenProject boots db:migrate under Ruby 4.0. +- Routine maintenance: Docker image and git-reference bumps, skills-lock refreshes, and dependabot updates (actions/checkout 6 to 7, @playwright/test 1.60.0 to 1.61.0, eslint 10.4.1 to 10.5.0). **Contributors** -* [Kevin Veen-Birkenbach](https://veen.world): object-store service, trusted-header SSO bridges, role fixes and review +- [Kevin Veen-Birkenbach](https://veen.world): object-store service, trusted-header SSO bridges, role fixes and review ## [9.3.0] - 2026-06-11 -* New Penpot role (web-app-penpot, requirement 235) that ships the upstream Penpot design platform comprising frontend, backend, exporter and Redis at image version 2.5.4, wired into the central Keycloak via OIDC and into the central OpenLDAP. Native local-password login is available as a toggle that is disabled automatically under OIDC, with the native-login and registration flags derived from the SSO flag. A custom JVM truststore imports the Infinito self-signed CA so OIDC over TLS succeeds, and the role is exercised end-to-end with Playwright covering OIDC login, logout and project creation. The local subnet was moved to 192.168.105.192/28 to avoid a collision with the ERPNext range. -* The Matrix role gains an ansible flavor (requirement 025) built on a unified compose template, with full Docker-in-Docker isolation, host-network mode cascaded to the addons and Jitsi, a central Postgres backend sharing the MATRIX_POSTGRES variables, and a central coturn aligned to the shared coturn variables for the MASH role. A dedicated MDAD runner image (python 3.13-slim with docker 28.0.4 CLI, migration validated against v2026.05.18.0) mounts the Infinito self-signed CA into both the runner and Synapse, and bootstrap now recovers cleanly from a stale marker. -* Smaller role fixes: ERPNext bypasses the v16 setup wizard per app and clears the Frappe cache after applying social-login, LDAP and email configuration; Friendica strips a trailing slash from the base URL and makes the admin-follow Playwright test idempotent; Funkwhale starts its API with gunicorn and binds the port. -* Routine maintenance: a lint that enforces a parameterised FROM in role Dockerfiles, a re-sync of the Claude settings allow-list with upstream, git references bumped to the latest semver tags (Bluesky 1.122.0 to 1.123.0, Bookwyrm v0.8.6 to v0.8.7), and Docker image version bumps across ERPNext v15.45.0 to v16.22.0, Friendica 2026.01 to 2026.05, Funkwhale 2.0.2 to 2.0.4, GitLab 19.0.1-ee.0 to 19.0.2-ee.0, Mattermost 11.7.2 to 11.8.0, OpenTalk v1.12.0 to v1.13.1, Prometheus v0.32.1 to v0.32.2, Shopware 3.6.0 to 3.7.0, MariaDB 12.2 to 12.3 and CoreDNS 1.14.3 to 1.14.4. +- New Penpot role (web-app-penpot, requirement 235) that ships the upstream Penpot design platform comprising frontend, backend, exporter and Redis at image version 2.5.4, wired into the central Keycloak via OIDC and into the central OpenLDAP. Native local-password login is available as a toggle that is disabled automatically under OIDC, with the native-login and registration flags derived from the SSO flag. A custom JVM truststore imports the Infinito self-signed CA so OIDC over TLS succeeds, and the role is exercised end-to-end with Playwright covering OIDC login, logout and project creation. The local subnet was moved to 192.168.105.192/28 to avoid a collision with the ERPNext range. +- The Matrix role gains an ansible flavor (requirement 025) built on a unified compose template, with full Docker-in-Docker isolation, host-network mode cascaded to the addons and Jitsi, a central Postgres backend sharing the MATRIX_POSTGRES variables, and a central coturn aligned to the shared coturn variables for the MASH role. A dedicated MDAD runner image (python 3.13-slim with docker 28.0.4 CLI, migration validated against v2026.05.18.0) mounts the Infinito self-signed CA into both the runner and Synapse, and bootstrap now recovers cleanly from a stale marker. +- Smaller role fixes: ERPNext bypasses the v16 setup wizard per app and clears the Frappe cache after applying social-login, LDAP and email configuration; Friendica strips a trailing slash from the base URL and makes the admin-follow Playwright test idempotent; Funkwhale starts its API with gunicorn and binds the port. +- Routine maintenance: a lint that enforces a parameterised FROM in role Dockerfiles, a re-sync of the Claude settings allow-list with upstream, git references bumped to the latest semver tags (Bluesky 1.122.0 to 1.123.0, Bookwyrm v0.8.6 to v0.8.7), and Docker image version bumps across ERPNext v15.45.0 to v16.22.0, Friendica 2026.01 to 2026.05, Funkwhale 2.0.2 to 2.0.4, GitLab 19.0.1-ee.0 to 19.0.2-ee.0, Mattermost 11.7.2 to 11.8.0, OpenTalk v1.12.0 to v1.13.1, Prometheus v0.32.1 to v0.32.2, Shopware 3.6.0 to 3.7.0, MariaDB 12.2 to 12.3 and CoreDNS 1.14.3 to 1.14.4. **Contributors** -* [Evangelos Tsakoudis](https://evangelostsak.com): Penpot role and its end-to-end test suite -* [Kevin Veen-Birkenbach](https://veen.world): Matrix ansible flavor, role fixes and review +- [Evangelos Tsakoudis](https://evangelostsak.com): Penpot role and its end-to-end test suite +- [Kevin Veen-Birkenbach](https://veen.world): Matrix ansible flavor, role fixes and review ## [9.2.0] - 2026-06-03 -* New ERPNext role that ships the upstream Frappe Framework v15 stack as a web-app-erpnext role β€” backend, frontend, websocket, scheduler and two queue workers β€” wired into the central Keycloak via a built-in Keycloak Social Login Key and into the central OpenLDAP via the LDAP Settings doctype. The three-variant matrix (SSO plus LDAP, no auth, LDAP only) is exercised end-to-end and a repo-wide lint caps Ansible task names at 120 characters. -* New Jitsi Meet role that adds an oauth2-proxy gated meeting surface plus matching LDAP-variant Playwright coverage. The spec layout is reorganised into a shared module and per-scenario test files so future scenarios can be added without touching the monolith. -* Outbound mail and Nix install resilience: the dev-nix role guards its set_fact against getent returning None on hosts without an nixbld group, and the host-stack mail health checks keep behaving cleanly on minimal images. -* Routine maintenance: Docker image version bumps including Friendica 2026.01, eslint 10.4.0 to 10.4.1, and a dockerignore re-sync after the recent claude hooks addition. +- New ERPNext role that ships the upstream Frappe Framework v15 stack as a web-app-erpnext role β€” backend, frontend, websocket, scheduler and two queue workers β€” wired into the central Keycloak via a built-in Keycloak Social Login Key and into the central OpenLDAP via the LDAP Settings doctype. The three-variant matrix (SSO plus LDAP, no auth, LDAP only) is exercised end-to-end and a repo-wide lint caps Ansible task names at 120 characters. +- New Jitsi Meet role that adds an oauth2-proxy gated meeting surface plus matching LDAP-variant Playwright coverage. The spec layout is reorganised into a shared module and per-scenario test files so future scenarios can be added without touching the monolith. +- Outbound mail and Nix install resilience: the dev-nix role guards its set_fact against getent returning None on hosts without an nixbld group, and the host-stack mail health checks keep behaving cleanly on minimal images. +- Routine maintenance: Docker image version bumps including Friendica 2026.01, eslint 10.4.0 to 10.4.1, and a dockerignore re-sync after the recent claude hooks addition. **Contributors** -* Release maintained by Kevin Veen-Birkenbach, . +- Release maintained by Kevin Veen-Birkenbach, . ## [9.1.0] - 2026-06-01 -* More robust Nix installer on Debian, Ubuntu, Fedora and CentOS systems: stale nixbld users from earlier installation attempts are cleaned up before the multi-user installer runs, and a long-standing crash on hosts where the nixbld group is absent has been resolved. -* Outbound mail health checks no longer fail silently on minimal container images: the heartbeat-email script copes with images that ship without the hostname binary, and the SSL trust file path is detected automatically across Red Hat, Debian, Ubuntu, Alpine and NixOS layouts. -* The Zammad helpdesk role completes its single-sign-on schema unification, with the variant matrix and Playwright test suite brought in line with the new shape. -* Internal infrastructure cleanups: re-synchronised .dockerignore and a shifted weekly CI schedule. +- More robust Nix installer on Debian, Ubuntu, Fedora and CentOS systems: stale nixbld users from earlier installation attempts are cleaned up before the multi-user installer runs, and a long-standing crash on hosts where the nixbld group is absent has been resolved. +- Outbound mail health checks no longer fail silently on minimal container images: the heartbeat-email script copes with images that ship without the hostname binary, and the SSL trust file path is detected automatically across Red Hat, Debian, Ubuntu, Alpine and NixOS layouts. +- The Zammad helpdesk role completes its single-sign-on schema unification, with the variant matrix and Playwright test suite brought in line with the new shape. +- Internal infrastructure cleanups: re-synchronised .dockerignore and a shifted weekly CI schedule. **Contributors** -* Release maintained by [Kevin Veen-Birkenbach](https://veen.world). +- Release maintained by [Kevin Veen-Birkenbach](https://veen.world). ## [9.0.2] - 2026-05-29 -* Restores the Debian dev-image build by introducing the INFINITO_VENV_DIR SPOT and calling infinito via its absolute venv path in scripts/docker/entry.sh, so the post-`make install` version check no longer trips on the PATH that bash -lc clobbers via /etc/profile; also scopes the auto-update PR dedup fingerprint to the files a run actually committed (instead of the whole commit tree) so unrelated drift on main no longer forces a fresh PR on every daily cron, nests web-app-bluesky's nocheck markers under the acl block they describe, and rolls up dependabot bumps (actions/cache 4β†’5, actions/setup-node 4β†’6) plus routine Docker image / git ref refreshes. +- Restores the Debian dev-image build by introducing the INFINITO_VENV_DIR SPOT and calling infinito via its absolute venv path in scripts/docker/entry.sh, so the post-`make install` version check no longer trips on the PATH that bash -lc clobbers via /etc/profile; also scopes the auto-update PR dedup fingerprint to the files a run actually committed (instead of the whole commit tree) so unrelated drift on main no longer forces a fresh PR on every daily cron, nests web-app-bluesky's nocheck markers under the acl block they describe, and rolls up dependabot bumps (actions/cache 4β†’5, actions/setup-node 4β†’6) plus routine Docker image / git ref refreshes. ## [9.0.1] - 2026-05-28 -* CI pipeline pass: PR flow now gates the env-matrix via a new detect-affected-roles resolver (skipped on role-only diffs); push CI skipped when an open PR exists (with 20s race retry for bot branches); pip cache + python 3.12 across all 16 workflows, plus npm and ansible-galaxy caches where missing. Update bot now deletes its own branches when closing superseded PRs. +- CI pipeline pass: PR flow now gates the env-matrix via a new detect-affected-roles resolver (skipped on role-only diffs); push CI skipped when an open PR exists (with 20s race retry for bot branches); pip cache + python 3.12 across all 16 workflows, plus npm and ansible-galaxy caches where missing. Update bot now deletes its own branches when closing superseded PRs. ## [9.0.0] - 2026-05-28 -* Collapses the parallel **oauth2** and **oidc** top-level blocks in every role *meta/services.yml* into a single *services.sso* block with a **flavor** discriminator (*oidc* | *oauth2* | *saml*, default *oidc*). Flavor-specific keys live under *sso.* (*sso.oauth2.{origin,acl,allowed_groups}*, *sso.oidc.plugin*). +- Collapses the parallel **oauth2** and **oidc** top-level blocks in every role *meta/services.yml* into a single *services.sso* block with a **flavor** discriminator (*oidc* | *oauth2* | *saml*, default *oidc*). Flavor-specific keys live under *sso.* (*sso.oauth2.{origin,acl,allowed_groups}*, *sso.oidc.plugin*). **Removed** -* The dedicated oauth2-proxy provider role (its directory under *roles/*) is deleted; the 5 sidecar templates and the per-consumer render task fold into **web-app-keycloak** (*templates/sso_proxy/*, *tasks/sso_proxy.yml*). **web-app-keycloak** now declares **provides: sso**. -* The two mutual-exclusion guards (*tests/integration/iam/oauth2_oidc/test_mutual_exclusive.py*, *test_acl_mutual_exclusive.py*) β€” obsolete under the single-block schema. +- The dedicated oauth2-proxy provider role (its directory under *roles/*) is deleted; the 5 sidecar templates and the per-consumer render task fold into **web-app-keycloak** (*templates/sso_proxy/*, *tasks/sso_proxy.yml*). **web-app-keycloak** now declares **provides: sso**. +- The two mutual-exclusion guards (*tests/integration/iam/oauth2_oidc/test_mutual_exclusive.py*, *test_acl_mutual_exclusive.py*) β€” obsolete under the single-block schema. **Added** -* *utils/roles/applications/services/sso.py* β€” central resolver for **is_enabled** / **is_proxy_gated** / **is_oidc_native** plus the oauth2 sub-values (*oauth2_origin_{host,port}*, *oauth2_acl*, *oauth2_allowed_groups*). -* Three lookup plugins on top of the resolver: **sso** (single-app predicate access), **sso_proxy_consumers** (enumerates oauth2-flavored consumers), **sso_oidc_plugin** (renamed from **oidc_flavor**, Nextcloud selector). -* *tests/lint/repository/no_legacy_sso_paths/* static guard against the legacy strings re-entering the source tree. +- *utils/roles/applications/services/sso.py* β€” central resolver for **is_enabled** / **is_proxy_gated** / **is_oidc_native** plus the oauth2 sub-values (*oauth2_origin_{host,port}*, *oauth2_acl*, *oauth2_allowed_groups*). +- Three lookup plugins on top of the resolver: **sso** (single-app predicate access), **sso_proxy_consumers** (enumerates oauth2-flavored consumers), **sso_oidc_plugin** (renamed from **oidc_flavor**, Nextcloud selector). +- *tests/lint/repository/no_legacy_sso_paths/* static guard against the legacy strings re-entering the source tree. **Renamed** -* *services..ports.local.oauth2* β†’ *ports.local.sso* -* *PORT_BANDS.local.oauth2* β†’ *PORT_BANDS.local.sso* -* **OAUTH2_PROXY_\*** env / Jinja vars β†’ **SSO_PROXY_\*** -* *oauth2_proxy_cookie_secret* β†’ *sso_proxy_cookie_secret* -* **OAUTH2_SERVICE_ENABLED** + **OIDC_SERVICE_ENABLED** β†’ single **SSO_SERVICE_ENABLED** -* Playwright gating helpers (*isServiceEnabled*, *skipUnlessServiceEnabled*, *requireService*, *safeIsEnabled*, *safeSkipUnlessEnabled*) move from service *oidc* / *oauth2* to *sso* -* *test_oauth2_contract.py* β†’ *test_sso_contract.py* +- *services..ports.local.oauth2* β†’ *ports.local.sso* +- *PORT_BANDS.local.oauth2* β†’ *PORT_BANDS.local.sso* +- **OAUTH2_PROXY_\*** env / Jinja vars β†’ **SSO_PROXY_\*** +- *oauth2_proxy_cookie_secret* β†’ *sso_proxy_cookie_secret* +- **OAUTH2_SERVICE_ENABLED** + **OIDC_SERVICE_ENABLED** β†’ single **SSO_SERVICE_ENABLED** +- Playwright gating helpers (*isServiceEnabled*, *skipUnlessServiceEnabled*, *requireService*, *safeIsEnabled*, *safeSkipUnlessEnabled*) move from service *oidc* / *oauth2* to *sso* +- *test_oauth2_contract.py* β†’ *test_sso_contract.py* **Changed** -* **sys-stk-backend**, **sys-svc-compose**, **sys-svc-proxy** and *plugins/filter/compose_volumes.py* now gate on **lookup(sso, …, is_proxy_gated)** instead of hand-combining **enabled** + **flavor**. -* Dual-block resolution: **web-app-bookwyrm** pinned to **flavor: oauth2**; **web-app-gitea** and **web-app-friendica** keep **flavor: oauth2** with the existing *oauth2.acl.blacklist* (*/user/login*) and *oauth2.acl.whitelist* (federation + discovery endpoints) β€” operative oauth2-proxy gating preserved. +- **sys-stk-backend**, **sys-svc-compose**, **sys-svc-proxy** and *plugins/filter/compose_volumes.py* now gate on **lookup(sso, …, is_proxy_gated)** instead of hand-combining **enabled** + **flavor**. +- Dual-block resolution: **web-app-bookwyrm** pinned to **flavor: oauth2**; **web-app-gitea** and **web-app-friendica** keep **flavor: oauth2** with the existing *oauth2.acl.blacklist* (*/user/login*) and *oauth2.acl.whitelist* (federation + discovery endpoints) β€” operative oauth2-proxy gating preserved. **Migration** @@ -974,60 +1138,60 @@ End-to-end against *web-app-{keycloak,nextcloud,bookwyrm,gitea,friendica,dashboa **Contributors** -* [Kevin Veen-Birkenbach](https://www.veen.world/) +- [Kevin Veen-Birkenbach](https://www.veen.world/) ## [8.0.5] - 2026-05-28 -* Adds --version / -V flag to the infinito CLI, drops a dead Compose-CLI reference link, and fixes the dev-deploy router so per-invocation routing knobs (apps, mode, purge, bundles, disable, full_cycle, variant) no longer leak into the persistent .env and the make-alias / env-var surface is unified 1:1. +- Adds --version / -V flag to the infinito CLI, drops a dead Compose-CLI reference link, and fixes the dev-deploy router so per-invocation routing knobs (apps, mode, purge, bundles, disable, full_cycle, variant) no longer leak into the persistent .env and the make-alias / env-var surface is unified 1:1. ## Older Releases -* [008.000.004-2026-05-28.md](docs/changelog/008.000.004-2026-05-28.md) -* [008.000.003-2026-05-28.md](docs/changelog/008.000.003-2026-05-28.md) -* [008.000.002-2026-05-28.md](docs/changelog/008.000.002-2026-05-28.md) -* [008.000.001-2026-05-28.md](docs/changelog/008.000.001-2026-05-28.md) -* [008.000.000-2026-05-27.md](docs/changelog/008.000.000-2026-05-27.md) -* [007.000.000-2026-05-08.md](docs/changelog/007.000.000-2026-05-08.md) -* [006.000.000-2026-04-25.md](docs/changelog/006.000.000-2026-04-25.md) -* [005.002.000-2026-03-21.md](docs/changelog/005.002.000-2026-03-21.md) -* [005.001.000-2026-02-28.md](docs/changelog/005.001.000-2026-02-28.md) -* [005.000.000-2026-02-25.md](docs/changelog/005.000.000-2026-02-25.md) -* [004.001.000-2026-02-17.md](docs/changelog/004.001.000-2026-02-17.md) -* [004.000.003-2026-02-16.md](docs/changelog/004.000.003-2026-02-16.md) -* [004.000.002-2026-02-15.md](docs/changelog/004.000.002-2026-02-15.md) -* [004.000.001-2026-02-15.md](docs/changelog/004.000.001-2026-02-15.md) -* [004.000.000-2026-02-13.md](docs/changelog/004.000.000-2026-02-13.md) -* [003.000.000-2026-02-11.md](docs/changelog/003.000.000-2026-02-11.md) -* [002.001.009-2026-02-10.md](docs/changelog/002.001.009-2026-02-10.md) -* [002.001.008-2026-02-09.md](docs/changelog/002.001.008-2026-02-09.md) -* [002.001.007-2026-02-09.md](docs/changelog/002.001.007-2026-02-09.md) -* [002.001.006-2026-02-09.md](docs/changelog/002.001.006-2026-02-09.md) -* [002.001.005-2026-02-09.md](docs/changelog/002.001.005-2026-02-09.md) -* [002.001.004-2026-02-08.md](docs/changelog/002.001.004-2026-02-08.md) -* [002.001.003-2026-02-08.md](docs/changelog/002.001.003-2026-02-08.md) -* [002.001.002-2026-02-08.md](docs/changelog/002.001.002-2026-02-08.md) -* [002.001.001-2026-02-08.md](docs/changelog/002.001.001-2026-02-08.md) -* [002.001.000-2026-02-08.md](docs/changelog/002.001.000-2026-02-08.md) -* [002.000.000-2026-02-08.md](docs/changelog/002.000.000-2026-02-08.md) -* [001.000.000-2026-02-03.md](docs/changelog/001.000.000-2026-02-03.md) -* [000.012.000-2026-01-25.md](docs/changelog/000.012.000-2026-01-25.md) -* [000.011.000-2026-01-10.md](docs/changelog/000.011.000-2026-01-10.md) -* [000.010.000-2026-01-08.md](docs/changelog/000.010.000-2026-01-08.md) -* [000.009.000-2026-01-07.md](docs/changelog/000.009.000-2026-01-07.md) -* [000.008.000-2026-01-06.md](docs/changelog/000.008.000-2026-01-06.md) -* [000.007.002-2026-01-06.md](docs/changelog/000.007.002-2026-01-06.md) -* [000.007.001-2026-01-06.md](docs/changelog/000.007.001-2026-01-06.md) -* [000.007.000-2026-01-05.md](docs/changelog/000.007.000-2026-01-05.md) -* [000.006.000-2025-12-31.md](docs/changelog/000.006.000-2025-12-31.md) -* [000.005.000-2025-12-30.md](docs/changelog/000.005.000-2025-12-30.md) -* [000.004.000-2025-12-29.md](docs/changelog/000.004.000-2025-12-29.md) -* [000.003.005-2025-12-21.md](docs/changelog/000.003.005-2025-12-21.md) -* [000.003.004-2025-12-21.md](docs/changelog/000.003.004-2025-12-21.md) -* [000.003.003-2025-12-21.md](docs/changelog/000.003.003-2025-12-21.md) -* [000.003.002-2025-12-19.md](docs/changelog/000.003.002-2025-12-19.md) -* [000.003.001-2025-12-18.md](docs/changelog/000.003.001-2025-12-18.md) -* [000.003.000-2025-12-17.md](docs/changelog/000.003.000-2025-12-17.md) -* [000.002.001-2025-12-10.md](docs/changelog/000.002.001-2025-12-10.md) -* [000.002.000-2025-12-10.md](docs/changelog/000.002.000-2025-12-10.md) -* [000.001.001-2025-12-10.md](docs/changelog/000.001.001-2025-12-10.md) -* [000.001.000-2025-12-09.md](docs/changelog/000.001.000-2025-12-09.md) +- [008.000.004-2026-05-28.md](docs/changelog/008.000.004-2026-05-28.md) +- [008.000.003-2026-05-28.md](docs/changelog/008.000.003-2026-05-28.md) +- [008.000.002-2026-05-28.md](docs/changelog/008.000.002-2026-05-28.md) +- [008.000.001-2026-05-28.md](docs/changelog/008.000.001-2026-05-28.md) +- [008.000.000-2026-05-27.md](docs/changelog/008.000.000-2026-05-27.md) +- [007.000.000-2026-05-08.md](docs/changelog/007.000.000-2026-05-08.md) +- [006.000.000-2026-04-25.md](docs/changelog/006.000.000-2026-04-25.md) +- [005.002.000-2026-03-21.md](docs/changelog/005.002.000-2026-03-21.md) +- [005.001.000-2026-02-28.md](docs/changelog/005.001.000-2026-02-28.md) +- [005.000.000-2026-02-25.md](docs/changelog/005.000.000-2026-02-25.md) +- [004.001.000-2026-02-17.md](docs/changelog/004.001.000-2026-02-17.md) +- [004.000.003-2026-02-16.md](docs/changelog/004.000.003-2026-02-16.md) +- [004.000.002-2026-02-15.md](docs/changelog/004.000.002-2026-02-15.md) +- [004.000.001-2026-02-15.md](docs/changelog/004.000.001-2026-02-15.md) +- [004.000.000-2026-02-13.md](docs/changelog/004.000.000-2026-02-13.md) +- [003.000.000-2026-02-11.md](docs/changelog/003.000.000-2026-02-11.md) +- [002.001.009-2026-02-10.md](docs/changelog/002.001.009-2026-02-10.md) +- [002.001.008-2026-02-09.md](docs/changelog/002.001.008-2026-02-09.md) +- [002.001.007-2026-02-09.md](docs/changelog/002.001.007-2026-02-09.md) +- [002.001.006-2026-02-09.md](docs/changelog/002.001.006-2026-02-09.md) +- [002.001.005-2026-02-09.md](docs/changelog/002.001.005-2026-02-09.md) +- [002.001.004-2026-02-08.md](docs/changelog/002.001.004-2026-02-08.md) +- [002.001.003-2026-02-08.md](docs/changelog/002.001.003-2026-02-08.md) +- [002.001.002-2026-02-08.md](docs/changelog/002.001.002-2026-02-08.md) +- [002.001.001-2026-02-08.md](docs/changelog/002.001.001-2026-02-08.md) +- [002.001.000-2026-02-08.md](docs/changelog/002.001.000-2026-02-08.md) +- [002.000.000-2026-02-08.md](docs/changelog/002.000.000-2026-02-08.md) +- [001.000.000-2026-02-03.md](docs/changelog/001.000.000-2026-02-03.md) +- [000.012.000-2026-01-25.md](docs/changelog/000.012.000-2026-01-25.md) +- [000.011.000-2026-01-10.md](docs/changelog/000.011.000-2026-01-10.md) +- [000.010.000-2026-01-08.md](docs/changelog/000.010.000-2026-01-08.md) +- [000.009.000-2026-01-07.md](docs/changelog/000.009.000-2026-01-07.md) +- [000.008.000-2026-01-06.md](docs/changelog/000.008.000-2026-01-06.md) +- [000.007.002-2026-01-06.md](docs/changelog/000.007.002-2026-01-06.md) +- [000.007.001-2026-01-06.md](docs/changelog/000.007.001-2026-01-06.md) +- [000.007.000-2026-01-05.md](docs/changelog/000.007.000-2026-01-05.md) +- [000.006.000-2025-12-31.md](docs/changelog/000.006.000-2025-12-31.md) +- [000.005.000-2025-12-30.md](docs/changelog/000.005.000-2025-12-30.md) +- [000.004.000-2025-12-29.md](docs/changelog/000.004.000-2025-12-29.md) +- [000.003.005-2025-12-21.md](docs/changelog/000.003.005-2025-12-21.md) +- [000.003.004-2025-12-21.md](docs/changelog/000.003.004-2025-12-21.md) +- [000.003.003-2025-12-21.md](docs/changelog/000.003.003-2025-12-21.md) +- [000.003.002-2025-12-19.md](docs/changelog/000.003.002-2025-12-19.md) +- [000.003.001-2025-12-18.md](docs/changelog/000.003.001-2025-12-18.md) +- [000.003.000-2025-12-17.md](docs/changelog/000.003.000-2025-12-17.md) +- [000.002.001-2025-12-10.md](docs/changelog/000.002.001-2025-12-10.md) +- [000.002.000-2025-12-10.md](docs/changelog/000.002.000-2025-12-10.md) +- [000.001.001-2025-12-10.md](docs/changelog/000.001.001-2025-12-10.md) +- [000.001.000-2025-12-09.md](docs/changelog/000.001.000-2025-12-09.md) diff --git a/Makefile b/Makefile index 2293dcfdcc..913e8f8df6 100644 --- a/Makefile +++ b/Makefile @@ -844,6 +844,8 @@ SWARM_ARCH = $(or $(arch),$(shell bash scripts/meta/resolve/architecture.sh)) # Param distros: optional single distro the cluster runs on (default: INFINITO_DISTRO from .env). # Param variant: optional matrix variant index to deploy (default 0); a multi-variant app runs one cluster per swarm-zombie, so pick the round to validate. # Param disable: optional comma-separated provider keys removed from the test inventory (e.g. matomo,dashboard,prometheus,email,css). +# Param vpn: optional WireGuard axis (auto|enforced|disabled); default disabled. +# Param meshes: optional WireGuard layout a meshed round deploys (default INFINITO_SWARM_MESHES). # Param name: optional cluster-id prefix for the container + network names; release with the same name=. # Param arch: architecture the cluster deploys on, amd64 | arm64 (default: the host's own). # Param step_timeout: optional minute budget for the matrix-deploy step (default 690). @@ -869,7 +871,7 @@ swarm-zombie: install-act ACT_WORKFLOW=.github/workflows/call-test-deploy.yml \ ACT_JOB=deploy \ ACT_MATRIX="apps:$(app);variant:$(or $(variant),0);mode:swarm" \ - ACT_INPUTS="whitelist=$(app)#$(or $(variant),0)@swarm distros=$(SWARM_DISTROS) index=0 sweep=0 modes=swarm disable=$(disable) architectures=$(SWARM_ARCH)" \ + ACT_INPUTS="whitelist=$(app)#$(or $(variant),0)@swarm distros=$(SWARM_DISTROS) index=0 sweep=0 modes=swarm vpn=$(or $(vpn),disabled) meshes=$(meshes) disable=$(disable) architectures=$(SWARM_ARCH)" \ bash scripts/tests/deploy/act/workflow.sh .PHONY: system-purge diff --git a/README.md b/README.md index 10a80bd7ff..594453a697 100644 --- a/README.md +++ b/README.md @@ -21,31 +21,31 @@ ## Key Features 🎯 -* **Automated Deployment** πŸ“¦ +- **Automated Deployment** πŸ“¦ Turn up servers and workstations in minutes with ready-made Ansible roles. -* **Enterprise-Grade Security** πŸ”’ +- **Enterprise-Grade Security** πŸ”’ Centralized user management via LDAP & OIDC (Keycloak), plus optional 2FA and encrypted storage. -* **Modular Scalability** πŸ“ˆ +- **Modular Scalability** πŸ“ˆ Grow from small teams to global enterprises by composing only the services you need. -* **Fediverse & ActivityPub Support** 🌐 +- **Fediverse & ActivityPub Support** 🌐 Seamlessly integrate Mastodon, Peertube, Matrix and other ActivityPub apps out of the box. -* **Self-Healing & Maintenance** βš™οΈ +- **Self-Healing & Maintenance** βš™οΈ Automated cleanup, container healing, and auto-updates keep infrastructure healthy without human intervention. -* **Monitoring, Alerting & Analytics** πŸ“Š +- **Monitoring, Alerting & Analytics** πŸ“Š Built-in system, application, and security monitoring with multi-channel notifications. -* **Backup & Disaster Recovery** πŸ’Ύ +- **Backup & Disaster Recovery** πŸ’Ύ Scheduled backups and scripted recovery processes to safeguard your data. -* **Continuous Updates** πŸ”„ +- **Continuous Updates** πŸ”„ Automatic patching and version upgrades across the stack. -* **Application Ecosystem** πŸš€ +- **Application Ecosystem** πŸš€ A curated suite of self-hosted apps, from **project management**, **version control**, and **CI/CD** to **chat**, **video conferencing**, **CMS**, **e-learning**, **social networking**, and **e-commerce**, all seamlessly integrated. --- @@ -200,13 +200,11 @@ Every invokable role in the tested lifecycle envelope, with its upstream homepag | [Translation Gateway](roles/web-svc-translate/) | beta | One translation endpoint that picks the engine itself and prefers a reviewed human string | [🌐](https://s.infinito.nexus/code) [πŸ› οΈ](roles/web-svc-translate/README.md#quick-setup) | [Keycloak](roles/web-app-keycloak/), [LibreTranslate Engine](roles/svc-ai-libretranslate-engine/), [LiteLLM Gateway](roles/svc-ai-litellm/), [LTEngine](roles/svc-ai-ltengine/), [Ollama](roles/svc-ai-ollama/), [PostgreSQL](roles/svc-db-postgres/), [Prometheus](roles/web-app-prometheus/), [System One](roles/svc-ai-s1/), [Tor Onion Service](roles/svc-net-tor/), [Universal Logout](roles/web-svc-logout/), [Weblate](roles/web-app-weblate/) | | [Typesense](roles/svc-db-typesense/) | beta | Central Dockerized search engine shared by multiple apps with per-consumer scoped API keys | [🌐](https://typesense.org/) [πŸ› οΈ](roles/svc-db-typesense/README.md#quick-setup) | [Backup Docker Volumes](roles/svc-bkp-volume-2-local/), [Tor Onion Service](roles/svc-net-tor/) | | [Unbound](roles/svc-dns-unbound/) | beta | Central recursive/forwarding DNSSEC resolver on a static IP for consumer stacks to target as their DNS | [🌐](https://nlnetlabs.nl/projects/unbound/about/) [πŸ› οΈ](roles/svc-dns-unbound/README.md#quick-setup) | | -| [Universal Logout](roles/web-svc-logout/) | beta | Central logout proxy for single-action sign-out across all OIDC-connected apps, with Nginx snippets and a live status UI | [πŸ› οΈ](roles/web-svc-logout/README.md#quick-setup) | [Corporate Design](roles/web-svc-design/), [Matomo](roles/web-app-matomo/), [Prometheus](roles/web-app-prometheus/), [Tor Onion Service](roles/svc-net-tor/) | -| [web-app-pihole](roles/web-app-pihole/) | beta | Network-wide DNS sinkhole for blocking ads and trackers across all devices, with DHCP and a web admin dashboard | [🌐](https://pi-hole.net/) [🎬](https://youtu.be/KBXTnrD_Zs4) [πŸ› οΈ](roles/web-app-pihole/README.md#quick-setup) | [Backup Docker Volumes](roles/svc-bkp-volume-2-local/), [Content Delivery Network](roles/web-svc-cdn/), [Corporate Design](roles/web-svc-design/), [Dashboard](roles/web-app-dashboard/), [Keycloak](roles/web-app-keycloak/), [Matomo](roles/web-app-matomo/), [Prometheus](roles/web-app-prometheus/), [Redis](roles/svc-db-redis/), [Tor Onion Service](roles/svc-net-tor/), [Universal Logout](roles/web-svc-logout/) | +| [Universal Logout](roles/web-svc-logout/) | beta | Central logout proxy for single-action sign-out across all OIDC-connected apps, with Nginx snippets and a live status UI | [πŸ› οΈ](roles/web-svc-logout/README.md#quick-setup) | [Corporate Design](roles/web-svc-css/), [Matomo](roles/web-app-matomo/), [Prometheus](roles/web-app-prometheus/), [Tor Onion Service](roles/svc-net-tor/) | +| [web-app-pihole](roles/web-app-pihole/) | beta | Network-wide DNS sinkhole for blocking ads and trackers across all devices, with DHCP and a web admin dashboard | [🌐](https://pi-hole.net/) [🎬](https://youtu.be/KBXTnrD_Zs4) [πŸ› οΈ](roles/web-app-pihole/README.md#quick-setup) | [Backup Docker Volumes](roles/svc-bkp-volume-2-local/), [Content Delivery Network](roles/web-svc-cdn/), [Corporate Design](roles/web-svc-css/), [Dashboard](roles/web-app-dashboard/), [Keycloak](roles/web-app-keycloak/), [Matomo](roles/web-app-matomo/), [Prometheus](roles/web-app-prometheus/), [Tor Onion Service](roles/svc-net-tor/), [Universal Logout](roles/web-svc-logout/) | | [Weblate](roles/web-app-weblate/) | beta | Translation memory, glossaries and the human review workflow behind the translation gateway | [🌐](https://weblate.org/) [πŸ› οΈ](roles/web-app-weblate/README.md#quick-setup) | [Backup Docker Volumes](roles/svc-bkp-volume-2-local/), [Corporate Design](roles/web-svc-design/), [Dashboard](roles/web-app-dashboard/), [Keycloak](roles/web-app-keycloak/), [Matomo](roles/web-app-matomo/), [PostgreSQL](roles/svc-db-postgres/), [Prometheus](roles/web-app-prometheus/), [Redis](roles/svc-db-redis/), [Stalwart Mail Server](roles/web-app-stalwart/), [Tor Onion Service](roles/svc-net-tor/), [Translation Gateway](roles/web-svc-translate/), [Universal Logout](roles/web-svc-logout/) | -| [Wireguard](roles/svc-net-wireguard-core/) | alpha | Host-level WireGuard VPN service with wg-quick config, package install, and IP-forwarding sysctl for secure tunnels | [🌐](https://www.wireguard.com/) [πŸ› οΈ](roles/svc-net-wireguard-core/README.md#quick-setup) | | -| [Wireguard Client](roles/svc-net-wireguard-plain/) | alpha | Client-side WireGuard VPN role for stable connectivity with a systemd service and script that tune interface MTU | [🌐](https://www.wireguard.com/) [πŸ› οΈ](roles/svc-net-wireguard-plain/README.md#quick-setup) | | -| [WireGuard Client behind NAT](roles/svc-net-wireguard-firewalled/) | alpha | Networking helper for iptables forwarding and NAT masquerading of a WireGuard client running behind NAT or a firewall | [πŸ› οΈ](roles/svc-net-wireguard-firewalled/README.md#quick-setup) | | -| [WordPress](roles/web-app-wordpress/) | beta | Content management system for building and managing websites, blogs, and multisite networks with themes and plugins | [🌐](https://wordpress.org/) [🎬](https://www.youtube.com/watch?v=QU8GFqvXRxE) [πŸ› οΈ](roles/web-app-wordpress/README.md#quick-setup) | [Backup Docker Volumes](roles/svc-bkp-volume-2-local/), [BigBlueButton](roles/web-app-bigbluebutton/), [Corporate Design](roles/web-svc-design/), [Dashboard](roles/web-app-dashboard/), [Discourse](roles/web-app-discourse/), [Hermes Agent](roles/web-app-hermes/), [Keycloak](roles/web-app-keycloak/), [Listmonk](roles/web-app-listmonk/), [LiteLLM Gateway](roles/svc-ai-litellm/), [MariaDB](roles/svc-db-mariadb/), [Matomo](roles/web-app-matomo/), [OpenClaw](roles/web-app-openclaw/), [PeerTube](roles/web-app-peertube/), [Prometheus](roles/web-app-prometheus/), [Stalwart Mail Server](roles/web-app-stalwart/), [Tor Onion Service](roles/svc-net-tor/), [Translation Gateway](roles/web-svc-translate/), [Universal Logout](roles/web-svc-logout/) | +| [WireGuard](roles/svc-net-wireguard/) | beta | Kernel WireGuard tunnels, hub-and-spoke meshes under a swarm manager and full meshes between Compose hosts | [🌐](https://www.wireguard.com/) [πŸ› οΈ](roles/svc-net-wireguard/README.md#quick-setup) | | +| [WordPress](roles/web-app-wordpress/) | beta | Content management system for building and managing websites, blogs, and multisite networks with themes and plugins | [🌐](https://wordpress.org/) [🎬](https://www.youtube.com/watch?v=QU8GFqvXRxE) [πŸ› οΈ](roles/web-app-wordpress/README.md#quick-setup) | [Backup Docker Volumes](roles/svc-bkp-volume-2-local/), [Corporate Design](roles/web-svc-css/), [Dashboard](roles/web-app-dashboard/), [Discourse](roles/web-app-discourse/), [Hermes Agent](roles/web-app-hermes/), [Keycloak](roles/web-app-keycloak/), [LiteLLM Gateway](roles/svc-ai-litellm/), [MariaDB](roles/svc-db-mariadb/), [Matomo](roles/web-app-matomo/), [OpenClaw](roles/web-app-openclaw/), [Prometheus](roles/web-app-prometheus/), [Stalwart Mail Server](roles/web-app-stalwart/), [Tor Onion Service](roles/svc-net-tor/), [Universal Logout](roles/web-svc-logout/) | | [World Wide Web](roles/web-opt-rdr-www/) | beta | NGINX server blocks that permanently redirect www subdomains to their non-www apex domains | [πŸ› οΈ](roles/web-opt-rdr-www/README.md#quick-setup) | [Tor Onion Service](roles/svc-net-tor/) | | [XMPP](roles/web-svc-xmpp/) | beta | Placeholder stub role for a future XMPP server/container deployment, implementation pending | [🌐](https://ejabberd.im/) [πŸ› οΈ](roles/web-svc-xmpp/README.md#quick-setup) | [Backup Docker Volumes](roles/svc-bkp-volume-2-local/), [Keycloak](roles/web-app-keycloak/), [OpenLDAP](roles/svc-db-openldap/), [Prometheus](roles/web-app-prometheus/), [Tor Onion Service](roles/svc-net-tor/) | | [XWiki](roles/web-app-xwiki/) | beta | Self-hosted enterprise wiki and knowledge-management platform with collaboration and app-based extensibility | [🌐](https://www.xwiki.org/) [🎬](https://www.youtube.com/watch?v=8DePx30dh2g) [πŸ› οΈ](roles/web-app-xwiki/README.md#quick-setup) | [Backup Docker Volumes](roles/svc-bkp-volume-2-local/), [Corporate Design](roles/web-svc-design/), [Dashboard](roles/web-app-dashboard/), [Keycloak](roles/web-app-keycloak/), [LiteLLM Gateway](roles/svc-ai-litellm/), [Matomo](roles/web-app-matomo/), [PostgreSQL](roles/svc-db-postgres/), [Prometheus](roles/web-app-prometheus/), [SeaweedFS](roles/web-svc-seaweedfs/), [Stalwart Mail Server](roles/web-app-stalwart/), [Tor Onion Service](roles/svc-net-tor/), [Universal Logout](roles/web-svc-logout/) | @@ -215,9 +213,9 @@ Every invokable role in the tested lifecycle envelope, with its upstream homepag ## Guides πŸ“š -* [Installation Guide](docs/administration/installation.md) for local CLI installation, Docker execution, and source builds. -* [Deploy Guide](docs/administration/deploy.md) for inventory creation, full deploys, and redeploy flows. -* [CI & Self-Hosted Runners](docs/administration/ci-runners.md) for the test gate and adding your own hardware to the CI pool. +- [Installation Guide](docs/administration/installation.md) for local CLI installation, Docker execution, and source builds. +- [Deploy Guide](docs/administration/deploy.md) for inventory creation, full deploys, and redeploy flows. +- [CI & Self-Hosted Runners](docs/administration/ci-runners.md) for the test gate and adding your own hardware to the CI pool. ## Contributing πŸ”¨ @@ -243,10 +241,10 @@ For expert installation, contact details, and project participation, see [SUPPOR Infinito.Nexus is developed independently. Your support helps fund development, infrastructure, documentation, and the long-term growth of the project. -* πŸ’™ **[GitHub Sponsors](https://github.com/sponsors/kevinveenbirkenbach)** -* β˜• **[Buy Us a Coffee](https://buymeacoffee.com/kevinveenbirkenbach)** -* πŸ’³ **[PayPal](https://s.veen.world/paypaldonate)** -* β‚Ώ `bitcoin:bc1qn667c729cy64p5x58m3vg7zmudwqvf0fww7ph5` +- πŸ’™ **[GitHub Sponsors](https://github.com/sponsors/kevinveenbirkenbach)** +- β˜• **[Buy Us a Coffee](https://buymeacoffee.com/kevinveenbirkenbach)** +- πŸ’³ **[PayPal](https://s.veen.world/paypaldonate)** +- β‚Ώ `bitcoin:bc1qn667c729cy64p5x58m3vg7zmudwqvf0fww7ph5` ## License βš–οΈ diff --git a/ansible.cfg b/ansible.cfg index 042543810f..85e7371fec 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -27,7 +27,7 @@ library = ./library module_utils = ./utils [callback_profile_tasks] -task_output_limit = 300 +task_output_limit = all [ssh_connection] ssh_args = -o ControlMaster=auto -o ControlPersist=20s -o ControlPath=~/.ssh/ansible-%h-%p-%r -o ServerAliveInterval=15 -o ServerAliveCountMax=3 -o StrictHostKeyChecking=accept-new -o PreferredAuthentications=publickey,password,keyboard-interactive diff --git a/cli/administration/deploy/ci/trigger/__main__.py b/cli/administration/deploy/ci/trigger/__main__.py index 21206a83f9..e8db8d6b83 100644 --- a/cli/administration/deploy/ci/trigger/__main__.py +++ b/cli/administration/deploy/ci/trigger/__main__.py @@ -21,7 +21,7 @@ import sys from cli.administration.deploy.ci import gh, runs, selections from cli.meta.ci import matrix, query, validate from utils.github import run_name -from utils.github.variant import pools, selection, tor +from utils.github.variant import pools, selection, tor, vpn _WORKFLOW = "entry-manual-steer.yml" _ALL = "__ALL__" @@ -49,6 +49,7 @@ def _ranking(whitelist: str, config: dict[str, str]) -> list[dict[str, str]]: lifecycles=config.get("lifecycles", ""), sweep=0, tor_mode=tor.resolve_tor_mode(config.get("tor")), + vpn_mode=vpn.resolve_vpn_mode(config.get("vpn")), distros=pools.resolve_distros(config.get("distros")), filesystems=pools.resolve_filesystems(config.get("filesystem")), architectures=pools.resolve_architectures(config.get("architectures")), diff --git a/cli/administration/inventory/credentials/reset/cli.py b/cli/administration/inventory/credentials/reset/cli.py index 9287c30b65..74c7e0e913 100644 --- a/cli/administration/inventory/credentials/reset/cli.py +++ b/cli/administration/inventory/credentials/reset/cli.py @@ -14,13 +14,22 @@ import json import shutil from datetime import UTC, datetime from pathlib import Path +from typing import TYPE_CHECKING, Any + +from ruamel.yaml.comments import CommentedMap from cli.administration.inventory.provision.project import ( build_env_with_project_root, detect_project_root, ) from cli.administration.inventory.provision.reset import reset_credentials -from cli.administration.inventory.provision.ruamel_io import load_document +from cli.administration.inventory.provision.ruamel_io import ( + dump_document, + load_document, +) + +if TYPE_CHECKING: + from collections.abc import Iterable def _parse_app_variants(raw: str | None) -> dict[str, int]: @@ -63,12 +72,36 @@ def _backup(host_vars_file: Path) -> Path: return copy -def _mirror_host_vars(host_vars_dir: Path, source: Path) -> list[str]: +def _subtree(document: Any, path: str) -> Any: + node = document + for key in path.split("."): + if not isinstance(node, dict) or key not in node: + return None + node = node[key] + return node + + +def _restore(document: Any, path: str, value: Any) -> None: + keys = path.split(".") + node = document + for key in keys[:-1]: + branch = node.get(key) + if not isinstance(branch, dict): + branch = CommentedMap() + node[key] = branch + node = branch + node[keys[-1]] = value + + +def _mirror_host_vars( + host_vars_dir: Path, source: Path, keep: Iterable[str] = () +) -> list[str]: """Copy ``source`` over every other host_vars file in its directory. Args: host_vars_dir: the inventory's ``host_vars`` directory. source: the file the other hosts are aligned to. + keep: dotted paths restored from the destination after the copy. Returns: The host names that were overwritten. @@ -77,11 +110,23 @@ def _mirror_host_vars(host_vars_dir: Path, source: Path) -> list[str]: manager's. Rotating only the manager's would hand every other node the previous secrets. """ + keep = list(keep) mirrored: list[str] = [] for candidate in sorted(host_vars_dir.glob("*.yml")): if candidate == source: continue + preserved = ( + {path: _subtree(load_document(candidate), path) for path in keep} + if keep and candidate.exists() + else {} + ) shutil.copyfile(source, candidate) + preserved = {path: node for path, node in preserved.items() if node is not None} + if preserved: + document = load_document(candidate) + for path, node in preserved.items(): + _restore(document, path, node) + dump_document(candidate, document) mirrored.append(candidate.stem) return mirrored @@ -141,6 +186,16 @@ def main(argv: list[str] | None = None) -> int: action="store_true", help="Copy the rotated host_vars file over every other host in the inventory.", ) + parser.add_argument( + "--mirror-keep", + action="append", + default=[], + metavar="DOTTED.PATH", + help=( + "Subtree the mirror restores from the destination afterwards. " + "Repeatable; ignored without --mirror." + ), + ) parser.add_argument( "--backup", action="store_true", @@ -206,7 +261,9 @@ def main(argv: list[str] | None = None) -> int: print(f"[INFO] Rotated {rotated} value(s)") if args.mirror: - mirrored = _mirror_host_vars(host_vars_file.parent, host_vars_file) + mirrored = _mirror_host_vars( + host_vars_file.parent, host_vars_file, keep=args.mirror_keep + ) print(f"[INFO] Mirrored to {', '.join(mirrored) or 'no other host'}") return 0 diff --git a/cli/administration/inventory/mesh/__init__.py b/cli/administration/inventory/mesh/__init__.py new file mode 100644 index 0000000000..eb43901ae9 --- /dev/null +++ b/cli/administration/inventory/mesh/__init__.py @@ -0,0 +1,12 @@ +from .model import Mesh, MeshMember, MeshSpec +from .plan import plan_mesh +from .write import existing_public_keys, write_mesh + +__all__ = [ + "Mesh", + "MeshMember", + "MeshSpec", + "existing_public_keys", + "plan_mesh", + "write_mesh", +] diff --git a/cli/administration/inventory/mesh/__main__.py b/cli/administration/inventory/mesh/__main__.py new file mode 100755 index 0000000000..3b8dca0222 --- /dev/null +++ b/cli/administration/inventory/mesh/__main__.py @@ -0,0 +1,167 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import argparse +import sys +from pathlib import Path + +from .inventory import declared_specs, groups_of, topology_of +from .plan import plan_mesh, primary_meshes +from .write import ( + existing_addresses, + existing_public_keys, + prune_foreign_meshes, + write_mesh, +) + + +def parse_endpoints(pairs: list[str]) -> dict[str, str]: + endpoints: dict[str, str] = {} + for pair in pairs: + host, separator, address = pair.partition("=") + if not separator or not host.strip() or not address.strip(): + raise SystemExit(f"--endpoint expects HOST=ADDRESS, got {pair!r}") + endpoints[host.strip()] = address.strip() + return endpoints + + +def main(argv: list[str] | None = None) -> int: + parser = argparse.ArgumentParser( + description="Write correlated mesh credentials into every member's host_vars." + ) + parser.add_argument( + "--inventory", + action="append", + required=True, + help="inventory file to read group membership from; repeatable", + ) + parser.add_argument( + "--host-vars-dir", + required=True, + help=( + "directory holding one .yml per member; the meshes and their " + "members are read from the applications block there" + ), + ) + parser.add_argument( + "--vault-password-file", + required=True, + help="password file the private keys are encrypted with", + ) + parser.add_argument( + "--mesh", + action="append", + help="restrict to this mesh name; repeatable, default all declared", + ) + parser.add_argument( + "--controller", + help="host to admit as an extra spoke of --controller-mesh", + ) + parser.add_argument( + "--controller-mesh", + help=( + "mesh --controller joins, default the first declared; ignored when " + "--controller is unset" + ), + ) + parser.add_argument( + "--endpoint", + action="append", + default=[], + metavar="HOST=ADDRESS", + help=( + "underlay address peers dial for HOST; repeatable, a host left out " + "is dialled by its inventory name" + ), + ) + parser.add_argument( + "--rotate", + action="store_true", + help="mint a fresh keypair for every member instead of reusing", + ) + args = parser.parse_args(argv) + + host_vars_dir = Path(args.host_vars_dir).resolve() + if not host_vars_dir.is_dir(): + print(f"[FATAL] host_vars dir not found: {host_vars_dir}", file=sys.stderr) + return 1 + + inventory_files = [Path(entry).resolve() for entry in args.inventory] + groups = groups_of(inventory_files) + if not groups: + print( + f"[FATAL] no groups resolved from: {', '.join(map(str, inventory_files))}", + file=sys.stderr, + ) + return 1 + + try: + declared = declared_specs(groups, host_vars_dir, inventory_files) + topology = topology_of(groups, host_vars_dir, declared) + except ValueError as error: + print(f"[FATAL] {error}", file=sys.stderr) + return 1 + + controller_mesh = args.controller_mesh or declared[0].name + if args.controller and controller_mesh not in {spec.name for spec in declared}: + print( + f"[FATAL] --controller-mesh {controller_mesh!r} is not a declared mesh", + file=sys.stderr, + ) + return 1 + primary = primary_meshes(declared, topology, args.controller, controller_mesh) + + specs = declared + if args.mesh: + wanted = set(args.mesh) + specs = [spec for spec in specs if spec.name in wanted] + if not specs: + print(f"[FATAL] no declared mesh matches {sorted(wanted)}", file=sys.stderr) + return 1 + + vault_password_file = Path(args.vault_password_file).resolve() + all_hosts = sorted( + {host for hosts in groups.values() for host in hosts} + | ({args.controller} if args.controller else set()) + ) + + for host, names in sorted(prune_foreign_meshes(host_vars_dir, all_hosts).items()): + print( + f"[INFO] {host}: dropped mesh entr(ies) owned elsewhere: {', '.join(names)}" + ) + + keyed_here: dict[str, str] = {} + for spec in specs: + held = ( + {} + if args.rotate + else existing_public_keys(host_vars_dir, all_hosts, spec.name) + ) + held.update(keyed_here) + mesh = plan_mesh( + spec, + topology, + held, + controller=(args.controller if spec.name == controller_mesh else None), + endpoints=parse_endpoints(args.endpoint), + addresses=existing_addresses(host_vars_dir, all_hosts, spec.name), + ) + keyed_here.update({member.host: member.public_key for member in mesh.members}) + written = write_mesh(mesh, host_vars_dir, vault_password_file, primary) + minted = sum(1 for member in mesh.members if member.private_key is not None) + shape = ( + f"full mesh of {len(mesh.members)} member(s)" + if mesh.is_full + else f"hub {mesh.hub.host} ({mesh.hub.address}), " + f"{len(mesh.spokes)} spoke(s)" + ) + print( + f"[INFO] mesh '{spec.name}': {shape}, " + f"{minted} keypair(s) minted, {len(written)} host_vars written" + ) + + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/cli/administration/inventory/mesh/inventory.py b/cli/administration/inventory/mesh/inventory.py new file mode 100644 index 0000000000..3334bbc474 --- /dev/null +++ b/cli/administration/inventory/mesh/inventory.py @@ -0,0 +1,202 @@ +from __future__ import annotations + +import ipaddress +import re +from pathlib import Path +from typing import Any + +from cli.administration.inventory.provision.ruamel_io import load_document +from utils import PROJECT_ROOT +from utils.cache.yaml import load_yaml_any +from utils.networks.mesh import ( + APPLICATION_ID, + HUB_ROLE, + MESHES_KEY, + declared_meshes, + joined_meshes, +) + +from .model import MeshSpec, Topology + +POOL_VAR = "NETWORK_MESH_POOL" + + +def groups_of(inventory_files: list[Path]) -> dict[str, list[str]]: + groups: dict[str, list[str]] = {} + for path in inventory_files: + if not path.exists(): + continue + document = load_yaml_any(str(path)) + if not isinstance(document, dict): + continue + _collect(document.get("all", {}), groups) + return groups + + +def _collect(node: Any, groups: dict[str, list[str]]) -> None: + if not isinstance(node, dict): + return + for name, child in (node.get("children") or {}).items(): + if not isinstance(child, dict): + continue + bucket = groups.setdefault(name, []) + for host in child.get("hosts") or {}: + if host not in bucket: + bucket.append(host) + _collect(child, groups) + + +def host_applications(host_vars_dir: Path, host: str) -> Any: + path = host_vars_dir / f"{host}.yml" + if not path.is_file(): + return {} + return load_document(path).get("applications") or {} + + +def hub_of(groups: dict[str, list[str]]) -> str | None: + hubs = sorted(dict.fromkeys(groups.get(HUB_ROLE, []))) + if not hubs: + return None + if len(hubs) != 1: + raise ValueError( + f"hub group '{HUB_ROLE}' resolves to {len(hubs)} hosts, expected exactly 1" + ) + return hubs[0] + + +def declared_specs( + groups: dict[str, list[str]], host_vars_dir: Path, inventory_files: list[Path] +) -> list[MeshSpec]: + """The meshes the deployment declares, in declaration order. + + Args: + groups: group to hosts over every inventory of the deploy. + host_vars_dir: directory holding one ``.yml`` per host. + inventory_files: the inventories of the deploy. + """ + hub = hub_of(groups) + if hub is not None: + return specs_of(host_applications(host_vars_dir, hub), inventory_files) + by_host: dict[str, list[MeshSpec]] = {} + for host in sorted({host for members in groups.values() for host in members}): + applications = host_applications(host_vars_dir, host) + if declared_meshes(applications): + by_host[host] = specs_of(applications, inventory_files) + if not by_host: + raise ValueError( + f"{APPLICATION_ID} declares no networks.{MESHES_KEY} on any host: " + "without a hub, a deployment states its meshes in every member's " + "host_vars" + ) + first, specs = next(iter(by_host.items())) + differing = sorted(host for host, other in by_host.items() if other != specs) + if differing: + raise ValueError( + f"{', '.join(differing)} declare(s) other meshes than {first}: " + "without a hub, every host that declares meshes declares the same" + ) + return specs + + +def specs_of(applications: Any, inventory_files: list[Path]) -> list[MeshSpec]: + """The meshes declared in *applications*, in declaration order. + + Args: + applications: the declaring host's ``applications`` block. + inventory_files: the inventories of the deploy. + """ + declared = declared_meshes(applications) + if not declared: + raise ValueError( + f"{APPLICATION_ID} declares no networks.{MESHES_KEY}: a deployment " + "states its meshes in the hub's host_vars" + ) + pool = pool_of(inventory_files) + specs = [ + MeshSpec( + name=str(entry["name"]), + subnet=str(entry["subnet"]), + listen_port=int(entry["listen_port"]), + routed_range=str(entry.get("routed_range") or pool), + ) + for entry in declared + ] + names = [spec.name for spec in specs] + duplicated = sorted({name for name in names if names.count(name) > 1}) + if duplicated: + raise ValueError(f"meshes declared more than once: {duplicated}") + assert_no_subnet_overlap(specs, pool) + return specs + + +def topology_of( + groups: dict[str, list[str]], host_vars_dir: Path, specs: list[MeshSpec] +) -> Topology: + hub = hub_of(groups) + spokes: dict[str, list[str]] = {spec.name: [] for spec in specs} + hosts = sorted({host for members in groups.values() for host in members}) + for host in hosts: + roles = [group for group, members in groups.items() if host in members] + joined = joined_meshes(host_applications(host_vars_dir, host), roles) + for name, by in sorted(joined.items()): + if name not in spokes: + raise ValueError( + f"{host}: {', '.join(by)} join(s) mesh '{name}', which " + f"{APPLICATION_ID} does not declare" + ) + if host != hub: + spokes[name].append(host) + return Topology(hub=hub, spokes={name: tuple(h) for name, h in spokes.items()}) + + +_REFERENCE = re.compile(r"^\s*\{\{\s*(?P[A-Z0-9_]+)\s*\}\}\s*$") + + +def _literal_of(name: str, directories: list[Path]) -> str | None: + for directory in directories: + for path in sorted(directory.glob("*.yml")): + document = load_yaml_any(str(path), default_if_missing={}) + value = (document or {}).get(name) + if isinstance(value, str) and not _REFERENCE.match(value): + return value + return None + + +def pool_of(inventory_files: list[Path]) -> str: + directories: list[Path] = [] + for path in inventory_files: + group_vars = Path(path).parent / "group_vars" + directories += [group_vars, group_vars / "all"] + directories.append(PROJECT_ROOT / "group_vars" / "all") + pool = _literal_of(POOL_VAR, list(dict.fromkeys(directories))) + if pool is None: + raise ValueError(f"{POOL_VAR} is defined nowhere the deploy reads it from") + return pool + + +def assert_no_subnet_overlap(specs: list[MeshSpec], pool: str | None) -> None: + networks = [ + (spec, ipaddress.ip_network(spec.subnet, strict=True)) for spec in specs + ] + + if pool: + allowed = ipaddress.ip_network(pool, strict=True) + for spec, network in networks: + if not network.subnet_of(allowed): + raise ValueError( + f"mesh '{spec.name}' subnet {spec.subnet} falls outside " + f"the declared pool {pool}" + ) + + for index, (spec, network) in enumerate(networks): + for other_spec, other in networks[index + 1 :]: + if network.overlaps(other): + raise ValueError( + f"mesh '{spec.name}' subnet {spec.subnet} overlaps " + f"mesh '{other_spec.name}' subnet {other_spec.subnet}" + ) + + ports = [spec.listen_port for spec in specs] + duplicated = {port for port in ports if ports.count(port) > 1} + if duplicated: + raise ValueError(f"meshes share listen port(s): {sorted(duplicated)}") diff --git a/cli/administration/inventory/mesh/keys.py b/cli/administration/inventory/mesh/keys.py new file mode 100644 index 0000000000..8dd72a0e35 --- /dev/null +++ b/cli/administration/inventory/mesh/keys.py @@ -0,0 +1,52 @@ +from __future__ import annotations + +import base64 + +from cryptography.hazmat.primitives.asymmetric.x25519 import ( + X25519PrivateKey, + X25519PublicKey, +) +from cryptography.hazmat.primitives.serialization import ( + Encoding, + NoEncryption, + PrivateFormat, + PublicFormat, +) + +KEY_LENGTH = 32 + + +def generate_private_key() -> str: + raw = X25519PrivateKey.generate().private_bytes( + encoding=Encoding.Raw, + format=PrivateFormat.Raw, + encryption_algorithm=NoEncryption(), + ) + return base64.b64encode(raw).decode("ascii") + + +def public_key_of(private_key: str) -> str: + raw = base64.b64decode(private_key, validate=True) + if len(raw) != KEY_LENGTH: + raise ValueError( + f"private key decodes to {len(raw)} bytes, expected {KEY_LENGTH}" + ) + return base64.b64encode( + X25519PrivateKey.from_private_bytes(raw) + .public_key() + .public_bytes(encoding=Encoding.Raw, format=PublicFormat.Raw) + ).decode("ascii") + + +def is_valid_public_key(value: str) -> bool: + try: + raw = base64.b64decode(value, validate=True) + except (ValueError, TypeError): + return False + if len(raw) != KEY_LENGTH: + return False + try: + X25519PublicKey.from_public_bytes(raw) + except ValueError: + return False + return True diff --git a/cli/administration/inventory/mesh/model.py b/cli/administration/inventory/mesh/model.py new file mode 100644 index 0000000000..38173827f3 --- /dev/null +++ b/cli/administration/inventory/mesh/model.py @@ -0,0 +1,100 @@ +from __future__ import annotations + +from dataclasses import dataclass, field + + +@dataclass(frozen=True) +class MeshSpec: + """One declared mesh. + + Args: + name: identifier of the mesh, used as the interface name. + subnet: the mesh address range, as ``a.b.c.0/24``. + listen_port: UDP port the hub, or every member of a full mesh, + listens on. + routed_range: the range a spoke routes through the hub. + """ + + name: str + subnet: str + listen_port: int + routed_range: str = "" + + +@dataclass(frozen=True) +class Topology: + """Who an inventory puts into each mesh. + + Args: + hub: the host that routes for every mesh, or None for full meshes. + spokes: mesh name to the hosts that joined it, never the hub. + """ + + hub: str | None + spokes: dict[str, tuple[str, ...]] = field(default_factory=dict) + + +@dataclass(frozen=True) +class MeshMember: + """One host's place in a resolved mesh. + + Args: + host: inventory hostname. + address: the member's address inside the mesh subnet. + endpoint: the underlay address its peers dial. + private_key: the member's own secret half, or None when the member + already holds one. + public_key: the half its peers receive. + is_hub: whether this member routes for the others. + """ + + host: str + address: str + private_key: str | None + public_key: str + is_hub: bool + endpoint: str = "" + + +@dataclass(frozen=True) +class Mesh: + """A spec resolved against an inventory. + + Args: + spec: the declaration this mesh was resolved from. + members: every host in the mesh, hub first. + """ + + spec: MeshSpec + members: tuple[MeshMember, ...] = field(default_factory=tuple) + + @property + def hub(self) -> MeshMember: + for member in self.members: + if member.is_hub: + return member + raise ValueError(f"mesh '{self.spec.name}' resolved without a hub") + + @property + def spokes(self) -> tuple[MeshMember, ...]: + return tuple(m for m in self.members if not m.is_hub) + + @property + def is_full(self) -> bool: + return not any(member.is_hub for member in self.members) + + def peers_of(self, host: str) -> tuple[MeshMember, ...]: + member = self.member(host) + if member is None: + return () + if member.is_hub: + return self.spokes + if self.is_full: + return tuple(m for m in self.members if m.host != host) + return (self.hub,) + + def member(self, host: str) -> MeshMember | None: + for candidate in self.members: + if candidate.host == host: + return candidate + return None diff --git a/cli/administration/inventory/mesh/plan.py b/cli/administration/inventory/mesh/plan.py new file mode 100644 index 0000000000..97b7af835a --- /dev/null +++ b/cli/administration/inventory/mesh/plan.py @@ -0,0 +1,158 @@ +from __future__ import annotations + +import ipaddress +from typing import TYPE_CHECKING + +from .keys import generate_private_key, public_key_of +from .model import Mesh, MeshMember + +if TYPE_CHECKING: + from .model import MeshSpec, Topology + +HUB_OFFSET = 1 +SPOKE_OFFSET = 10 + + +def members_of( + spec: MeshSpec, topology: Topology, controller: str | None = None +) -> tuple[str | None, list[str]]: + spokes = [ + host + for host in dict.fromkeys(topology.spokes.get(spec.name, ())) + if host != topology.hub + ] + if controller and controller != topology.hub and controller not in spokes: + spokes.append(controller) + return topology.hub, sorted(spokes) + + +def primary_meshes( + specs: list[MeshSpec], + topology: Topology, + controller: str | None = None, + controller_mesh: str | None = None, +) -> dict[str, str]: + """The first declared mesh each host belongs to. + + Args: + specs: every declared mesh, in declaration order. + topology: who the inventory puts into each mesh. + controller: host admitted as an extra spoke of ``controller_mesh``. + controller_mesh: the mesh ``controller`` joins. + + Returns: + hostname to the name of its primary mesh. + """ + primary: dict[str, str] = {} + for spec in specs: + hub, spokes = members_of( + spec, topology, controller if spec.name == controller_mesh else None + ) + for host in [hub, *spokes] if hub else spokes: + primary.setdefault(host, spec.name) + return primary + + +def _address(subnet: str, offset: int) -> str: + network = ipaddress.ip_network(subnet, strict=True) + address = network.network_address + offset + if address not in network: + raise ValueError(f"offset {offset} falls outside {subnet}") + return str(address) + + +def _offset_of(subnet: str, address: str) -> int | None: + network = ipaddress.ip_network(subnet, strict=True) + try: + candidate = ipaddress.ip_address(address) + except ValueError: + return None + if candidate not in network: + return None + offset = int(candidate) - int(network.network_address) + return offset if offset > SPOKE_OFFSET else None + + +def _spoke_offsets( + subnet: str, spokes: list[str], stored: dict[str, str] +) -> dict[str, int]: + """Hostname to its offset, keeping every address a spoke already holds. + + Args: + subnet: the mesh subnet offsets are taken in. + spokes: every spoke of the mesh, in the order they were resolved. + stored: hostname to the address it already holds on this mesh. + """ + taken = {HUB_OFFSET} + offsets: dict[str, int] = {} + for host in spokes: + offset = _offset_of(subnet, stored.get(host, "")) + if offset is None or offset in taken: + continue + offsets[host] = offset + taken.add(offset) + + cursor = SPOKE_OFFSET + 1 + for host in spokes: + if host in offsets: + continue + while cursor in taken: + cursor += 1 + offsets[host] = cursor + taken.add(cursor) + return offsets + + +def plan_mesh( + spec: MeshSpec, + topology: Topology, + existing_public_keys: dict[str, str] | None = None, + *, + rotate: bool = False, + controller: str | None = None, + endpoints: dict[str, str] | None = None, + addresses: dict[str, str] | None = None, +) -> Mesh: + """Resolve ``spec`` into a mesh whose members are addressed and keyed. + + Args: + spec: the mesh to resolve. + topology: who the inventory puts into each mesh. + existing_public_keys: hostname to already-issued public key. + rotate: mint a fresh keypair for every member. + controller: host to admit as an extra spoke. + endpoints: hostname to the underlay address its peers dial; a host + left out is dialled by its hostname. + addresses: hostname to the mesh address it already holds, kept across + a rotation. + """ + held = {} if rotate else dict(existing_public_keys or {}) + underlay = dict(endpoints or {}) + hub, spokes = members_of(spec, topology, controller) + offsets = _spoke_offsets(spec.subnet, spokes, dict(addresses or {})) + + def member(host: str, offset: int, is_hub: bool) -> MeshMember: + address = _address(spec.subnet, offset) + endpoint = underlay.get(host, host) + if host in held: + return MeshMember( + host=host, + address=address, + private_key=None, + public_key=held[host], + is_hub=is_hub, + endpoint=endpoint, + ) + private_key = generate_private_key() + return MeshMember( + host=host, + address=address, + private_key=private_key, + public_key=public_key_of(private_key), + is_hub=is_hub, + endpoint=endpoint, + ) + + members = [member(hub, HUB_OFFSET, True)] if hub else [] + members.extend(member(host, offsets[host], False) for host in spokes) + return Mesh(spec=spec, members=tuple(members)) diff --git a/cli/administration/inventory/mesh/transport.py b/cli/administration/inventory/mesh/transport.py new file mode 100644 index 0000000000..69d23568da --- /dev/null +++ b/cli/administration/inventory/mesh/transport.py @@ -0,0 +1,91 @@ +from __future__ import annotations + +import shlex +from configparser import ConfigParser +from typing import TYPE_CHECKING + +from cli.administration.inventory.provision.ruamel_io import ( + dump_document, + load_document, +) +from utils import PROJECT_ROOT +from utils.networks.mesh import address_on + +from .write import host_vars_path + +if TYPE_CHECKING: + from pathlib import Path + +SSH_CONNECTION = "ssh" + +MESH_CONTROL_PERSIST = "600s" + +_REPLACED_OPTIONS = ("ControlPersist=", "ControlPath=") + + +def mesh_ssh_args(base: str, *, persist: str = MESH_CONTROL_PERSIST) -> str: + """The repo's ``ssh_args`` retuned for a host reached over the mesh. + + Args: + base: the ``ssh_args`` every other host uses. + persist: how long to keep an idle master alive. + """ + words = shlex.split(base) + kept: list[str] = [] + index = 0 + while index < len(words): + if words[index] == "-o" and index + 1 < len(words): + if not words[index + 1].startswith(_REPLACED_OPTIONS): + kept += ["-o", words[index + 1]] + index += 2 + continue + kept.append(words[index]) + index += 1 + kept += ["-o", f"ControlPersist={persist}"] + return shlex.join(kept) + + +def repo_ssh_args(config_file: Path | None = None) -> str: + parser = ConfigParser(interpolation=None) + parser.read(config_file or PROJECT_ROOT / "ansible.cfg") + return parser.get("ssh_connection", "ssh_args", fallback="") + + +def mesh_address(host_vars_dir: Path, host: str, mesh_name: str) -> str | None: + path = host_vars_path(host_vars_dir, host) + if not path.exists(): + return None + address = address_on(load_document(path).get("applications", {}), host, mesh_name) + return address or None + + +def switch_to_mesh( + host_vars_dir: Path, + hosts: list[str], + mesh_name: str, + *, + user: str, + private_key_file: str, +) -> dict[str, str]: + """Point every member of *mesh_name* at its mesh address over SSH. + + Returns: + Host to the address it was switched to; a host without one is left + alone. + """ + switched: dict[str, str] = {} + for host in hosts: + address = mesh_address(host_vars_dir, host, mesh_name) + if address is None: + continue + path = host_vars_path(host_vars_dir, host) + document = load_document(path) + document["ansible_host"] = address + document["ansible_connection"] = SSH_CONNECTION + document["ansible_user"] = user + document["ansible_ssh_private_key_file"] = private_key_file + document["ansible_ssh_args"] = mesh_ssh_args(repo_ssh_args()) + document["ansible_ssh_use_tty"] = False + dump_document(path, document) + switched[host] = address + return switched diff --git a/cli/administration/inventory/mesh/write.py b/cli/administration/inventory/mesh/write.py new file mode 100644 index 0000000000..c6a2466b56 --- /dev/null +++ b/cli/administration/inventory/mesh/write.py @@ -0,0 +1,202 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING + +from ruamel.yaml.comments import CommentedMap, CommentedSeq + +from cli.administration.inventory.provision.ruamel_io import ( + dump_document, + ensure_map, + load_document, + vault_value, +) +from utils.manager.credential_key import CREDENTIALS_KEY, SECRETS_KEY +from utils.networks.mesh import ( + APPLICATION_ID, + INTERFACES_KEY, + interfaces, + owned_interface, +) + +from .keys import is_valid_public_key + +if TYPE_CHECKING: + from pathlib import Path + + from .model import Mesh + +HOST_PREFIX_32 = "/32" + + +PRIVATE_KEY_NAME = "mesh_private_key" + + +def private_key_name(mesh_name: str | None = None) -> str: + return PRIVATE_KEY_NAME + + +def host_vars_path(host_vars_dir: Path, host: str) -> Path: + return host_vars_dir / f"{host}.yml" + + +def _interface_list(document: CommentedMap) -> CommentedSeq: + app = ensure_map(ensure_map(document, "applications"), APPLICATION_ID) + networks = ensure_map(app, "networks") + listed = networks.get(INTERFACES_KEY) + if not isinstance(listed, list): + listed = CommentedSeq() + networks[INTERFACES_KEY] = listed + return listed + + +def existing_public_keys( + host_vars_dir: Path, hosts: list[str], mesh_name: str +) -> dict[str, str]: + found: dict[str, str] = {} + for host in hosts: + path = host_vars_path(host_vars_dir, host) + if not path.exists(): + continue + document = load_document(path) + applications = document.get("applications", {}) + own = owned_interface(applications, host, mesh_name) + owned = [ + entry + for entry in (own, *interfaces(applications)) + if entry is not None and entry.get("host") == host + ] + public_key = next( + ( + entry["public_key"] + for entry in owned + if isinstance(entry.get("public_key"), str) + and is_valid_public_key(entry["public_key"]) + ), + None, + ) + if public_key is None: + continue + credentials = ( + applications.get(APPLICATION_ID, {}) + .get(SECRETS_KEY, {}) + .get(CREDENTIALS_KEY, {}) + ) + if private_key_name() not in credentials: + continue + found[host] = public_key + return found + + +def existing_addresses( + host_vars_dir: Path, hosts: list[str], mesh_name: str +) -> dict[str, str]: + found: dict[str, str] = {} + for host in hosts: + path = host_vars_path(host_vars_dir, host) + if not path.exists(): + continue + entry = owned_interface( + load_document(path).get("applications", {}), host, mesh_name + ) + address = (entry or {}).get("address") + if isinstance(address, str) and address.strip(): + found[host] = address.strip() + return found + + +def prune_foreign_meshes(host_vars_dir: Path, hosts: list[str]) -> dict[str, list[str]]: + removed: dict[str, list[str]] = {} + for host in hosts: + path = host_vars_path(host_vars_dir, host) + if not path.exists(): + continue + document = load_document(path) + if not interfaces(document.get("applications", {})): + continue + listed = _interface_list(document) + foreign = [ + entry + for entry in listed + if isinstance(entry, dict) and entry.get("host") not in (None, "", host) + ] + if not foreign: + continue + for entry in foreign: + listed.remove(entry) + dump_document(path, document) + removed[host] = sorted(str(entry.get("name")) for entry in foreign) + return removed + + +def _peer_entries(mesh: Mesh, host: str, *, routes_pool: bool) -> list[CommentedMap]: + entries: list[CommentedMap] = [] + for peer in mesh.peers_of(host): + entry = CommentedMap() + entry["host"] = peer.host + entry["endpoint"] = peer.endpoint or peer.host + entry["public_key"] = peer.public_key + entry["address"] = peer.address + if not peer.is_hub: + entry["allowed_ips"] = peer.address + HOST_PREFIX_32 + elif routes_pool: + entry["allowed_ips"] = mesh.spec.routed_range or mesh.spec.subnet + else: + entry["allowed_ips"] = mesh.spec.subnet + entry["is_hub"] = peer.is_hub + entries.append(entry) + return entries + + +def _entry_for(listed: CommentedSeq, mesh_name: str) -> CommentedMap: + for entry in listed: + if isinstance(entry, dict) and entry.get("name") == mesh_name: + return entry + entry = CommentedMap() + entry["name"] = mesh_name + listed.append(entry) + return entry + + +def write_mesh( + mesh: Mesh, + host_vars_dir: Path, + vault_password_file: Path, + primary: dict[str, str] | None = None, +) -> list[Path]: + """Write ``mesh`` into every member's host_vars and return the paths. + + Args: + mesh: the resolved mesh. + host_vars_dir: directory holding one ``.yml`` per member. + vault_password_file: password file the private keys are encrypted with. + primary: hostname to its primary mesh; an absent host counts this + mesh as its primary. + """ + written: list[Path] = [] + key_name = private_key_name() + + for member in mesh.members: + path = host_vars_path(host_vars_dir, member.host) + document = load_document(path) if path.exists() else CommentedMap() + is_primary = (primary or {}).get(member.host, mesh.spec.name) == mesh.spec.name + + entry = _entry_for(_interface_list(document), mesh.spec.name) + app = document["applications"][APPLICATION_ID] + entry["host"] = member.host + entry["address"] = member.address + entry["subnet"] = mesh.spec.subnet + entry["listen_port"] = mesh.spec.listen_port + entry["is_hub"] = member.is_hub + entry["primary"] = is_primary + entry["public_key"] = member.public_key + entry["peers"] = _peer_entries(mesh, member.host, routes_pool=is_primary) + + if member.private_key is not None: + credentials = ensure_map(ensure_map(app, SECRETS_KEY), CREDENTIALS_KEY) + credentials[key_name] = vault_value( + vault_password_file, member.private_key, key_name + ) + + dump_document(path, document) + written.append(path) + return written diff --git a/cli/meta/ci/matrix.py b/cli/meta/ci/matrix.py index 815159b58b..0932fc3e3a 100644 --- a/cli/meta/ci/matrix.py +++ b/cli/meta/ci/matrix.py @@ -40,7 +40,7 @@ from cli.administration.deploy.development.inventory.planner import ( from cli.meta.ci import chunks, query, slots from utils.cache.applications import get_variants from utils.cache.files import PROJECT_ROOT -from utils.github.variant import axes, instructions, pools, selection, tor +from utils.github.variant import axes, instructions, pools, selection, tor, vpn from utils.roles.display import display_names DROPPED = ("priority", "id", "covered", "clone") @@ -112,6 +112,7 @@ def entries_of( lifecycles: str, sweep: int, tor_mode: str, + vpn_mode: str, distros: tuple[str, ...], filesystems: tuple[str, ...], architectures: tuple[str, ...] = pools.ARCHITECTURES, @@ -129,6 +130,7 @@ def entries_of( ], sweep=sweep, tor_mode=tor_mode, + vpn_mode=vpn_mode, distros=distros, filesystems=filesystems, architectures=architectures, @@ -212,6 +214,7 @@ def build_sweep( lifecycles: str, sweep: int, tor_mode: str, + vpn_mode: str, distros: tuple[str, ...], filesystems: tuple[str, ...], architectures: tuple[str, ...] = pools.ARCHITECTURES, @@ -226,6 +229,7 @@ def build_sweep( lifecycles=lifecycles, sweep=sweep, tor_mode=tor_mode, + vpn_mode=vpn_mode, distros=distros, filesystems=filesystems, architectures=architectures, @@ -245,6 +249,7 @@ def main(argv: list[str] | None = None) -> int: parser.add_argument("--priority", default="") parser.add_argument("--lifecycles", default="") parser.add_argument("--tor", default=None) + parser.add_argument("--vpn", default=None) parser.add_argument("--distros", default="") parser.add_argument("--filesystem", default="") parser.add_argument("--architectures", default="") @@ -263,6 +268,7 @@ def main(argv: list[str] | None = None) -> int: lifecycles=args.lifecycles, sweep=sweep, tor_mode=tor.resolve_tor_mode(args.tor), + vpn_mode=vpn.resolve_vpn_mode(args.vpn), distros=pools.resolve_distros(args.distros), filesystems=pools.resolve_filesystems(args.filesystem), architectures=pools.resolve_architectures(args.architectures), diff --git a/cli/meta/ci/plan.py b/cli/meta/ci/plan.py index e044b86588..4afc33858e 100644 --- a/cli/meta/ci/plan.py +++ b/cli/meta/ci/plan.py @@ -36,7 +36,7 @@ import sys from cli.meta.ci import matrix, query, slots from cli.meta.roles.applications.complexity.render import _dwidth -from utils.github.variant import axes, instructions, pools, tor +from utils.github.variant import axes, instructions, pools, tor, vpn from utils.roles.display import display_names from utils.symbol_glossary import to_emoji @@ -55,6 +55,7 @@ _COLUMNS = ( "filesystem", "architecture", "tor", + "vpn", "triggered", "covered_by", "instructions", @@ -81,6 +82,7 @@ def _key(entry: dict[str, str]) -> tuple[str, ...]: entry["variant"], entry["mode"], entry["tor"], + entry["vpn"], entry["distro"], entry["filesystem"], entry["architecture"], @@ -127,6 +129,7 @@ def cells( to_emoji(entry["filesystem"]), to_emoji(entry["architecture"]), to_emoji("tor" if entry["tor"] == "true" else "clearnet"), + to_emoji("vpn" if entry["vpn"] == "true" else "direct"), status, positions.get(covered, covered) if covered not in ("", "0") else "", to_emoji(entry["instructions"]) if entry["instructions"] else "", @@ -184,6 +187,7 @@ def main(argv: list[str] | None = None) -> int: parser.add_argument("--lifecycles", default="") parser.add_argument("--sweep", type=int, default=None) parser.add_argument("--tor", default=None) + parser.add_argument("--vpn", default=None) parser.add_argument("--filesystem", default="") parser.add_argument("--architectures", default="") parser.add_argument("--offset", default=None) @@ -202,6 +206,7 @@ def main(argv: list[str] | None = None) -> int: lifecycles=args.lifecycles, sweep=sweep, tor_mode=tor.resolve_tor_mode(args.tor), + vpn_mode=vpn.resolve_vpn_mode(args.vpn), distros=pools.resolve_distros(args.distros), filesystems=pools.resolve_filesystems(args.filesystem), architectures=pools.resolve_architectures(args.architectures), diff --git a/cli/meta/ci/report_failures.py b/cli/meta/ci/report_failures.py index 43a36656d0..49e17e7811 100644 --- a/cli/meta/ci/report_failures.py +++ b/cli/meta/ci/report_failures.py @@ -28,14 +28,15 @@ class Failure(NamedTuple): distro: str filesystem: str architecture: str + vpn: bool = False def failed_roles(jobs: list[dict]) -> dict[str, list[Failure]]: """Map role -> [:class:`Failure`] for every failed deploy job. - A deploy job is titled `` `` with an optional - trailing ⭐ for a + A deploy job is titled `` `` + with an optional trailing ⭐ for a priority row. The middle is resolved through the display-name codec rather than matched as a raw role id: job names carry display names, so a regex over ``web-app-…`` silently matched nothing and every failure went @@ -60,6 +61,7 @@ def failed_roles(jobs: list[dict]) -> dict[str, list[Failure]]: label.distro, label.filesystem, label.architecture, + label.vpn, ) ) return out @@ -80,6 +82,7 @@ def artifact_name(role: str, failure: Failure) -> str: failure.distro, failure.filesystem, failure.architecture, + failure.vpn, ) diff --git a/default.env b/default.env index 5b663ef741..74e7e0dc67 100644 --- a/default.env +++ b/default.env @@ -359,6 +359,9 @@ INFINITO_SWARM_LAB_NET_NAME=swarm-lab # Lab bridge-network subnet of the act-swarm-test cluster; the node IPs must live inside it. INFINITO_SWARM_LAB_SUBNET=192.168.244.0/24 +# WireGuard layout a meshed swarm round bakes into the lab inventory. +INFINITO_SWARM_MESHES=inventories/development/wireguard.yml + # Fixed lab IP of the manager node (pinned via extra_hosts on every node so multi-network DNS stays deterministic). INFINITO_SWARM_MGR_IP=192.168.244.10 @@ -386,6 +389,9 @@ INFINITO_SWARM_TEARDOWN_RESERVE_SECONDS=900 # Docker label stamped on every act-swarm-test container (DinD + NFS sidecar) so cleanup selects by label, not a guessed name. INFINITO_SWARM_TEST_LABEL=infinito.swarm-test +# 'true' deploys the WireGuard mesh with the swarm cluster. +INFINITO_SWARM_VPN= + # Fixed lab IP of worker node 1. INFINITO_SWARM_WRK1_IP=192.168.244.11 @@ -419,6 +425,9 @@ INFINITO_VARS_PAYLOAD= # Absolute path of the project virtualenv inside the dev container (and on the host when /opt is writable). INFINITO_VENV_DIR=/opt/venvs/infinito +# WireGuard axis of the CI deploy matrix: auto rotates the mesh over the swarm rows, enforced meshes all, disabled meshes none. +INFINITO_VPN=auto + # Seconds 'make up' waits for the infinito container healthcheck before failing. INFINITO_WAIT_HEALTH_TIMEOUT_S=600 diff --git a/docs/changelog/000.001.000-2025-12-09.md b/docs/changelog/000.001.000-2025-12-09.md index 49c76ba837..eabbb1e80b 100644 --- a/docs/changelog/000.001.000-2025-12-09.md +++ b/docs/changelog/000.001.000-2025-12-09.md @@ -2,4 +2,4 @@ ## [0.1.0] - 2025-12-09 -* Added Nix support role +- Added Nix support role diff --git a/docs/changelog/000.001.001-2025-12-10.md b/docs/changelog/000.001.001-2025-12-10.md index 979910e089..422046547f 100644 --- a/docs/changelog/000.001.001-2025-12-10.md +++ b/docs/changelog/000.001.001-2025-12-10.md @@ -2,4 +2,4 @@ ## [0.1.1] - 2025-12-10 -* PKGMGR will now be pulled again +- PKGMGR will now be pulled again diff --git a/docs/changelog/000.002.000-2025-12-10.md b/docs/changelog/000.002.000-2025-12-10.md index 5cd72d438c..02988a8a31 100644 --- a/docs/changelog/000.002.000-2025-12-10.md +++ b/docs/changelog/000.002.000-2025-12-10.md @@ -2,4 +2,4 @@ ## [0.2.0] - 2025-12-10 -* Added full Nix installer integration with dynamic upstream SHA256 verification, OS-specific installation paths, template-driven configuration, and updated pkgmgr integration. +- Added full Nix installer integration with dynamic upstream SHA256 verification, OS-specific installation paths, template-driven configuration, and updated pkgmgr integration. diff --git a/docs/changelog/000.002.001-2025-12-10.md b/docs/changelog/000.002.001-2025-12-10.md index 93d9682183..f82d0b16c1 100644 --- a/docs/changelog/000.002.001-2025-12-10.md +++ b/docs/changelog/000.002.001-2025-12-10.md @@ -2,4 +2,4 @@ ## [0.2.1] - 2025-12-10 -* restored full deployability of the Sphinx app by fixing the application_id scoping bug. +- restored full deployability of the Sphinx app by fixing the application_id scoping bug. diff --git a/docs/changelog/000.003.001-2025-12-18.md b/docs/changelog/000.003.001-2025-12-18.md index f099aa59fa..bc4f8ad0d0 100644 --- a/docs/changelog/000.003.001-2025-12-18.md +++ b/docs/changelog/000.003.001-2025-12-18.md @@ -2,4 +2,4 @@ ## [0.3.1] - 2025-12-18 -* Enabled ***pkgmgr install infinito*** test +- Enabled ***pkgmgr install infinito*** test diff --git a/docs/changelog/000.003.002-2025-12-19.md b/docs/changelog/000.003.002-2025-12-19.md index a0a6a1b6ad..fa77bf37c0 100644 --- a/docs/changelog/000.003.002-2025-12-19.md +++ b/docs/changelog/000.003.002-2025-12-19.md @@ -2,8 +2,8 @@ ## [0.3.2] - 2025-12-19 -* Unified cleanup and simplified deploy flow using ***make clean*** -* Switched Docker image base to pkgmgr and enforced local images for deploy tests -* Improved CI reliability with reusable workflows, fixed permissions, and consistent SARIF uploads -* Addressed multiple CodeQL and Hadolint findings; applied formatting and security fixes +- Unified cleanup and simplified deploy flow using ***make clean*** +- Switched Docker image base to pkgmgr and enforced local images for deploy tests +- Improved CI reliability with reusable workflows, fixed permissions, and consistent SARIF uploads +- Addressed multiple CodeQL and Hadolint findings; applied formatting and security fixes **Result:** more reproducible builds, cleaner CI, and more robust Docker-based deployments. diff --git a/docs/changelog/000.003.003-2025-12-21.md b/docs/changelog/000.003.003-2025-12-21.md index 32697a4dae..b44818f492 100644 --- a/docs/changelog/000.003.003-2025-12-21.md +++ b/docs/changelog/000.003.003-2025-12-21.md @@ -2,8 +2,8 @@ ## [0.3.3] - 2025-12-21 -* **More reliable installs and deploys:** Fewer Docker and OS-specific failures (especially on CentOS Stream), cleaner container builds, and stable Python/Ansible execution across CI and local environments. -* **Simpler deploy experience:** The deploy command is more predictable and faster because testing is no longer mixed into deploy runs. -* **Fewer β€œmysterious” errors:** Path, working-directory, and virtualenv issues that previously caused random CI or local failures are fixed. -* **Smoother inventory creation:** Inventory and credential generation now work consistently after refactors, without brittle path assumptions. -* **Overall impact:** Day-to-day usage is more stable, commands behave as expected in more environments, and setup/deploy workflows require less troubleshooting. +- **More reliable installs and deploys:** Fewer Docker and OS-specific failures (especially on CentOS Stream), cleaner container builds, and stable Python/Ansible execution across CI and local environments. +- **Simpler deploy experience:** The deploy command is more predictable and faster because testing is no longer mixed into deploy runs. +- **Fewer β€œmysterious” errors:** Path, working-directory, and virtualenv issues that previously caused random CI or local failures are fixed. +- **Smoother inventory creation:** Inventory and credential generation now work consistently after refactors, without brittle path assumptions. +- **Overall impact:** Day-to-day usage is more stable, commands behave as expected in more environments, and setup/deploy workflows require less troubleshooting. diff --git a/docs/changelog/000.003.004-2025-12-21.md b/docs/changelog/000.003.004-2025-12-21.md index 82732f2ab1..06617ad179 100644 --- a/docs/changelog/000.003.004-2025-12-21.md +++ b/docs/changelog/000.003.004-2025-12-21.md @@ -2,8 +2,8 @@ ## [0.3.4] - 2025-12-21 -* Added ***sys-util-git-pull*** for deterministic shallow Git updates with tag pinning; integrated into ***pkgmgr***. -* Pinned ***pkgmgr*** clones to ***stable*** for reproducible deployments. -* Refactored CLI to avoid runpy warnings. -* Improved Ansible portability (pacman β†’ package) and added formatter workflow. -* Fixed deploy resolution, AUR installs (use ***aur_builder***), Debian/Ubuntu images (openssh-client), CI rate limits (***NIX_CONFIG***), plus general test and security fixes. +- Added ***sys-util-git-pull*** for deterministic shallow Git updates with tag pinning; integrated into ***pkgmgr***. +- Pinned ***pkgmgr*** clones to ***stable*** for reproducible deployments. +- Refactored CLI to avoid runpy warnings. +- Improved Ansible portability (pacman β†’ package) and added formatter workflow. +- Fixed deploy resolution, AUR installs (use ***aur_builder***), Debian/Ubuntu images (openssh-client), CI rate limits (***NIX_CONFIG***), plus general test and security fixes. diff --git a/docs/changelog/000.003.005-2025-12-21.md b/docs/changelog/000.003.005-2025-12-21.md index a6ef785ca5..3afc361f0e 100644 --- a/docs/changelog/000.003.005-2025-12-21.md +++ b/docs/changelog/000.003.005-2025-12-21.md @@ -2,4 +2,4 @@ ## [0.3.5] - 2025-12-21 -* SSH client installation is now handled explicitly during user provisioning instead of being bundled into the container build. Root SSH keys are generated in a modular, idempotent way and are preserved across repeated runs. This makes SSH access more predictable, reproducible, and easier to maintain, without changing user-facing behavior. +- SSH client installation is now handled explicitly during user provisioning instead of being bundled into the container build. Root SSH keys are generated in a modular, idempotent way and are preserved across repeated runs. This makes SSH access more predictable, reproducible, and easier to maintain, without changing user-facing behavior. diff --git a/docs/changelog/000.004.000-2025-12-29.md b/docs/changelog/000.004.000-2025-12-29.md index f4430bbe9a..c522fa8871 100644 --- a/docs/changelog/000.004.000-2025-12-29.md +++ b/docs/changelog/000.004.000-2025-12-29.md @@ -2,15 +2,15 @@ ## [0.4.0] - 2025-12-29 -* **CI DNS & Defaults:** Introduced CoreDNS-based *.localhost resolution (A/AAAA to loopback), set DOMAIN_PRIMARY to localhost, added DNS assertions and a strict default 404 vhost to stabilize early CI stages. -* **Docker-in-Docker:** Switched the deploy container to real Docker-in-Docker using fuse-overlayfs, fully decoupled from the host Docker socket and configured a deterministic storage driver. -* **CI Debugging:** Greatly improved CI diagnostics by dumping resolved docker compose configuration and environment data in debug mode, with optional unmasked .env output. -* **Bind Mount Robustness:** Fixed CI-specific bind mount issues, ensured /tmp/gh-action visibility, prevented file-vs-directory conflicts, and asserted OpenResty/NGINX mount sources before startup. -* **Service Orchestration:** Added deferred service execution via system_service_run_final and the new sys-service-terminator, enabling deterministic, end-of-play service execution with built-in rescue diagnostics. -* **Backup Layout:** Consolidated all backups under /var/lib/infinito, parameterized the pull workflow, switched to dump-only backups, and disabled Redis backups across web applications. -* **Database Seeding:** Introduced the * multi-database marker for cluster-aware seeding, enabling clean PostgreSQL cluster dumps and clearer seeder semantics. -* **CSP Health Checks:** Migrated CSP health checks to a Docker-based csp-checker with configurable image selection, optional pre-pull behavior, and improved ignore handling. -* **Tokens & Secrets:** Unified token handling through a centralized token store, added user token defaults, and fully centralized secrets path definitions across roles. -* **Installation Refactor:** Migrated system and backup tooling from pkgmgr and Nix-based installs to system-wide pip installations with clear host vs container separation. -* **Systemd & CI Stability:** Hardened systemd and oneshot service handling in containerized CI, improved exit-code diagnostics, and reduced flaky CI behavior through deterministic execution. -* **Maintenance & Cleanup:** Reduced Let’s Encrypt renewal frequency to avoid rate limits, removed deprecated logs and variables, applied broad refactorings, and merged the Matomo autosetup feature. +- **CI DNS & Defaults:** Introduced CoreDNS-based *.localhost resolution (A/AAAA to loopback), set DOMAIN_PRIMARY to localhost, added DNS assertions and a strict default 404 vhost to stabilize early CI stages. +- **Docker-in-Docker:** Switched the deploy container to real Docker-in-Docker using fuse-overlayfs, fully decoupled from the host Docker socket and configured a deterministic storage driver. +- **CI Debugging:** Greatly improved CI diagnostics by dumping resolved docker compose configuration and environment data in debug mode, with optional unmasked .env output. +- **Bind Mount Robustness:** Fixed CI-specific bind mount issues, ensured /tmp/gh-action visibility, prevented file-vs-directory conflicts, and asserted OpenResty/NGINX mount sources before startup. +- **Service Orchestration:** Added deferred service execution via system_service_run_final and the new sys-service-terminator, enabling deterministic, end-of-play service execution with built-in rescue diagnostics. +- **Backup Layout:** Consolidated all backups under /var/lib/infinito, parameterized the pull workflow, switched to dump-only backups, and disabled Redis backups across web applications. +- **Database Seeding:** Introduced the * multi-database marker for cluster-aware seeding, enabling clean PostgreSQL cluster dumps and clearer seeder semantics. +- **CSP Health Checks:** Migrated CSP health checks to a Docker-based csp-checker with configurable image selection, optional pre-pull behavior, and improved ignore handling. +- **Tokens & Secrets:** Unified token handling through a centralized token store, added user token defaults, and fully centralized secrets path definitions across roles. +- **Installation Refactor:** Migrated system and backup tooling from pkgmgr and Nix-based installs to system-wide pip installations with clear host vs container separation. +- **Systemd & CI Stability:** Hardened systemd and oneshot service handling in containerized CI, improved exit-code diagnostics, and reduced flaky CI behavior through deterministic execution. +- **Maintenance & Cleanup:** Reduced Let’s Encrypt renewal frequency to avoid rate limits, removed deprecated logs and variables, applied broad refactorings, and merged the Matomo autosetup feature. diff --git a/docs/changelog/000.005.000-2025-12-30.md b/docs/changelog/000.005.000-2025-12-30.md index 77d53cdd11..38fe0583a8 100644 --- a/docs/changelog/000.005.000-2025-12-30.md +++ b/docs/changelog/000.005.000-2025-12-30.md @@ -2,15 +2,15 @@ ## [0.5.0] - 2025-12-30 -* Unified TLS handling by replacing SSL_ENABLED with TLS_ENABLED across the entire stack -* Removed localhost special-casing and introduced infinito.localhost as a consistent FQDN -* Stabilized CI deploys via a single make test-deploy entrypoint with INFINITO_DISTRO -* Eliminated Docker container name conflicts by reusing or cleanly resetting deploy test containers -* Fixed systemd-in-container boot hangs by disabling systemd-firstboot and initializing machine-id -* Switched CI execution to compose-native workflows with host cgroup support for systemd -* Hardened Docker and systemd restarts with non-blocking logic, timeouts, and detailed diagnostics -* Fixed SMTP in CI and DinD by dynamically selecting ports and disabling authentication when TLS is off -* Ensured reliable Mailu initialization by waiting for database schema readiness -* Prevented backup failures by enforcing linear service execution order and safer handler flushing -* Removed obsolete legacy paths now that systemd is universally available -* Improved code quality and CI stability through Ruff optimization and test fixes +- Unified TLS handling by replacing SSL_ENABLED with TLS_ENABLED across the entire stack +- Removed localhost special-casing and introduced infinito.localhost as a consistent FQDN +- Stabilized CI deploys via a single make test-deploy entrypoint with INFINITO_DISTRO +- Eliminated Docker container name conflicts by reusing or cleanly resetting deploy test containers +- Fixed systemd-in-container boot hangs by disabling systemd-firstboot and initializing machine-id +- Switched CI execution to compose-native workflows with host cgroup support for systemd +- Hardened Docker and systemd restarts with non-blocking logic, timeouts, and detailed diagnostics +- Fixed SMTP in CI and DinD by dynamically selecting ports and disabling authentication when TLS is off +- Ensured reliable Mailu initialization by waiting for database schema readiness +- Prevented backup failures by enforcing linear service execution order and safer handler flushing +- Removed obsolete legacy paths now that systemd is universally available +- Improved code quality and CI stability through Ruff optimization and test fixes diff --git a/docs/changelog/000.006.000-2025-12-31.md b/docs/changelog/000.006.000-2025-12-31.md index 08007bf39e..721a6efaa4 100644 --- a/docs/changelog/000.006.000-2025-12-31.md +++ b/docs/changelog/000.006.000-2025-12-31.md @@ -2,10 +2,10 @@ ## [0.6.0] - 2025-12-31 -* **SSH keys are now configured in inventory via users..authorized_keys** (single source of truth). The old CLI option to inject administrator keys and the inventory files-based authorized_keys copy were removed. -* **Administrator login is enforced to be key-based:** playbooks fail early if users.administrator.authorized_keys is empty. -* **Backup user SSH access was hardened:** backup keys are wrapped with a forced command wrapper and written via the shared user role; config is now users.backup.authorized_keys. -* **Token handling was unified:** Mailu and Matomo now read tokens from users.*.tokens (mailu_token legacy removed), and a token-store hydration mechanism loads persisted tokens automatically. -* **Matomo integration is safer:** it now fails fast on empty tokens and consistently uses the hydrated users.administrator.tokens value for API calls. -* **Backup/cleanup services are more reliable:** run-once flags execute earlier, user-backup is an explicit dependency, and cleanback now uses a configurable backups root and keeps the newest backups by default (force-keep=3). -* **Better cross-distro stability:** sys-pip-install now resolves the correct pip executable dynamically and uses ansible.builtin.pip, reducing interpreter/PATH mismatches; plus CoreDNS is a compose dependency and yay auto-rebuilds if the binary is broken after libalpm ABI changes. +- **SSH keys are now configured in inventory via users..authorized_keys** (single source of truth). The old CLI option to inject administrator keys and the inventory files-based authorized_keys copy were removed. +- **Administrator login is enforced to be key-based:** playbooks fail early if users.administrator.authorized_keys is empty. +- **Backup user SSH access was hardened:** backup keys are wrapped with a forced command wrapper and written via the shared user role; config is now users.backup.authorized_keys. +- **Token handling was unified:** Mailu and Matomo now read tokens from users.*.tokens (mailu_token legacy removed), and a token-store hydration mechanism loads persisted tokens automatically. +- **Matomo integration is safer:** it now fails fast on empty tokens and consistently uses the hydrated users.administrator.tokens value for API calls. +- **Backup/cleanup services are more reliable:** run-once flags execute earlier, user-backup is an explicit dependency, and cleanback now uses a configurable backups root and keeps the newest backups by default (force-keep=3). +- **Better cross-distro stability:** sys-pip-install now resolves the correct pip executable dynamically and uses ansible.builtin.pip, reducing interpreter/PATH mismatches; plus CoreDNS is a compose dependency and yay auto-rebuilds if the binary is broken after libalpm ABI changes. diff --git a/docs/changelog/000.007.000-2026-01-05.md b/docs/changelog/000.007.000-2026-01-05.md index 3ac882cb33..0b8277a017 100644 --- a/docs/changelog/000.007.000-2026-01-05.md +++ b/docs/changelog/000.007.000-2026-01-05.md @@ -2,8 +2,8 @@ ## [0.7.0] - 2026-01-05 -* More reliable releases: versioned Docker images are always built and published; latest always points to the newest version. -* More stable updates: pkgmgr execution is more robust, especially in non-interactive environments and virtual environments. -* Better readability: Ansible output is now shown in clean, human-readable YAML format by default. -* More reliable analytics setup: Matomo is initialized automatically even if the service is unreachable or the API token is missing. -* Improved networking behavior: Docker services now consistently use configurable host addresses instead of hard-coded loopback addresses. +- More reliable releases: versioned Docker images are always built and published; latest always points to the newest version. +- More stable updates: pkgmgr execution is more robust, especially in non-interactive environments and virtual environments. +- Better readability: Ansible output is now shown in clean, human-readable YAML format by default. +- More reliable analytics setup: Matomo is initialized automatically even if the service is unreachable or the API token is missing. +- Improved networking behavior: Docker services now consistently use configurable host addresses instead of hard-coded loopback addresses. diff --git a/docs/changelog/000.007.001-2026-01-06.md b/docs/changelog/000.007.001-2026-01-06.md index 6ac64f0f47..297dce16a9 100644 --- a/docs/changelog/000.007.001-2026-01-06.md +++ b/docs/changelog/000.007.001-2026-01-06.md @@ -2,15 +2,15 @@ ## [0.7.1] - 2026-01-06 -* Switched web-app-sphinx to a prebuilt container image +- Switched web-app-sphinx to a prebuilt container image Removed local pkgmgr build logic and now deploys via the published GHCR image with explicit Docker service configuration. -* Stabilized XWiki REST authentication and superadmin provisioning +- Stabilized XWiki REST authentication and superadmin provisioning Fixed Dockerfile credential injection, introduced shared REST session handling, and ensured consistent cookie and CSRF usage for all REST writes. -* Improved XWiki Ansible idempotency and URL handling +- Improved XWiki Ansible idempotency and URL handling Normalized internal URLs, clarified uri auth parameters, and made extension install and admin setup fully repeatable. -* Reset logout service database configuration +- Reset logout service database configuration Explicitly set database type to null where no persistence is required. -* Restored Ansible task timing and profiling output +- Restored Ansible task timing and profiling output Re-enabled timer and profile_tasks via callbacks_enabled, restoring runtime visibility with YAML output. -* Simplified CI image publishing workflow +- Simplified CI image publishing workflow Removed the ci-publish workflow to ensure images are always built on version tags, while keeping stable tagging gated on successful checks. diff --git a/docs/changelog/000.007.002-2026-01-06.md b/docs/changelog/000.007.002-2026-01-06.md index 5d076e1b17..9bb0bd46d2 100644 --- a/docs/changelog/000.007.002-2026-01-06.md +++ b/docs/changelog/000.007.002-2026-01-06.md @@ -2,6 +2,6 @@ ## [0.7.2] - 2026-01-06 -* Introduced lifecycle metadata for roles (`meta/main.yml`) -* Gated CI deploy tests to tested lifecycles only (alpha, beta, rc, stable) -* Bumped `cleanback` to 1.2.1 (timestamp-based force-keep) +- Introduced lifecycle metadata for roles (`meta/main.yml`) +- Gated CI deploy tests to tested lifecycles only (alpha, beta, rc, stable) +- Bumped `cleanback` to 1.2.1 (timestamp-based force-keep) diff --git a/docs/changelog/000.008.000-2026-01-06.md b/docs/changelog/000.008.000-2026-01-06.md index e8fa818f1e..87d83d1c38 100644 --- a/docs/changelog/000.008.000-2026-01-06.md +++ b/docs/changelog/000.008.000-2026-01-06.md @@ -2,4 +2,4 @@ ## [0.8.0] - 2026-01-06 -* Safer failed-backup cleanup (04:00, timeout, single worker; cleanback 1.3.0 semantics). +- Safer failed-backup cleanup (04:00, timeout, single worker; cleanback 1.3.0 semantics). diff --git a/docs/changelog/000.009.000-2026-01-07.md b/docs/changelog/000.009.000-2026-01-07.md index dd617deff4..6017763655 100644 --- a/docs/changelog/000.009.000-2026-01-07.md +++ b/docs/changelog/000.009.000-2026-01-07.md @@ -2,10 +2,10 @@ ## [0.9.0] - 2026-01-07 -* Skip hostname configuration when running inside Docker containers -* Unify workstation user handling via *WORKSTATION_USER* across desktop roles -* Cleanly resolve conflicts between postfix and msmtp for local and external mail delivery -* Consolidate mail configuration using flat *SYSTEM_EMAIL_* variables and improve local delivery reliability -* Make remote backup pulls fail fast per host while continuing across providers -* Enable Nix shell integration by default and finalize the official installer flow -* Improve MediaWiki deployment with persistent extensions and a safer install/update process +- Skip hostname configuration when running inside Docker containers +- Unify workstation user handling via *WORKSTATION_USER* across desktop roles +- Cleanly resolve conflicts between postfix and msmtp for local and external mail delivery +- Consolidate mail configuration using flat *SYSTEM_EMAIL_* variables and improve local delivery reliability +- Make remote backup pulls fail fast per host while continuing across providers +- Enable Nix shell integration by default and finalize the official installer flow +- Improve MediaWiki deployment with persistent extensions and a safer install/update process diff --git a/docs/changelog/000.010.000-2026-01-08.md b/docs/changelog/000.010.000-2026-01-08.md index 9e61e46d61..1e6ad80ba4 100644 --- a/docs/changelog/000.010.000-2026-01-08.md +++ b/docs/changelog/000.010.000-2026-01-08.md @@ -2,9 +2,9 @@ ## [0.10.0] - 2026-01-08 -* **More reliable workstation setups:** A dedicated *workstation user* ensures deployments and integration tests run consistently. -* **Improved user management:** A unified *user_key* model provides clearer and more robust user and permission handling across all roles. -* **Cleaner Docker environments:** Removing implicit cgroup volumes prevents unwanted anonymous volumes and makes container behavior more predictable. -* **New CLI capability:** Automatic resolution of *run_after* dependencies with safe cycle detection simplifies role analysis and automation. -* **More reliable Git configuration:** Git setup now works consistently for workstation users without broken or implicit dependencies. -* **More robust Mailu configuration:** Optional user roles are handled safely, avoiding configuration and runtime errors. +- **More reliable workstation setups:** A dedicated *workstation user* ensures deployments and integration tests run consistently. +- **Improved user management:** A unified *user_key* model provides clearer and more robust user and permission handling across all roles. +- **Cleaner Docker environments:** Removing implicit cgroup volumes prevents unwanted anonymous volumes and makes container behavior more predictable. +- **New CLI capability:** Automatic resolution of *run_after* dependencies with safe cycle detection simplifies role analysis and automation. +- **More reliable Git configuration:** Git setup now works consistently for workstation users without broken or implicit dependencies. +- **More robust Mailu configuration:** Optional user roles are handled safely, avoiding configuration and runtime errors. diff --git a/docs/changelog/000.011.000-2026-01-10.md b/docs/changelog/000.011.000-2026-01-10.md index dcb2aec2b5..3ea6967100 100644 --- a/docs/changelog/000.011.000-2026-01-10.md +++ b/docs/changelog/000.011.000-2026-01-10.md @@ -2,4 +2,4 @@ ## [0.11.0] - 2026-01-10 -* CI failures are easier to debug thanks to clear per-app logs and improved error reporting. +- CI failures are easier to debug thanks to clear per-app logs and improved error reporting. diff --git a/docs/changelog/000.012.000-2026-01-25.md b/docs/changelog/000.012.000-2026-01-25.md index a89bdedce9..755cf73265 100644 --- a/docs/changelog/000.012.000-2026-01-25.md +++ b/docs/changelog/000.012.000-2026-01-25.md @@ -2,15 +2,15 @@ ## [0.12.0] - 2026-01-25 -* Hardened CI/CD pipelines with retries and Git fallback for Ansible Galaxy collections -* Unified ShellCheck execution via container for reproducible linting -* Enforced secure secret handling across all roles (shell quoting, dotenv, sed safety) -* Introduced `sed_escape` filter to prevent sed injection and config corruption -* Implemented robust, idempotent PostgreSQL superuser password rotation -* Improved Mailu and MariaDB user/password idempotency and CLI safety -* Added optional Django admin bootstrap and secure `SECRET_KEY` handling for Baserow -* Refactored TLS into a single, explicit resolution layer with SAN-aware certificates -* Improved Keycloak reliability by handling noisy CLI output without jq -* Fixed Discourse startup issues by enforcing `C.UTF-8` locale -* Refactored CSP health checks to operate on full URLs derived from NGINX configs (**breaking change**) -* Improved developer experience with cleaner CLI structure, scripts, and tests +- Hardened CI/CD pipelines with retries and Git fallback for Ansible Galaxy collections +- Unified ShellCheck execution via container for reproducible linting +- Enforced secure secret handling across all roles (shell quoting, dotenv, sed safety) +- Introduced `sed_escape` filter to prevent sed injection and config corruption +- Implemented robust, idempotent PostgreSQL superuser password rotation +- Improved Mailu and MariaDB user/password idempotency and CLI safety +- Added optional Django admin bootstrap and secure `SECRET_KEY` handling for Baserow +- Refactored TLS into a single, explicit resolution layer with SAN-aware certificates +- Improved Keycloak reliability by handling noisy CLI output without jq +- Fixed Discourse startup issues by enforcing `C.UTF-8` locale +- Refactored CSP health checks to operate on full URLs derived from NGINX configs (**breaking change**) +- Improved developer experience with cleaner CLI structure, scripts, and tests diff --git a/docs/changelog/001.000.000-2026-02-03.md b/docs/changelog/001.000.000-2026-02-03.md index 46f3220ce7..886ec9b3f1 100644 --- a/docs/changelog/001.000.000-2026-02-03.md +++ b/docs/changelog/001.000.000-2026-02-03.md @@ -10,68 +10,68 @@ This release delivers a major stability and reliability upgrade across the Infin #### TLS & Certificate Pipeline πŸ” -* Switched self-signed mode to a **CA-signed certificate chain** with deterministic trust installation -* Strict SAN planning driven by `CURRENT_PLAY_DOMAINS_ALL` -* Clean separation of TLS state (`tls`) and cert paths (`cert`) -* Faster, safer cert deployment (no global sleeps, deterministic container restarts) -* Improved domain/alias resolution and strict opt-in auto-alias behavior +- Switched self-signed mode to a **CA-signed certificate chain** with deterministic trust installation +- Strict SAN planning driven by `CURRENT_PLAY_DOMAINS_ALL` +- Clean separation of TLS state (`tls`) and cert paths (`cert`) +- Faster, safer cert deployment (no global sleeps, deterministic container restarts) +- Improved domain/alias resolution and strict opt-in auto-alias behavior #### CA Trust Injection (Host & Containers) 🧩 -* Unified trust injection via `with-ca-trust.sh` -* Best-effort CA installation (non-fatal in minimal/unprivileged containers) -* Env-based trust fallbacks (`SSL_CERT_FILE`, `REQUESTS_CA_BUNDLE`, …) -* Support for distroless images, profile-only services, NSS/Chromium -* Hardened CA override generator and correct execution order +- Unified trust injection via `with-ca-trust.sh` +- Best-effort CA installation (non-fatal in minimal/unprivileged containers) +- Env-based trust fallbacks (`SSL_CERT_FILE`, `REQUESTS_CA_BUNDLE`, …) +- Support for distroless images, profile-only services, NSS/Chromium +- Hardened CA override generator and correct execution order #### Docker Compose Tooling 🐳 -* Centralized and hardened compose wrappers (`compose-base`) -* Strict multi-pass Jinja rendering to prevent leaked templates -* Correct `--env-file` handling and safe argument escaping -* Deterministic compose behavior across local, CI, and containerized environments +- Centralized and hardened compose wrappers (`compose-base`) +- Strict multi-pass Jinja rendering to prevent leaked templates +- Correct `--env-file` handling and safe argument escaping +- Deterministic compose behavior across local, CI, and containerized environments #### Inventory & Image Mirroring πŸͺž -* New `--mirror` support for inventory generation -* Per-service `mirror_policy`: - * `if_missing` (default) - * `force` - * `skip` -* Mirrors override **image/version only**, preserving all other service config -* Robust GHCR mirroring with rate limiting, concurrency protection, and recompress fallback -* CI workflows fully mirror-aware with strict env validation +- New `--mirror` support for inventory generation +- Per-service `mirror_policy`: + - `if_missing` (default) + - `force` + - `skip` +- Mirrors override **image/version only**, preserving all other service config +- Robust GHCR mirroring with rate limiting, concurrency protection, and recompress fallback +- CI workflows fully mirror-aware with strict env validation #### Standardized Service Configuration 🧱 -* Unified Docker image handling via `docker.services..image/version` -* Refactored multiple roles (pgAdmin, Friendica, LibreTranslate, oauth2-proxy, Funkwhale, …) -* Removed misleading/deprecated image/version flags (e.g. Nextcloud) +- Unified Docker image handling via `docker.services..image/version` +- Refactored multiple roles (pgAdmin, Friendica, LibreTranslate, oauth2-proxy, Funkwhale, …) +- Removed misleading/deprecated image/version flags (e.g. Nextcloud) #### CI & Test Guardrails πŸ§ͺ -* New integration tests enforcing: - * valid image/version syntax - * required image tags for buildable services -* Improved CI stability (AppArmor handling, deterministic compose execution) +- New integration tests enforcing: + - valid image/version syntax + - required image tags for buildable services +- Improved CI stability (AppArmor handling, deterministic compose execution) #### Role Hardening & Idempotency πŸ› οΈ -* Reliable admin bootstrap for Discourse, Snipe-IT, Taiga, WordPress -* LDAP/OIDC fixes across multiple services (Nextcloud, Mailu, Snipe-IT, Discourse) -* Resource limits added to prevent OOM crashes -* Safer systemd deploy flow with deploy-safe timer handling -* Improved admin and cleanup tooling +- Reliable admin bootstrap for Discourse, Snipe-IT, Taiga, WordPress +- LDAP/OIDC fixes across multiple services (Nextcloud, Mailu, Snipe-IT, Discourse) +- Resource limits added to prevent OOM crashes +- Safer systemd deploy flow with deploy-safe timer handling +- Improved admin and cleanup tooling ### Why this matters 🧠 -* Deployments are now **predictable, repeatable, and debuggable** -* TLS, CA trust, and Docker behavior are aligned across **local, CI, and production** -* Image mirroring is **explicit, controlled, and safe by default** -* Role configuration is **consistent and machine-verifiable** +- Deployments are now **predictable, repeatable, and debuggable** +- TLS, CA trust, and Docker behavior are aligned across **local, CI, and production** +- Image mirroring is **explicit, controlled, and safe by default** +- Role configuration is **consistent and machine-verifiable** ### Notes ⚠️ -* Mirroring remains **opt-in** via `--mirror` -* Strict validation fails fast only where silent misconfiguration would be dangerous -* Several deprecated config paths/tests were removed as part of the standardization +- Mirroring remains **opt-in** via `--mirror` +- Strict validation fails fast only where silent misconfiguration would be dangerous +- Several deprecated config paths/tests were removed as part of the standardization diff --git a/docs/changelog/002.000.000-2026-02-08.md b/docs/changelog/002.000.000-2026-02-08.md index a29e6cd448..1291b0dcd0 100644 --- a/docs/changelog/002.000.000-2026-02-08.md +++ b/docs/changelog/002.000.000-2026-02-08.md @@ -2,13 +2,13 @@ ## [2.0.0] - 2026-02-08 -* **Standardized container execution** by fully replacing raw Docker CLI usage with the *container* and *compose* wrappers, enforcing engine-agnostic behavior via integration tests -* **Migrated compose files** from *docker-compose.yml* to *compose.yml*, including override and CA override variants, and unified compose-related configuration keys -* **Centralized compose path resolution** and file argument handling to be deterministic, consistent, and testable -* **Introduced strict lookup APIs** using positional *want-path* semantics for *config*, *container*, *compose*, *tls*, *cert*, *nginx*, *domain*, and *database* -* **Improved CLI testability** by making imports patchable and forwarding command arguments unchanged -* **Hardened CA trust, health, and repair logic** with *soft-fail* behavior, improved diagnostics, and safe handling of one-shot containers -* **Fixed Moodle redeploy failures** by stripping the trailing slash from *CFG->wwwroot* to prevent health check issues -* **Made Snipe-IT admin bootstrap idempotent** and treated known *users_groups* duplicate constraint errors as non-fatal while keeping strict failure handling for other cases -* **Stabilized multi-distro CI deploys** with per-distro orchestration, two-pass *ASYNC* testing, hard cleanup between runs, and a global execution time budget -* **Improved image mirroring workflows** with clearer separation of full and missing-only runs, branch-scoped concurrency, and deploy gating on successful mirroring +- **Standardized container execution** by fully replacing raw Docker CLI usage with the *container* and *compose* wrappers, enforcing engine-agnostic behavior via integration tests +- **Migrated compose files** from *docker-compose.yml* to *compose.yml*, including override and CA override variants, and unified compose-related configuration keys +- **Centralized compose path resolution** and file argument handling to be deterministic, consistent, and testable +- **Introduced strict lookup APIs** using positional *want-path* semantics for *config*, *container*, *compose*, *tls*, *cert*, *nginx*, *domain*, and *database* +- **Improved CLI testability** by making imports patchable and forwarding command arguments unchanged +- **Hardened CA trust, health, and repair logic** with *soft-fail* behavior, improved diagnostics, and safe handling of one-shot containers +- **Fixed Moodle redeploy failures** by stripping the trailing slash from *CFG->wwwroot* to prevent health check issues +- **Made Snipe-IT admin bootstrap idempotent** and treated known *users_groups* duplicate constraint errors as non-fatal while keeping strict failure handling for other cases +- **Stabilized multi-distro CI deploys** with per-distro orchestration, two-pass *ASYNC* testing, hard cleanup between runs, and a global execution time budget +- **Improved image mirroring workflows** with clearer separation of full and missing-only runs, branch-scoped concurrency, and deploy gating on successful mirroring diff --git a/docs/changelog/002.001.000-2026-02-08.md b/docs/changelog/002.001.000-2026-02-08.md index a17778f663..02a51fb64f 100644 --- a/docs/changelog/002.001.000-2026-02-08.md +++ b/docs/changelog/002.001.000-2026-02-08.md @@ -2,4 +2,4 @@ ## [2.1.0] - 2026-02-08 -* Improves CI and release reliability by simplifying workflows, correcting permission handling, and hardening the pipeline against transient upstream failures. +- Improves CI and release reliability by simplifying workflows, correcting permission handling, and hardening the pipeline against transient upstream failures. diff --git a/docs/changelog/002.001.001-2026-02-08.md b/docs/changelog/002.001.001-2026-02-08.md index 11a05290a4..e1f767dc7d 100644 --- a/docs/changelog/002.001.001-2026-02-08.md +++ b/docs/changelog/002.001.001-2026-02-08.md @@ -2,4 +2,4 @@ ## [2.1.1] - 2026-02-08 -* Resolved CI instability caused by incomplete Docker cleanup between distro runs +- Resolved CI instability caused by incomplete Docker cleanup between distro runs diff --git a/docs/changelog/002.001.002-2026-02-08.md b/docs/changelog/002.001.002-2026-02-08.md index 712fa5926e..94da2dedcf 100644 --- a/docs/changelog/002.001.002-2026-02-08.md +++ b/docs/changelog/002.001.002-2026-02-08.md @@ -2,4 +2,4 @@ ## [2.1.2] - 2026-02-08 -* Removes the v* tag trigger from the push workflow so CI runs only on branch pushes. This prevents duplicate pipeline executions when pushing a branch together with a version tag and aligns the workflow with the updated release process. +- Removes the v* tag trigger from the push workflow so CI runs only on branch pushes. This prevents duplicate pipeline executions when pushing a branch together with a version tag and aligns the workflow with the updated release process. diff --git a/docs/changelog/002.001.003-2026-02-08.md b/docs/changelog/002.001.003-2026-02-08.md index 5136e466f3..ed678f9f0d 100644 --- a/docs/changelog/002.001.003-2026-02-08.md +++ b/docs/changelog/002.001.003-2026-02-08.md @@ -2,4 +2,4 @@ ## [2.1.3] - 2026-02-08 -* This release improves CI and developer tooling robustness by fixing hardlink-related errors, stabilizing workflow triggers, resolving type-checking import cycles, and hardening cleanup and teardown logic across the CLI and templating utilities. +- This release improves CI and developer tooling robustness by fixing hardlink-related errors, stabilizing workflow triggers, resolving type-checking import cycles, and hardening cleanup and teardown logic across the CLI and templating utilities. diff --git a/docs/changelog/002.001.004-2026-02-08.md b/docs/changelog/002.001.004-2026-02-08.md index 69c7c3f01e..e41078723d 100644 --- a/docs/changelog/002.001.004-2026-02-08.md +++ b/docs/changelog/002.001.004-2026-02-08.md @@ -2,4 +2,4 @@ ## [2.1.4] - 2026-02-08 -* This release ensures that commits carrying a version tag trigger the full distro test matrix by detecting tags pointing at the current commit, while regular commits continue to run on a single random distro. +- This release ensures that commits carrying a version tag trigger the full distro test matrix by detecting tags pointing at the current commit, while regular commits continue to run on a single random distro. diff --git a/docs/changelog/002.001.005-2026-02-09.md b/docs/changelog/002.001.005-2026-02-09.md index f6137eb893..7181477832 100644 --- a/docs/changelog/002.001.005-2026-02-09.md +++ b/docs/changelog/002.001.005-2026-02-09.md @@ -2,4 +2,4 @@ ## [2.1.5] - 2026-02-09 -* Prevents CI failures when no workstation apps are discovered by safely skipping the deploy job, and cleans up unnecessary cleanup output to keep logs readable and focused. +- Prevents CI failures when no workstation apps are discovered by safely skipping the deploy job, and cleans up unnecessary cleanup output to keep logs readable and focused. diff --git a/docs/changelog/002.001.006-2026-02-09.md b/docs/changelog/002.001.006-2026-02-09.md index c8127bee05..ad7129d643 100644 --- a/docs/changelog/002.001.006-2026-02-09.md +++ b/docs/changelog/002.001.006-2026-02-09.md @@ -2,4 +2,4 @@ ## [2.1.6] - 2026-02-09 -* Improves CI and test robustness by fixing Jinja2 templating edge cases, unifying unittest mock imports, hardening Docker image pull retries, and resolving multiple code-scanning alerts without suppressions. +- Improves CI and test robustness by fixing Jinja2 templating edge cases, unifying unittest mock imports, hardening Docker image pull retries, and resolving multiple code-scanning alerts without suppressions. diff --git a/docs/changelog/002.001.007-2026-02-09.md b/docs/changelog/002.001.007-2026-02-09.md index 37b657f368..9d283dc9a7 100644 --- a/docs/changelog/002.001.007-2026-02-09.md +++ b/docs/changelog/002.001.007-2026-02-09.md @@ -2,4 +2,4 @@ ## [2.1.7] - 2026-02-09 -* Improves CI stability by extending deploy job timeouts to 6 hours, moving compose pull retries into Ansible, and adding additional deployer metadata. +- Improves CI stability by extending deploy job timeouts to 6 hours, moving compose pull retries into Ansible, and adding additional deployer metadata. diff --git a/docs/changelog/002.001.008-2026-02-09.md b/docs/changelog/002.001.008-2026-02-09.md index f7934ddfe0..271db7f24b 100644 --- a/docs/changelog/002.001.008-2026-02-09.md +++ b/docs/changelog/002.001.008-2026-02-09.md @@ -2,4 +2,4 @@ ## [2.1.8] - 2026-02-09 -* Add SSH client to the CI Docker image so Ansible controller runs no longer fail due to a missing ssh binary. +- Add SSH client to the CI Docker image so Ansible controller runs no longer fail due to a missing ssh binary. diff --git a/docs/changelog/002.001.009-2026-02-10.md b/docs/changelog/002.001.009-2026-02-10.md index 062cd01a88..01293d6492 100644 --- a/docs/changelog/002.001.009-2026-02-10.md +++ b/docs/changelog/002.001.009-2026-02-10.md @@ -2,4 +2,4 @@ ## [2.1.9] - 2026-02-10 -* Matomo now waits for a real HTTP-ready state before bootstrapping, replacing the TCP check with a PHP-based /index.php healthcheck to prevent startup race conditions. +- Matomo now waits for a real HTTP-ready state before bootstrapping, replacing the TCP check with a PHP-based /index.php healthcheck to prevent startup race conditions. diff --git a/docs/changelog/003.000.000-2026-02-11.md b/docs/changelog/003.000.000-2026-02-11.md index 492d48fa3e..cb2e8d8661 100644 --- a/docs/changelog/003.000.000-2026-02-11.md +++ b/docs/changelog/003.000.000-2026-02-11.md @@ -2,21 +2,21 @@ ## [3.0.0] - 2026-02-11 -* **🚨 Breaking Changes** -* Deployment type flag removed +- **🚨 Breaking Changes** +- Deployment type flag removed The CLI flag *-T / INFINITO_DEPLOY_TYPE* has been removed. Deployment types are now derived automatically from invokable role rules. -* Universal stage execution removed +- Universal stage execution removed Universal roles are no longer executed as a separate lifecycle stage. They are handled exclusively via constructor and destructor stages. This prevents duplicate executions but changes lifecycle behavior. -* Removed CLI flags +- Removed CLI flags The following options are no longer available: *--sound* *--no-signal* *--alarm-timeout* -* CI filtering changed +- CI filtering changed *ONLY_APP* has been replaced with a space-separated *WHITELIST*. *INCLUDE_RE* and *EXCLUDE_RE* have been removed. Lifecycle selection via *TESTED_LIFECYCLES* is no longer supported. -* Web-App Chess deployment changed +- Web-App Chess deployment changed The custom Dockerfile was removed. The service now uses a prebuilt registry image. Runtime *yarn install* no longer runs during container startup. @@ -24,24 +24,24 @@ --- **⚠ Behavior Changes** -* Deployment type detection +- Deployment type detection Deployment types server, workstation, and universal are now derived strictly from centralized invokable rules. Inventory group aliases are no longer interpreted. -* Matomo healthcheck behavior +- Matomo healthcheck behavior Healthchecks were reworked. HTTP readiness validation is stricter. Bootstrap now retries before failing. Container health timing differs from previous versions. -* OpenResty image handling +- OpenResty image handling Image and version are now resolved from role configuration instead of hardcoded variables. Custom overrides must be placed in config. -* Docker command abstraction +- Docker command abstraction Direct *docker exec* usage was replaced with *container exec*. Custom scripts relying on raw docker commands may require adjustment. -* CI release triggering +- CI release triggering Release logic is now driven by commit tags instead of tag-push events. --- **🧹 Removed** -* Sound subsystem -* Deprecated lifecycle filtering logic -* Legacy matrix text-based filtering -* Obsolete CLI and CI parameters +- Sound subsystem +- Deprecated lifecycle filtering logic +- Legacy matrix text-based filtering +- Obsolete CLI and CI parameters diff --git a/docs/changelog/004.000.000-2026-02-13.md b/docs/changelog/004.000.000-2026-02-13.md index d3fc4c9631..b472b30783 100644 --- a/docs/changelog/004.000.000-2026-02-13.md +++ b/docs/changelog/004.000.000-2026-02-13.md @@ -2,12 +2,12 @@ ## [4.0.0] - 2026-02-13 -* **Breaking Changes** -* Renamed *compose.services.desktop* to *compose.services.dashboard* -* Renamed role *web-app-desktop* to *web-app-dashboard* +- **Breaking Changes** +- Renamed *compose.services.desktop* to *compose.services.dashboard* +- Renamed role *web-app-desktop* to *web-app-dashboard* β†’ Custom inventories and overrides must be updated accordingly **Added** -* Introduced bundle-based server inventories under *inventories/servers/* +- Introduced bundle-based server inventories under *inventories/servers/* **Changed** -* *DOMAIN_PRIMARY* is now strictly validated (especially for Dashboard and OpenResty) -* Homepage domain is resolved automatically (Dashboard domain is preferred if present) +- *DOMAIN_PRIMARY* is now strictly validated (especially for Dashboard and OpenResty) +- Homepage domain is resolved automatically (Dashboard domain is preferred if present) diff --git a/docs/changelog/004.000.001-2026-02-15.md b/docs/changelog/004.000.001-2026-02-15.md index 50ac2cabc3..d433b2229e 100644 --- a/docs/changelog/004.000.001-2026-02-15.md +++ b/docs/changelog/004.000.001-2026-02-15.md @@ -2,22 +2,22 @@ ## [4.0.1] - 2026-02-15 -* This release focuses on improving Matomo installation stability, aligning base images, and introducing automated CI image cleanup. +- This release focuses on improving Matomo installation stability, aligning base images, and introducing automated CI image cleanup. **Improvements** -* Upgraded *matomo-bootstrap* to v1.1.12 and aligned with the latest Matomo version -* Increased installer stability with explicit timeout environment variables -* Extended timeout for the flaky *setupSuperUser* step -* Properly quoted *MATOMO_ADMIN_PASSWORD* in bootstrap environment -* Removed obsolete debug code referencing a non-existent *--debug* parameter +- Upgraded *matomo-bootstrap* to v1.1.12 and aligned with the latest Matomo version +- Increased installer stability with explicit timeout environment variables +- Extended timeout for the flaky *setupSuperUser* step +- Properly quoted *MATOMO_ADMIN_PASSWORD* in bootstrap environment +- Removed obsolete debug code referencing a non-existent *--debug* parameter **Base Image Changes** -* Changed default distribution from Arch β†’ Debian (slimmer, better aligned with published images) -* Refactored *mig* to use the published image and aligned Debian aliases -* Fixed integration tests +- Changed default distribution from Arch β†’ Debian (slimmer, better aligned with published images) +- Refactored *mig* to use the published image and aligned Debian aliases +- Fixed integration tests **CI Enhancements** -* Renamed mirror workflows (*mirror-images-* β†’ *images-mirror-*) -* Added automated weekly + manual GHCR cleanup workflow -* Cleanup removes only *ci-* tagged images older than 7 days -* Extracted cleanup logic into a dedicated script -* Supports both user and organization GHCR registries +- Renamed mirror workflows (*mirror-images-* β†’ *images-mirror-*) +- Added automated weekly + manual GHCR cleanup workflow +- Cleanup removes only *ci-* tagged images older than 7 days +- Extracted cleanup logic into a dedicated script +- Supports both user and organization GHCR registries **Result** More stable Matomo installations, leaner base images, and improved CI image lifecycle management. diff --git a/docs/changelog/004.000.002-2026-02-15.md b/docs/changelog/004.000.002-2026-02-15.md index 792dc3d959..71be9f5294 100644 --- a/docs/changelog/004.000.002-2026-02-15.md +++ b/docs/changelog/004.000.002-2026-02-15.md @@ -2,4 +2,4 @@ ## [4.0.2] - 2026-02-15 -* Matomo upgrade to 1.1.13 +- Matomo upgrade to 1.1.13 diff --git a/docs/changelog/004.000.003-2026-02-16.md b/docs/changelog/004.000.003-2026-02-16.md index b00b7930b9..0fc218c584 100644 --- a/docs/changelog/004.000.003-2026-02-16.md +++ b/docs/changelog/004.000.003-2026-02-16.md @@ -2,4 +2,4 @@ ## [4.0.3] - 2026-02-16 -* Try Matomo Boostrap 7 times if errors occure +- Try Matomo Boostrap 7 times if errors occure diff --git a/docs/changelog/004.001.000-2026-02-17.md b/docs/changelog/004.001.000-2026-02-17.md index 963a0abbc3..5dae6b209d 100644 --- a/docs/changelog/004.001.000-2026-02-17.md +++ b/docs/changelog/004.001.000-2026-02-17.md @@ -4,18 +4,18 @@ **Added** -* Controller-side *version* lookup plugin reading from *pyproject.toml* (with Poetry fallback) -* New *unit_name* lookup plugin for consistent versioned systemd unit generation -* Automatic prune phase in *sys-service* (stop/disable outdated units, remove old unit files, trigger daemon-reload) -* Persist application version as *INFINITO_VERSION* in */etc/environment* -* Parameterized image and version handling for *web-svc-simpleicons* -* Introduced *entity_name* derived from *application_id* +- Controller-side *version* lookup plugin reading from *pyproject.toml* (with Poetry fallback) +- New *unit_name* lookup plugin for consistent versioned systemd unit generation +- Automatic prune phase in *sys-service* (stop/disable outdated units, remove old unit files, trigger daemon-reload) +- Persist application version as *INFINITO_VERSION* in */etc/environment* +- Parameterized image and version handling for *web-svc-simpleicons* +- Introduced *entity_name* derived from *application_id* **Changed** -* *sys-service* now uses *SOFTWARE_DOMAIN* instead of *SOFTWARE_NAME* for versioned units -* Reordered service lifecycle: *prune β†’ lockdown β†’ reset* -* Refactored internal task structure for clearer execution flow -* Made */etc/environment* path configurable +- *sys-service* now uses *SOFTWARE_DOMAIN* instead of *SOFTWARE_NAME* for versioned units +- Reordered service lifecycle: *prune β†’ lockdown β†’ reset* +- Refactored internal task structure for clearer execution flow +- Made */etc/environment* path configurable **Removed** -* Legacy *FILE_VERSION* mechanism -* Deprecated *get_service_name* filter -* Legacy *simpleicons_host_* variables +- Legacy *FILE_VERSION* mechanism +- Deprecated *get_service_name* filter +- Legacy *simpleicons_host_* variables diff --git a/docs/changelog/005.000.000-2026-02-25.md b/docs/changelog/005.000.000-2026-02-25.md index 069618dd33..2f34e5b99c 100644 --- a/docs/changelog/005.000.000-2026-02-25.md +++ b/docs/changelog/005.000.000-2026-02-25.md @@ -2,9 +2,9 @@ ## [5.0.0] - 2026-02-25 -* **Supported distributions:** *Fedora*, *CentOS*, *Ubuntu*, *Debian* -* **Breaking Changes:** Migration from *util-* to bundle inventories under *inventories/bundles/*; deployments must migrate to new bundle and role names. Central package and AUR model via *SYS_PACKAGES* and *SYS_AUR_PACKAGES*; new roles *sys-aur* and *sys-aur-install*; renames including *util-desk-dev-core* to *dev-core*, *util-desk-dev-python* to *dev-python*, *util-desk-dev-arduino* to *dev-arduino*; *util-srv-corporate-identity* removed. -* **Added:** New workstation bundles (*admin*, *admin-network*, *browser*, *design*, *dev-arduino*, *dev-core*, *dev-java*, *dev-php*, *dev-python*, *dev-shell*, *game-compose*, *game-os*, *game-windows*, *office*). Inventory driven *sys-package* role with constructor auto load when *SYS_PACKAGES* is set. New roles *sys-openssl* and *sys-aur-install*. New lookup plugin *command_path*. New variable *SOFTWARE_URL* and updated login banner. -* **Changed:** Default distribution switched to *Debian* and CI image handling aligned. Python baseline raised: *dev-python* installs Python 3.11+ by default; *requires-python* raised to *>=3.11*. Cross distro Python interpreter and pip handling unified via *sys-pip-install*. Dashboard deployment uses fixed image *ghcr.io/kevinveenbirkenbach/port-ui:1.0.0* and mounts generated *config.yaml* read only. Alerting hardened with explicit timeouts for compose and email, plus portable mailer and systemd instance fallbacks. -* **Fixed:** OpenProject migrations stabilized (simplified migration step; preload *CustomFieldContext* before *db:migrate*). Nextcloud LDAP config hardened and incompatible apps disabled in production. XWiki extension install hardened and one time seed ensures *Main.WebHome* exists. Matomo bootstrap fails fast on root cause. TLS and CA improvements (unified self signed CA env for health services, retries for CA trust override generation, Nix TLS CA trust fix). *msmtp* improved on Fedora. OpenLDAP *python-ldap* build prerequisites and header fallback refactored; per user *password_update* policy added. Backup and ops fixes (OnlyOffice no restart during backups; backup home and ACL tasks more reliable). Container setup hardened (Fedora Docker CE CLI, dnf5 repo add, Debian buildx conflict fix, Docker readiness and SSH restart improvements). -* **CI and Tests:** New integration tests for portable python shebangs, forbid *sh -lc* with *pipefail*, and improved variable checks. CI stability improvements for per distro stacks and mirror resolver via venv Python, plus more robust package manager retries. +- **Supported distributions:** *Fedora*, *CentOS*, *Ubuntu*, *Debian* +- **Breaking Changes:** Migration from *util-* to bundle inventories under *inventories/bundles/*; deployments must migrate to new bundle and role names. Central package and AUR model via *SYS_PACKAGES* and *SYS_AUR_PACKAGES*; new roles *sys-aur* and *sys-aur-install*; renames including *util-desk-dev-core* to *dev-core*, *util-desk-dev-python* to *dev-python*, *util-desk-dev-arduino* to *dev-arduino*; *util-srv-corporate-identity* removed. +- **Added:** New workstation bundles (*admin*, *admin-network*, *browser*, *design*, *dev-arduino*, *dev-core*, *dev-java*, *dev-php*, *dev-python*, *dev-shell*, *game-compose*, *game-os*, *game-windows*, *office*). Inventory driven *sys-package* role with constructor auto load when *SYS_PACKAGES* is set. New roles *sys-openssl* and *sys-aur-install*. New lookup plugin *command_path*. New variable *SOFTWARE_URL* and updated login banner. +- **Changed:** Default distribution switched to *Debian* and CI image handling aligned. Python baseline raised: *dev-python* installs Python 3.11+ by default; *requires-python* raised to *>=3.11*. Cross distro Python interpreter and pip handling unified via *sys-pip-install*. Dashboard deployment uses fixed image *ghcr.io/kevinveenbirkenbach/port-ui:1.0.0* and mounts generated *config.yaml* read only. Alerting hardened with explicit timeouts for compose and email, plus portable mailer and systemd instance fallbacks. +- **Fixed:** OpenProject migrations stabilized (simplified migration step; preload *CustomFieldContext* before *db:migrate*). Nextcloud LDAP config hardened and incompatible apps disabled in production. XWiki extension install hardened and one time seed ensures *Main.WebHome* exists. Matomo bootstrap fails fast on root cause. TLS and CA improvements (unified self signed CA env for health services, retries for CA trust override generation, Nix TLS CA trust fix). *msmtp* improved on Fedora. OpenLDAP *python-ldap* build prerequisites and header fallback refactored; per user *password_update* policy added. Backup and ops fixes (OnlyOffice no restart during backups; backup home and ACL tasks more reliable). Container setup hardened (Fedora Docker CE CLI, dnf5 repo add, Debian buildx conflict fix, Docker readiness and SSH restart improvements). +- **CI and Tests:** New integration tests for portable python shebangs, forbid *sh -lc* with *pipefail*, and improved variable checks. CI stability improvements for per distro stacks and mirror resolver via venv Python, plus more robust package manager retries. diff --git a/docs/changelog/005.001.000-2026-02-28.md b/docs/changelog/005.001.000-2026-02-28.md index 8152706642..4f7ee01a60 100644 --- a/docs/changelog/005.001.000-2026-02-28.md +++ b/docs/changelog/005.001.000-2026-02-28.md @@ -6,24 +6,24 @@ This minor release improves cross-distro package handling, hardens CI reliabilit **Added** -* Introduced *docs/guides/developer/CONTRIBUTION_WORKFLOW.md* with fork-based workflow, mandatory green fork CI before PRs, and merge policy guidance -* Added the single-app local deploy wrapper and related local test documentation -* Added *min_storage* entries for warned roles +- Introduced *docs/guides/developer/CONTRIBUTION_WORKFLOW.md* with fork-based workflow, mandatory green fork CI before PRs, and merge policy guidance +- Added the single-app local deploy wrapper and related local test documentation +- Added *min_storage* entries for warned roles **Changed** -* Made *dev-base-devel* distro-aware for default distros -* Removed hardcoded *base-devel* from workstation bundles and *sys-aur* -* Set *drv-epson-multiprinter* lifecycle to *pre-alpha* -* Refactored *dev-fakeroot* by extracting *00_core* tasks -* Documented local *make check* targets +- Made *dev-base-devel* distro-aware for default distros +- Removed hardcoded *base-devel* from workstation bundles and *sys-aur* +- Set *drv-epson-multiprinter* lifecycle to *pre-alpha* +- Refactored *dev-fakeroot* by extracting *00_core* tasks +- Documented local *make check* targets **Fixed** -* Fixed *sys-aur-install* name/upgrade clash -* Enabled EPEL for *dev-fakeroot* on CentOS -* Made *drv-intel* VA-API package handling distro-specific -* Fixed undefined *run_once* lookup in backend service loader -* Restored DB seed enablement semantics without bool-coercion warning -* Fixed Ansible fact deprecations and loop variable collisions +- Fixed *sys-aur-install* name/upgrade clash +- Enabled EPEL for *dev-fakeroot* on CentOS +- Made *drv-intel* VA-API package handling distro-specific +- Fixed undefined *run_once* lookup in backend service loader +- Restored DB seed enablement semantics without bool-coercion warning +- Fixed Ansible fact deprecations and loop variable collisions **CI and Tests** -* Added retries for Docker-in-Docker DNS handling -* Added retry loop for buildx push -* Aggressively pruned Docker artifacts between distro runs -* Removed deprecated buildx install input +- Added retries for Docker-in-Docker DNS handling +- Added retry loop for buildx push +- Aggressively pruned Docker artifacts between distro runs +- Removed deprecated buildx install input diff --git a/docs/changelog/005.002.000-2026-03-21.md b/docs/changelog/005.002.000-2026-03-21.md index 2c6eefbefd..85f5f1d5b6 100644 --- a/docs/changelog/005.002.000-2026-03-21.md +++ b/docs/changelog/005.002.000-2026-03-21.md @@ -6,31 +6,31 @@ This minor release adds Mattermost deployment support, improves release image au **Added** -* Added *web-app-mattermost* with Docker Compose deployment, PostgreSQL support, Keycloak-based SSO via the GitLab OAuth2 provider, and optional Mailu integration -* Added retry-capable *uri_retry* and *get_url_retry* action plugins with dedicated unit and integration test coverage -* Added a scheduled/manual workflow to backfill the highest missing release image tag in GHCR -* Added a pull request template and consolidated contributor workflow documentation -* Added Manjaro ID support +- Added *web-app-mattermost* with Docker Compose deployment, PostgreSQL support, Keycloak-based SSO via the GitLab OAuth2 provider, and optional Mailu integration +- Added retry-capable *uri_retry* and *get_url_retry* action plugins with dedicated unit and integration test coverage +- Added a scheduled/manual workflow to backfill the highest missing release image tag in GHCR +- Added a pull request template and consolidated contributor workflow documentation +- Added Manjaro ID support **Changed** -* Reorganized custom Ansible plugins into the unified *plugins/* layout -* Moved backend service-load decisions into a dedicated lookup plugin -* Increased Nextcloud Talk and Talk Recording resources and made upload size handling configurable -* Reworked image build, push, mirror, wait, and release helper scripts for clearer repository and distro resolution -* Pinned Docker GitHub Actions used in release image workflows to commit SHAs -* Hardened *baserow* by pinning the image version to *2.1.6* +- Reorganized custom Ansible plugins into the unified *plugins/* layout +- Moved backend service-load decisions into a dedicated lookup plugin +- Increased Nextcloud Talk and Talk Recording resources and made upload size handling configurable +- Reworked image build, push, mirror, wait, and release helper scripts for clearer repository and distro resolution +- Pinned Docker GitHub Actions used in release image workflows to commit SHAs +- Hardened *baserow* by pinning the image version to *2.1.6* **Fixed** -* Fixed Mailu admin readiness checks and reduced Mailu deploy race conditions in CI -* Fixed flaky Nix-related network failures and added explicit failure-path coverage for retry handling -* Fixed *strong_password* filter *module_utils* resolution -* Fixed reusable workflow wait parameter wiring and test-dns CI image selection -* Fixed GHCR namespace lowercasing edge cases in image-related workflows -* Added deeper Matomo bootstrap failure diagnostics for easier troubleshooting +- Fixed Mailu admin readiness checks and reduced Mailu deploy race conditions in CI +- Fixed flaky Nix-related network failures and added explicit failure-path coverage for retry handling +- Fixed *strong_password* filter *module_utils* resolution +- Fixed reusable workflow wait parameter wiring and test-dns CI image selection +- Fixed GHCR namespace lowercasing edge cases in image-related workflows +- Added deeper Matomo bootstrap failure diagnostics for easier troubleshooting **CI and Tests** -* Refactored fork PR image handling to safely build, mirror, and validate CI images for external contributions -* Improved GHCR publish authentication, source linking, and source labels on pushed CI images -* Added explicit prebuilt-image wait errors and clearer release-image backfill detection -* Reduced false CI failures by skipping cleanup during the second deploy pass -* Expanded lint, unit, and integration coverage around retry plugins and plugin path usage +- Refactored fork PR image handling to safely build, mirror, and validate CI images for external contributions +- Improved GHCR publish authentication, source linking, and source labels on pushed CI images +- Added explicit prebuilt-image wait errors and clearer release-image backfill detection +- Reduced false CI failures by skipping cleanup during the second deploy pass +- Expanded lint, unit, and integration coverage around retry plugins and plugin path usage **Contributors** -* [Kevin Veen-Birkenbach](https://www.veen.world/) -* [Alejandro Roman](https://github.com/AlejandroRomanIbanez) +- [Kevin Veen-Birkenbach](https://www.veen.world/) +- [Alejandro Roman](https://github.com/AlejandroRomanIbanez) diff --git a/docs/changelog/006.000.000-2026-04-25.md b/docs/changelog/006.000.000-2026-04-25.md index d56f131ea2..6c338283e3 100644 --- a/docs/changelog/006.000.000-2026-04-25.md +++ b/docs/changelog/006.000.000-2026-04-25.md @@ -6,54 +6,54 @@ This release expands the application portfolio with new civic, ERP, feedback, an **Major Changes** -* Added major new application roles including web-app-odoo, web-app-decidim, web-app-fider, and web-app-prometheus -* Replaced legacy generated applications / users setup flows with cached lookup-driven runtime data, centralized service-registry semantics, and nested compose.services.* configuration paths -* Replaced the legacy Cypress-based browser test path with the dedicated test-e2e-playwright role and role-local Playwright specs / env files -* Expanded shared platform integrations for SMTP, Prometheus / native metrics, OIDC, LDAP, and role-based RBAC provisioning -* Hardened CI and local development with better WSL2 bootstrap support, safer swap / disk handling, stronger GHCR mirroring and release workflows, and updated fork / PR automation +- Added major new application roles including web-app-odoo, web-app-decidim, web-app-fider, and web-app-prometheus +- Replaced legacy generated applications / users setup flows with cached lookup-driven runtime data, centralized service-registry semantics, and nested compose.services.* configuration paths +- Replaced the legacy Cypress-based browser test path with the dedicated test-e2e-playwright role and role-local Playwright specs / env files +- Expanded shared platform integrations for SMTP, Prometheus / native metrics, OIDC, LDAP, and role-based RBAC provisioning +- Hardened CI and local development with better WSL2 bootstrap support, safer swap / disk handling, stronger GHCR mirroring and release workflows, and updated fork / PR automation **Added** -* Added web-app-odoo with Docker Compose deployment, Redis integration, LDAP support, Keycloak / OIDC auto-provisioning, HTTPS-safe OAuth customization, and Playwright login / logout coverage -* Added web-app-decidim with dedicated Docker image, OIDC bootstrap wiring, Ruby helper scripts, administrator setup, and Playwright coverage -* Added web-app-fider as a new feedback platform role with deployment, OIDC setup, and end-to-end browser coverage -* Added web-app-prometheus with alerting, alertmanager, blackbox, UI integration assets, and Playwright coverage -* Added the dedicated test-e2e-playwright runner role plus broad new Playwright suites for apps including Pixelfed, Taiga, Mailu, Mattermost, Friendica, Joomla, Odoo, Decidim, PeerTube, Nextcloud, Matrix, BigBlueButton, and dashboard-linked flows -* Added lookup(email) as the shared SMTP resolution layer and wired email integration into roles such as openwebui, flowise, pretix, and gitlab -* Added generic OIDC group-to-RBAC auto-provisioning for WordPress through OpenLDAP-backed role mapping -* Added issue templates, split PR templates by contribution type, and introduced CODEOWNERS -* Added broader GHCR tooling including mirror cleanup, Docker image version fixing, and release / update workflow helpers +- Added web-app-odoo with Docker Compose deployment, Redis integration, LDAP support, Keycloak / OIDC auto-provisioning, HTTPS-safe OAuth customization, and Playwright login / logout coverage +- Added web-app-decidim with dedicated Docker image, OIDC bootstrap wiring, Ruby helper scripts, administrator setup, and Playwright coverage +- Added web-app-fider as a new feedback platform role with deployment, OIDC setup, and end-to-end browser coverage +- Added web-app-prometheus with alerting, alertmanager, blackbox, UI integration assets, and Playwright coverage +- Added the dedicated test-e2e-playwright runner role plus broad new Playwright suites for apps including Pixelfed, Taiga, Mailu, Mattermost, Friendica, Joomla, Odoo, Decidim, PeerTube, Nextcloud, Matrix, BigBlueButton, and dashboard-linked flows +- Added lookup(email) as the shared SMTP resolution layer and wired email integration into roles such as openwebui, flowise, pretix, and gitlab +- Added generic OIDC group-to-RBAC auto-provisioning for WordPress through OpenLDAP-backed role mapping +- Added issue templates, split PR templates by contribution type, and introduced CODEOWNERS +- Added broader GHCR tooling including mirror cleanup, Docker image version fixing, and release / update workflow helpers **Changed** -* Migrated runtime resolution away from legacy generated dictionaries and setup CLIs toward cached lookup plugins such as applications, users, domains, image, service, and service_registry -* Reworked shared service discovery and loading around the new sys-utils-service-loader flow and the required service semantics -* Reorganized role configuration toward clearer service-scoped keys under compose.services.* -* Extended Docker image version handling to support ghcr.io, depth-aware comparisons, and flavored semver tags such as 5.4.5-php8.3-apache -* Expanded Prometheus / native metrics integration across application roles, especially communication-oriented apps -* Reworked contributor, agent, and operations documentation into granular SPOT-style guides covering workflow, testing, debugging, sandboxing, PR creation, and environment setup -* Improved WSL2 and local development bootstrap flow with better Docker, DNS, CA trust, package installation, and smoke-test coverage -* Adopted git-maintainer-tools for fork / upstream remote routing and signed-push workflow handling +- Migrated runtime resolution away from legacy generated dictionaries and setup CLIs toward cached lookup plugins such as applications, users, domains, image, service, and service_registry +- Reworked shared service discovery and loading around the new sys-utils-service-loader flow and the required service semantics +- Reorganized role configuration toward clearer service-scoped keys under compose.services.* +- Extended Docker image version handling to support ghcr.io, depth-aware comparisons, and flavored semver tags such as 5.4.5-php8.3-apache +- Expanded Prometheus / native metrics integration across application roles, especially communication-oriented apps +- Reworked contributor, agent, and operations documentation into granular SPOT-style guides covering workflow, testing, debugging, sandboxing, PR creation, and environment setup +- Improved WSL2 and local development bootstrap flow with better Docker, DNS, CA trust, package installation, and smoke-test coverage +- Adopted git-maintainer-tools for fork / upstream remote routing and signed-push workflow handling **Fixed** -* Fixed the Joomla install / re-deploy flow across the open regression classes: raw-git-tree refusal handling, re-deploy idempotency, dash pipefail incompatibility, cleanup-phase crashes, and fresh-install password-reset races -* Fixed PeerTube plugin-install reliability with explicit image pinning, improved diagnostics, memory-cap-aware install handling, and local OOM reproduction support -* Fixed Mattermost SSO button regressions, Mailu DNS behavior, Nextcloud Talk TURN publishing, Friendica LDAP addon activation, Baserow bootstrap timing, BigBlueButton database race conditions, and multiple Odoo OAuth / provisioning edge cases -* Fixed GHCR mirror visibility publication, propagation timing, and authenticated package handling -* Fixed PR / branch cancellation behavior, branch-scope CI gating, fork prerequisite handling, and several GitHub Actions orchestration edge cases -* Fixed multiple domain, CSP, email, lookup, and proxy wiring issues uncovered during the applications / users migration +- Fixed the Joomla install / re-deploy flow across the open regression classes: raw-git-tree refusal handling, re-deploy idempotency, dash pipefail incompatibility, cleanup-phase crashes, and fresh-install password-reset races +- Fixed PeerTube plugin-install reliability with explicit image pinning, improved diagnostics, memory-cap-aware install handling, and local OOM reproduction support +- Fixed Mattermost SSO button regressions, Mailu DNS behavior, Nextcloud Talk TURN publishing, Friendica LDAP addon activation, Baserow bootstrap timing, BigBlueButton database race conditions, and multiple Odoo OAuth / provisioning edge cases +- Fixed GHCR mirror visibility publication, propagation timing, and authenticated package handling +- Fixed PR / branch cancellation behavior, branch-scope CI gating, fork prerequisite handling, and several GitHub Actions orchestration edge cases +- Fixed multiple domain, CSP, email, lookup, and proxy wiring issues uncovered during the applications / users migration **CI and Tests** -* Added the external Docker image version-check workflow, a weekly CodeQL safety cron, dedicated PR close / branch delete cancel workflows, and stronger development-environment testing -* Expanded lint, unit, and integration coverage around service-registry behavior, compose resource limits, email integration requirements, no_log policy, lookup usage, min-storage validation, and non-bash pipefail regressions -* Improved CI diagnostics, runner-state dumps, disk / swap handling, image wait logic, and mirror / release backfill workflows for fork-based development -* Centralized more CI helper logic into reusable scripts and utility modules to reduce workflow duplication +- Added the external Docker image version-check workflow, a weekly CodeQL safety cron, dedicated PR close / branch delete cancel workflows, and stronger development-environment testing +- Expanded lint, unit, and integration coverage around service-registry behavior, compose resource limits, email integration requirements, no_log policy, lookup usage, min-storage validation, and non-bash pipefail regressions +- Improved CI diagnostics, runner-state dumps, disk / swap handling, image wait logic, and mirror / release backfill workflows for fork-based development +- Centralized more CI helper logic into reusable scripts and utility modules to reduce workflow duplication **Contributors** -* [Kevin Veen-Birkenbach](https://www.veen.world/) -* [Alejandro Roman](https://github.com/AlejandroRomanIbanez) -* [Evangelos Tsakoudis](https://github.com/evangelostsak) -* [Prageeth Panicker](https://github.com/pragepani) +- [Kevin Veen-Birkenbach](https://www.veen.world/) +- [Alejandro Roman](https://github.com/AlejandroRomanIbanez) +- [Evangelos Tsakoudis](https://github.com/evangelostsak) +- [Prageeth Panicker](https://github.com/pragepani) diff --git a/docs/changelog/007.000.000-2026-05-08.md b/docs/changelog/007.000.000-2026-05-08.md index ebdf013aaa..b0ec439033 100644 --- a/docs/changelog/007.000.000-2026-05-08.md +++ b/docs/changelog/007.000.000-2026-05-08.md @@ -6,59 +6,59 @@ This major release migrates every role to the new meta/ layout with explicit per **Major Changes** -* Migrated every role's meta/ to the req-008/009/010/011 layout: per-role services.yml is the single source of truth for service flags, server.yml carries per-role local subnets, ports live next to the service that owns them, run_after / lifecycle move next to the entity, and a new meta/info.yml carries non-Galaxy descriptive metadata -* Replaced the legacy single-pass deploy with a variant-aware combined resolver and per-round include path: each role can declare a meta/variants.yml, the matrix-deploy planner produces one folder per round, and Playwright specs run once per variant -* Routed every YAML touchpoint and every project-tree walk through utils.cache.{yaml,files} and consolidated the cache modules into a single utils/cache/ package; integration tests now share one parse and one walk per make test invocation -* Promoted 13 web-app roles from alpha to beta with full per-role baselines: native OIDC for Joomla via plg_system_keycloak, in-role login-broker for Bluesky (variant A+), real OIDC integration for four further roles, and the matching Playwright SSO coverage -* Added two new pull-through caches: a Sonatype Nexus 3 OSS package cache (req-012) and a registry cache with TLS frontend, override-only gating, and dev-only Compose profiles +- Migrated every role's meta/ to the req-008/009/010/011 layout: per-role services.yml is the single source of truth for service flags, server.yml carries per-role local subnets, ports live next to the service that owns them, run_after / lifecycle move next to the entity, and a new meta/info.yml carries non-Galaxy descriptive metadata +- Replaced the legacy single-pass deploy with a variant-aware combined resolver and per-round include path: each role can declare a meta/variants.yml, the matrix-deploy planner produces one folder per round, and Playwright specs run once per variant +- Routed every YAML touchpoint and every project-tree walk through utils.cache.{yaml,files} and consolidated the cache modules into a single utils/cache/ package; integration tests now share one parse and one walk per make test invocation +- Promoted 13 web-app roles from alpha to beta with full per-role baselines: native OIDC for Joomla via plg_system_keycloak, in-role login-broker for Bluesky (variant A+), real OIDC integration for four further roles, and the matching Playwright SSO coverage +- Added two new pull-through caches: a Sonatype Nexus 3 OSS package cache (req-012) and a registry cache with TLS frontend, override-only gating, and dev-only Compose profiles **Added** -* Added new application roles: web-app-opencloud and web-app-opentalk with shared OIDC + LDAP, web-app-hugo for static-site hosting (req-016), web-app-moodle self-built image with OIDC+LDAP hybrid and LDAP-only variants (req-015), web-app-fediwall as multi-wall public-timeline aggregator, plus web-app-mig and web-app-sphinx E2E coverage -* Added the per-role matrix-deploy variant model with folder-per-round inventories, meta/variants.yml declarations, and variant-aware Playwright env wiring -* Added hierarchical /roles// RBAC paths, service-gated Playwright specs, and the WordPress ↔ Discourse round-trip flow -* Added lookup(email) as the shared SMTP resolution layer and wired email integration into pretix, gitlab, openwebui, flowise, and others -* Added the package-cache (Nexus 3 OSS) and registry-cache stacks with inner-build override, TTL env vars, and SPOT documentation -* Added the diff-driven app whitelist for deploy tests, the unified # noqa / # nocheck suppression grammar, and the info.yml per-role metadata file -* Added web-app-keycloak per-app mapper SPOT via filter plugin and shell-script extraction; OpenLDAP schema for Moodle; web-app-mediawiki install/update via composer_install_extension.sh -* Added new lint guards: project-walk, cache-read, project-root-import, noqa-only-ruff-codes, no-direct-yaml, no-inline-multiline-php-in-sh, no-inline-multiline-sql, no-lookup-config-jinja-default, role-meta-layout, web-role-no-web-dependency, run-once-on-shared-services, redundant-bool-patterns, sed-escape, no-sh-pipefail, compose-resource-limits, dynamic-flag, auth-coverage, variant-coverage, variants-services-match +- Added new application roles: web-app-opencloud and web-app-opentalk with shared OIDC + LDAP, web-app-hugo for static-site hosting (req-016), web-app-moodle self-built image with OIDC+LDAP hybrid and LDAP-only variants (req-015), web-app-fediwall as multi-wall public-timeline aggregator, plus web-app-mig and web-app-sphinx E2E coverage +- Added the per-role matrix-deploy variant model with folder-per-round inventories, meta/variants.yml declarations, and variant-aware Playwright env wiring +- Added hierarchical /roles// RBAC paths, service-gated Playwright specs, and the WordPress ↔ Discourse round-trip flow +- Added lookup(email) as the shared SMTP resolution layer and wired email integration into pretix, gitlab, openwebui, flowise, and others +- Added the package-cache (Nexus 3 OSS) and registry-cache stacks with inner-build override, TTL env vars, and SPOT documentation +- Added the diff-driven app whitelist for deploy tests, the unified # noqa / # nocheck suppression grammar, and the info.yml per-role metadata file +- Added web-app-keycloak per-app mapper SPOT via filter plugin and shell-script extraction; OpenLDAP schema for Moodle; web-app-mediawiki install/update via composer_install_extension.sh +- Added new lint guards: project-walk, cache-read, project-root-import, noqa-only-ruff-codes, no-direct-yaml, no-inline-multiline-php-in-sh, no-inline-multiline-sql, no-lookup-config-jinja-default, role-meta-layout, web-role-no-web-dependency, run-once-on-shared-services, redundant-bool-patterns, sed-escape, no-sh-pipefail, compose-resource-limits, dynamic-flag, auth-coverage, variant-coverage, variants-services-match **Changed** -* Routed every yaml.safe_load / yaml.safe_dump / glob.glob / os.walk / Path.rglob / Path.read_text callsite in tests through utils.cache.{yaml,files} so the project walk and reads are shared across the pytest session -* Reworked the combined resolver to be variant-aware, dropped non-Galaxy keys (license_url, repository, documentation) from meta/main.yml, and consumed web-svc-html via the service registry from web-svc-legal -* Registered web-app-{mastodon,friendica,pixelfed} as shared services for the Fediwall aggregator -* Consolidated update to a single role with per-package-family task files; replaced the MODE_CI flag with a direct RUNTIME check -* Pinned image versions explicitly: SuiteCRM PHP 8.2, Nextcloud 33-fpm-alpine, Moodle PHP 8.3-fpm, Hugo nginx 1.30.0-alpine; opted Ubuntu's docker-compose-v2 out of the package selection -* Migrated Decidim, OpenLDAP schema, Postgres grant-schema, Fider, Odoo OIDC, and svc-db-postgres SQL into dedicated files/*.sql so the inline-multiline-SQL lint stays at zero -* Tightened the compose-resource-limits lint and reconciled the entire role corpus against it -* Adopted the unified `# nocheck: ` suppression marker repo-wide; reserved `# noqa:` markers for real ruff/flake8 codes +- Routed every yaml.safe_load / yaml.safe_dump / glob.glob / os.walk / Path.rglob / Path.read_text callsite in tests through utils.cache.{yaml,files} so the project walk and reads are shared across the pytest session +- Reworked the combined resolver to be variant-aware, dropped non-Galaxy keys (license_url, repository, documentation) from meta/main.yml, and consumed web-svc-html via the service registry from web-svc-legal +- Registered web-app-{mastodon,friendica,pixelfed} as shared services for the Fediwall aggregator +- Consolidated update to a single role with per-package-family task files; replaced the MODE_CI flag with a direct RUNTIME check +- Pinned image versions explicitly: SuiteCRM PHP 8.2, Nextcloud 33-fpm-alpine, Moodle PHP 8.3-fpm, Hugo nginx 1.30.0-alpine; opted Ubuntu's docker-compose-v2 out of the package selection +- Migrated Decidim, OpenLDAP schema, Postgres grant-schema, Fider, Odoo OIDC, and svc-db-postgres SQL into dedicated files/*.sql so the inline-multiline-SQL lint stays at zero +- Tightened the compose-resource-limits lint and reconciled the entire role corpus against it +- Adopted the unified `# nocheck: ` suppression marker repo-wide; reserved `# noqa:` markers for real ruff/flake8 codes **Fixed** -* Fixed Joomla admin-password handling ($ no longer eaten by bash), plugin manifest waits, and Playwright login hardening -* Fixed Moodle deploy: PHP 8.3-fpm pin, serialized PHP-ext build to avoid modules/ race, dropped msmtp from the FPM healthcheck, aligned meta/services.yml with the image+version mirror convention -* Fixed Nextcloud Talk admin spec, Settings-menu locator drift, Metadata plugin incompatibility, OIDC alt-login click, and the files_bpm plugin entry -* Fixed WordPress multisite wp-config quoting, hardcoded plugin-enable lookups, discourse-integration ordering, and per-variant Discourse toggle gating -* Fixed Mig + Sphinx container_port pointing at a non-existent flat .port key (added a wildcard-path validator) -* Fixed OpenCloud / OpenTalk Playwright OIDC scenarios; added the OpenTalk recorder; fixed OpenCloud SPA wait after the OIDC callback -* Fixed Discourse asset compilation by setting DISCOURSE_FORCE_HTTPS; marked Discourse as a discourse-service provider; dropped the WordPress run_after dep -* Fixed env-test suites: dynamic Fedora release resolution in the cache probe, compose-network discovery for the DiD probe, and oauth2-proxy allowed_groups slash normalization -* Fixed meta drift: req-008 sweep gaps (lost suppressions, silent test breakage, one prod bug), host-bound port collisions on 8071/8072, subnet collisions on 192.168.105.{48,64}/28, and Moodle resource limits -* Fixed utils.cache Ansible coupling: data is importable without ansible, the GID resolver works without ansible, and the YAML cache invalidates per-path entries when mtime/size changes -* Fixed the sys-svc-container package selection on Ubuntu; the Makefile clean target is resilient to container-owned **pycache** files -* Fixed Bluesky cross-variant recovery + URL-test failures (req-013) +- Fixed Joomla admin-password handling ($ no longer eaten by bash), plugin manifest waits, and Playwright login hardening +- Fixed Moodle deploy: PHP 8.3-fpm pin, serialized PHP-ext build to avoid modules/ race, dropped msmtp from the FPM healthcheck, aligned meta/services.yml with the image+version mirror convention +- Fixed Nextcloud Talk admin spec, Settings-menu locator drift, Metadata plugin incompatibility, OIDC alt-login click, and the files_bpm plugin entry +- Fixed WordPress multisite wp-config quoting, hardcoded plugin-enable lookups, discourse-integration ordering, and per-variant Discourse toggle gating +- Fixed Mig + Sphinx container_port pointing at a non-existent flat .port key (added a wildcard-path validator) +- Fixed OpenCloud / OpenTalk Playwright OIDC scenarios; added the OpenTalk recorder; fixed OpenCloud SPA wait after the OIDC callback +- Fixed Discourse asset compilation by setting DISCOURSE_FORCE_HTTPS; marked Discourse as a discourse-service provider; dropped the WordPress run_after dep +- Fixed env-test suites: dynamic Fedora release resolution in the cache probe, compose-network discovery for the DiD probe, and oauth2-proxy allowed_groups slash normalization +- Fixed meta drift: req-008 sweep gaps (lost suppressions, silent test breakage, one prod bug), host-bound port collisions on 8071/8072, subnet collisions on 192.168.105.{48,64}/28, and Moodle resource limits +- Fixed utils.cache Ansible coupling: data is importable without ansible, the GID resolver works without ansible, and the YAML cache invalidates per-path entries when mtime/size changes +- Fixed the sys-svc-container package selection on Ubuntu; the Makefile clean target is resilient to container-owned **pycache** files +- Fixed Bluesky cross-variant recovery + URL-test failures (req-013) **CI and Tests** -* Added a diff-driven app whitelist so deploy tests run only against roles touched in the change -* Added the lint corpus for: project-walk / cache-read / project-root-import / no-direct-yaml / no-inline-multiline-php-in-sh / no-inline-multiline-sql / no-lookup-config-jinja-default / role-meta-layout / web-role-no-web-dependency / run-once-on-shared-services / redundant-bool-patterns / sed-escape / no-sh-pipefail / compose-resource-limits / dynamic-flag / auth-coverage / variant-coverage / variants-services-match / Ansible Galaxy schema / inline literal script-block size cap / production Python file-size cap / SPOT-of-truth for domain literals / oauth2 proxy-port allocation -* Added the unified # noqa / # nocheck suppression grammar and the noqa-only-ruff-codes guard that forbids project rules in # noqa: -* Routed every fixture write through utils.cache.yaml.dump_yaml and every fixture read through utils.cache.files.read_text -* Added the rbac-group-path static guard, the run-once guard for shared service-registry roles, the Mattermost SSO-button + onboarding dismissal coverage, and the WordPress discourse-roundtrip + finally-cleanup-bound spec -* Promoted the docker-raw-call guard onto the unified suppression grammar and scoped it to roles/ -* Centralized INFINITO_DISTRO / INFINITO_CONTAINER SPOT and moved INFINITO_MAKE_DEPLOY defaults into scripts/meta/env/ci.sh +- Added a diff-driven app whitelist so deploy tests run only against roles touched in the change +- Added the lint corpus for: project-walk / cache-read / project-root-import / no-direct-yaml / no-inline-multiline-php-in-sh / no-inline-multiline-sql / no-lookup-config-jinja-default / role-meta-layout / web-role-no-web-dependency / run-once-on-shared-services / redundant-bool-patterns / sed-escape / no-sh-pipefail / compose-resource-limits / dynamic-flag / auth-coverage / variant-coverage / variants-services-match / Ansible Galaxy schema / inline literal script-block size cap / production Python file-size cap / SPOT-of-truth for domain literals / oauth2 proxy-port allocation +- Added the unified # noqa / # nocheck suppression grammar and the noqa-only-ruff-codes guard that forbids project rules in # noqa: +- Routed every fixture write through utils.cache.yaml.dump_yaml and every fixture read through utils.cache.files.read_text +- Added the rbac-group-path static guard, the run-once guard for shared service-registry roles, the Mattermost SSO-button + onboarding dismissal coverage, and the WordPress discourse-roundtrip + finally-cleanup-bound spec +- Promoted the docker-raw-call guard onto the unified suppression grammar and scoped it to roles/ +- Centralized INFINITO_DISTRO / INFINITO_CONTAINER SPOT and moved INFINITO_MAKE_DEPLOY defaults into scripts/meta/env/ci.sh **Contributors** -* [Kevin Veen-Birkenbach](https://www.veen.world/) +- [Kevin Veen-Birkenbach](https://www.veen.world/) diff --git a/docs/changelog/008.000.000-2026-05-27.md b/docs/changelog/008.000.000-2026-05-27.md index 1c19cece95..a91150e15b 100644 --- a/docs/changelog/008.000.000-2026-05-27.md +++ b/docs/changelog/008.000.000-2026-05-27.md @@ -2,30 +2,30 @@ ## [8.0.0] - 2026-05-27 -* This release lands the matrix-deploy hardening pass, an interactive console for the CLI, the bundles workflow, a per-consumer Postgres builder, a shared Playwright persona library across every web role, a SPOT env pipeline under the `INFINITO_` namespace, and a new education-suite bundle (openwebui + mailu) alongside the KIX Service Management role. +- This release lands the matrix-deploy hardening pass, an interactive console for the CLI, the bundles workflow, a per-consumer Postgres builder, a shared Playwright persona library across every web role, a SPOT env pipeline under the `INFINITO_` namespace, and a new education-suite bundle (openwebui + mailu) alongside the KIX Service Management role. **Major Changes** -* Promoted matrix-deploy to a full purge + full redeploy between rounds, taught the inventory validator to honour variants.yml keys, and split the variant runner into auth-isolated rounds so OIDC, LDAP, and native personas never share residual state -* Replaced inline SQL task templates with a first-class database_query Ansible module that takes a caller-controlled mask_values parameter, and migrated every role to call it instead of templating ad-hoc psql/mysql commands -* Rebuilt the env pipeline around a SPOT default.env at the repository root, retired the env/ subtree and the env.development marker, folded ci.env into default.env, and put every runtime knob under the `INFINITO_` namespace (BUILDKIT_ENABLED, OUTER_NETWORK_MTU auto-detected from the host route, CONTAINER_CA_ENABLED, and the path/image overrides) -* Reworked the Make surface into domain prefixes (compose-, network-, clean-, container-), added comment-derived make help, parallel test/lint wrappers with per-target wall-clock, a default help target, a single make deploy router, a make console REPL, make compose-playwright, a test-signed pre-push gate, and a clean-container-owned target -* Routed every role image reference through lookup(config, ...) so the GHCR mirror takes effect uniformly, and introduced a per-consumer Postgres image builder so shared:false rdbms consumers get the extensions and libraries they need via initdb.d +- Promoted matrix-deploy to a full purge + full redeploy between rounds, taught the inventory validator to honour variants.yml keys, and split the variant runner into auth-isolated rounds so OIDC, LDAP, and native personas never share residual state +- Replaced inline SQL task templates with a first-class database_query Ansible module that takes a caller-controlled mask_values parameter, and migrated every role to call it instead of templating ad-hoc psql/mysql commands +- Rebuilt the env pipeline around a SPOT default.env at the repository root, retired the env/ subtree and the env.development marker, folded ci.env into default.env, and put every runtime knob under the `INFINITO_` namespace (BUILDKIT_ENABLED, OUTER_NETWORK_MTU auto-detected from the host route, CONTAINER_CA_ENABLED, and the path/image overrides) +- Reworked the Make surface into domain prefixes (compose-, network-, clean-, container-), added comment-derived make help, parallel test/lint wrappers with per-target wall-clock, a default help target, a single make deploy router, a make console REPL, make compose-playwright, a test-signed pre-push gate, and a clean-container-owned target +- Routed every role image reference through lookup(config, ...) so the GHCR mirror takes effect uniformly, and introduced a per-consumer Postgres image builder so shared:false rdbms consumers get the extensions and libraries they need via initdb.d **Added** -* Added web-app-kix (KIX Service Management, req-015), the education-suite bundle wiring web-app-openwebui and web-app-mailu, the bundles deploy-bundles / redeploy-bundles flow, and a deploy verifier that walks required_by for every non-invokable role -* Added an interactive CLI console with stateful navigation, ls, and modular subcommands; a meta roles applications complexity command with reverse direction, level filter, total column, ordering, and cli/json output; and a meta roles services called verifier hooked into dev-deploy -* Added a shared Playwright persona library that now drives every web role, parameterized matomo tracker checks, web-svc-logout injection specs via roles_with_service, dashboard dropdown handling, iframe-aware deny checks, keycloak auth-provider exemption, the `PERSONA_*_BLOCKED` contract, a PLAYWRIGHT_KEEP_ALL artefact toggle, persisted artefacts per variant and pass, and a Time column in the summary table -* Added lint guards: auth-isolation across variants.yml, variants-services-match with a nocheck opt-out, required_by on non-invokable roles (Bundle C), lint-playwright per-role spec parse, a raw-image ban in compose templates (and the eight existing violations fixed), expanded required_by[web] for the webserver and CSP infra, and a Python-ized lint installer with host/docker dispatch -* Added a requirements archive CLI with a completeness lint, a live registry-reachability probe for pinned images, top-N Ansible role runtimes in the deploy job summary, Playwright JUnit reports rendered as a workflow step summary, an affected-roles filter that skips .md/.rst outside roles, and an update open-pr deduper that supersedes stale class siblings -* Added native admin login for web-app-bluesky when oauth2 is disabled, native + LDAP + OIDC persona tests for web-app-openwebui, a multi-auth dispatcher for web-app-matrix (OIDC plus native/LDAP password), web-app-lam registered as a service provider with moodle v0/v1 opt-in, web-app-prometheus navbar logout injection, SMTP wiring for web-app-pgadmin, dynamic LDAP and Playwright LDAP coverage for web-app-opencloud, version-incompatible plugin tolerance for web-app-nextcloud, gated enable_local_logins for web-app-discourse, and biber+admin persona blocks for web-app-akaunting, web-app-bookwyrm, web-app-bluesky, and web-app-postmarks +- Added web-app-kix (KIX Service Management, req-015), the education-suite bundle wiring web-app-openwebui and web-app-mailu, the bundles deploy-bundles / redeploy-bundles flow, and a deploy verifier that walks required_by for every non-invokable role +- Added an interactive CLI console with stateful navigation, ls, and modular subcommands; a meta roles applications complexity command with reverse direction, level filter, total column, ordering, and cli/json output; and a meta roles services called verifier hooked into dev-deploy +- Added a shared Playwright persona library that now drives every web role, parameterized matomo tracker checks, web-svc-logout injection specs via roles_with_service, dashboard dropdown handling, iframe-aware deny checks, keycloak auth-provider exemption, the `PERSONA_*_BLOCKED` contract, a PLAYWRIGHT_KEEP_ALL artefact toggle, persisted artefacts per variant and pass, and a Time column in the summary table +- Added lint guards: auth-isolation across variants.yml, variants-services-match with a nocheck opt-out, required_by on non-invokable roles (Bundle C), lint-playwright per-role spec parse, a raw-image ban in compose templates (and the eight existing violations fixed), expanded required_by[web] for the webserver and CSP infra, and a Python-ized lint installer with host/docker dispatch +- Added a requirements archive CLI with a completeness lint, a live registry-reachability probe for pinned images, top-N Ansible role runtimes in the deploy job summary, Playwright JUnit reports rendered as a workflow step summary, an affected-roles filter that skips .md/.rst outside roles, and an update open-pr deduper that supersedes stale class siblings +- Added native admin login for web-app-bluesky when oauth2 is disabled, native + LDAP + OIDC persona tests for web-app-openwebui, a multi-auth dispatcher for web-app-matrix (OIDC plus native/LDAP password), web-app-lam registered as a service provider with moodle v0/v1 opt-in, web-app-prometheus navbar logout injection, SMTP wiring for web-app-pgadmin, dynamic LDAP and Playwright LDAP coverage for web-app-opencloud, version-incompatible plugin tolerance for web-app-nextcloud, gated enable_local_logins for web-app-discourse, and biber+admin persona blocks for web-app-akaunting, web-app-bookwyrm, web-app-bluesky, and web-app-postmarks **Removed and Renamed** -* Renamed deploy to compose-deploy across Make, `container-*` purges and refresh to `compose-*`, the legacy backup roles to `svc-bkp-*` with container/local-2-remote invokable entrypoints, lookup status to deployment with a runtime-aware deployed flag, `dmbs_*/dbms_base` templates to a container_depends_on lookup, INFINITO_CMD to a plain cmd parameter, and web-opt-rdr-www canonical to w3redirect with lookup-based mappings -* Dropped the ci compose profile and its --profile ci arg, the run-once guard on web-opt-rdr-domains, the slim pkgmgr base image variant, requirement-file references from runtime code, and the inline XML payload duplication in web-app-xwiki +- Renamed deploy to compose-deploy across Make, `container-*` purges and refresh to `compose-*`, the legacy backup roles to `svc-bkp-*` with container/local-2-remote invokable entrypoints, lookup status to deployment with a runtime-aware deployed flag, `dmbs_*/dbms_base` templates to a container_depends_on lookup, INFINITO_CMD to a plain cmd parameter, and web-opt-rdr-www canonical to w3redirect with lookup-based mappings +- Dropped the ci compose profile and its --profile ci arg, the run-once guard on web-opt-rdr-domains, the slim pkgmgr base image variant, requirement-file references from runtime code, and the inline XML payload duplication in web-app-xwiki **Contributors** -* [Kevin Veen-Birkenbach](https://www.veen.world/) +- [Kevin Veen-Birkenbach](https://www.veen.world/) diff --git a/docs/changelog/008.000.001-2026-05-28.md b/docs/changelog/008.000.001-2026-05-28.md index 0e01eec936..8cc973b400 100644 --- a/docs/changelog/008.000.001-2026-05-28.md +++ b/docs/changelog/008.000.001-2026-05-28.md @@ -2,30 +2,30 @@ ## [8.0.1] - 2026-05-28 -* Restores Debian build viability, satisfies the new eslint rules, moves the requirements archive CLI to kpmx, adds make requirements-archive, pins pkgmgr to v1.14.0, sharpens the agent iteration docs, and rolls up dependabot bumps. +- Restores Debian build viability, satisfies the new eslint rules, moves the requirements archive CLI to kpmx, adds make requirements-archive, pins pkgmgr to v1.14.0, sharpens the agent iteration docs, and rolls up dependabot bumps. **Added** -* make requirements-archive installs kpmx and runs pkgmgr archive docs/requirements in one shot +- make requirements-archive installs kpmx and runs pkgmgr archive docs/requirements in one shot **Fixed** -* debian/changelog source-package name restored to infinito-nexus so dpkg-source builds succeed again -* eslint preserve-caught-error and no-useless-assignment violations in five Playwright helpers +- debian/changelog source-package name restored to infinito-nexus so dpkg-source builds succeed again +- eslint preserve-caught-error and no-useless-assignment violations in five Playwright helpers **Changed** -* Archive CLI for completed requirement files moved out of cli/contributing/requirements/archive into pkgmgr.actions.archive shipped by kpmx; the lint test inlines the discovery and unchecked-counter primitives so the suite no longer pulls kpmx as a dependency -* pkgmgr dependency pinned to v1.14.0 (was floating stable), bringing in the package_name resolver and pkgmgr release --retry +- Archive CLI for completed requirement files moved out of cli/contributing/requirements/archive into pkgmgr.actions.archive shipped by kpmx; the lint test inlines the discovery and unchecked-counter primitives so the suite no longer pulls kpmx as a dependency +- pkgmgr dependency pinned to v1.14.0 (was floating stable), bringing in the package_name resolver and pkgmgr release --retry **Docs** -* docs/agents/action/iteration/compose.md sharpens the in-container verify rule and full-matrix flow +- docs/agents/action/iteration/compose.md sharpens the in-container verify rule and full-matrix flow **Dependencies** -* eslint, eslint-plugin-playwright, eslint/js, actions/setup-python, actions/create-github-app-token +- eslint, eslint-plugin-playwright, eslint/js, actions/setup-python, actions/create-github-app-token **Contributors** -* [Kevin Veen-Birkenbach](https://www.veen.world/) +- [Kevin Veen-Birkenbach](https://www.veen.world/) diff --git a/docs/changelog/008.000.002-2026-05-28.md b/docs/changelog/008.000.002-2026-05-28.md index 71aba7a9ad..8b04e97bee 100644 --- a/docs/changelog/008.000.002-2026-05-28.md +++ b/docs/changelog/008.000.002-2026-05-28.md @@ -2,4 +2,4 @@ ## [8.0.2] - 2026-05-28 -* Restores CI by dropping pkgmgr from the dev Dockerfile (entry.sh now `make install`s straight from INFINITO_SRC_DIR) and bumping the pkgmgr role pin to v1.15.2, which re-registers the `infinito` alias. +- Restores CI by dropping pkgmgr from the dev Dockerfile (entry.sh now `make install`s straight from INFINITO_SRC_DIR) and bumping the pkgmgr role pin to v1.15.2, which re-registers the `infinito` alias. diff --git a/docs/changelog/008.000.003-2026-05-28.md b/docs/changelog/008.000.003-2026-05-28.md index 2429d0e231..847c8ccac4 100644 --- a/docs/changelog/008.000.003-2026-05-28.md +++ b/docs/changelog/008.000.003-2026-05-28.md @@ -2,4 +2,4 @@ ## [8.0.3] - 2026-05-28 -* Loads the project dotenv (`make dotenv` + `set -a; . .env; set +a`) inside the update workflow wrappers so `INFINITO_WORKER_FETCH` resolves on CI runners that skip compose. +- Loads the project dotenv (`make dotenv` + `set -a; . .env; set +a`) inside the update workflow wrappers so `INFINITO_WORKER_FETCH` resolves on CI runners that skip compose. diff --git a/docs/changelog/008.000.004-2026-05-28.md b/docs/changelog/008.000.004-2026-05-28.md index cde8d3584e..24965ef867 100644 --- a/docs/changelog/008.000.004-2026-05-28.md +++ b/docs/changelog/008.000.004-2026-05-28.md @@ -2,4 +2,4 @@ ## [8.0.4] - 2026-05-28 -* Repairs the update PR workflow end-to-end: tree-SHA dedup replaces the >300-file-breaking diff API, the GitHub App token is now migrated to `client-id` (with renamed secret + docs) and reaches the push wire by blanking actions/checkout's external credentials file. +- Repairs the update PR workflow end-to-end: tree-SHA dedup replaces the >300-file-breaking diff API, the GitHub App token is now migrated to `client-id` (with renamed secret + docs) and reaches the push wire by blanking actions/checkout's external credentials file. diff --git a/docs/contributing/tools/github/branch/security.md b/docs/contributing/tools/github/branch/security.md index 4df8bfeb63..594c8331bc 100644 --- a/docs/contributing/tools/github/branch/security.md +++ b/docs/contributing/tools/github/branch/security.md @@ -4,34 +4,34 @@ See also [repository.md](../repository.md) for repository-wide security settings ## Enforcement πŸ”’ -* Ruleset is **Enabled (Enforced)** +- Ruleset is **Enabled (Enforced)** πŸ‘‰ **Meaning for contributors:** -* All rules in this document are **actively enforced** on the default branch (`main`). -* Contributors MUST comply; violations will block pushes/merges. +- All rules in this document are **actively enforced** on the default branch (`main`). +- Contributors MUST comply; violations will block pushes/merges. --- ## Bypass πŸšͺ -* Organization admins and repository admins can always bypass rules +- Organization admins and repository admins can always bypass rules πŸ‘‰ **Meaning for contributors:** -* Normal contributors MUST follow all rules -* Admins MAY merge without approvals or checks +- Normal contributors MUST follow all rules +- Admins MAY merge without approvals or checks --- ## Branch Target 🎯 -* Applies to: **`main` (default branch)** +- Applies to: **`main` (default branch)** πŸ‘‰ **Meaning for contributors:** -* All rules apply when targeting `main`. -* Feature branches are NOT restricted until a PR targets `main`. +- All rules apply when targeting `main`. +- Feature branches are NOT restricted until a PR targets `main`. --- @@ -39,32 +39,32 @@ See also [repository.md](../repository.md) for repository-wide security settings ### Restrict Updates βœ… -* Direct pushes are blocked +- Direct pushes are blocked πŸ‘‰ **Contributor impact:** -* You MUST NOT push directly to `main` -* You MUST use a Pull Request (PR) +- You MUST NOT push directly to `main` +- You MUST use a Pull Request (PR) --- ### Restrict Deletions βœ… -* Protected branch cannot be deleted +- Protected branch cannot be deleted πŸ‘‰ **Contributor impact:** -* You MUST NOT delete the main branch +- You MUST NOT delete the main branch --- ### Restrict Creations ❌ -* Branch creation is allowed +- Branch creation is allowed πŸ‘‰ **Contributor impact:** -* You MAY create branches freely +- You MAY create branches freely --- @@ -74,8 +74,8 @@ See also [repository.md](../repository.md) for repository-wide security settings πŸ‘‰ **Contributor impact:** -* You MUST open a PR to merge into `main` -* Direct commits to `main` are rejected +- You MUST open a PR to merge into `main` +- Direct commits to `main` are rejected --- @@ -83,8 +83,8 @@ See also [repository.md](../repository.md) for repository-wide security settings πŸ‘‰ **Contributor impact:** -* You MUST get **2 approvals** before merging -* Self-approval does not count +- You MUST get **2 approvals** before merging +- Self-approval does not count --- @@ -92,10 +92,10 @@ See also [repository.md](../repository.md) for repository-wide security settings πŸ‘‰ **Contributor impact:** -* If you push new commits: +- If you push new commits: - * Previous approvals are INVALIDATED -* You MUST get approvals again + - Previous approvals are INVALIDATED +- You MUST get approvals again --- @@ -103,10 +103,10 @@ See also [repository.md](../repository.md) for repository-wide security settings πŸ‘‰ **Contributor impact:** -* If you modify owned files: +- If you modify owned files: - * A CODEOWNER MUST approve -* PR cannot be merged without them + - A CODEOWNER MUST approve +- PR cannot be merged without them --- @@ -114,10 +114,10 @@ See also [repository.md](../repository.md) for repository-wide security settings πŸ‘‰ **Contributor impact:** -* After your last commit: +- After your last commit: - * Someone ELSE MUST approve again -* You CANNOT approve your own changes + - Someone ELSE MUST approve again +- You CANNOT approve your own changes --- @@ -125,8 +125,8 @@ See also [repository.md](../repository.md) for repository-wide security settings πŸ‘‰ **Contributor impact:** -* All review comments MUST be resolved -* Open discussions block merging +- All review comments MUST be resolved +- Open discussions block merging --- @@ -134,8 +134,8 @@ See also [repository.md](../repository.md) for repository-wide security settings πŸ‘‰ **Contributor impact:** -* No fixed team is always required -* Only CODEOWNERS matter +- No fixed team is always required +- Only CODEOWNERS matter --- @@ -145,8 +145,8 @@ See also [repository.md](../repository.md) for repository-wide security settings πŸ‘‰ **Contributor impact:** -* PRs are merged using merge commits -* History MAY become non-linear +- PRs are merged using merge commits +- History MAY become non-linear --- @@ -154,8 +154,8 @@ See also [repository.md](../repository.md) for repository-wide security settings πŸ‘‰ **Contributor impact:** -* Merge commits ARE allowed -* You MAY see branching history +- Merge commits ARE allowed +- You MAY see branching history --- @@ -163,8 +163,8 @@ See also [repository.md](../repository.md) for repository-wide security settings πŸ‘‰ **Contributor impact:** -* PRs can be merged immediately after approval -* No automatic queueing +- PRs can be merged immediately after approval +- No automatic queueing --- @@ -174,7 +174,7 @@ See also [repository.md](../repository.md) for repository-wide security settings πŸ‘‰ **Contributor impact:** -* Your PR MUST pass CI before merging +- Your PR MUST pass CI before merging --- @@ -182,8 +182,8 @@ See also [repository.md](../repository.md) for repository-wide security settings πŸ‘‰ **Contributor impact:** -* Currently, no checks are enforced -* Effectively: nothing blocks merge here +- Currently, no checks are enforced +- Effectively: nothing blocks merge here --- @@ -191,11 +191,11 @@ See also [repository.md](../repository.md) for repository-wide security settings πŸ‘‰ **Contributor impact:** -* You MUST update your branch before merging -* Typically via: +- You MUST update your branch before merging +- Typically via: - * merge `main` - * or rebase + - merge `main` + - or rebase --- @@ -205,8 +205,8 @@ See also [repository.md](../repository.md) for repository-wide security settings πŸ‘‰ **Contributor impact:** -* All commits MUST be signed (GPG/SSH) -* Unsigned commits will be rejected +- All commits MUST be signed (GPG/SSH) +- Unsigned commits will be rejected --- @@ -214,8 +214,8 @@ See also [repository.md](../repository.md) for repository-wide security settings πŸ‘‰ **Contributor impact:** -* You MUST NOT rewrite history on protected branches -* `git push --force` is blocked +- You MUST NOT rewrite history on protected branches +- `git push --force` is blocked --- @@ -225,13 +225,13 @@ See also [repository.md](../repository.md) for repository-wide security settings Configured tools: -* CodeQL (High severity) -* Hadolint (High severity) +- CodeQL (High severity) +- Hadolint (High severity) πŸ‘‰ **Contributor impact:** -* PR MUST NOT introduce high-severity issues -* Otherwise merge is blocked +- PR MUST NOT introduce high-severity issues +- Otherwise merge is blocked --- @@ -239,11 +239,11 @@ Configured tools: ### Require Code Quality Results βœ… -* Threshold: Warnings and higher +- Threshold: Warnings and higher πŸ‘‰ **Contributor impact:** -* You MUST fix code quality issues before merge +- You MUST fix code quality issues before merge --- @@ -253,6 +253,6 @@ Configured tools: πŸ‘‰ **Contributor impact:** -* Copilot may automatically review your PR -* It may comment on issues -* It does not replace human approvals +- Copilot may automatically review your PR +- It may comment on issues +- It does not replace human approvals diff --git a/docs/contributing/tools/github/repository.md b/docs/contributing/tools/github/repository.md index d1e7e6a54b..9f69e43799 100644 --- a/docs/contributing/tools/github/repository.md +++ b/docs/contributing/tools/github/repository.md @@ -52,24 +52,24 @@ For GHCR authentication configuration see [authentication.md](../ghcr/authentica Once enabled, you MUST: -* Create a PR (no direct push) -* Get 2 approvals -* Get CODEOWNER approval (if applicable) -* Resolve all comments -* Re-approve after changes -* Keep branch up-to-date -* Use signed commits -* Pass code scanning & quality checks +- Create a PR (no direct push) +- Get 2 approvals +- Get CODEOWNER approval (if applicable) +- Resolve all comments +- Re-approve after changes +- Keep branch up-to-date +- Use signed commits +- Pass code scanning & quality checks You MUST NOT: -* Push directly to main -* Force push -* Merge without approvals +- Push directly to main +- Force push +- Merge without approvals You MAY: -* Create branches freely -* Use merge commits +- Create branches freely +- Use merge commits All rules above are **currently enforced** on `main`. diff --git a/docs/requirements/035-mcp-proxy-expansion.md b/docs/requirements/035-mcp-proxy-expansion.md index 0a6f0e4a4f..170569955e 100644 --- a/docs/requirements/035-mcp-proxy-expansion.md +++ b/docs/requirements/035-mcp-proxy-expansion.md @@ -78,7 +78,7 @@ A future exception requires a new requirement with a fixed operation list, dedic **`host_execution_boundary` (39):** `desk-bluray-player`, `desk-chromium`, `desk-copyq`, `desk-docker`, `desk-dotlinker`, `desk-firefox`, `desk-git`, `desk-gnome`, `desk-gnome-caffeine`, `desk-gnome-extensions`, `desk-gnome-terminal`, `desk-gnucash`, `desk-jrnl`, `desk-keepassxc`, `desk-libreoffice`, `desk-micro`, `desk-neovim`, `desk-nextcloud`, `desk-obs`, `desk-qbittorrent`, `desk-retroarch`, `desk-spotify`, `desk-ssh`, `desk-torbrowser`, `desk-virtualbox`, `desk-zoom`, `dev-arduino`, `dev-core`, `dev-java`, `dev-locales`, `dev-make`, `dev-nix`, `dev-nodejs`, `dev-python`, `drv-epson-multiprinter`, `drv-intel`, `drv-lid-switch`, `drv-non-free`, `gen-hunspell`. These roles operate a workstation, developer toolchain, device, or host package; bridging them would amount to shared shell, filesystem, browser-session, device, or host execution without an application-specific remote identity. -**`privileged_control_plane` (26):** `svc-bkp-local-2-device`, `svc-bkp-nfs-2-local`, `svc-bkp-remote-2-local`, `svc-bkp-secrets-2-local`, `svc-bkp-volume-2-local`, `svc-dns-unbound`, `svc-net-firewall`, `svc-net-tor`, `svc-net-tor-smtp`, `svc-net-wireguard-core`, `svc-net-wireguard-firewalled`, `svc-net-wireguard-plain`, `svc-opt-keyboard-color`, `svc-opt-ssd-hdd`, `svc-opt-swapfile`, `svc-prx-openresty`, `svc-registry-cache`, `svc-registry-docker`, `svc-runner`, `svc-storage-nfs-client`, `svc-storage-nfs-server`, `svc-swarm-manager`, `svc-swarm-node`, `svc-virt-kata`, `update`, `web-app-openbao`. +**`privileged_control_plane` (24):** `svc-bkp-local-2-device`, `svc-bkp-nfs-2-local`, `svc-bkp-remote-2-local`, `svc-bkp-secrets-2-local`, `svc-bkp-volume-2-local`, `svc-dns-unbound`, `svc-net-firewall`, `svc-net-tor`, `svc-net-tor-smtp`, `svc-net-wireguard`, `svc-opt-keyboard-color`, `svc-opt-ssd-hdd`, `svc-opt-swapfile`, `svc-prx-openresty`, `svc-registry-cache`, `svc-registry-docker`, `svc-runner`, `svc-storage-nfs-client`, `svc-storage-nfs-server`, `svc-swarm-manager`, `svc-swarm-node`, `svc-virt-kata`, `update`, `web-app-openbao`. These roles can recover secrets, alter routing or host state, run code, change deployment state, or reach storage/control-plane sockets; they require a separate audited operations gateway and human approval rather than general-purpose application MCP. **`shared_engine_isolation` (4):** `svc-db-memcached`, `svc-db-openldap`, `svc-db-postgres`, `svc-db-rabbitmq`. diff --git a/docs/requirements/039-svc-net-wireguard-own-ci-row.md b/docs/requirements/039-svc-net-wireguard-own-ci-row.md new file mode 100644 index 0000000000..43bb3c21ed --- /dev/null +++ b/docs/requirements/039-svc-net-wireguard-own-ci-row.md @@ -0,0 +1,16 @@ +# 039 - svc-net-wireguard: Test Full Meshes on the Role's Own CI Row + +## User Story + +As a maintainer, I want the full-mesh WireGuard test to run only on the role's own CI row, so that no Compose app row spends deploy time on WireGuard while every role keeps its WireGuard support in production. + +## Acceptance Criteria + +- [x] Compose CI rows carry no πŸš‡ or πŸ›£οΈ glyph and never deploy `svc-net-wireguard`; the `vpn` axis covers swarm rows only, as before Compose support. +- [x] `INFINITO_COMPOSE_VPN` and its plumbing are gone. +- [x] `svc-net-wireguard` runs on a host exactly when the host is in the `svc-net-wireguard` group. +- [x] Outside swarm, a host in that group without a mesh is skipped with a visible message; in swarm it still fails hard. +- [x] A role's `meta/tests.yml` can name roles its CLI test requires under `cli.requires`, and `test-e2e-cli` includes them before the test runs. +- [ ] The CLI test of `svc-net-wireguard` requires `sys-svc-container`, and the role's own deploy row runs it to green with no other application deployed. +- [ ] Swarm deploys behave as before. +- [x] Every role keeps its `networks.meshes` field and Compose hosts can still join full meshes in production. diff --git a/docs/requirements/README.md b/docs/requirements/README.md index cc775f1bdd..fac2b1bbc6 100644 --- a/docs/requirements/README.md +++ b/docs/requirements/README.md @@ -31,4 +31,6 @@ Its scope is user stories and acceptance criteria that define what the project m - 025 - Matrix Role Ansible Flavor (matrix-docker-ansible-deploy) - 028 - atmo.rsvp (AT Protocol Events) Role + Mobilizon/ActivityPub Bridge - 031 - svc-net-tor: Tor Onion-Service Provider (injected alongside the clearnet domain) +- 037 - svc-net-wireguard: WireGuard Transport for Swarm Deployments +- 038 - svc-net-wireguard: Full-Mesh WireGuard for Compose Deployments - 038 - web-svc-api diff --git a/group_vars/all/08_networks.yml b/group_vars/all/08_networks.yml index 16ef357a73..bcf764757c 100644 --- a/group_vars/all/08_networks.yml +++ b/group_vars/all/08_networks.yml @@ -26,6 +26,7 @@ NETWORK_DOCKER_ADDRESS_POOLS: - base: "10.208.0.0/12" size: 24 NETWORK_TOR_VIRTUAL_CIDR: "10.240.0.0/12" # Range tor answers for .onion instead of routing; must not overlap the pool above +NETWORK_MESH_POOL: "10.100.0.0/16" # Range every WireGuard mesh subnet is carved from NETWORK_CONTAINER_BRIDGE_RESOLVER: false NETWORK_NESTED_DOCKER_BIP: "192.168.67.1/24" NETWORK_NESTED_DOCKER_ADDRESS_POOLS: diff --git a/group_vars/all/15_storage.yml b/group_vars/all/15_storage.yml index 47444fac08..743fbf3530 100644 --- a/group_vars/all/15_storage.yml +++ b/group_vars/all/15_storage.yml @@ -7,7 +7,10 @@ STORAGE_NFS_MOUNT_OPTS: "{{ lookup('nfs_mount_opts') }}" STORAGE_NFS_FSTYPE: "{{ lookup('nfs_fstype') }}" STORAGE_NFS_CLIENT_SRC: "{{ lookup('nfs_client_src') }}" +STORAGE_NFS_CONTROLLER_SRC: "{{ lookup('nfs_client_src', 'controller') }}" + storage: backend: local nfs: server: "" + controller_server: "" diff --git a/group_vars/all/18_swarm.yml b/group_vars/all/18_swarm.yml index 20e031e16b..18e9a87c00 100644 --- a/group_vars/all/18_swarm.yml +++ b/group_vars/all/18_swarm.yml @@ -20,7 +20,8 @@ swarm_stack_fatal_grace: 180 swarm: manager: - advertise_addr: "" + advertise_addr: >- + {{ lookup('mesh_address', STACK_HOST) if (WIREGUARD_ENABLED | bool) else '' }} network: encryption: true registry: diff --git a/group_vars/all/21_wireguard.yml b/group_vars/all/21_wireguard.yml new file mode 100644 index 0000000000..bf6e4a9595 --- /dev/null +++ b/group_vars/all/21_wireguard.yml @@ -0,0 +1,6 @@ +--- +WIREGUARD_SUBNET_POOL: "{{ NETWORK_MESH_POOL }}" + +WIREGUARD_SUBNET_POOLS: "{{ [WIREGUARD_SUBNET_POOL] }}" + +WIREGUARD_ENABLED: "{{ 'svc-net-wireguard' in group_names }}" diff --git a/inventories/development/wireguard.yml b/inventories/development/wireguard.yml new file mode 100644 index 0000000000..d443007449 --- /dev/null +++ b/inventories/development/wireguard.yml @@ -0,0 +1,32 @@ +--- +applications: + svc-net-wireguard: + networks: + meshes: + - name: swarm + subnet: "10.100.0.0/24" + listen_port: 51820 + - name: data + subnet: "10.100.1.0/24" + listen_port: 51821 + svc-swarm-node: + networks: + meshes: [swarm] + svc-storage-nfs-server: + networks: + meshes: [data] + svc-bkp-volume-2-local: + networks: + meshes: [data] + svc-bkp-secrets-2-local: + networks: + meshes: [data] + svc-bkp-nfs-2-local: + networks: + meshes: [data] + svc-bkp-remote-2-local: + networks: + meshes: [data] + svc-bkp-local-2-device: + networks: + meshes: [data] diff --git a/inventories/examples/wireguard-three-meshes/README.md b/inventories/examples/wireguard-three-meshes/README.md new file mode 100644 index 0000000000..9700b55aab --- /dev/null +++ b/inventories/examples/wireguard-three-meshes/README.md @@ -0,0 +1,78 @@ +# WireGuard: three meshes around one hub + +An inventory with **three** WireGuard meshes, to show that the number of meshes +and the hosts in them belong to the deployment rather than to this repository. +Nothing here is special-cased: the same CLI, role and planner serve it, and +every role ships its mesh fields empty. + +## The topology + +| mesh | subnet | port | hub | spokes | +|---|---|---|---|---| +| `alpha` | `10.100.10.0/24` | 51830 | `mesh-hub-01` | `svc-swarm-node` | +| `beta` | `10.100.11.0/24` | 51831 | `mesh-hub-01` | `svc-storage-nfs-server` | +| `gamma` | `10.100.12.0/24` | 51832 | `mesh-hub-01` | the five `svc-bkp-*` roles | + +The host carrying `svc-swarm-manager` is the hub of every mesh, which is what +lets a spoke of one reach a spoke of another: every spoke routes the whole +`NETWORK_MESH_POOL` through its hub. Two meshes with no host in common cannot +reach each other, by design. + +Declaration order matters once: each host's first declared mesh is its +**primary**. That is the address the other planes reach it on, the mesh a +deploy controller joins, and the one interface a spoke of several meshes +routes the pool through. Its other interfaces route only their own subnet, +because two interfaces claiming one range is a route `wg-quick` refuses. + +## Where the values go + +[wireguard.yml](wireguard.yml) holds the layout as ordinary `applications` +values: + +- `svc-net-wireguard.networks.meshes` declares the meshes. It belongs in the + hub's `host_vars`, which is where the mesh CLI reads it. +- `.networks.meshes` lists the meshes a role puts its hosts into. It + belongs in the `host_vars` of the hosts carrying that role, and may differ + per host, so two hosts of one role can sit in different meshes. + +`host_vars` is the place because a host's `applications` there replaces any +set in `group_vars`, and provisioning always writes one. + +## Running it + +The mesh is written by one cross-host pass before the play, never by the role: + +```bash +python3 -m cli.administration.inventory.mesh \ + --inventory inventories/examples/wireguard-three-meshes/inventory.yml \ + --host-vars-dir \ + --vault-password-file +``` + +It writes each host's own addresses, keys and peers into +`svc-net-wireguard.networks.interfaces` of that host's `host_vars`. + +## Testing it end to end + +The swarm lab has the same five hosts in the same groups as `inventory.yml`, +under its own names. Point a meshed swarm round at this layout and it deploys a +role over all three meshes: + +```bash +make swarm-zombie app= vpn=enforced \ + meshes=inventories/examples/wireguard-three-meshes/wireguard.yml +``` + +In CI, dispatch the manual workflow with the same three choices: + +```bash +gh workflow run entry-manual-steer.yml --ref \ + -f whitelist= -f mode=swarm -f vpn=enforced \ + -f meshes=inventories/examples/wireguard-three-meshes/wireguard.yml +``` + +The lab bakes the whole block into every host, which is enough because a host +only counts the roles it carries. It is also slightly stricter than this +inventory: its NFS server keeps its own backup leg, so `svc-bkp-nfs-2-local` +makes it a spoke of `gamma` as well as `beta`, and a run proves a spoke of two +meshes. diff --git a/inventories/examples/wireguard-three-meshes/inventory.yml b/inventories/examples/wireguard-three-meshes/inventory.yml new file mode 100644 index 0000000000..1257c99e9c --- /dev/null +++ b/inventories/examples/wireguard-three-meshes/inventory.yml @@ -0,0 +1,24 @@ +--- +all: + children: + svc-net-wireguard: + hosts: + mesh-hub-01: + mesh-wrk-01: + mesh-wrk-02: + mesh-nfs-01: + mesh-bkp-01: + svc-swarm-manager: + hosts: + mesh-hub-01: + svc-swarm-node: + hosts: + mesh-hub-01: + mesh-wrk-01: + mesh-wrk-02: + svc-storage-nfs-server: + hosts: + mesh-nfs-01: + svc-bkp-remote-2-local: + hosts: + mesh-bkp-01: diff --git a/inventories/examples/wireguard-three-meshes/wireguard.yml b/inventories/examples/wireguard-three-meshes/wireguard.yml new file mode 100644 index 0000000000..4d28c37117 --- /dev/null +++ b/inventories/examples/wireguard-three-meshes/wireguard.yml @@ -0,0 +1,35 @@ +--- +applications: + svc-net-wireguard: + networks: + meshes: + - name: alpha + subnet: "10.100.10.0/24" + listen_port: 51830 + - name: beta + subnet: "10.100.11.0/24" + listen_port: 51831 + - name: gamma + subnet: "10.100.12.0/24" + listen_port: 51832 + svc-swarm-node: + networks: + meshes: [alpha] + svc-storage-nfs-server: + networks: + meshes: [beta] + svc-bkp-volume-2-local: + networks: + meshes: [gamma] + svc-bkp-secrets-2-local: + networks: + meshes: [gamma] + svc-bkp-nfs-2-local: + networks: + meshes: [gamma] + svc-bkp-remote-2-local: + networks: + meshes: [gamma] + svc-bkp-local-2-device: + networks: + meshes: [gamma] diff --git a/meta/packages.yml b/meta/packages.yml index 2d0e56f5ae..7424d9a256 100644 --- a/meta/packages.yml +++ b/meta/packages.yml @@ -113,6 +113,22 @@ gnuchess: fedora: - gnuchess +iproute: + Archlinux: + - iproute2 + Debian: + - iproute2 + RedHat: + - iproute + +iputils-ping: + Archlinux: + - iputils + Debian: + - iputils-ping + RedHat: + - iputils + java-jdk: Archlinux: - jdk11-openjdk diff --git a/packaging/arch/PKGBUILD b/packaging/arch/PKGBUILD index 8b6f777599..bb869b0ff2 100644 --- a/packaging/arch/PKGBUILD +++ b/packaging/arch/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Kevin Veen-Birkenbach pkgname=infinito-nexus -pkgver=15.0.0 +pkgver=16.0.1 pkgrel=1 pkgdesc="Meta package for Infinito.Nexus host dependencies (dev + CI)." arch=('any') diff --git a/packaging/debian/changelog b/packaging/debian/changelog index 9b775eb6fe..b8cf49388e 100644 --- a/packaging/debian/changelog +++ b/packaging/debian/changelog @@ -1,3 +1,171 @@ +infinito-nexus (16.0.1-1) unstable; urgency=medium + + Fixed: + + - Changelog: every entry uses dash bullets, so the file lints clean again + - Lint: Markdown lists must use dash bullets; MD004 now pins that style + + Upgrade notes: + + - 16.0.0 was never published; its two upgrade notes apply to this release + - Moodle: [web-installed plugins](roles/web-app-moodle/README.md#updates) are not carried to 5.3 + - Zammad: Elasticsearch 9 rebuilds the search index on the first deploy + + Contributors: + + - [Kevin Veen-Birkenbach](https://veen.world): the Markdown list style fix + + -- Kevin Veen-Birkenbach Sun, 18 Oct 2026 23:04:22 +0200 + +infinito-nexus (16.0.0-1) unstable; urgency=medium + + Added: + + - WireGuard: new *svc-net-wireguard* role (beta) builds per-host mesh tunnels + - Mesh: every role can put its hosts into WireGuard meshes via inventory + - Mesh: full meshes without a hub, hub and spoke, controller as a spoke + - Mesh CLI: writes the mesh *host_vars* of an inventory and rotates its keys + - Swarm: nodes advertise and mount NFS over their primary mesh address + - Inventory: credentials can be generated across hosts + - Deploy: CLI end-to-end tests run after a deploy; roles declare them + - Update: a version pin can declare its own upstream source, addons too + - Plugins: memory parameters follow the container limit via one lookup + - Stalwart: bans and failed logins appear in the container output + - Playbooks: playbooks under *playbooks/* load the root *group_vars* + + Changed: + + - Moodle: runs 5.3; existing 4.5 sites are upgraded on deploy + - OpenTalk: runs product version 26.2.1 + - Bluesky: PDS 0.4.66, so AppView proxy calls carry *lxm* + - Nextcloud: held at 34 until *integration_openproject* supports 35 + - Nextcloud: BPM Files, News and Recognize are optional addons + - Memory: PHP, Postgres and Snipe-IT limits follow the container size + - Hugo: builds with the official Hugo image as the image's own user + - BigBlueButton: the release set follows one version source + + Version jumps (net since 15.0.0): + + - *svc-ai-ollama*: 0.35.0 to 0.40.6 + - *svc-db-elasticsearch*: 9.5.3 to 9.5.5 + - *svc-db-qdrant*: v1.19.1 to v1.19.2 + - *svc-net-tor-smtp*: 3.14-slim to 3.15-slim + - *svc-runner*: BuildKit v0.33.1 to v0.34.0 + - *sys-ctl-hlth-csp*: csp-checker 3.0.4 to 3.1.0 + - *test-e2e-playwright*: Playwright v1.63.0-noble to v1.64.1-noble + - *web-app-baserow*: 2.3.4 to 2.4.1 + - *web-app-bigbluebutton*: dockerize v0.15.1 to v0.15.2 + - *web-app-bluesky*: PDS 0.4.0 to 0.4.66, AppView 1.134.0 to 1.135.0 + - *web-app-checkmk*: 2.4.0p32 to 2.4.0p37 + - *web-app-chess*: v1.0.1 to v1.2.2 + - *web-app-erpnext*: v16.37.0 to v16.51.1 + - *web-app-espocrm*: 10.0.9 to 10.0.10 + - *web-app-fediwall*: 1.31.6-alpine to 1.31.7-alpine + - *web-app-flowise*: better-sqlite3 12.11.1 to 13.0.3 + - *web-app-funkwhale*: 2.0.11 to 2.0.12 + - *web-app-gitea*: 1.27.3 to 28.1.0, MCP server 1.6.0 to 1.9.0 + - *web-app-gitlab*: v19.4.1 to v19.5.0 + - *web-app-hermes*: v2026.9.7 to v2026.9.24 + - *web-app-hugo*: builder exts-0.148.0 to v0.168.0 + - *web-app-hugo*: hugoDocs source v0.148.0 to v0.165.0 + - *web-app-jenkins*: 2.568.3-lts to 2.580.1-lts + - *web-app-jira*: 11.3.11 to 11.3.12 + - *web-app-keycloak*: 26.8.0 to 26.8.1 + - *web-app-lam*: 9.6 to 9.7 + - *web-app-littlejs*: 1.31.6-alpine to 1.31.7-alpine + - *web-app-matrix*: Synapse v1.162.0 to v1.163.0 + - *web-app-matrix*: Element v1.12.30 to v1.12.32 + - *web-app-mattermost*: 11.11.0 to 12.0.0 + - *web-app-moodle*: 4.5.11 to 5.3.0, OIDC plugin v4.5.8 to v5.2.1 + - *web-app-n8n*: 1.100.1 to 2.44.3 + - *web-app-nextcloud*: context_agent 2.8.0 to 2.9.1 + - *web-app-nextcloud*: proxy 1.31.5-alpine to 1.31.7-alpine + - *web-app-openbao*: 2.6.2 to 2.7.1 + - *web-app-opentalk*: frontend v2.9.0 to v2.9.2 (product 26.2.1) + - *web-app-opentalk*: controller v0.34.1 to v0.34.5 + - *web-app-opentalk*: recorder v0.16.2 to v0.17.5 + - *web-app-opentalk*: LiveKit v1.13.7 to v1.13.10 + - *web-app-penpot*: 2.17.2 to 2.18.3 + - *web-app-pihole*: 2026.09.0 to 2026.10.0 + - *web-app-pixelfed*: 20260917 to 20261017 + - *web-app-pretix*: 2026.7.0 to 2026.8.0 + - *web-app-prometheus*: v3.14.0 to v3.15.0 + - *web-app-prometheus*: cAdvisor v0.52.1 to v0.55.1 + - *web-app-prometheus*: blackbox exporter v0.28.0 to v0.29.0 + - *web-app-semaphore*: v2.19.14 to v2.19.16 + - *web-app-socialhome*: 2026.10.2 to 2026.10.17 + - *web-app-stalwart*: v0.16.24 to v0.16.26, web UI v1.0.5 to v1.0.11 + - *web-app-suitecrm*: 8.9.1 to 8.10.2 + - *web-app-taiga*: gateway 1.31.6-alpine to 1.31.7-alpine + - *web-app-wordpress*: 7.1.0 to 7.1.3, MCP adapter v0.5.0 to v0.7.1 + - *web-app-xwiki*: OIDC authenticator 2.19.6 to 2.29.0 + - *web-app-xwiki*: LDAP authenticator 9.15.7 to 9.16.6 + - *web-app-xwiki*: AI LLM 0.7 to 0.10 + - *web-app-zammad*: Elasticsearch 8.13.4 to 9.5.5 + - *web-svc-collabora*: 26.04.2.1.1 to 26.04.5.1.1 + - *web-svc-coturn*: gateway 1.31.6-alpine to 1.31.7-alpine + - *web-svc-logout*: v1.4.1 to v1.4.2 + - *web-svc-onlyoffice*: 9.4.0 to 10.0.0 + - *backup-docker-to-local* (*baudolo*): 7.0.2 to 7.1.1 + - *community.general*: 13.4.0 to 13.5.0 + - *community.docker*: 5.3.0 to 5.4.0 + - *hetzner.hcloud*: 7.1.0 to 7.2.0 + - *ruff* (dev): 0.16.9 to 0.17.0 + - *@playwright/test* (dev): ^1.63.0 to ^1.64.0 + - *eslint* (dev): ^10.9.1 to ^10.12.0 + - *eslint-plugin-playwright* (dev): ^2.10.5 to ^2.12.1 + - *globals* (dev): ^17.12.0 to ^17.13.0 + - *stylelint* (dev): ^17.15.0 to ^17.16.0 + + Fixed: + + - Zammad: init waits for search in swarm; disk watermarks fit the disk + - Zammad: the deploy stops when Elasticsearch allocates no shard + - Nextcloud: OnlyOffice server URL is written last and checked in time + - Nextcloud: Talk server lists are written as typed arrays + - Keycloak: concurrent *kcadm* jobs no longer lose the config lock + - SuiteCRM: sessions live in Redis so replicas share them + - SuiteCRM: external auth provisioning can create its user + - n8n: SSO hook, MCP provisioning and API paging work under n8n 2 + - Stalwart: address bans expire; bots use app passwords under SSO + - OpenProject: the migration probe no longer creates tables + - Prometheus: probes are judged per target and reach apps on their vhosts + - Collabora: the WOPI host follows Nextcloud's domain and TLS state + - Odoo: the OAuth addon works on Odoo 20 + - Mobilizon: four migrations are patched for PostgreSQL 18 + - OpenBao: the LDAP auth method ships as an external plugin + - Penpot: the frontend waits for its backend; its probe needs no curl + - Pixelfed: the OIDC token exchange uses Tor on an onion issuer + - Matrix: Synapse metrics are published in the ansible flavor + - Matomo: the CSP allows the inline handler of the core top bar + - Moodle: the code tree is replaced only after a complete copy + - XWiki: an add-on off its pinned version is upgraded + - Bridgy Fed: builds on Python 3.14 until cbor2 supports 3.15 + - Tor: the onion apex no longer redirects to a clearnet homepage + - Health: the CSP crawler follows redirects to this node + - Health: the journal check reads long messages, skips container logs + - Services: a stale unit result no longer fails a deploy + - Cache: the applications carrier stays valid across nested app loads + - Docker: the installed apt key is kept when its refresh is refused + - Mail: a connection dropped before the greeting is retried + - Admin: */usr/local/bin* stays on the administrator's sudo path + - User: the login banner stays off non-interactive stdout + - CI: a change under *tests/* no longer deploys every role + - CI: workspace and runner images are pulled through the GHCR mirror + + Upgrade notes: + + - Moodle: [web-installed plugins](roles/web-app-moodle/README.md#updates) are not carried to 5.3 + - Zammad: Elasticsearch 9 rebuilds the search index on the first deploy + + Contributors: + + - [Evangelos Tsakoudis](https://evangelostsak.com): WireGuard role and meshes + - [Kevin Veen-Birkenbach](https://veen.world): app fixes, version sources, CI + - [Prageeth Panicker](https://github.com/pragepani): the journal check fix + + -- Kevin Veen-Birkenbach Sun, 18 Oct 2026 22:08:32 +0200 + infinito-nexus (15.0.0-1) unstable; urgency=medium **Breaking Changes** diff --git a/packaging/fedora/infinito-nexus.spec b/packaging/fedora/infinito-nexus.spec index d87e2f2e42..1c2016ba6b 100644 --- a/packaging/fedora/infinito-nexus.spec +++ b/packaging/fedora/infinito-nexus.spec @@ -1,5 +1,5 @@ Name: infinito-nexus -Version: 15.0.0 +Version: 16.0.1 Release: 1%{?dist} Summary: Meta package for Infinito.Nexus host dependencies @@ -58,6 +58,168 @@ install -d %{buildroot}%{_docdir}/%{name} %doc %{_docdir}/%{name}/DEPENDENCIES %changelog +* Sun Oct 18 2026 Kevin Veen-Birkenbach - 16.0.1-1 +- Fixed: + +- - Changelog: every entry uses dash bullets, so the file lints clean again +- - Lint: Markdown lists must use dash bullets; MD004 now pins that style + +- Upgrade notes: + +- - 16.0.0 was never published; its two upgrade notes apply to this release +- - Moodle: [web-installed plugins](roles/web-app-moodle/README.md#updates) are not carried to 5.3 +- - Zammad: Elasticsearch 9 rebuilds the search index on the first deploy + +- Contributors: + +- - [Kevin Veen-Birkenbach](https://veen.world): the Markdown list style fix + +* Sun Oct 18 2026 Kevin Veen-Birkenbach - 16.0.0-1 +- Added: + +- - WireGuard: new *svc-net-wireguard* role (beta) builds per-host mesh tunnels +- - Mesh: every role can put its hosts into WireGuard meshes via inventory +- - Mesh: full meshes without a hub, hub and spoke, controller as a spoke +- - Mesh CLI: writes the mesh *host_vars* of an inventory and rotates its keys +- - Swarm: nodes advertise and mount NFS over their primary mesh address +- - Inventory: credentials can be generated across hosts +- - Deploy: CLI end-to-end tests run after a deploy; roles declare them +- - Update: a version pin can declare its own upstream source, addons too +- - Plugins: memory parameters follow the container limit via one lookup +- - Stalwart: bans and failed logins appear in the container output +- - Playbooks: playbooks under *playbooks/* load the root *group_vars* + +- Changed: + +- - Moodle: runs 5.3; existing 4.5 sites are upgraded on deploy +- - OpenTalk: runs product version 26.2.1 +- - Bluesky: PDS 0.4.66, so AppView proxy calls carry *lxm* +- - Nextcloud: held at 34 until *integration_openproject* supports 35 +- - Nextcloud: BPM Files, News and Recognize are optional addons +- - Memory: PHP, Postgres and Snipe-IT limits follow the container size +- - Hugo: builds with the official Hugo image as the image's own user +- - BigBlueButton: the release set follows one version source + +- Version jumps (net since 15.0.0): + +- - *svc-ai-ollama*: 0.35.0 to 0.40.6 +- - *svc-db-elasticsearch*: 9.5.3 to 9.5.5 +- - *svc-db-qdrant*: v1.19.1 to v1.19.2 +- - *svc-net-tor-smtp*: 3.14-slim to 3.15-slim +- - *svc-runner*: BuildKit v0.33.1 to v0.34.0 +- - *sys-ctl-hlth-csp*: csp-checker 3.0.4 to 3.1.0 +- - *test-e2e-playwright*: Playwright v1.63.0-noble to v1.64.1-noble +- - *web-app-baserow*: 2.3.4 to 2.4.1 +- - *web-app-bigbluebutton*: dockerize v0.15.1 to v0.15.2 +- - *web-app-bluesky*: PDS 0.4.0 to 0.4.66, AppView 1.134.0 to 1.135.0 +- - *web-app-checkmk*: 2.4.0p32 to 2.4.0p37 +- - *web-app-chess*: v1.0.1 to v1.2.2 +- - *web-app-erpnext*: v16.37.0 to v16.51.1 +- - *web-app-espocrm*: 10.0.9 to 10.0.10 +- - *web-app-fediwall*: 1.31.6-alpine to 1.31.7-alpine +- - *web-app-flowise*: better-sqlite3 12.11.1 to 13.0.3 +- - *web-app-funkwhale*: 2.0.11 to 2.0.12 +- - *web-app-gitea*: 1.27.3 to 28.1.0, MCP server 1.6.0 to 1.9.0 +- - *web-app-gitlab*: v19.4.1 to v19.5.0 +- - *web-app-hermes*: v2026.9.7 to v2026.9.24 +- - *web-app-hugo*: builder exts-0.148.0 to v0.168.0 +- - *web-app-hugo*: hugoDocs source v0.148.0 to v0.165.0 +- - *web-app-jenkins*: 2.568.3-lts to 2.580.1-lts +- - *web-app-jira*: 11.3.11 to 11.3.12 +- - *web-app-keycloak*: 26.8.0 to 26.8.1 +- - *web-app-lam*: 9.6 to 9.7 +- - *web-app-littlejs*: 1.31.6-alpine to 1.31.7-alpine +- - *web-app-matrix*: Synapse v1.162.0 to v1.163.0 +- - *web-app-matrix*: Element v1.12.30 to v1.12.32 +- - *web-app-mattermost*: 11.11.0 to 12.0.0 +- - *web-app-moodle*: 4.5.11 to 5.3.0, OIDC plugin v4.5.8 to v5.2.1 +- - *web-app-n8n*: 1.100.1 to 2.44.3 +- - *web-app-nextcloud*: context_agent 2.8.0 to 2.9.1 +- - *web-app-nextcloud*: proxy 1.31.5-alpine to 1.31.7-alpine +- - *web-app-openbao*: 2.6.2 to 2.7.1 +- - *web-app-opentalk*: frontend v2.9.0 to v2.9.2 (product 26.2.1) +- - *web-app-opentalk*: controller v0.34.1 to v0.34.5 +- - *web-app-opentalk*: recorder v0.16.2 to v0.17.5 +- - *web-app-opentalk*: LiveKit v1.13.7 to v1.13.10 +- - *web-app-penpot*: 2.17.2 to 2.18.3 +- - *web-app-pihole*: 2026.09.0 to 2026.10.0 +- - *web-app-pixelfed*: 20260917 to 20261017 +- - *web-app-pretix*: 2026.7.0 to 2026.8.0 +- - *web-app-prometheus*: v3.14.0 to v3.15.0 +- - *web-app-prometheus*: cAdvisor v0.52.1 to v0.55.1 +- - *web-app-prometheus*: blackbox exporter v0.28.0 to v0.29.0 +- - *web-app-semaphore*: v2.19.14 to v2.19.16 +- - *web-app-socialhome*: 2026.10.2 to 2026.10.17 +- - *web-app-stalwart*: v0.16.24 to v0.16.26, web UI v1.0.5 to v1.0.11 +- - *web-app-suitecrm*: 8.9.1 to 8.10.2 +- - *web-app-taiga*: gateway 1.31.6-alpine to 1.31.7-alpine +- - *web-app-wordpress*: 7.1.0 to 7.1.3, MCP adapter v0.5.0 to v0.7.1 +- - *web-app-xwiki*: OIDC authenticator 2.19.6 to 2.29.0 +- - *web-app-xwiki*: LDAP authenticator 9.15.7 to 9.16.6 +- - *web-app-xwiki*: AI LLM 0.7 to 0.10 +- - *web-app-zammad*: Elasticsearch 8.13.4 to 9.5.5 +- - *web-svc-collabora*: 26.04.2.1.1 to 26.04.5.1.1 +- - *web-svc-coturn*: gateway 1.31.6-alpine to 1.31.7-alpine +- - *web-svc-logout*: v1.4.1 to v1.4.2 +- - *web-svc-onlyoffice*: 9.4.0 to 10.0.0 +- - *backup-docker-to-local* (*baudolo*): 7.0.2 to 7.1.1 +- - *community.general*: 13.4.0 to 13.5.0 +- - *community.docker*: 5.3.0 to 5.4.0 +- - *hetzner.hcloud*: 7.1.0 to 7.2.0 +- - *ruff* (dev): 0.16.9 to 0.17.0 +- - *@playwright/test* (dev): ^1.63.0 to ^1.64.0 +- - *eslint* (dev): ^10.9.1 to ^10.12.0 +- - *eslint-plugin-playwright* (dev): ^2.10.5 to ^2.12.1 +- - *globals* (dev): ^17.12.0 to ^17.13.0 +- - *stylelint* (dev): ^17.15.0 to ^17.16.0 + +- Fixed: + +- - Zammad: init waits for search in swarm; disk watermarks fit the disk +- - Zammad: the deploy stops when Elasticsearch allocates no shard +- - Nextcloud: OnlyOffice server URL is written last and checked in time +- - Nextcloud: Talk server lists are written as typed arrays +- - Keycloak: concurrent *kcadm* jobs no longer lose the config lock +- - SuiteCRM: sessions live in Redis so replicas share them +- - SuiteCRM: external auth provisioning can create its user +- - n8n: SSO hook, MCP provisioning and API paging work under n8n 2 +- - Stalwart: address bans expire; bots use app passwords under SSO +- - OpenProject: the migration probe no longer creates tables +- - Prometheus: probes are judged per target and reach apps on their vhosts +- - Collabora: the WOPI host follows Nextcloud's domain and TLS state +- - Odoo: the OAuth addon works on Odoo 20 +- - Mobilizon: four migrations are patched for PostgreSQL 18 +- - OpenBao: the LDAP auth method ships as an external plugin +- - Penpot: the frontend waits for its backend; its probe needs no curl +- - Pixelfed: the OIDC token exchange uses Tor on an onion issuer +- - Matrix: Synapse metrics are published in the ansible flavor +- - Matomo: the CSP allows the inline handler of the core top bar +- - Moodle: the code tree is replaced only after a complete copy +- - XWiki: an add-on off its pinned version is upgraded +- - Bridgy Fed: builds on Python 3.14 until cbor2 supports 3.15 +- - Tor: the onion apex no longer redirects to a clearnet homepage +- - Health: the CSP crawler follows redirects to this node +- - Health: the journal check reads long messages, skips container logs +- - Services: a stale unit result no longer fails a deploy +- - Cache: the applications carrier stays valid across nested app loads +- - Docker: the installed apt key is kept when its refresh is refused +- - Mail: a connection dropped before the greeting is retried +- - Admin: */usr/local/bin* stays on the administrator's sudo path +- - User: the login banner stays off non-interactive stdout +- - CI: a change under *tests/* no longer deploys every role +- - CI: workspace and runner images are pulled through the GHCR mirror + +- Upgrade notes: + +- - Moodle: [web-installed plugins](roles/web-app-moodle/README.md#updates) are not carried to 5.3 +- - Zammad: Elasticsearch 9 rebuilds the search index on the first deploy + +- Contributors: + +- - [Evangelos Tsakoudis](https://evangelostsak.com): WireGuard role and meshes +- - [Kevin Veen-Birkenbach](https://veen.world): app fixes, version sources, CI +- - [Prageeth Panicker](https://github.com/pragepani): the journal check fix + * Sat Oct 03 2026 Kevin Veen-Birkenbach - 15.0.0-1 - **Breaking Changes** diff --git a/playbooks/group_vars b/playbooks/group_vars new file mode 120000 index 0000000000..cc7e7a90f9 --- /dev/null +++ b/playbooks/group_vars @@ -0,0 +1 @@ +../group_vars \ No newline at end of file diff --git a/playbooks/mesh.yml b/playbooks/mesh.yml new file mode 100644 index 0000000000..e5075c43b9 --- /dev/null +++ b/playbooks/mesh.yml @@ -0,0 +1,18 @@ +--- +- name: "πŸ”’ Bring every host of this inventory onto the mesh" + hosts: svc-net-wireguard + become: true + vars: + MESH_BOOTSTRAP: false + pre_tasks: + - name: "🧊 Render the applications SPOT once and carry it into every task's worker" + applications_carrier: {} + + - name: "πŸ”“ Get apt ready before the first apt task" + ansible.builtin.include_tasks: "../tasks/utils/apt/ready.yml" + when: ansible_facts['os_family'] == 'Debian' + roles: + - role: user-root + when: MESH_BOOTSTRAP | bool + + - role: svc-net-wireguard diff --git a/playbooks/swarm-lab-passwordless-sudo.yml b/playbooks/swarm-lab-passwordless-sudo.yml new file mode 100644 index 0000000000..5525649239 --- /dev/null +++ b/playbooks/swarm-lab-passwordless-sudo.yml @@ -0,0 +1,16 @@ +--- +- name: "πŸ”“ Let the lab's administrator escalate without a prompt" + hosts: all + become: true + gather_facts: false + vars_files: + - ../roles/user-administrator/vars/main.yml + tasks: + - name: "πŸ”“ Drop the lab sudoers override" + ansible.builtin.copy: + content: "{{ USER_ADMINISTRATOR_NAME }} ALL=(ALL) NOPASSWD: ALL\n" + dest: "/etc/sudoers.d/zz-swarm-lab-{{ USER_ADMINISTRATOR_NAME }}" + owner: root + group: root + mode: "0440" + validate: "visudo -cf %s" diff --git a/plugins/action/package_install.py b/plugins/action/package_install.py index 474a8238a9..ea7fe211c1 100755 --- a/plugins/action/package_install.py +++ b/plugins/action/package_install.py @@ -36,6 +36,7 @@ from ansible.plugins.action import ActionBase from utils.packages.calls import ( GENERIC_PACKAGE, + MANAGER_ARGS, STATE_PRESENT, STATES, ModuleCall, @@ -129,6 +130,8 @@ class ActionModule(ActionBase): ) -> dict[str, Any]: args = {k: v for k, v in call.args.items() if v is not None} module = self._module_name(call, facts) + if call.module == GENERIC_PACKAGE: + args.update(MANAGER_ARGS.get(module, {})) if not call.become_user: return self._execute_module( module_name=module, module_args=args, task_vars=task_vars diff --git a/plugins/lookup/mesh_address.py b/plugins/lookup/mesh_address.py new file mode 100644 index 0000000000..1a050510b7 --- /dev/null +++ b/plugins/lookup/mesh_address.py @@ -0,0 +1,35 @@ +"""Lookup `mesh_address`: a host's primary mesh address, or '' off the mesh. + +Usage: + + {{ lookup('mesh_address', STACK_HOST) }} + +Takes exactly one term, the inventory hostname. +""" + +from __future__ import annotations + +from typing import Any + +from ansible.errors import AnsibleError +from ansible.plugins.lookup import LookupBase + +from utils.networks.mesh import primary_address + + +class LookupModule(LookupBase): + def run( + self, + terms: list[Any] | None, + variables: dict[str, Any] | None = None, + **kwargs: Any, + ) -> list[Any]: + if not terms or len(terms) != 1: + raise AnsibleError("lookup('mesh_address', ) takes one term") + host = str(terms[0]).strip() + hostvars = (variables or {}).get("hostvars") or {} + try: + applications = hostvars[host].get("applications") or {} + except KeyError: + applications = {} + return [primary_address(applications, host)] diff --git a/plugins/lookup/mesh_ranges.py b/plugins/lookup/mesh_ranges.py new file mode 100644 index 0000000000..e327e2c18f --- /dev/null +++ b/plugins/lookup/mesh_ranges.py @@ -0,0 +1,49 @@ +"""Lookup `mesh_ranges`: the address ranges the WireGuard meshes occupy, as a list. + +Usage: + + {{ lookup('mesh_ranges') }} + +Takes no terms. +""" + +from __future__ import annotations + +from typing import Any + +from ansible.errors import AnsibleError +from ansible.plugins.lookup import LookupBase + +from utils.networks.lookup_context import resolve_var + +_POOL_VAR = "WIREGUARD_SUBNET_POOLS" + + +def _is_template(value: str) -> bool: + return "{{" in value or "{%" in value + + +class LookupModule(LookupBase): + def run( + self, + terms: list[Any] | None, + variables: dict[str, Any] | None = None, + **kwargs: Any, + ) -> list[Any]: + if terms: + raise AnsibleError("lookup('mesh_ranges') takes no terms") + pools = (variables or {}).get(_POOL_VAR) + if pools is None: + raise AnsibleError(f"mesh_ranges: {_POOL_VAR} is not defined") + pools = resolve_var(getattr(self, "_templar", None), pools) + if isinstance(pools, str): + pools = [pools] + ranges = [str(entry).strip() for entry in pools if str(entry).strip()] + if not ranges: + raise AnsibleError(f"mesh_ranges: {_POOL_VAR} declares no range") + unrendered = [entry for entry in ranges if _is_template(entry)] + if unrendered: + raise AnsibleError( + f"mesh_ranges: {_POOL_VAR} did not render: {', '.join(unrendered)}" + ) + return [ranges] diff --git a/plugins/lookup/nfs_client_src.py b/plugins/lookup/nfs_client_src.py index 513a086e84..a38d27b068 100644 --- a/plugins/lookup/nfs_client_src.py +++ b/plugins/lookup/nfs_client_src.py @@ -13,13 +13,20 @@ from utils.storage.nfs import ( class LookupModule(LookupBase): - """NFS client mount src (server:path): {{ lookup('nfs_client_src') }}.""" + """NFS client mount src (server:path): {{ lookup('nfs_client_src') }}. + + ``{{ lookup('nfs_client_src', 'controller') }}`` addresses the server as + the Ansible controller reaches it. + """ def run(self, terms, variables=None, **kwargs): variables = variables or getattr(self._templar, "available_variables", {}) or {} nfs = variables.get("storage", {}).get("nfs", {}) + server = nfs.get("server") + if terms and terms[0] == "controller": + server = nfs.get("controller_server") or server flavor = lookup_loader.get( "nfs_flavor", loader=self._loader, templar=self._templar ).run([], variables=variables)[0] state = state_path(get_export_base(), STATE_SUBDIR) - return [client_src(nfs.get("server"), get_client_version(), flavor, state)] + return [client_src(server, get_client_version(), flavor, state)] diff --git a/pyproject.toml b/pyproject.toml index 9639107c97..4ed075e2fa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "infinito-nexus" -version = "15.0.0" +version = "16.0.1" description = "Infinito.Nexus" readme = "README.md" requires-python = ">=3.11" diff --git a/roles/svc-ai-litellm/meta/networks.yml b/roles/svc-ai-litellm/meta/networks.yml index 9b9e0c25a7..51eb48cfd6 100644 --- a/roles/svc-ai-litellm/meta/networks.yml +++ b/roles/svc-ai-litellm/meta/networks.yml @@ -1,4 +1,5 @@ --- +meshes: [] local: subnet: 192.168.80.0/24 overlay: diff --git a/roles/svc-ai-lmstudio/meta/networks.yml b/roles/svc-ai-lmstudio/meta/networks.yml index f313538776..dbde5c13b5 100644 --- a/roles/svc-ai-lmstudio/meta/networks.yml +++ b/roles/svc-ai-lmstudio/meta/networks.yml @@ -1,4 +1,5 @@ --- +meshes: [] local: subnet: 192.168.108.0/24 overlay: diff --git a/roles/svc-ai-mcp-adapter/meta/networks.yml b/roles/svc-ai-mcp-adapter/meta/networks.yml index b4de29575a..2fe702346c 100644 --- a/roles/svc-ai-mcp-adapter/meta/networks.yml +++ b/roles/svc-ai-mcp-adapter/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.221.0/24 diff --git a/roles/svc-ai-ollama/meta/networks.yml b/roles/svc-ai-ollama/meta/networks.yml index 817fc9986d..06e175f881 100644 --- a/roles/svc-ai-ollama/meta/networks.yml +++ b/roles/svc-ai-ollama/meta/networks.yml @@ -1,4 +1,5 @@ --- +meshes: [] local: subnet: 192.168.203.0/24 overlay: diff --git a/roles/svc-bkp-local-2-device/meta/networks.yml b/roles/svc-bkp-local-2-device/meta/networks.yml new file mode 100644 index 0000000000..05c3b3a894 --- /dev/null +++ b/roles/svc-bkp-local-2-device/meta/networks.yml @@ -0,0 +1,2 @@ +--- +meshes: [] diff --git a/roles/svc-bkp-nfs-2-local/meta/networks.yml b/roles/svc-bkp-nfs-2-local/meta/networks.yml new file mode 100644 index 0000000000..05c3b3a894 --- /dev/null +++ b/roles/svc-bkp-nfs-2-local/meta/networks.yml @@ -0,0 +1,2 @@ +--- +meshes: [] diff --git a/roles/svc-bkp-remote-2-local/meta/networks.yml b/roles/svc-bkp-remote-2-local/meta/networks.yml new file mode 100644 index 0000000000..05c3b3a894 --- /dev/null +++ b/roles/svc-bkp-remote-2-local/meta/networks.yml @@ -0,0 +1,2 @@ +--- +meshes: [] diff --git a/roles/svc-bkp-secrets-2-local/meta/networks.yml b/roles/svc-bkp-secrets-2-local/meta/networks.yml new file mode 100644 index 0000000000..05c3b3a894 --- /dev/null +++ b/roles/svc-bkp-secrets-2-local/meta/networks.yml @@ -0,0 +1,2 @@ +--- +meshes: [] diff --git a/roles/svc-bkp-volume-2-local/meta/networks.yml b/roles/svc-bkp-volume-2-local/meta/networks.yml new file mode 100644 index 0000000000..05c3b3a894 --- /dev/null +++ b/roles/svc-bkp-volume-2-local/meta/networks.yml @@ -0,0 +1,2 @@ +--- +meshes: [] diff --git a/roles/svc-db-elasticsearch/meta/networks.yml b/roles/svc-db-elasticsearch/meta/networks.yml index cf2d58644c..b5a2951fe2 100644 --- a/roles/svc-db-elasticsearch/meta/networks.yml +++ b/roles/svc-db-elasticsearch/meta/networks.yml @@ -1,4 +1,5 @@ --- +meshes: [] local: subnet: 192.168.211.0/24 overlay: diff --git a/roles/svc-db-mariadb/defaults/README.md b/roles/svc-db-mariadb/defaults/README.md index 003dd2c007..a95ad34767 100644 --- a/roles/svc-db-mariadb/defaults/README.md +++ b/roles/svc-db-mariadb/defaults/README.md @@ -10,23 +10,23 @@ This directory contains default variable definition files for the `svc-db-mariad Defines default values for how the MariaDB database should be created. -* **`database_encoding`** (string): +- **`database_encoding`** (string): - * **Default:** `"utf8mb4"` - * **Reasoning:** + - **Default:** `"utf8mb4"` + - **Reasoning:** - * **Full Unicode support**: `utf8mb4` is the only MySQL/MariaDB character set that fully implements 4‑byte UTF‑8, allowing storage of emojis, supplementary symbols, and all global scripts without data loss. - * **Future‑proof:** Modern applications and standards have converged on UTF‑8; using `utf8mb4` avoids migration challenges later. - * **Performance trade‑off:** While slightly more storage might be used compared to `latin1`, the universality of `utf8mb4` outweighs the cost for most deployments. + - **Full Unicode support**: `utf8mb4` is the only MySQL/MariaDB character set that fully implements 4‑byte UTF‑8, allowing storage of emojis, supplementary symbols, and all global scripts without data loss. + - **Future‑proof:** Modern applications and standards have converged on UTF‑8; using `utf8mb4` avoids migration challenges later. + - **Performance trade‑off:** While slightly more storage might be used compared to `latin1`, the universality of `utf8mb4` outweighs the cost for most deployments. -* **`database_collation`** (string): +- **`database_collation`** (string): - * **Default:** `"utf8mb4_unicode_ci"` - * **Reasoning:** + - **Default:** `"utf8mb4_unicode_ci"` + - **Reasoning:** - * **Accurate sorting & comparison:** This collation uses full Unicode algorithm rules, ensuring linguistically correct comparisons across many languages. - * **Case‑insensitive (`ci`):** Most web apps expect case‑insensitive matching for usernames, emails, and search queries, improving usability. - * **Neutral choice:** Unlike language‑specific collations, `unicode_ci` works robustly in multilingual contexts without bias. + - **Accurate sorting & comparison:** This collation uses full Unicode algorithm rules, ensuring linguistically correct comparisons across many languages. + - **Case‑insensitive (`ci`):** Most web apps expect case‑insensitive matching for usernames, emails, and search queries, improving usability. + - **Neutral choice:** Unlike language‑specific collations, `unicode_ci` works robustly in multilingual contexts without bias. > **Tip:** If you have a legacy application requiring a different charset or collation (e.g., for backward compatibility with existing data), simply override `database_encoding` and `database_collation` in your playbook-level variables. diff --git a/roles/svc-db-mariadb/meta/networks.yml b/roles/svc-db-mariadb/meta/networks.yml index df4e54723d..fdd1f37dab 100644 --- a/roles/svc-db-mariadb/meta/networks.yml +++ b/roles/svc-db-mariadb/meta/networks.yml @@ -1,4 +1,5 @@ --- +meshes: [] local: subnet: 192.168.201.0/24 overlay: diff --git a/roles/svc-db-mariadb/vars/README.md b/roles/svc-db-mariadb/vars/README.md index 285d5bc501..2ab0b9e08a 100644 --- a/roles/svc-db-mariadb/vars/README.md +++ b/roles/svc-db-mariadb/vars/README.md @@ -11,15 +11,15 @@ This directory contains variable definition files for the `svc-db-mariadb` Ansib The role's service config (file root IS the services map keyed by ``). For `svc-db-mariadb` this carries the entity-keyed image, version, and hostname: -* **`version`** (string): +- **`version`** (string): - * Default: `"latest"` - * The MariaDB image tag to pull (e.g. `10.6`, `10.11`, or `latest`). + - Default: `"latest"` + - The MariaDB image tag to pull (e.g. `10.6`, `10.11`, or `latest`). -* **`hostname`** (string): +- **`hostname`** (string): - * Default: `"central-mariadb"` - * The container name and DNS alias within the `central_mariadb` network. Used by other services (like Moodle) to connect. + - Default: `"central-mariadb"` + - The container name and DNS alias within the `central_mariadb` network. Used by other services (like Moodle) to connect. > **Tip:** Pin to a specific minor version (e.g., `10.6.12`) in production to avoid breaking changes on rebuilds. @@ -29,7 +29,7 @@ For `svc-db-mariadb` this carries the entity-keyed image, version, and hostname: Minimal file defining the application identifier for the role. -* **`application_id`** (string): +- **`application_id`** (string): - * Default: `"mariadb"` - * Logical name used in templates, notifications, or paths when multiple roles/services may coexist. + - Default: `"mariadb"` + - Logical name used in templates, notifications, or paths when multiple roles/services may coexist. diff --git a/roles/svc-db-memcached/meta/networks.yml b/roles/svc-db-memcached/meta/networks.yml index 281fca771b..f4defb7fe9 100644 --- a/roles/svc-db-memcached/meta/networks.yml +++ b/roles/svc-db-memcached/meta/networks.yml @@ -1,4 +1,5 @@ --- +meshes: [] local: subnet: 192.168.210.0/24 overlay: diff --git a/roles/svc-db-openldap/meta/networks.yml b/roles/svc-db-openldap/meta/networks.yml index 82eeedf9a5..347fc3f5ff 100644 --- a/roles/svc-db-openldap/meta/networks.yml +++ b/roles/svc-db-openldap/meta/networks.yml @@ -1,4 +1,5 @@ --- +meshes: [] local: subnet: 192.168.202.0/24 overlay: diff --git a/roles/svc-db-postgres/meta/networks.yml b/roles/svc-db-postgres/meta/networks.yml index cc8595b24e..2df072cf07 100644 --- a/roles/svc-db-postgres/meta/networks.yml +++ b/roles/svc-db-postgres/meta/networks.yml @@ -1,4 +1,5 @@ --- +meshes: [] local: subnet: 192.168.200.0/24 overlay: diff --git a/roles/svc-db-qdrant/meta/networks.yml b/roles/svc-db-qdrant/meta/networks.yml index 77711b5672..c9ebd22230 100644 --- a/roles/svc-db-qdrant/meta/networks.yml +++ b/roles/svc-db-qdrant/meta/networks.yml @@ -1,4 +1,5 @@ --- +meshes: [] local: subnet: 192.168.213.0/24 overlay: diff --git a/roles/svc-db-rabbitmq/meta/networks.yml b/roles/svc-db-rabbitmq/meta/networks.yml index 5fa358bbb6..8092c1c6c9 100644 --- a/roles/svc-db-rabbitmq/meta/networks.yml +++ b/roles/svc-db-rabbitmq/meta/networks.yml @@ -1,4 +1,5 @@ --- +meshes: [] local: subnet: 192.168.209.0/24 overlay: diff --git a/roles/svc-db-redis/meta/networks.yml b/roles/svc-db-redis/meta/networks.yml index f6d517f993..1a108f5d97 100644 --- a/roles/svc-db-redis/meta/networks.yml +++ b/roles/svc-db-redis/meta/networks.yml @@ -1,4 +1,5 @@ --- +meshes: [] local: subnet: 192.168.207.0/24 overlay: diff --git a/roles/svc-db-typesense/meta/networks.yml b/roles/svc-db-typesense/meta/networks.yml index eb2c10eb9e..5939dfdb5f 100644 --- a/roles/svc-db-typesense/meta/networks.yml +++ b/roles/svc-db-typesense/meta/networks.yml @@ -1,4 +1,5 @@ --- +meshes: [] local: subnet: 192.168.212.0/24 overlay: diff --git a/roles/svc-dns-unbound/meta/networks.yml b/roles/svc-dns-unbound/meta/networks.yml index fc6f01a664..5d61b0f74c 100644 --- a/roles/svc-dns-unbound/meta/networks.yml +++ b/roles/svc-dns-unbound/meta/networks.yml @@ -1,4 +1,5 @@ --- +meshes: [] local: subnet: 192.168.208.0/24 dns_resolver: 192.168.208.53 diff --git a/roles/svc-net-tor-smtp/meta/networks.yml b/roles/svc-net-tor-smtp/meta/networks.yml index 7185e59673..73b67e109f 100644 --- a/roles/svc-net-tor-smtp/meta/networks.yml +++ b/roles/svc-net-tor-smtp/meta/networks.yml @@ -1,4 +1,5 @@ --- +meshes: [] local: subnet: 192.168.109.0/24 overlay: diff --git a/roles/svc-net-tor/meta/networks.yml b/roles/svc-net-tor/meta/networks.yml index 663e84fd14..398886cf39 100644 --- a/roles/svc-net-tor/meta/networks.yml +++ b/roles/svc-net-tor/meta/networks.yml @@ -2,6 +2,7 @@ # Tor runs with network_mode: host and has no vhost of its own, but the compose # role contract still requires a local network entry (see # test_compose_roles_have_local_network). Kept minimal; not used at runtime. +meshes: [] local: subnet: 192.168.74.0/24 overlay: diff --git a/roles/svc-net-wireguard-core/Administration.md b/roles/svc-net-wireguard-core/Administration.md deleted file mode 100644 index cfcf8cb6e9..0000000000 --- a/roles/svc-net-wireguard-core/Administration.md +++ /dev/null @@ -1,37 +0,0 @@ -# Administration - -## Client - -### Setup wireguard - -```bash - pacman -S wireguard-tools -``` - -### Create Client Keys - -```bash - wg_private_key="$(wg genkey)" - wg_public_key="$(echo "$wg_private_key" | wg pubkey)" - echo "PrivateKey: $wg_private_key" - echo "PublicKey: $wg_public_key" - echo "PresharedKey: $(wg genpsk)" -``` - -### Activate Configuration - -```bash - cp /path/to/wg0.conf /etc/wireguard/wg0.conf - systemctl enable wg-quick@wg0.service --now -``` - -### Check status - -```bash - systemctl status wg-quick@wg0.service -``` - -## Further Resources - -- [ArchWiki: WireGuard](https://wiki.archlinux.org/index.php/WireGuard) -- [Subnetting Basics](https://www.scaleuptech.com/de/blog/was-ist-und-wie-funktioniert-subnetting/) diff --git a/roles/svc-net-wireguard-core/README.md b/roles/svc-net-wireguard-core/README.md deleted file mode 100644 index bd6ef1df75..0000000000 --- a/roles/svc-net-wireguard-core/README.md +++ /dev/null @@ -1,29 +0,0 @@ -# Wireguard - -## Description - -This role manages [Wireguard](https://www.wireguard.com/) on the host. It installs the necessary Wireguard packages, configures sysctl settings for IPv4/IPv6 forwarding, and deploys the Wireguard configuration file to enable the VPN service using [wg-quick](https://www.wireguard.com/quickstart/). - -## Overview - -Optimized for both [Arch Linux](https://wiki.archlinux.org/index.php/WireGuard) and [Ubuntu/Debian](https://wireguard.com/install/), this role performs the following tasks: - -- Installs Wireguard tools using the appropriate package manager. -- Copies a sysctl configuration file to enable IP forwarding and proper IPv6 settings. -- Deploys a host-specific Wireguard configuration file to `/etc/wireguard/wg0.infinito.conf`. -- Uses systemd handlers to restart the Wireguard service and reload sysctl settings. - -## Purpose - -The primary purpose of this role is to set up and manage a Wireguard VPN configuration on the host. By automating package installation and configuration file deployment, it ensures that the VPN service is enabled with optimal network settings for secure connectivity. - -## Features - -- **Multi-Platform Support:** Installs Wireguard tools using [pacman](https://wiki.archlinux.org/title/Pacman) on Arch Linux and [apt](https://en.wikipedia.org/wiki/APT_(software)) on Ubuntu/Debian. -- **Sysctl Configuration:** Deploys a sysctl configuration file to manage IPv4/IPv6 forwarding and related network parameters. -- **Wireguard Configuration:** Copies a host-specific Wireguard configuration file to `/etc/wireguard/wg0.infinito.conf`. -- **Service Management:** Provides handlers to restart the Wireguard service and reload sysctl settings. - -## Administration - -For detailed client setup instructions, please see the [Administration](./Administration.md) file. diff --git a/roles/svc-net-wireguard-core/files/wireguard-ip.conf b/roles/svc-net-wireguard-core/files/wireguard-ip.conf deleted file mode 100644 index 70cf127018..0000000000 --- a/roles/svc-net-wireguard-core/files/wireguard-ip.conf +++ /dev/null @@ -1,8 +0,0 @@ -# This file is created by -# https://s.infinito.nexus/code/tree/main/roles/wireguard - -net.ipv6.conf.all.disable_ipv6 = 0 -net.ipv6.conf.default.disable_ipv6 = 0 -net.ipv6.conf.lo.disable_ipv6 = 0 -net.ipv6.conf.all.forwarding = 1 -net.ipv4.ip_forward = 1 \ No newline at end of file diff --git a/roles/svc-net-wireguard-core/handlers/main.yml b/roles/svc-net-wireguard-core/handlers/main.yml deleted file mode 100644 index 06ca30b0f1..0000000000 --- a/roles/svc-net-wireguard-core/handlers/main.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- -- name: "πŸ”„ restart wireguard" - listen: restart-wireguard - systemd: - name: wg-quick@wg0.service - state: restarted - enabled: true - daemon_reload: true - -- name: "♻️ reload sysctl configuration" - listen: reload-sysctl-configuration - shell: "sysctl --load='/etc/sysctl.d/wireguard-ip.conf'" diff --git a/roles/svc-net-wireguard-core/meta/services.yml b/roles/svc-net-wireguard-core/meta/services.yml deleted file mode 100644 index 60c114c09b..0000000000 --- a/roles/svc-net-wireguard-core/meta/services.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -wireguard-core: - modes: - host: - enabled: true - compose: - enabled: false - swarm: - enabled: false - min_storage: 0GB - lifecycle: alpha - cpus: "0.1" - mem_reservation: "32m" - mem_limit: "64m" - pids_limit: 64 diff --git a/roles/svc-net-wireguard-core/tasks/00_core.yml b/roles/svc-net-wireguard-core/tasks/00_core.yml deleted file mode 100644 index b81e957077..0000000000 --- a/roles/svc-net-wireguard-core/tasks/00_core.yml +++ /dev/null @@ -1,22 +0,0 @@ ---- -- name: πŸ“¦ install wireguard - package_install: - id: wireguard - -- name: πŸ“ create wireguard-ip.conf - copy: - src: "wireguard-ip.conf" - dest: /etc/sysctl.d/wireguard-ip.conf - owner: root - group: root - notify: reload-sysctl-configuration - -- name: "πŸš€ deploy {{ WG0_CONF_DEST }}" - copy: - src: "{{ [inventory_dir, 'files', inventory_hostname, 'etc/wireguard/wg0.conf' ] | path_join }}" - dest: "{{ WG0_CONF_DEST }}" - owner: root - group: root - notify: restart-wireguard - -- include_tasks: utils/once/flag.yml diff --git a/roles/svc-net-wireguard-core/tasks/main.yml b/roles/svc-net-wireguard-core/tasks/main.yml deleted file mode 100644 index a70c6d46a6..0000000000 --- a/roles/svc-net-wireguard-core/tasks/main.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- include_tasks: 00_core.yml - when: - - run_once_svc_net_wireguard_core is not defined - - not (DOCKER_IN_CONTAINER | bool) diff --git a/roles/svc-net-wireguard-core/vars/main.yml b/roles/svc-net-wireguard-core/vars/main.yml deleted file mode 100644 index a8e11c5b9b..0000000000 --- a/roles/svc-net-wireguard-core/vars/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -application_id: svc-net-wireguard-core - -WG0_CONF_DEST: "/etc/wireguard/wg0.conf" diff --git a/roles/svc-net-wireguard-firewalled/README.md b/roles/svc-net-wireguard-firewalled/README.md deleted file mode 100644 index 0aceca5188..0000000000 --- a/roles/svc-net-wireguard-firewalled/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# WireGuard Client behind NAT - -## Description - -This role adapts iptables rules to enable proper connectivity for a WireGuard client running behind a NAT or firewall. It ensures that traffic is forwarded correctly by applying necessary masquerading rules. - -## Overview - -Optimized for environments with network address translation (NAT), this role: - -- Installs its iptables rules through Ansible's `iptables` module, so a redeploy converges instead of appending a duplicate. -- Allows traffic from the WireGuard client interface (e.g. `wg0-client`) and sets up NAT masquerading on the external interface (e.g. `eth0`). -- Works as an extension to the native WireGuard client role. - -## Purpose - -The primary purpose of this role is to enable proper routing and connectivity for a WireGuard client situated behind a firewall or NAT device. By adapting iptables rules, it ensures that the client can communicate effectively with external networks. - -## Features - -- **iptables Rule Adaptation:** Modifies iptables to allow forwarding and NAT masquerading for the WireGuard client. -- **NAT Support:** Configures the external interface for proper masquerading. -- **Role Integration:** Depends on the [svc-net-wireguard-plain](../svc-net-wireguard-plain/README.md) role to ensure that WireGuard is properly configured before applying firewall rules. - -## Further Resources - -- [Debian Wiki: iptables](https://wiki.debian.org/iptables) diff --git a/roles/svc-net-wireguard-firewalled/meta/info.yml b/roles/svc-net-wireguard-firewalled/meta/info.yml deleted file mode 100644 index 7de4d9f511..0000000000 --- a/roles/svc-net-wireguard-firewalled/meta/info.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# nocheck: info-media Self-written glue role that adapts iptables/NAT masquerading rules for a WireGuard client behind NAT; no consumer-facing upstream product website. diff --git a/roles/svc-net-wireguard-firewalled/meta/main.yml b/roles/svc-net-wireguard-firewalled/meta/main.yml deleted file mode 100644 index f1e0739ef5..0000000000 --- a/roles/svc-net-wireguard-firewalled/meta/main.yml +++ /dev/null @@ -1,34 +0,0 @@ ---- -galaxy_info: - author: Kevin Veen-Birkenbach - description: Networking helper for iptables forwarding and NAT masquerading of a WireGuard client running behind NAT or a firewall - license: Infinito.Nexus Community License (Non-Commercial) - company: | - Kevin Veen-Birkenbach - https://www.veen.world - min_ansible_version: "2.9" - platforms: - - name: ArchLinux - versions: - - all - - name: Debian - versions: - - all - - name: EL - versions: - - all - - name: Fedora - versions: - - all - - name: Ubuntu - versions: - - all - galaxy_tags: - - wireguard - - nat - - firewall - - iptables - - networking - issue_tracker_url: https://s.infinito.nexus/issues -dependencies: - - svc-net-wireguard-plain diff --git a/roles/svc-net-wireguard-firewalled/meta/services.yml b/roles/svc-net-wireguard-firewalled/meta/services.yml deleted file mode 100644 index d862ef121b..0000000000 --- a/roles/svc-net-wireguard-firewalled/meta/services.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -wireguard-firewalled: - modes: - host: - enabled: true - compose: - enabled: false - swarm: - enabled: false - lifecycle: alpha - min_storage: "50MB" - cpus: "0.1" - mem_reservation: "32m" - mem_limit: "64m" - pids_limit: 64 diff --git a/roles/svc-net-wireguard-firewalled/tasks/00_core.yml b/roles/svc-net-wireguard-firewalled/tasks/00_core.yml deleted file mode 100644 index 7360c4dc21..0000000000 --- a/roles/svc-net-wireguard-firewalled/tasks/00_core.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -- name: "🧱 Accept forwarded traffic from the wireguard client" - become: true - ansible.builtin.iptables: - chain: FORWARD - in_interface: "{{ WIREGUARD_CLIENT_INTERFACE }}" - jump: ACCEPT - state: present - -- name: "🧱 Masquerade the client behind the uplink address" - become: true - ansible.builtin.iptables: - table: nat - chain: POSTROUTING - out_interface: "{{ WIREGUARD_UPLINK_INTERFACE }}" - jump: MASQUERADE - state: present - -- include_tasks: utils/once/flag.yml diff --git a/roles/svc-net-wireguard-firewalled/tasks/main.yml b/roles/svc-net-wireguard-firewalled/tasks/main.yml deleted file mode 100644 index 90682e4865..0000000000 --- a/roles/svc-net-wireguard-firewalled/tasks/main.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- include_tasks: 00_core.yml - when: - - run_once_svc_net_wireguard_firewalled is not defined - - not (DOCKER_IN_CONTAINER | bool) diff --git a/roles/svc-net-wireguard-firewalled/vars/main.yml b/roles/svc-net-wireguard-firewalled/vars/main.yml deleted file mode 100644 index 2cd2850160..0000000000 --- a/roles/svc-net-wireguard-firewalled/vars/main.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -application_id: svc-net-wireguard-firewalled - -WIREGUARD_CLIENT_INTERFACE: wg0-client -WIREGUARD_UPLINK_INTERFACE: eth0 diff --git a/roles/svc-net-wireguard-plain/Administration.md b/roles/svc-net-wireguard-plain/Administration.md deleted file mode 100644 index 2a502469aa..0000000000 --- a/roles/svc-net-wireguard-plain/Administration.md +++ /dev/null @@ -1,11 +0,0 @@ -# Administration - -## Create Client Keys - -```bash - wg_private_key="$(wg genkey)" - wg_public_key="$(echo "$wg_private_key" | wg pubkey)" - echo "PrivateKey: $wg_private_key" - echo "PublicKey: $wg_public_key" - echo "PresharedKey: $(wg genpsk)" -``` diff --git a/roles/svc-net-wireguard-plain/README.md b/roles/svc-net-wireguard-plain/README.md deleted file mode 100644 index c7ff55e2b9..0000000000 --- a/roles/svc-net-wireguard-plain/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# Wireguard Client - -## Description - -This role manages WireGuard on a client system. It sets up essential services and scripts to configure and optimize WireGuard connectivity. - -## Overview - -Optimized for client configurations, this role: - -- Deploys a systemd service and its associated script to set the MTU on specified network interfaces. -- Uses a Jinja2 template to generate the `set-mtu.sh` script. -- Ensures that the MTU is configured correctly before starting WireGuard with [wg-quick](https://www.wireguard.com/quickstart/). - -## Purpose - -The primary purpose of this role is to configure WireGuard on a client by setting appropriate MTU values on network interfaces. This ensures a stable and optimized VPN connection. - -## Features - -- **MTU Configuration:** Deploys a template-based script to set the MTU on all defined internet interfaces. -- **Systemd Service Integration:** Creates and manages a systemd service to execute the MTU configuration script. -- **Administration Support:** For client key creation and further setup, please refer to the [Administration](./Administration.md) file. -- **Modular Design:** Easily integrates with other WireGuard roles or network configuration roles. - -## Further Resources - -- [WireGuard Documentation](https://www.wireguard.com/) -- [ArchWiki: WireGuard](https://wiki.archlinux.org/index.php/WireGuard) -- [Subnetting Basics](https://www.scaleuptech.com/de/blog/was-ist-und-wie-funktioniert-subnetting/) -- [WireGuard Permissions Issue Discussion](https://bodhilinux.boards.net/thread/450/wireguard-rtnetlink-answers-permission-denied) -- [UFW and SSH via WireGuard](https://unix.stackexchange.com/questions/717172/why-is-ufw-blocking-acces-to-ssh-via-wireguard) -- [OpenWrt Forum Discussion on WireGuard](https://forum.openwrt.org/t/cannot-ssh-to-clients-on-lan-when-accessing-router-via-wireguard-client/132709/3) -- [WireGuard Connection Dies on Ubuntu](https://serverfault.com/questions/1086297/wireguard-connection-dies-on-ubuntu-peer) -- [SSH Fails with WireGuard IP](https://unix.stackexchange.com/questions/624987/ssh-fails-to-start-when-listenaddress-is-set-to-wireguard-vpn-ip) -- [WireGuard NAT and Firewall Issues](https://serverfault.com/questions/210408/cannot-ssh-debug1-expecting-ssh2-msg-kex-dh-gex-reply) diff --git a/roles/svc-net-wireguard-plain/defaults/main.yml b/roles/svc-net-wireguard-plain/defaults/main.yml deleted file mode 100644 index ff4fccecc9..0000000000 --- a/roles/svc-net-wireguard-plain/defaults/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -internet_interfaces: [] diff --git a/roles/svc-net-wireguard-plain/meta/info.yml b/roles/svc-net-wireguard-plain/meta/info.yml deleted file mode 100644 index 4afe3f4e0b..0000000000 --- a/roles/svc-net-wireguard-plain/meta/info.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -# nocheck: info-media no official demo video -homepage: https://www.wireguard.com/ diff --git a/roles/svc-net-wireguard-plain/meta/main.yml b/roles/svc-net-wireguard-plain/meta/main.yml deleted file mode 100644 index fef50f863d..0000000000 --- a/roles/svc-net-wireguard-plain/meta/main.yml +++ /dev/null @@ -1,35 +0,0 @@ ---- -galaxy_info: - author: Kevin Veen-Birkenbach - description: Client-side WireGuard VPN role for stable connectivity with a systemd service and script that tune interface MTU - license: Infinito.Nexus Community License (Non-Commercial) - company: | - Kevin Veen-Birkenbach - https://www.veen.world - min_ansible_version: "2.9" - platforms: - - name: ArchLinux - versions: - - all - - name: Debian - versions: - - all - - name: EL - versions: - - all - - name: Fedora - versions: - - all - - name: Ubuntu - versions: - - all - galaxy_tags: - - wireguard - - vpn - - client - - mtu - - systemd - - configuration - issue_tracker_url: https://s.infinito.nexus/issues -dependencies: - - svc-net-wireguard-core diff --git a/roles/svc-net-wireguard-plain/meta/services.yml b/roles/svc-net-wireguard-plain/meta/services.yml deleted file mode 100644 index 62db8ab578..0000000000 --- a/roles/svc-net-wireguard-plain/meta/services.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -wireguard-plain: - modes: - host: - enabled: true - compose: - enabled: false - swarm: - enabled: false - lifecycle: alpha - min_storage: "50MB" - cpus: "0.1" - mem_reservation: "32m" - mem_limit: "64m" - pids_limit: 64 diff --git a/roles/svc-net-wireguard-plain/tasks/00_core.yml b/roles/svc-net-wireguard-plain/tasks/00_core.yml deleted file mode 100644 index d5b8940ad1..0000000000 --- a/roles/svc-net-wireguard-plain/tasks/00_core.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- include_role: - name: sys-service - -- include_tasks: utils/once/flag.yml diff --git a/roles/svc-net-wireguard-plain/tasks/main.yml b/roles/svc-net-wireguard-plain/tasks/main.yml deleted file mode 100644 index fbc9bc3a77..0000000000 --- a/roles/svc-net-wireguard-plain/tasks/main.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- include_tasks: 00_core.yml - when: - - run_once_svc_net_wireguard_plain is not defined - - not (DOCKER_IN_CONTAINER | bool) diff --git a/roles/svc-net-wireguard-plain/templates/script.sh.j2 b/roles/svc-net-wireguard-plain/templates/script.sh.j2 deleted file mode 100644 index 5412c5143e..0000000000 --- a/roles/svc-net-wireguard-plain/templates/script.sh.j2 +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -{# nocheck: shell-template grandfathered: one line per internet interface, replaceable by argv #} -{% for internet_interface in internet_interfaces %} -ip li set mtu 1400 dev {{internet_interface}} -{% endfor %} diff --git a/roles/svc-net-wireguard-plain/templates/systemctl.service.j2 b/roles/svc-net-wireguard-plain/templates/systemctl.service.j2 deleted file mode 100644 index 0c5966900b..0000000000 --- a/roles/svc-net-wireguard-plain/templates/systemctl.service.j2 +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=set MTU -Before=wg-quick@wg0.service - -[Service] -Type=oneshot -ExecStart={{ system_service_script_exec }} - -[Install] -RequiredBy=wg-quick@wg0.service \ No newline at end of file diff --git a/roles/svc-net-wireguard-plain/vars/main.yml b/roles/svc-net-wireguard-plain/vars/main.yml deleted file mode 100644 index 5961faf032..0000000000 --- a/roles/svc-net-wireguard-plain/vars/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -application_id: svc-net-wireguard-plain -system_service_id: "{{ application_id }}" diff --git a/roles/svc-net-wireguard/README.md b/roles/svc-net-wireguard/README.md new file mode 100644 index 0000000000..1e765b3d78 --- /dev/null +++ b/roles/svc-net-wireguard/README.md @@ -0,0 +1,155 @@ +# WireGuard + +## Description + +[WireGuard](https://www.wireguard.com/) is an in-kernel VPN protocol. Peers +authenticate each other with Curve25519 keypairs and exchange encrypted UDP +datagrams, so a tunnel needs no session state, no certificate authority and no +daemon of its own. + +## Overview + +This role puts WireGuard under a swarm deployment so that swarm control, +overlay and storage traffic never crosses an untunnelled network. It configures +the hub-and-spoke meshes the deployment declares, any number of them, with the +swarm manager as the hub of each. The manager forwards between them, which is +how a worker reaches an NFS export it is not a member of. + +Without a swarm manager, as in a Compose deployment spread over several hosts, +every declared mesh is a full mesh instead. Each member knows the key of every +other member and dials it directly, and nothing forwards between meshes: a host +reaches exactly the members of the meshes it joined. + +The meshes are inventory values, and every role ships them empty. +`networks.meshes` of this role declares them in the hub's `host_vars`, or in +the `host_vars` of every member when there is no hub, and `networks.meshes` of +every other role lists the meshes its hosts join. The +development lab declares two, `swarm` and `data`, in +[wireguard.yml](../../inventories/development/wireguard.yml); +[wireguard-three-meshes](../../inventories/examples/wireguard-three-meshes/README.md) +declares three. Consumers read a host's mesh address through +`lookup('mesh_address', )` instead of naming a mesh. + +The role plans nothing. Every key, address and peer list is written into the +inventory beforehand by `cli.administration.inventory.mesh`, the one pass that +sees every host at once; this role renders what its own host was handed and +then proves the result. It acts on every host in the `svc-net-wireguard` +group; outside swarm mode a host the mesh CLI gave no mesh is skipped. + +## Cosmos + +The diagram places WireGuard in the Infinito.Nexus cosmos: the components it deploys (capabilities), the central services it consumes (dependencies), and its outward reach (federation and bridged external networks). + +```mermaid +flowchart LR + subgraph role [svc-net-wireguard πŸ’»] + svc_wireguard["wireguard"] + end +``` + +Solid `1:1` edges are fixed relationships; dashed `0..1` edges are conditional (enabled only in matching deployments); red `0..0` edges are turned off in this role. Node markers show the role's deploy modes (πŸ’» host, 🐳 compose, 🐝 swarm); ❌ marks a service that is explicitly turned off, and βš™οΈ an Ansible role dependency declared in `meta/main.yml`. + +## Features + +- Any number of hub-and-spoke meshes around one hub, so the planes stay + separate while remaining mutually reachable. +- Full meshes when the inventory has no hub, each member peered with every + other and no route between meshes. +- A host may be a spoke of several meshes: it routes the pool through its + first declared one and only the mesh subnet through the others, so no two + interfaces claim one route. +- Per-host interfaces rendered from inventory state, with each private key + vault-encrypted in exactly one host's `host_vars`. +- Forwarding enabled only on the hub, which is the only member with peers in + every plane. +- A hard gate that fails the deploy before swarm initialises when any peer is + unreachable or the path will not carry a full-size payload. + +## Quick Setup + +### Development + +Clone, set up the workstation, and deploy WireGuard onto the local stack: + +```bash +git clone https://github.com/infinito-nexus/core.git +cd core +make onboard +make compose-deploy mode=reinstall apps=svc-net-wireguard full_cycle=false +``` + +### Production + +Install WireGuard directly onto the target machine: clone the repository, install the OS prerequisites and the repository toolchain, then deploy against localhost over a local connection (no SSH, no container): + +```bash +git clone https://github.com/infinito-nexus/core.git +cd core +bash scripts/install/package.sh +make install +source scripts/meta/env/load.sh + +APP=svc-net-wireguard +DOMAIN= +TLS_MODE=self_signed +SSH_PUBLIC_KEY="" +INVENTORY=inventories/production +infinito administration inventory provision "$INVENTORY" \ + --inventory-file "$INVENTORY/devices.yml" \ + --host localhost \ + --include "$APP" \ + --vars "{\"TLS_MODE\": \"$TLS_MODE\", \"DOMAIN_PRIMARY\": \"$DOMAIN\", \"users\": {\"administrator\": {\"authorized_keys\": [\"$SSH_PUBLIC_KEY\"]}}}" +infinito administration deploy dedicated "$INVENTORY/devices.yml" \ + --password-file "$INVENTORY/.password" \ + --diff -vv +``` + +## Administration + +The mesh must exist in the inventory before the play runs. Write it once over +every inventory of the deploy, including any sibling file that holds hosts the +cluster inventory does not: + +```bash +python3 -m cli.administration.inventory.mesh \ + --inventory /tmp/inv/devices.yml \ + --inventory /tmp/inv/backup.yml \ + --host-vars-dir /tmp/inv/host_vars \ + --vault-password-file /tmp/inv/.password +``` + +It reads the declarations and memberships from the `host_vars` it writes to, +and records each host's addresses, keys and peers in that host's +`svc-net-wireguard.networks.interfaces`. + +Re-running is a no-op. To replace every keypair, add `--rotate`; that rewrites +the whole mesh in one pass, because rotating one member alone partitions it. + +### Compose hosts + +For Compose hosts the inventory holds no `svc-swarm-manager`, so the writer +plans full meshes. Put the same `svc-net-wireguard.networks.meshes` +declaration into the `host_vars` of every member, list the meshes a host joins +under `networks.meshes` of a role it carries, add the hosts to the +`svc-net-wireguard` group, write the mesh as above and deploy. Each member +listens on the mesh port, so that UDP port must be open between the members. +The role brings the interfaces up and gates on a handshake with every peer; +an application uses the tunnel only where it is pointed at a peer's mesh +address, which `lookup('mesh_address', )` returns. + +Inspect a live interface on any member: + +```bash +wg show +``` + +A peer with no recent handshake is either unreachable on the underlay or +carrying a key its peer does not know. The second case means the inventory and +the running interface disagree: re-run the mesh writer and redeploy rather than +editing `/etc/wireguard` by hand, which the next deploy overwrites. + +## Credits + +Implemented by **[Evangelos Tsakoudis](https://github.com/evangelostsak)**. +Part of the [Infinito.Nexus Project](https://s.infinito.nexus/code) and maintained by [Kevin Veen-Birkenbach](https://www.veen.world). +Licensed under the [Infinito.Nexus Community License (Non-Commercial)](https://s.infinito.nexus/license). diff --git a/roles/svc-net-wireguard/files/test/.nocheck b/roles/svc-net-wireguard/files/test/.nocheck new file mode 100644 index 0000000000..2b9d82d840 --- /dev/null +++ b/roles/svc-net-wireguard/files/test/.nocheck @@ -0,0 +1 @@ +# nocheck: role-files-layout - Role test harness with test.sh as its entry point; test-e2e-cli stages files/test/ by that fixed path. diff --git a/roles/svc-net-wireguard/files/test/compose.yml b/roles/svc-net-wireguard/files/test/compose.yml new file mode 100644 index 0000000000..dd25fa0e21 --- /dev/null +++ b/roles/svc-net-wireguard/files/test/compose.yml @@ -0,0 +1,30 @@ +--- +x-host: &host + command: ["sleep", "infinity"] + cap_add: + - NET_ADMIN + networks: + - underlay + +services: + host-i: + <<: *host + image: debian:13.7-slim + container_name: "${HOST_I:?set by test.sh}" + hostname: "${HOST_I:?set by test.sh}" + + host-ii: + <<: *host + image: debian:13.7-slim + container_name: "${HOST_II:?set by test.sh}" + hostname: "${HOST_II:?set by test.sh}" + + host-iii: + <<: *host + image: debian:13.7-slim + container_name: "${HOST_III:?set by test.sh}" + hostname: "${HOST_III:?set by test.sh}" + +networks: + underlay: + name: "${NETWORK:?set by test.sh}" diff --git a/roles/svc-net-wireguard/files/test/test.sh b/roles/svc-net-wireguard/files/test/test.sh new file mode 100644 index 0000000000..800c21a217 --- /dev/null +++ b/roles/svc-net-wireguard/files/test/test.sh @@ -0,0 +1,250 @@ +#!/usr/bin/env bash +# shellcheck shell=bash +# +# svc-net-wireguard role test: three throwaway hosts in two full meshes. +# +# Env (all required; the role's test.env carries them): +# BULK_BYTES size of the transfer each reachable pair must carry intact +# MESH_ROLE role whose networks.meshes puts each host into its meshes +# PING_COUNT echo requests per reachability probe +# PYTHON interpreter that runs Ansible and the mesh CLI +# REPO_ROOT repository the deploy runs from +# SSH_TIMEOUT seconds an SSH connection may take before it counts as failed + +set -euo pipefail + +BULK_BYTES="${BULK_BYTES:?pass BULK_BYTES as env (bytes each reachable pair must carry)}" +MESH_ROLE="${MESH_ROLE:?pass MESH_ROLE as env (role whose networks.meshes joins the hosts)}" +PING_COUNT="${PING_COUNT:?pass PING_COUNT as env (echo requests per probe)}" +PYTHON="${PYTHON:?pass PYTHON as env (interpreter that runs Ansible)}" +REPO_ROOT="${REPO_ROOT:?pass REPO_ROOT as env (repository the deploy runs from)}" +SSH_TIMEOUT="${SSH_TIMEOUT:?pass SSH_TIMEOUT as env (seconds an SSH connection may take)}" + +COMPOSE_FILE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/compose.yml" +PREFIX="wg-mesh-$$" +NETWORK="${PREFIX}" +HOST_I="${PREFIX}-1" +HOST_II="${PREFIX}-2" +HOST_III="${PREFIX}-3" +HOSTS=("${HOST_I}" "${HOST_II}" "${HOST_III}") +WORK="$(mktemp -d)" +SSH_ARGS=() +failures=0 + +hosts_compose() { + HOST_I="${HOST_I}" HOST_II="${HOST_II}" HOST_III="${HOST_III}" NETWORK="${NETWORK}" \ + container compose --file "${COMPOSE_FILE}" --project-name "${PREFIX}" "$@" +} + +cleanup() { + hosts_compose down --remove-orphans >/dev/null 2>&1 + rm -rf "${WORK}" +} +trap cleanup EXIT + +on() { + local host="$1" + shift + container exec "${host}" "$@" +} + +provision_host() { + local host="$1" + on "${host}" sh -c 'rm -rf /var/lib/apt/lists/* \ + && apt-get -o Acquire::Retries=3 update -qq \ + && apt-get -o Acquire::Retries=3 install -y -qq --no-install-recommends \ + python3 openssh-server \ + && mkdir -p /run/sshd /root/.ssh \ + && chmod 700 /root/.ssh \ + && ssh-keygen -q -t ed25519 -N "" -f /root/.ssh/id_ed25519 \ + && /usr/sbin/sshd' >/dev/null +} + +authorize_every_host() { + local host keys="" + for host in "${HOSTS[@]}"; do + keys+="$(on "${host}" cat /root/.ssh/id_ed25519.pub)"$'\n' + done + for host in "${HOSTS[@]}"; do + printf '%s' "${keys}" | container exec -i "${host}" \ + sh -c 'cat >/root/.ssh/authorized_keys && chmod 600 /root/.ssh/authorized_keys' + done +} + +host_vars() { + local host="$1" meshes="$2" + cat >"${WORK}/host_vars/${host}.yml" <&2 + failures=$((failures + 1)) + fi +} + +not() { + ! "$@" +} + +pings() { + on "$1" ping -c "${PING_COUNT}" -W 2 "$2" >/dev/null 2>&1 +} + +ssh_to() { + local from="$1" target="$2" + shift 2 + on "${from}" ssh -n "${SSH_ARGS[@]}" "root@${target}" "$@" +} + +lands_on() { + [[ "$(ssh_to "$1" "$2" cat /etc/hostname 2>/dev/null)" == "$3" ]] +} + +carries_bulk() { + local from="$1" to="$2" target="$3" sent received + sent="$(on "${to}" sh -c "head -c ${BULK_BYTES} /dev/urandom >/tmp/mesh-bulk && sha256sum &1)"; then + return 1 + fi + [[ "${output}" != *"Permission denied"* ]] +} + +refused_by_wireguard() { + local from="$1" target="$2" via="$3" output + on "${from}" ip route add "${target}/32" dev "${via}" + output="$(on "${from}" ping -c 1 -W 2 "${target}" 2>&1)" + on "${from}" ip route del "${target}/32" dev "${via}" + [[ "${output}" == *"Required key not available"* ]] +} + +expect_reach() { + local from="$1" to="$2" mesh="$3" target + target="$(address "${to}" "${mesh}")" + if [[ -z "${target}" ]]; then + check "${to} holds an address on ${mesh}" false + return + fi + check "${from} pings ${to} at ${target} over ${mesh}" pings "${from}" "${target}" + check "${from} opens SSH to ${target} over ${mesh} and lands on ${to}" lands_on "${from}" "${target}" "${to}" + check "${from} pulls ${BULK_BYTES} bytes from ${to} over ${mesh} intact" carries_bulk "${from}" "${to}" "${target}" +} + +expect_isolated() { + local from="$1" to="$2" mesh="$3" via="$4" target + target="$(address "${to}" "${mesh}")" + if [[ -z "${target}" ]]; then + check "${to} holds an address on ${mesh}" false + return + fi + check "${from} does not ping ${to} at ${target} over ${mesh}" not pings "${from}" "${target}" + check "${from} cannot open SSH to ${to} at ${target} over ${mesh}" ssh_never_connects "${from}" "${target}" + check "WireGuard on ${from} refuses ${target} routed into ${via}" refused_by_wireguard "${from}" "${target}" "${via}" + check "${from} still reaches ${to} on the underlay" pings "${from}" "${to}" +} + +cd "${REPO_ROOT}" +mkdir -p "${WORK}/host_vars" +"${PYTHON}" -c 'import secrets; print(secrets.token_hex(32))' >"${WORK}/.password" +load_mesh_ssh_args + +echo "[INFO] starting three throwaway hosts from $(hosts_compose config --images | sort -u)" +hosts_compose up --detach --quiet-pull >/dev/null +for host in "${HOSTS[@]}"; do + provision_host "${host}" +done +authorize_every_host + +cat >"${WORK}/devices.yml" < 0)); then + echo "[FATAL] ${failures} mesh assertion(s) failed" >&2 + exit 1 +fi +echo "[OK] I and II reach each other, II and III reach each other, I and III do not" diff --git a/roles/svc-net-wireguard/filter_plugins/mesh_peers.py b/roles/svc-net-wireguard/filter_plugins/mesh_peers.py new file mode 100644 index 0000000000..7a6061b6ff --- /dev/null +++ b/roles/svc-net-wireguard/filter_plugins/mesh_peers.py @@ -0,0 +1,11 @@ +from __future__ import annotations + +from utils.networks.mesh import dialled_peers, listens + + +class FilterModule: + def filters(self): + return { + "mesh_dialled_peers": dialled_peers, + "mesh_listens": listens, + } diff --git a/roles/svc-net-wireguard-core/meta/info.yml b/roles/svc-net-wireguard/meta/info.yml similarity index 100% rename from roles/svc-net-wireguard-core/meta/info.yml rename to roles/svc-net-wireguard/meta/info.yml diff --git a/roles/svc-net-wireguard-core/meta/main.yml b/roles/svc-net-wireguard/meta/main.yml similarity index 69% rename from roles/svc-net-wireguard-core/meta/main.yml rename to roles/svc-net-wireguard/meta/main.yml index 5c828d48c7..16e8fdb46b 100644 --- a/roles/svc-net-wireguard-core/meta/main.yml +++ b/roles/svc-net-wireguard/meta/main.yml @@ -1,11 +1,17 @@ --- galaxy_info: - author: Kevin Veen-Birkenbach - description: Host-level WireGuard VPN service with wg-quick config, package install, and IP-forwarding sysctl for secure tunnels + author: Evangelos Tsakoudis + description: Kernel WireGuard tunnels, hub-and-spoke meshes under a swarm manager and full meshes between Compose hosts license: Infinito.Nexus Community License (Non-Commercial) company: | Kevin Veen-Birkenbach https://www.veen.world + galaxy_tags: + - wireguard + - vpn + - network + - swarm + issue_tracker_url: https://s.infinito.nexus/issues min_ansible_version: "2.9" platforms: - name: ArchLinux @@ -23,11 +29,3 @@ galaxy_info: - name: Ubuntu versions: - all - galaxy_tags: - - wireguard - - vpn - - networking - - systemd - - configuration - issue_tracker_url: https://s.infinito.nexus/issues -dependencies: [] diff --git a/roles/svc-net-wireguard/meta/networks.yml b/roles/svc-net-wireguard/meta/networks.yml new file mode 100644 index 0000000000..793fa8ca03 --- /dev/null +++ b/roles/svc-net-wireguard/meta/networks.yml @@ -0,0 +1,3 @@ +--- +meshes: [] +interfaces: [] diff --git a/roles/svc-net-wireguard-core/meta/packages.yml b/roles/svc-net-wireguard/meta/packages.yml similarity index 57% rename from roles/svc-net-wireguard-core/meta/packages.yml rename to roles/svc-net-wireguard/meta/packages.yml index 09ebd0916e..ca3794afe1 100644 --- a/roles/svc-net-wireguard-core/meta/packages.yml +++ b/roles/svc-net-wireguard/meta/packages.yml @@ -1,8 +1,11 @@ --- wireguard: Archlinux: + - procps-ng - wireguard-tools Debian: - - wireguard + - procps + - wireguard-tools RedHat: + - procps-ng - wireguard-tools diff --git a/roles/svc-net-wireguard/meta/secrets.yml b/roles/svc-net-wireguard/meta/secrets.yml new file mode 100644 index 0000000000..cbb1b602a0 --- /dev/null +++ b/roles/svc-net-wireguard/meta/secrets.yml @@ -0,0 +1,7 @@ +--- +credentials: + mesh_private_key: + description: Curve25519 private key identifying this host on every mesh it belongs to, minted by cli.administration.inventory.mesh. + algorithm: plain + validation: non_empty_string + rotatable: false diff --git a/roles/svc-net-wireguard/meta/services.yml b/roles/svc-net-wireguard/meta/services.yml new file mode 100644 index 0000000000..a197fcbf74 --- /dev/null +++ b/roles/svc-net-wireguard/meta/services.yml @@ -0,0 +1,19 @@ +--- +wireguard: + modes: + host: + enabled: true + compose: + enabled: false + swarm: + enabled: false + name: wireguard + lifecycle: beta + enabled: true + shared: true + bond: 1 + min_storage: "1MB" + cpus: "0.01" + mem_reservation: "8m" + mem_limit: "16m" + pids_limit: 8 diff --git a/roles/svc-net-wireguard/meta/tests.yml b/roles/svc-net-wireguard/meta/tests.yml new file mode 100644 index 0000000000..ddb7e75f0e --- /dev/null +++ b/roles/svc-net-wireguard/meta/tests.yml @@ -0,0 +1,6 @@ +--- +cli: + timeout: 1800 + controller_only: true + requires: + - sys-svc-container diff --git a/roles/svc-net-wireguard/tasks/00_core.yml b/roles/svc-net-wireguard/tasks/00_core.yml new file mode 100644 index 0000000000..b0f89c0f8b --- /dev/null +++ b/roles/svc-net-wireguard/tasks/00_core.yml @@ -0,0 +1,105 @@ +--- +- include_tasks: utils/once/flag.yml + +- name: "πŸ“‚ Include dependency 'user-administrator' for the mesh transport" + include_role: + name: user-administrator + when: + - "'svc-swarm-node' in group_names" + - run_once_user_administrator is not defined + +- name: "πŸ›‘ Fail when the inventory carries no mesh for this host" + ansible.builtin.fail: + msg: >- + {{ inventory_hostname }} is to carry WireGuard but its inventory declares + no WireGuard mesh. Run cli.administration.inventory.mesh over every + inventory of this deploy before the play; the mesh is written by that one + cross-host pass, never by this role. + when: WIREGUARD_MESH_NAMES | length == 0 + +- name: "πŸ“¦ Install the WireGuard tooling" + package_install: + id: + - wireguard + - iproute + - iputils-ping + +- name: "πŸ“¦ Install automtu via pip (system-wide)" + include_role: + name: sys-pip-install + vars: + package_name: "automtu==1.1.1" + global_install: true + +- name: "πŸ” Detect the path MTU the tunnel has to fit inside" + ansible.builtin.command: + argv: + - "{{ ansible_python_interpreter }}" + - -m + - automtu + - --pmtu-target + - "{{ WIREGUARD_PMTU_TARGETS | join(',') }}" + - --pmtu-policy + - min + - --print-mtu + - effective + register: wireguard_pmtu + changed_when: false + +- name: "βœ… Assert automtu returned an integer MTU" + ansible.builtin.assert: + that: + - wireguard_pmtu.stdout is match('^[0-9]+$') + - (wireguard_pmtu.stdout | int) >= 576 + - (wireguard_pmtu.stdout | int) <= 9000 + fail_msg: "automtu returned unexpected MTU output: '{{ wireguard_pmtu.stdout | default('') }}'" + +- name: "πŸ”§ Derive the tunnel and overlay MTUs from the measured path" + ansible.builtin.set_fact: + wireguard_mtu: "{{ wireguard_pmtu.stdout | int - WIREGUARD_HEADER_BYTES | int }}" + wireguard_overlay_mtu: >- + {{ wireguard_pmtu.stdout | int + - WIREGUARD_HEADER_BYTES | int + - WIREGUARD_VXLAN_HEADER_BYTES | int }} + changed_when: false + +- name: "πŸ“ Create {{ WIREGUARD_CONFIG_DIR }}" + ansible.builtin.file: + path: "{{ WIREGUARD_CONFIG_DIR }}" + state: directory + owner: root + group: root + mode: "0700" + +- name: "πŸ“„ Render the interface of every mesh this host belongs to" + ansible.builtin.template: # nocheck: stack-host-template (per-host /etc/wireguard) + src: wg.conf.j2 + dest: "{{ [WIREGUARD_CONFIG_DIR, mesh_name ~ '.conf'] | path_join }}" + owner: root + group: root + mode: "0600" + loop: "{{ WIREGUARD_MESH_NAMES }}" + loop_control: + loop_var: mesh_name + vars: + mesh: "{{ WIREGUARD_ACTIVE_MESHES[mesh_name] }}" + no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}" + register: wireguard_rendered + +- name: "πŸ”€ Enable forwarding on the hub" + ansible.posix.sysctl: + name: net.ipv4.ip_forward + value: "1" + sysctl_set: true + state: present + reload: true + when: WIREGUARD_IS_HUB | bool + +- name: "🚿 Bring every rendered interface up" + ansible.builtin.include_tasks: utils/interface_up.yml + loop: "{{ WIREGUARD_MESH_NAMES }}" + loop_control: + loop_var: mesh_name + +- name: "βœ… Gate: prove the layer works before anything depends on it" + ansible.builtin.include_tasks: 01_gate.yml diff --git a/roles/svc-net-wireguard/tasks/01_gate.yml b/roles/svc-net-wireguard/tasks/01_gate.yml new file mode 100644 index 0000000000..10b85ecac7 --- /dev/null +++ b/roles/svc-net-wireguard/tasks/01_gate.yml @@ -0,0 +1,76 @@ +--- +- name: "πŸ” Read the peer state of every interface" + ansible.builtin.command: "wg show {{ mesh_name | quote }} peers" + loop: "{{ WIREGUARD_MESH_NAMES }}" + loop_control: + loop_var: mesh_name + register: wireguard_peer_state + changed_when: false + +- name: "πŸ›‘ Fail when an interface carries no peer" + ansible.builtin.fail: + msg: >- + WireGuard interface '{{ item.mesh_name }}' on {{ inventory_hostname }} + came up with no peer. The mesh in this host's inventory is incomplete. + loop: "{{ wireguard_peer_state.results }}" + loop_control: + label: "{{ item.mesh_name }}" + when: (item.stdout | trim) | length == 0 + +- name: "⏳ Wait until every dialling interface has handshaked with its peers" + ansible.builtin.command: "wg show {{ mesh_name | quote }} latest-handshakes" + loop: "{{ WIREGUARD_SPOKE_MESH_NAMES }}" + loop_control: + loop_var: mesh_name + register: wireguard_handshakes + changed_when: false + failed_when: false + retries: 24 + delay: 5 + until: + - wireguard_handshakes.rc | default(1) == 0 + - wireguard_handshakes.stdout | default('', true) | trim | length > 0 + - wireguard_handshakes.stdout is not search('\t0') + +- name: "πŸ›‘ Fail hard when a dialling interface never reached a peer" + ansible.builtin.fail: + msg: >- + WireGuard interface '{{ item.mesh_name }}' on {{ inventory_hostname }} + never completed a handshake with every peer it dials. No deploy can + proceed over a partitioned mesh. + loop: "{{ wireguard_handshakes.results | default([]) }}" + loop_control: + label: "{{ item.mesh_name }}" + when: >- + item.rc | default(1) != 0 + or (item.stdout | default('', true) | trim | length) == 0 + or (item.stdout | default('', true)) is search('\t0') + +- name: "πŸ” Check whether ping is available for the MTU probe" + ansible.builtin.stat: + path: "{{ WIREGUARD_PING_BINARY }}" + register: wireguard_ping + +- name: "πŸ“ Prove the path carries a full-size payload without fragmenting" + ansible.builtin.command: >- + {{ WIREGUARD_PING_BINARY }} -c 2 -W 2 -M do + -s {{ wireguard_overlay_mtu | int - 28 }} {{ item | quote }} + loop: "{{ WIREGUARD_EXPECTED_PEERS }}" + register: wireguard_mtu_probe + changed_when: false + failed_when: false + when: wireguard_ping.stat.exists + +- name: "πŸ›‘ Fail when the overlay MTU does not survive the tunnel" + ansible.builtin.fail: + msg: >- + A {{ wireguard_overlay_mtu | int }}-byte payload does not reach + {{ oversized | map(attribute='item') | join(', ') }} from + {{ inventory_hostname }}. Stacked VXLAN inside WireGuard needs the + overlay MTU at or below the tunnel's, or large payloads drop silently. + vars: + oversized: >- + {{ wireguard_mtu_probe.results | default([]) + | rejectattr('skipped', 'defined') + | rejectattr('rc', 'equalto', 0) | list }} + when: oversized | length > 0 diff --git a/roles/svc-net-wireguard/tasks/main.yml b/roles/svc-net-wireguard/tasks/main.yml new file mode 100644 index 0000000000..ebcb766e33 --- /dev/null +++ b/roles/svc-net-wireguard/tasks/main.yml @@ -0,0 +1,15 @@ +--- +- name: "⏭️ Skip WireGuard on a compose host the mesh CLI wrote no mesh for" + ansible.builtin.debug: + msg: >- + {{ inventory_hostname }} carries svc-net-wireguard but holds no mesh; run + cli.administration.inventory.mesh over this deploy's inventories to give + it one. + when: WIREGUARD_MESHLESS_COMPOSE_HOST | bool + +- include_tasks: 00_core.yml + when: + - run_once_svc_net_wireguard is not defined + - not (WIREGUARD_MESHLESS_COMPOSE_HOST | bool) + vars: + application_id: svc-net-wireguard diff --git a/roles/svc-net-wireguard/tasks/utils/interface_up.yml b/roles/svc-net-wireguard/tasks/utils/interface_up.yml new file mode 100644 index 0000000000..4e1142bf32 --- /dev/null +++ b/roles/svc-net-wireguard/tasks/utils/interface_up.yml @@ -0,0 +1,22 @@ +--- +- name: "πŸ” Check whether '{{ mesh_name }}' is already up" + ansible.builtin.command: "wg show {{ mesh_name | quote }}" + register: wireguard_present + changed_when: false + failed_when: false + +- name: "πŸ”Ί Bring '{{ mesh_name }}' up" + ansible.builtin.command: "wg-quick up {{ mesh_name | quote }}" + register: wireguard_up + changed_when: wireguard_up.rc == 0 + when: wireguard_present.rc != 0 + +- name: "♻️ Reconfigure the live '{{ mesh_name }}' in place" + ansible.builtin.shell: > + set -o pipefail && wg syncconf {{ mesh_name | quote }} + <(wg-quick strip {{ mesh_name | quote }}) + args: + executable: /bin/bash + register: wireguard_synced + changed_when: wireguard_synced.rc == 0 + when: wireguard_present.rc == 0 diff --git a/roles/svc-net-wireguard/templates/test.env.j2 b/roles/svc-net-wireguard/templates/test.env.j2 new file mode 100644 index 0000000000..9e2750ab73 --- /dev/null +++ b/roles/svc-net-wireguard/templates/test.env.j2 @@ -0,0 +1,6 @@ +BULK_BYTES=8388608 +MESH_ROLE=svc-bkp-remote-2-local +PING_COUNT=3 +PYTHON={{ ansible_playbook_python }} +REPO_ROOT={{ playbook_dir }} +SSH_TIMEOUT=5 diff --git a/roles/svc-net-wireguard/templates/wg.conf.j2 b/roles/svc-net-wireguard/templates/wg.conf.j2 new file mode 100644 index 0000000000..0e0151b191 --- /dev/null +++ b/roles/svc-net-wireguard/templates/wg.conf.j2 @@ -0,0 +1,19 @@ +[Interface] +Address = {{ mesh.address }}/{{ mesh.subnet.split('/')[1] }} +PrivateKey = {{ WIREGUARD_PRIVATE_KEY }} +MTU = {{ wireguard_mtu | int }} +{% if mesh | mesh_listens %} +ListenPort = {{ mesh.listen_port | int }} +{% endif %} + +{% set dialled = mesh | mesh_dialled_peers | map(attribute='host') | list %} +{% for peer in mesh.peers %} +[Peer] +PublicKey = {{ peer.public_key }} +AllowedIPs = {{ peer.allowed_ips }} +{% if peer.host in dialled %} +Endpoint = {{ peer.endpoint | default(peer.host, true) }}:{{ mesh.listen_port | int }} +PersistentKeepalive = 25 +{% endif %} + +{% endfor %} diff --git a/roles/svc-net-wireguard/vars/main.yml b/roles/svc-net-wireguard/vars/main.yml new file mode 100644 index 0000000000..3c3de9d57f --- /dev/null +++ b/roles/svc-net-wireguard/vars/main.yml @@ -0,0 +1,41 @@ +--- +application_id: "svc-net-wireguard" + +WIREGUARD_CONFIG_DIR: "/etc/wireguard" + +WIREGUARD_INTERFACES: "{{ lookup('config', application_id, 'networks.interfaces', []) }}" + +WIREGUARD_ACTIVE_MESHES: >- + {{ dict(WIREGUARD_INTERFACES | selectattr('address') | map(attribute='name') + | zip(WIREGUARD_INTERFACES | selectattr('address'))) }} + +WIREGUARD_MESH_NAMES: "{{ WIREGUARD_ACTIVE_MESHES.keys() | list | sort }}" + +WIREGUARD_MESHLESS_COMPOSE_HOST: "{{ DEPLOYMENT_MODE == 'compose' and WIREGUARD_MESH_NAMES | length == 0 }}" + +WIREGUARD_SPOKE_MESH_NAMES: >- + {{ WIREGUARD_ACTIVE_MESHES | dict2items + | rejectattr('value.is_hub') + | map(attribute='key') | list | sort }} + +WIREGUARD_PING_BINARY: "/bin/ping" + +WIREGUARD_PRIVATE_KEY: "{{ lookup('config', application_id, 'secrets.credentials.mesh_private_key', '') }}" + +WIREGUARD_IS_HUB: >- + {{ WIREGUARD_ACTIVE_MESHES.values() | map(attribute='is_hub') | select | list | length > 0 }} + +WIREGUARD_DIALLED_PEERS: >- + {{ WIREGUARD_ACTIVE_MESHES.values() + | map('mesh_dialled_peers') + | flatten + | list }} + +WIREGUARD_EXPECTED_PEERS: "{{ WIREGUARD_DIALLED_PEERS | map(attribute='address') | list }}" + +WIREGUARD_HEADER_BYTES: 60 +WIREGUARD_VXLAN_HEADER_BYTES: 50 + +WIREGUARD_PMTU_TARGETS: >- + {{ (WIREGUARD_DIALLED_PEERS | map(attribute='endpoint') | list) + | default(NETWORK_PUBLIC_DNS_RESOLVERS, true) }} diff --git a/roles/svc-prx-openresty/meta/networks.yml b/roles/svc-prx-openresty/meta/networks.yml index 1b1c727365..0a206bc72c 100644 --- a/roles/svc-prx-openresty/meta/networks.yml +++ b/roles/svc-prx-openresty/meta/networks.yml @@ -1,4 +1,5 @@ --- +meshes: [] local: subnet: 192.168.107.0/24 overlay: diff --git a/roles/svc-registry-cache/meta/networks.yml b/roles/svc-registry-cache/meta/networks.yml index 3341622d91..e43bcfd9de 100644 --- a/roles/svc-registry-cache/meta/networks.yml +++ b/roles/svc-registry-cache/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.205.0/24 diff --git a/roles/svc-registry-docker/meta/networks.yml b/roles/svc-registry-docker/meta/networks.yml index b6930e0d6b..9d980353c7 100644 --- a/roles/svc-registry-docker/meta/networks.yml +++ b/roles/svc-registry-docker/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.204.0/24 diff --git a/roles/svc-runner/meta/networks.yml b/roles/svc-runner/meta/networks.yml index 429c46dd8a..6461df7bf6 100644 --- a/roles/svc-runner/meta/networks.yml +++ b/roles/svc-runner/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.219.0/24 diff --git a/roles/svc-storage-nfs-client/files/shell/premount_state.sh b/roles/svc-storage-nfs-client/files/shell/premount_state.sh index 0615c8847f..ccd2210197 100644 --- a/roles/svc-storage-nfs-client/files/shell/premount_state.sh +++ b/roles/svc-storage-nfs-client/files/shell/premount_state.sh @@ -3,9 +3,9 @@ set -eu : "${DIR_VAR_LIB:?DIR_VAR_LIB required}" if grep -qF " ${DIR_VAR_LIB} " /proc/self/mountinfo; then - echo "mounted" + echo "STATE=mounted" elif [ -d "${DIR_VAR_LIB}" ] && [ -n "$(ls -A "${DIR_VAR_LIB}" 2>/dev/null)" ]; then - echo "has-local-data" + echo "STATE=has-local-data" else - echo "empty" + echo "STATE=empty" fi diff --git a/roles/svc-storage-nfs-client/tasks/main.yml b/roles/svc-storage-nfs-client/tasks/main.yml index 1f19f53630..8fdcdb4fe4 100644 --- a/roles/svc-storage-nfs-client/tasks/main.yml +++ b/roles/svc-storage-nfs-client/tasks/main.yml @@ -76,11 +76,14 @@ - name: "βœ… Assert no pre-existing local data at {{ DIR_VAR_LIB }} (mount would hide it)" ansible.builtin.assert: that: - - (_svc_storage_nfs_client_premount_state.stdout | trim) in ["mounted", "empty"] + - >- + 'STATE=mounted' in _svc_storage_nfs_client_premount_state.stdout + or 'STATE=empty' in _svc_storage_nfs_client_premount_state.stdout fail_msg: >- Pre-existing local data found at {{ DIR_VAR_LIB }}; NFS mount-over would silently hide it. Migrate or remove the local tree manually, - then re-run the deploy. + then re-run the deploy. Probe said: + {{ _svc_storage_nfs_client_premount_state.stdout | trim }} - name: "βœ… Ensure infinito state mount point exists" ansible.builtin.file: diff --git a/roles/svc-storage-nfs-server/meta/networks.yml b/roles/svc-storage-nfs-server/meta/networks.yml new file mode 100644 index 0000000000..05c3b3a894 --- /dev/null +++ b/roles/svc-storage-nfs-server/meta/networks.yml @@ -0,0 +1,2 @@ +--- +meshes: [] diff --git a/roles/svc-storage-nfs-server/tasks/01_prepare.yml b/roles/svc-storage-nfs-server/tasks/01_prepare.yml index d872770cad..d265346729 100644 --- a/roles/svc-storage-nfs-server/tasks/01_prepare.yml +++ b/roles/svc-storage-nfs-server/tasks/01_prepare.yml @@ -47,12 +47,14 @@ ansible.builtin.set_fact: svc_storage_nfs_server_allowed_ips: >- {{ - (groups['svc-swarm-node'] - | default([]) - | map('extract', hostvars, ['ansible_facts', 'default_ipv4', 'address']) - | select('defined') - | list) - or [ansible_facts.default_ipv4.address | default('127.0.0.1')] + ((groups['svc-swarm-node'] + | default([]) + | map('extract', hostvars, ['ansible_facts', 'default_ipv4', 'address']) + | select('defined') + | list) + or [ansible_facts.default_ipv4.address | default('127.0.0.1')]) + + (lookup('mesh_ranges') + if ('svc-net-wireguard' in group_names) else []) }} - name: "βœ… Assert at least one allowed IP was resolved" diff --git a/roles/svc-storage-nfs-server/tasks/03_controller_mount.yml b/roles/svc-storage-nfs-server/tasks/03_controller_mount.yml index e9653e6b47..fdaddf1a6b 100644 --- a/roles/svc-storage-nfs-server/tasks/03_controller_mount.yml +++ b/roles/svc-storage-nfs-server/tasks/03_controller_mount.yml @@ -11,11 +11,14 @@ - name: "βœ… Assert controller {{ DIR_VAR_LIB }} has no pre-existing data (mount hides it)" ansible.builtin.assert: that: - - (_ctrl_premount_state.stdout | trim) in ["mounted", "empty"] + - >- + 'STATE=mounted' in _ctrl_premount_state.stdout + or 'STATE=empty' in _ctrl_premount_state.stdout fail_msg: >- Pre-existing local data found at controller {{ DIR_VAR_LIB }}; NFS mount-over would silently hide it. Migrate or remove the local tree - on the controller, then re-run the deploy. + on the controller, then re-run the deploy. Probe said: + {{ _ctrl_premount_state.stdout | trim }} - name: "βœ… Ensure controller mount point exists" ansible.builtin.file: @@ -41,14 +44,14 @@ path: "{{ DIR_VAR_LIB }}" state: unmounted when: - - (_ctrl_premount_state.stdout | trim) == 'mounted' + - "'STATE=mounted' in _ctrl_premount_state.stdout" - (_ctrl_mount_src.stdout | trim) | length > 0 - - (_ctrl_mount_src.stdout | trim) != STORAGE_NFS_CLIENT_SRC + - (_ctrl_mount_src.stdout | trim) != STORAGE_NFS_CONTROLLER_SRC - name: "πŸ”— Mount cluster-shared infinito state on controller" ansible.posix.mount: path: "{{ DIR_VAR_LIB }}" - src: "{{ STORAGE_NFS_CLIENT_SRC }}" + src: "{{ STORAGE_NFS_CONTROLLER_SRC }}" fstype: "{{ STORAGE_NFS_FSTYPE }}" opts: "{{ STORAGE_NFS_MOUNT_OPTS }}" state: ephemeral diff --git a/roles/svc-swarm-node/meta/networks.yml b/roles/svc-swarm-node/meta/networks.yml new file mode 100644 index 0000000000..05c3b3a894 --- /dev/null +++ b/roles/svc-swarm-node/meta/networks.yml @@ -0,0 +1,2 @@ +--- +meshes: [] diff --git a/roles/svc-swarm-node/meta/services.yml b/roles/svc-swarm-node/meta/services.yml index 95b4dd3744..9a514deb33 100644 --- a/roles/svc-swarm-node/meta/services.yml +++ b/roles/svc-swarm-node/meta/services.yml @@ -1,5 +1,4 @@ --- -# nocheck: required-by-coverage node: modes: host: diff --git a/roles/sys-ctl-cln-docker/README.md b/roles/sys-ctl-cln-docker/README.md index 00e5cf7a28..13128f4dfa 100644 --- a/roles/sys-ctl-cln-docker/README.md +++ b/roles/sys-ctl-cln-docker/README.md @@ -10,32 +10,32 @@ The cleanup is fully automated and can run on a schedule or be triggered manuall Optimized for maintaining a clean and efficient Docker environment, this role: -* Loads and triggers the anonymous volume cleanup role. -* Installs a systemd service and timer for Docker pruning. -* Deploys a cleanup script that invokes: +- Loads and triggers the anonymous volume cleanup role. +- Installs a systemd service and timer for Docker pruning. +- Deploys a cleanup script that invokes: - * The anonymous volume cleanup service. - * `container system prune -a -f` to remove unused Docker resources. -* Allows forced execution during maintenance runs (`MODE_CLEANUP`). + - The anonymous volume cleanup service. + - `container system prune -a -f` to remove unused Docker resources. +- Allows forced execution during maintenance runs (`MODE_CLEANUP`). ## Purpose The primary purpose of this role is to prevent storage bloat caused by unused Docker images, volumes, and build artifacts. Regular pruning ensures: -* Reduced disk usage -* Improved system performance -* Faster CI/CD and container deployments -* More predictable Docker engine behavior +- Reduced disk usage +- Improved system performance +- Faster CI/CD and container deployments +- More predictable Docker engine behavior ## Features -* **Anonymous Volume Cleanup:** Integrates with `sys-ctl-cln-anon-volumes` to remove stale volumes. -* **Full Docker Prune:** Executes `container system prune -a -f` to reclaim space. -* **Systemd Integration:** Registers a systemd unit and timer for automated cleanup. -* **Scheduled Execution:** Runs daily (or as configured) based on `SYS_SCHEDULE_CLEANUP_DOCKER`. -* **Force Execution Mode:** When `MODE_CLEANUP=true`, cleanup is executed immediately. -* **Safe Execution:** Includes validation for missing services and Docker availability. +- **Anonymous Volume Cleanup:** Integrates with `sys-ctl-cln-anon-volumes` to remove stale volumes. +- **Full Docker Prune:** Executes `container system prune -a -f` to reclaim space. +- **Systemd Integration:** Registers a systemd unit and timer for automated cleanup. +- **Scheduled Execution:** Runs daily (or as configured) based on `SYS_SCHEDULE_CLEANUP_DOCKER`. +- **Force Execution Mode:** When `MODE_CLEANUP=true`, cleanup is executed immediately. +- **Safe Execution:** Includes validation for missing services and Docker availability. ## Script Behavior diff --git a/roles/sys-svc-cdn/README.md b/roles/sys-svc-cdn/README.md index bf80aad11f..bcf52bef21 100644 --- a/roles/sys-svc-cdn/README.md +++ b/roles/sys-svc-cdn/README.md @@ -12,8 +12,8 @@ Defines a per-role CDN structure under `roles//` plus s ## Features -* Jinja filters: `cdn_paths`, `cdn_urls`, `cdn_dirs` -* Variables: `CDN_ROOT`, `CDN_VERSION`, `CDN_BASE_URL`, `cdn`, `cdn_dirs`, `cdn_urls` -* Creates shared/vendor/release directories -* Maintains `roles//latest` symlink (when version β‰  `latest`) -* Plays nicely with `web-svc-cdn` without circular inclusion +- Jinja filters: `cdn_paths`, `cdn_urls`, `cdn_dirs` +- Variables: `CDN_ROOT`, `CDN_VERSION`, `CDN_BASE_URL`, `cdn`, `cdn_dirs`, `cdn_urls` +- Creates shared/vendor/release directories +- Maintains `roles//latest` symlink (when version β‰  `latest`) +- Plays nicely with `web-svc-cdn` without circular inclusion diff --git a/roles/sys-svc-webserver-core/README.md b/roles/sys-svc-webserver-core/README.md index 5f05cae430..c5be3d619c 100644 --- a/roles/sys-svc-webserver-core/README.md +++ b/roles/sys-svc-webserver-core/README.md @@ -4,10 +4,10 @@ This Ansible role installs and configures **NGINX** as a core HTTP/stream server on Arch Linux systems. It provides: -* **HTTP serving** with MIME types, gzip compression, caching, and custom `NGINX.conf` templating. -* **TCP/UDP stream support** via the NGINX Streams module. -* **Directory management** for configuration, `sites-available`/`enabled`, cache, and data. -* **Debugging helpers**: log formats and instructions for general and detailed troubleshooting. +- **HTTP serving** with MIME types, gzip compression, caching, and custom `NGINX.conf` templating. +- **TCP/UDP stream support** via the NGINX Streams module. +- **Directory management** for configuration, `sites-available`/`enabled`, cache, and data. +- **Debugging helpers**: log formats and instructions for general and detailed troubleshooting. ## Overview @@ -15,15 +15,15 @@ This role installs and configures Nginx HTTP and stream modules with performance ## Features -* **Package installation** of `NGINX` and `NGINX-mod-stream`. -* **Idempotent setup**: tasks run only once per host. -* **Configurable reset and cleanup** modes to purge and recreate directories. -* **Custom `NGINX.conf`** template with sensible defaults for performance and security. -* **Stream proxy support**: includes `stream` block for TCP/UDP proxies. -* **Cache directory management**: cleanup and recreation based on `MODE_CLEANUP`. +- **Package installation** of `NGINX` and `NGINX-mod-stream`. +- **Idempotent setup**: tasks run only once per host. +- **Configurable reset and cleanup** modes to purge and recreate directories. +- **Custom `NGINX.conf`** template with sensible defaults for performance and security. +- **Stream proxy support**: includes `stream` block for TCP/UDP proxies. +- **Cache directory management**: cleanup and recreation based on `MODE_CLEANUP`. ## Debugging Tips -* **General logs**: `journalctl -f -u NGINX` -* **Filter by host**: `journalctl -u NGINX -f | grep "{{ inventory_hostname }}"` -* **Enable detailed format**: set `MODE_DEBUG: true` and reload NGINX. +- **General logs**: `journalctl -f -u NGINX` +- **Filter by host**: `journalctl -u NGINX -f | grep "{{ inventory_hostname }}"` +- **Enable detailed format**: set `MODE_DEBUG: true` and reload NGINX. diff --git a/roles/test-e2e-cli/tasks/main.yml b/roles/test-e2e-cli/tasks/main.yml index f8a024a42b..0d200fd3d3 100644 --- a/roles/test-e2e-cli/tasks/main.yml +++ b/roles/test-e2e-cli/tasks/main.yml @@ -47,8 +47,14 @@ loop_var: application_id # nocheck: loop-var-shadow the item IS the role id, so run_one reads the same value the tested role declares label: "{{ application_id }}" when: >- - not (ASYNC_ENABLED | bool) - or not (lookup('role_tests', application_id, 'cli.once', default=false) | bool) + ( + not (ASYNC_ENABLED | bool) + or not (lookup('role_tests', application_id, 'cli.once', default=false) | bool) + ) + and ( + not (lookup('role_tests', application_id, 'cli.controller_only', default=false) | bool) + or (ansible_connection | default('')) == 'local' + ) - name: βœ… Fail if there were CLI test failures ansible.builtin.fail: diff --git a/roles/test-e2e-cli/tasks/run_one.yml b/roles/test-e2e-cli/tasks/run_one.yml index 48be14b43a..6cd87b8f79 100644 --- a/roles/test-e2e-cli/tasks/run_one.yml +++ b/roles/test-e2e-cli/tasks/run_one.yml @@ -6,6 +6,13 @@ _cli_test_script: "{{ TEST_E2E_CLI_STAGE_BASE_DIR }}/{{ application_id }}/test.sh" _cli_service_key: "{{ lookup('role_tests', application_id, 'cli.container_service_key', default='') | trim }}" +- name: "πŸ“¦ Include the roles the CLI test of {{ application_id }} requires" + ansible.builtin.include_role: + name: "{{ required_role }}" + loop: "{{ lookup('role_tests', application_id, 'cli.requires', default=[]) }}" + loop_control: + loop_var: required_role + - name: "βœ… Assert CLI test assets exist for {{ application_id }}" ansible.builtin.stat: path: "{{ item }}" diff --git a/roles/user-administrator/files/administrator b/roles/user-administrator/files/administrator deleted file mode 100644 index c8393a5527..0000000000 --- a/roles/user-administrator/files/administrator +++ /dev/null @@ -1 +0,0 @@ -administrator ALL=(ALL) ALL diff --git a/roles/user-administrator/tasks/00_core.yml b/roles/user-administrator/tasks/00_core.yml index b32bcbdd85..ea1087ea90 100644 --- a/roles/user-administrator/tasks/00_core.yml +++ b/roles/user-administrator/tasks/00_core.yml @@ -2,19 +2,19 @@ - name: πŸ›‘ Fail if administrator authorized_keys is empty ansible.builtin.fail: msg: >- - lookup('users', 'administrator').authorized_keys must contain at least one SSH public key. - when: lookup('users', 'administrator').authorized_keys | length == 0 + lookup('users', '{{ USER_ADMINISTRATOR_NAME }}').authorized_keys must contain at least one SSH public key. + when: lookup('users', USER_ADMINISTRATOR_NAME).authorized_keys | length == 0 - name: πŸ“‚ Include dependency 'sys-sudo' include_role: name: sys-sudo when: run_once_sys_sudo is not defined -- name: πŸ“ create administrator +- name: "πŸ“ create {{ USER_ADMINISTRATOR_NAME }}" user: - name: administrator + name: "{{ USER_ADMINISTRATOR_NAME }}" update_password: on_create - password: "{{ lookup('users', 'administrator').password | password_hash('sha512') }}" + password: "{{ lookup('users', USER_ADMINISTRATOR_NAME).password | password_hash('sha512') }}" create_home: true generate_ssh_key: true ssh_key_type: rsa @@ -25,14 +25,14 @@ file: path: "{{ DIR_HOME_ADMINISTRATOR }}" state: directory - owner: administrator - group: administrator + owner: "{{ USER_ADMINISTRATOR_NAME }}" + group: "{{ USER_ADMINISTRATOR_NAME }}" mode: "0700" -- name: πŸ” grant administrator sudo rights with password - copy: - src: "administrator" - dest: /etc/sudoers.d/administrator +- name: "πŸ” grant {{ USER_ADMINISTRATOR_NAME }} sudo rights with password" + template: # nocheck: stack-host-template (per-host /etc/sudoers.d) + src: sudoers.j2 + dest: "/etc/sudoers.d/{{ USER_ADMINISTRATOR_NAME }}" mode: "0644" owner: root group: root diff --git a/roles/user-administrator/templates/sudoers.j2 b/roles/user-administrator/templates/sudoers.j2 new file mode 100644 index 0000000000..7a8c27cf74 --- /dev/null +++ b/roles/user-administrator/templates/sudoers.j2 @@ -0,0 +1,2 @@ +{{ USER_ADMINISTRATOR_NAME }} ALL=(ALL) ALL +Defaults:{{ USER_ADMINISTRATOR_NAME }} secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" diff --git a/roles/user-administrator/vars/main.yml b/roles/user-administrator/vars/main.yml new file mode 100644 index 0000000000..f17b6d9888 --- /dev/null +++ b/roles/user-administrator/vars/main.yml @@ -0,0 +1,2 @@ +--- +USER_ADMINISTRATOR_NAME: "administrator" diff --git a/roles/web-app-akaunting/meta/networks.yml b/roles/web-app-akaunting/meta/networks.yml index 6321bc16ee..3b5da8e9d5 100644 --- a/roles/web-app-akaunting/meta/networks.yml +++ b/roles/web-app-akaunting/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.0.0/24 diff --git a/roles/web-app-baserow/meta/networks.yml b/roles/web-app-baserow/meta/networks.yml index e833be7012..a5aba59e1f 100644 --- a/roles/web-app-baserow/meta/networks.yml +++ b/roles/web-app-baserow/meta/networks.yml @@ -1,4 +1,5 @@ --- +meshes: [] local: subnet: 192.168.1.0/24 overlay: diff --git a/roles/web-app-bigbluebutton/meta/networks.yml b/roles/web-app-bigbluebutton/meta/networks.yml index 4cb8992685..ec12c90e6e 100644 --- a/roles/web-app-bigbluebutton/meta/networks.yml +++ b/roles/web-app-bigbluebutton/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 10.7.7.0/24 diff --git a/roles/web-app-bluesky/files/login-broker/README.md b/roles/web-app-bluesky/files/login-broker/README.md index d15b0395fe..cfe89ebb96 100644 --- a/roles/web-app-bluesky/files/login-broker/README.md +++ b/roles/web-app-bluesky/files/login-broker/README.md @@ -55,15 +55,15 @@ broker returns HTTP 401, there is no anonymous fallback by design. ## Failure modes -* **PDS unreachable:** the broker bubbles up the createAccount or +- **PDS unreachable:** the broker bubbles up the createAccount or createSession failure and the user sees an HTML error page on the handoff route. Re-trying the visit after PDS recovery completes the handoff. -* **Encrypted attribute decrypt failure:** indicates a key mismatch +- **Encrypted attribute decrypt failure:** indicates a key mismatch between the SPI and the broker. The broker rejects the request with HTTP 500 rather than risk silently re-provisioning a fresh PDS account that loses the user's existing posts. Recovery: rotate the key and clear the attribute (manual op for now, key rotation is in the doc 013 Future Hardening section). -* **social-app upstream error:** the broker forwards the upstream's +- **social-app upstream error:** the broker forwards the upstream's error response. diff --git a/roles/web-app-bluesky/meta/networks.yml b/roles/web-app-bluesky/meta/networks.yml index 5cf133ab82..b6cd21566b 100644 --- a/roles/web-app-bluesky/meta/networks.yml +++ b/roles/web-app-bluesky/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.2.0/24 diff --git a/roles/web-app-bookwyrm/meta/networks.yml b/roles/web-app-bookwyrm/meta/networks.yml index c9feb12050..58355cfebc 100644 --- a/roles/web-app-bookwyrm/meta/networks.yml +++ b/roles/web-app-bookwyrm/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.3.0/24 diff --git a/roles/web-app-bridgy-fed/meta/networks.yml b/roles/web-app-bridgy-fed/meta/networks.yml index 389f32824e..9320cf11cf 100644 --- a/roles/web-app-bridgy-fed/meta/networks.yml +++ b/roles/web-app-bridgy-fed/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.4.0/24 diff --git a/roles/web-app-checkmk/meta/networks.yml b/roles/web-app-checkmk/meta/networks.yml index 117daa981d..eb3b646a54 100644 --- a/roles/web-app-checkmk/meta/networks.yml +++ b/roles/web-app-checkmk/meta/networks.yml @@ -1,4 +1,5 @@ --- +meshes: [] local: subnet: 192.168.217.0/24 overlay: diff --git a/roles/web-app-chess/meta/networks.yml b/roles/web-app-chess/meta/networks.yml index 8f7e2af5d5..d3ebdeb475 100644 --- a/roles/web-app-chess/meta/networks.yml +++ b/roles/web-app-chess/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.5.0/24 diff --git a/roles/web-app-confluence/README.md b/roles/web-app-confluence/README.md index 78b8d4af88..e04a717d06 100644 --- a/roles/web-app-confluence/README.md +++ b/roles/web-app-confluence/README.md @@ -12,19 +12,19 @@ The role builds a minimal custom image on top of the official Confluence image, ## Features -* **Fully Dockerized:** Compose stack with a dedicated data volume (`confluence_data`) and a slim overlay image for future add-ons. -* **Reverse-Proxy Ready:** Sets `ATL_PROXY_NAME/PORT/SCHEME/SECURE` so Confluence generates correct external URLs behind HTTPS. -* **OIDC SSO (Optional):** Pre-templated vars for issuer, client, scopes, JWKS; compatible with Atlassian DC SSO/OIDC marketplace apps. -* **Central Database:** PostgreSQL integration (local or central DB) with bootstrap credentials from role vars. -* **JVM Auto-Tuning:** `JVM_MINIMUM_MEMORY` / `JVM_MAXIMUM_MEMORY` are 35 % and 70 % of the service `mem_limit`. -* **Health Checks:** Curl-based container healthcheck for early failure detection. -* **CSP & Canonical Domains:** Hooks into platform CSP/SSL/domain management to keep policies strict and URLs stable. -* **Backup Friendly:** Data isolated under `{{ CONFLUENCE_HOME }}`. +- **Fully Dockerized:** Compose stack with a dedicated data volume (`confluence_data`) and a slim overlay image for future add-ons. +- **Reverse-Proxy Ready:** Sets `ATL_PROXY_NAME/PORT/SCHEME/SECURE` so Confluence generates correct external URLs behind HTTPS. +- **OIDC SSO (Optional):** Pre-templated vars for issuer, client, scopes, JWKS; compatible with Atlassian DC SSO/OIDC marketplace apps. +- **Central Database:** PostgreSQL integration (local or central DB) with bootstrap credentials from role vars. +- **JVM Auto-Tuning:** `JVM_MINIMUM_MEMORY` / `JVM_MAXIMUM_MEMORY` are 35 % and 70 % of the service `mem_limit`. +- **Health Checks:** Curl-based container healthcheck for early failure detection. +- **CSP & Canonical Domains:** Hooks into platform CSP/SSL/domain management to keep policies strict and URLs stable. +- **Backup Friendly:** Data isolated under `{{ CONFLUENCE_HOME }}`. ## Further Resources -* Product page: [Atlassian Confluence](https://www.atlassian.com/software/confluence) -* Docker Hub (official image): [atlassian/confluence](https://hub.docker.com/r/atlassian/confluence) +- Product page: [Atlassian Confluence](https://www.atlassian.com/software/confluence) +- Docker Hub (official image): [atlassian/confluence](https://hub.docker.com/r/atlassian/confluence) ## Persona contract opt-outs diff --git a/roles/web-app-confluence/meta/networks.yml b/roles/web-app-confluence/meta/networks.yml index 475fca513c..b68b6ff32a 100644 --- a/roles/web-app-confluence/meta/networks.yml +++ b/roles/web-app-confluence/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.6.0/24 diff --git a/roles/web-app-dashboard/meta/networks.yml b/roles/web-app-dashboard/meta/networks.yml index 2446d5aae0..b732926ba0 100644 --- a/roles/web-app-dashboard/meta/networks.yml +++ b/roles/web-app-dashboard/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.7.0/24 diff --git a/roles/web-app-decidim/meta/networks.yml b/roles/web-app-decidim/meta/networks.yml index bb42b7e618..46b851fff9 100644 --- a/roles/web-app-decidim/meta/networks.yml +++ b/roles/web-app-decidim/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.8.0/24 diff --git a/roles/web-app-discourse/meta/networks.yml b/roles/web-app-discourse/meta/networks.yml index 9a5e369c0a..81b4308f02 100644 --- a/roles/web-app-discourse/meta/networks.yml +++ b/roles/web-app-discourse/meta/networks.yml @@ -1,4 +1,5 @@ --- +meshes: [] local: subnet: 192.168.9.0/24 force_bridge: true diff --git a/roles/web-app-docs/meta/networks.yml b/roles/web-app-docs/meta/networks.yml index 2749940fff..183bc905e7 100644 --- a/roles/web-app-docs/meta/networks.yml +++ b/roles/web-app-docs/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.60.0/24 diff --git a/roles/web-app-erpnext/meta/networks.yml b/roles/web-app-erpnext/meta/networks.yml index a56b5ffcbb..311124c0b1 100644 --- a/roles/web-app-erpnext/meta/networks.yml +++ b/roles/web-app-erpnext/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.214.0/24 diff --git a/roles/web-app-espocrm/meta/networks.yml b/roles/web-app-espocrm/meta/networks.yml index 8f0217057d..3aab0ef196 100644 --- a/roles/web-app-espocrm/meta/networks.yml +++ b/roles/web-app-espocrm/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.10.0/24 diff --git a/roles/web-app-fediwall/meta/networks.yml b/roles/web-app-fediwall/meta/networks.yml index 0170a29419..b801b1cd26 100644 --- a/roles/web-app-fediwall/meta/networks.yml +++ b/roles/web-app-fediwall/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.11.0/24 diff --git a/roles/web-app-fider/meta/networks.yml b/roles/web-app-fider/meta/networks.yml index f79c622502..72807cb6ee 100644 --- a/roles/web-app-fider/meta/networks.yml +++ b/roles/web-app-fider/meta/networks.yml @@ -1,4 +1,5 @@ --- +meshes: [] local: subnet: 192.168.12.0/24 overlay: diff --git a/roles/web-app-flowise/README.md b/roles/web-app-flowise/README.md index b78003cd4c..fe008d658d 100644 --- a/roles/web-app-flowise/README.md +++ b/roles/web-app-flowise/README.md @@ -10,20 +10,20 @@ Users design flows on a drag-and-drop canvas (LLM, RAG, tools, webhooks), test t ## Features -* No/low-code canvas to build assistants and pipelines -* Publish flows as HTTP endpoints for easy integration -* Retrieval-augmented generation (RAG) with vector DBs (e.g., Qdrant) -* Pluggable model backends via OpenAI-compatible API or direct Ollama -* Keep data and prompts on your own infrastructure -* **MCP client contract:** With an MCP server deployed alongside it, the role declares the MCP client side of the platform contract as an internal streamable-HTTP client with a read-only tool policy. The deploy registers every discovered provider in the instance-level `/api/v1/custom-mcp-servers` registry under an `infinito:` name, stores the bearer as an encrypted `CUSTOM_HEADERS` `authConfig`, authorizes each entry and compares the discovered tools against the provider's declared allowlist. `CUSTOM_MCP_PROTOCOL=sse` pins the deployment to URL-based MCP servers, so no flow can spawn a local stdio command. Reaching an MCP server whose URL resolves inside the container network requires `HTTP_SECURITY_CHECK=false` plus an `HTTP_DENY_LIST` that keeps loopback and the cloud-metadata addresses denied; both are rendered only while MCP servers are discovered, and the deploy proves the list is live by pointing a throwaway entry at each denied address. One managed Agentflow fixture calls a single named tool with fixed arguments and is executed on every deploy. Wiring a provider into a flow of your own stays an operator step. +- No/low-code canvas to build assistants and pipelines +- Publish flows as HTTP endpoints for easy integration +- Retrieval-augmented generation (RAG) with vector DBs (e.g., Qdrant) +- Pluggable model backends via OpenAI-compatible API or direct Ollama +- Keep data and prompts on your own infrastructure +- **MCP client contract:** With an MCP server deployed alongside it, the role declares the MCP client side of the platform contract as an internal streamable-HTTP client with a read-only tool policy. The deploy registers every discovered provider in the instance-level `/api/v1/custom-mcp-servers` registry under an `infinito:` name, stores the bearer as an encrypted `CUSTOM_HEADERS` `authConfig`, authorizes each entry and compares the discovered tools against the provider's declared allowlist. `CUSTOM_MCP_PROTOCOL=sse` pins the deployment to URL-based MCP servers, so no flow can spawn a local stdio command. Reaching an MCP server whose URL resolves inside the container network requires `HTTP_SECURITY_CHECK=false` plus an `HTTP_DENY_LIST` that keeps loopback and the cloud-metadata addresses denied; both are rendered only while MCP servers are discovered, and the deploy proves the list is live by pointing a throwaway entry at each denied address. One managed Agentflow fixture calls a single named tool with fixed arguments and is executed on every deploy. Wiring a provider into a flow of your own stays an operator step. ## Further Resources -* Flowise: [flowiseai.com](https://flowiseai.com) -* Qdrant: [qdrant.tech](https://qdrant.tech) -* LiteLLM: [litellm.ai](https://www.litellm.ai) -* Ollama: [ollama.com](https://ollama.com) -* [Corporate design review: screenshots in light, dark, desktop and mobile](https://claude.ai/artifact/M7hkFsuTnwiSqcnhNrreXT) +- Flowise: [flowiseai.com](https://flowiseai.com) +- Qdrant: [qdrant.tech](https://qdrant.tech) +- LiteLLM: [litellm.ai](https://www.litellm.ai) +- Ollama: [ollama.com](https://ollama.com) +- [Corporate design review: screenshots in light, dark, desktop and mobile](https://claude.ai/artifact/M7hkFsuTnwiSqcnhNrreXT) ## MCP Client diff --git a/roles/web-app-flowise/meta/networks.yml b/roles/web-app-flowise/meta/networks.yml index e109788752..07a37be600 100644 --- a/roles/web-app-flowise/meta/networks.yml +++ b/roles/web-app-flowise/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.13.0/24 diff --git a/roles/web-app-friendica/meta/networks.yml b/roles/web-app-friendica/meta/networks.yml index 1ce8d09340..d88320d665 100644 --- a/roles/web-app-friendica/meta/networks.yml +++ b/roles/web-app-friendica/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.14.0/24 diff --git a/roles/web-app-funkwhale/meta/networks.yml b/roles/web-app-funkwhale/meta/networks.yml index c120c7b1ad..6927b8d8e3 100644 --- a/roles/web-app-funkwhale/meta/networks.yml +++ b/roles/web-app-funkwhale/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.15.0/24 diff --git a/roles/web-app-fusiondirectory/meta/networks.yml b/roles/web-app-fusiondirectory/meta/networks.yml index 896a9210d2..7edb6edbcb 100644 --- a/roles/web-app-fusiondirectory/meta/networks.yml +++ b/roles/web-app-fusiondirectory/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.16.0/24 diff --git a/roles/web-app-gitea/meta/networks.yml b/roles/web-app-gitea/meta/networks.yml index b083f64837..c7cec477b4 100644 --- a/roles/web-app-gitea/meta/networks.yml +++ b/roles/web-app-gitea/meta/networks.yml @@ -1,4 +1,5 @@ --- +meshes: [] local: subnet: 192.168.17.0/24 overlay: diff --git a/roles/web-app-gitea/meta/services.yml b/roles/web-app-gitea/meta/services.yml index b3ff30b7b4..0f9e6578f0 100644 --- a/roles/web-app-gitea/meta/services.yml +++ b/roles/web-app-gitea/meta/services.yml @@ -49,7 +49,7 @@ gitea: shared: true provides: gitea image: gitea/gitea - version: 28.1.0 + version: 28.2.0 replicas: 1 # nocheck: single-replica single-writer app state on swarm-shared NFS; concurrent multi-node writers corrupt app.ini min_storage: 270MB backup: @@ -111,7 +111,7 @@ giteamcpupstream: enabled: "{{ lookup('config', 'web-app-gitea', 'mcp.enabled') | bool }}" shared: false image: docker.gitea.com/gitea-mcp-server - version: "1.9.0" + version: "1.10.0" update: type: registry_tags image: docker.gitea.com/gitea-mcp-server diff --git a/roles/web-app-gitlab/meta/networks.yml b/roles/web-app-gitlab/meta/networks.yml index 5cd98345e3..d5b6c30796 100644 --- a/roles/web-app-gitlab/meta/networks.yml +++ b/roles/web-app-gitlab/meta/networks.yml @@ -1,4 +1,5 @@ --- +meshes: [] local: subnet: 192.168.18.0/24 overlay: diff --git a/roles/web-app-hermes/meta/networks.yml b/roles/web-app-hermes/meta/networks.yml index 06e3227e31..9b127a7de9 100644 --- a/roles/web-app-hermes/meta/networks.yml +++ b/roles/web-app-hermes/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.77.0/24 diff --git a/roles/web-app-homeassistant/meta/networks.yml b/roles/web-app-homeassistant/meta/networks.yml index 734e03ce96..74811c687c 100644 --- a/roles/web-app-homeassistant/meta/networks.yml +++ b/roles/web-app-homeassistant/meta/networks.yml @@ -1,4 +1,5 @@ --- +meshes: [] local: subnet: 192.168.79.0/24 overlay: diff --git a/roles/web-app-hugo/meta/networks.yml b/roles/web-app-hugo/meta/networks.yml index 2a4baabebd..5bfe4e38dd 100644 --- a/roles/web-app-hugo/meta/networks.yml +++ b/roles/web-app-hugo/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.19.0/24 diff --git a/roles/web-app-jellyfin/meta/networks.yml b/roles/web-app-jellyfin/meta/networks.yml index 3339b6499e..ffd3731e31 100644 --- a/roles/web-app-jellyfin/meta/networks.yml +++ b/roles/web-app-jellyfin/meta/networks.yml @@ -1,4 +1,5 @@ --- +meshes: [] local: subnet: 192.168.215.0/24 overlay: diff --git a/roles/web-app-jenkins/meta/networks.yml b/roles/web-app-jenkins/meta/networks.yml index b96514b36e..b9ea511046 100644 --- a/roles/web-app-jenkins/meta/networks.yml +++ b/roles/web-app-jenkins/meta/networks.yml @@ -1,4 +1,5 @@ --- +meshes: [] local: subnet: 192.168.20.0/24 overlay: diff --git a/roles/web-app-jira/README.md b/roles/web-app-jira/README.md index b79c10f237..5ed0faeda4 100644 --- a/roles/web-app-jira/README.md +++ b/roles/web-app-jira/README.md @@ -12,18 +12,18 @@ The role builds a lean custom image on top of the official Jira Software image, ## Features -* **Fully Dockerized:** Compose stack with a dedicated data volume (`jira_data`) and a minimal overlay image to enable future plugins/config. -* **Reverse-Proxy/HTTPS Ready:** Preconfigured Atlassian Tomcat proxy envs so Jira respects external scheme/host/port. -* **OIDC SSO (Optional):** Pre-templated vars for issuer, client, endpoints, scopes; compatible with Atlassian DC SSO/OIDC marketplace apps. -* **Central Database:** PostgreSQL integration (local or central) with credentials sourced from role configuration. -* **JVM Auto-Tuning:** `JVM_MINIMUM_MEMORY` / `JVM_MAXIMUM_MEMORY` are 35 % and 70 % of the service `mem_limit`. -* **Health Checks:** Container healthcheck for quicker failure detection and stable automation. -* **CSP & Canonical Domains:** Integrates with platform CSP and domain management. -* **Backup Ready:** Persistent data under `{{ JIRA_STORAGE_PATH }}`. +- **Fully Dockerized:** Compose stack with a dedicated data volume (`jira_data`) and a minimal overlay image to enable future plugins/config. +- **Reverse-Proxy/HTTPS Ready:** Preconfigured Atlassian Tomcat proxy envs so Jira respects external scheme/host/port. +- **OIDC SSO (Optional):** Pre-templated vars for issuer, client, endpoints, scopes; compatible with Atlassian DC SSO/OIDC marketplace apps. +- **Central Database:** PostgreSQL integration (local or central) with credentials sourced from role configuration. +- **JVM Auto-Tuning:** `JVM_MINIMUM_MEMORY` / `JVM_MAXIMUM_MEMORY` are 35 % and 70 % of the service `mem_limit`. +- **Health Checks:** Container healthcheck for quicker failure detection and stable automation. +- **CSP & Canonical Domains:** Integrates with platform CSP and domain management. +- **Backup Ready:** Persistent data under `{{ JIRA_STORAGE_PATH }}`. ## Further Resources -* Docker Hub (official image): [atlassian/jira-software](https://hub.docker.com/r/atlassian/jira-software) +- Docker Hub (official image): [atlassian/jira-software](https://hub.docker.com/r/atlassian/jira-software) ## Persona contract opt-outs diff --git a/roles/web-app-jira/meta/networks.yml b/roles/web-app-jira/meta/networks.yml index 5761a32633..75a754842f 100644 --- a/roles/web-app-jira/meta/networks.yml +++ b/roles/web-app-jira/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.21.0/24 diff --git a/roles/web-app-jitsi/meta/networks.yml b/roles/web-app-jitsi/meta/networks.yml index 4052290ee8..15e34d9ffe 100644 --- a/roles/web-app-jitsi/meta/networks.yml +++ b/roles/web-app-jitsi/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.22.0/24 diff --git a/roles/web-app-joomla/files/joomla-oidc-plugin/README.md b/roles/web-app-joomla/files/joomla-oidc-plugin/README.md index d31a7cf36f..0c3d3657e8 100644 --- a/roles/web-app-joomla/files/joomla-oidc-plugin/README.md +++ b/roles/web-app-joomla/files/joomla-oidc-plugin/README.md @@ -55,17 +55,17 @@ memberships from Keycloak. ## Watch points -* The plugin trusts the Keycloak-issued ID token. The +- The plugin trusts the Keycloak-issued ID token. The `jumbojett/openid-connect-php` library validates the JWT signature against the realm's JWKS, so the issuer URL MUST be reachable from the Joomla container at the time the user authenticates. -* The plugin lives in the `system` plugin group so it can intercept +- The plugin lives in the `system` plugin group so it can intercept every request via `onAfterInitialise`. It MUST run BEFORE the Joomla local form-login plugin in the system event chain so the redirect short-circuits any local-account authentication attempt. System plugins are ordered alphabetically. `keycloak` ranks before `users`, which is the typical local-form gate. -* The local-form fallback at `?fallback=local` is documented as an +- The local-form fallback at `?fallback=local` is documented as an emergency hatch. For high-security deployments, set `JOOMLA_OIDC_FALLBACK_ENABLED=false` to disable it (Modus 1 effective). diff --git a/roles/web-app-joomla/meta/networks.yml b/roles/web-app-joomla/meta/networks.yml index 27a28bec79..b6104d7fee 100644 --- a/roles/web-app-joomla/meta/networks.yml +++ b/roles/web-app-joomla/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.23.0/24 diff --git a/roles/web-app-keycloak/meta/networks.yml b/roles/web-app-keycloak/meta/networks.yml index 97e721ec6a..addde909b1 100644 --- a/roles/web-app-keycloak/meta/networks.yml +++ b/roles/web-app-keycloak/meta/networks.yml @@ -1,4 +1,5 @@ --- +meshes: [] local: subnet: 192.168.24.0/24 overlay: diff --git a/roles/web-app-kix/meta/networks.yml b/roles/web-app-kix/meta/networks.yml index 428dea2f14..69748eecb3 100644 --- a/roles/web-app-kix/meta/networks.yml +++ b/roles/web-app-kix/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.25.0/24 diff --git a/roles/web-app-lam/meta/networks.yml b/roles/web-app-lam/meta/networks.yml index ce9b8537cc..b4bd851bf5 100644 --- a/roles/web-app-lam/meta/networks.yml +++ b/roles/web-app-lam/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.26.0/24 diff --git a/roles/web-app-listmonk/meta/networks.yml b/roles/web-app-listmonk/meta/networks.yml index a424ac7030..7cc4f7ec48 100644 --- a/roles/web-app-listmonk/meta/networks.yml +++ b/roles/web-app-listmonk/meta/networks.yml @@ -1,4 +1,5 @@ --- +meshes: [] local: subnet: 192.168.27.0/24 overlay: diff --git a/roles/web-app-littlejs/meta/networks.yml b/roles/web-app-littlejs/meta/networks.yml index 500b8c43b9..a601c376db 100644 --- a/roles/web-app-littlejs/meta/networks.yml +++ b/roles/web-app-littlejs/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.28.0/24 diff --git a/roles/web-app-magento/meta/networks.yml b/roles/web-app-magento/meta/networks.yml index a56654fe73..65cd7061bb 100644 --- a/roles/web-app-magento/meta/networks.yml +++ b/roles/web-app-magento/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.29.0/24 diff --git a/roles/web-app-mailu/docs/Move_Domain.md b/roles/web-app-mailu/docs/Move_Domain.md index b15368e3a7..1e9f17d4f6 100644 --- a/roles/web-app-mailu/docs/Move_Domain.md +++ b/roles/web-app-mailu/docs/Move_Domain.md @@ -8,9 +8,9 @@ This guide explains the **safe procedure** for migrating user mailboxes to a new ## Why renaming folders directly does not work πŸ”΄ -* Mailu keeps **domains, users, and aliases** in the `admin_data` database. If you rename folders only, Mailu will not recognize the new accounts. -* Dovecot generates `.dovecot.index*` and `dovecot-uidlist` files in each mailbox. These must be rebuilt when moving mailboxes; otherwise, users may see missing or broken mail. -* Postfix will refuse to deliver or relay messages for unknown domains. +- Mailu keeps **domains, users, and aliases** in the `admin_data` database. If you rename folders only, Mailu will not recognize the new accounts. +- Dovecot generates `.dovecot.index*` and `dovecot-uidlist` files in each mailbox. These must be rebuilt when moving mailboxes; otherwise, users may see missing or broken mail. +- Postfix will refuse to deliver or relay messages for unknown domains. --- @@ -84,8 +84,8 @@ This maps all `@cymais.cloud` addresses to their equivalents under `@infinito.ne ## Summary πŸ’‘ -* Do **not** just rename mailbox folders. -* Always create the new domain and user in Mailu first. -* Copy existing Maildir contents into the new user’s directory. -* Remove Dovecot indices and fix permissions. -* Optionally configure a **domain alias** so old addresses remain valid. +- Do **not** just rename mailbox folders. +- Always create the new domain and user in Mailu first. +- Copy existing Maildir contents into the new user’s directory. +- Remove Dovecot indices and fix permissions. +- Optionally configure a **domain alias** so old addresses remain valid. diff --git a/roles/web-app-mailu/meta/networks.yml b/roles/web-app-mailu/meta/networks.yml index ef938f21ed..853aa53e6e 100644 --- a/roles/web-app-mailu/meta/networks.yml +++ b/roles/web-app-mailu/meta/networks.yml @@ -1,4 +1,5 @@ --- +meshes: [] local: subnet: 192.168.106.0/24 dns_resolver: 192.168.106.29 diff --git a/roles/web-app-mastodon/meta/networks.yml b/roles/web-app-mastodon/meta/networks.yml index bfea6ca758..244c5710d4 100644 --- a/roles/web-app-mastodon/meta/networks.yml +++ b/roles/web-app-mastodon/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.30.0/24 diff --git a/roles/web-app-matomo/meta/networks.yml b/roles/web-app-matomo/meta/networks.yml index 9d64ff496f..532754db0a 100644 --- a/roles/web-app-matomo/meta/networks.yml +++ b/roles/web-app-matomo/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.31.0/24 diff --git a/roles/web-app-matrix/meta/networks.yml b/roles/web-app-matrix/meta/networks.yml index f03479fcb3..d5682eebe7 100644 --- a/roles/web-app-matrix/meta/networks.yml +++ b/roles/web-app-matrix/meta/networks.yml @@ -1,4 +1,5 @@ --- +meshes: [] local: subnet: 192.168.32.0/24 force_bridge: "{{ lookup('config', 'web-app-matrix', 'services.matrix.flavor') == 'ansible' }}" diff --git a/roles/web-app-mattermost/meta/networks.yml b/roles/web-app-mattermost/meta/networks.yml index 2cad14c791..7fa8d9a384 100644 --- a/roles/web-app-mattermost/meta/networks.yml +++ b/roles/web-app-mattermost/meta/networks.yml @@ -1,4 +1,5 @@ --- +meshes: [] local: subnet: 192.168.33.0/24 overlay: diff --git a/roles/web-app-mediawiki/meta/networks.yml b/roles/web-app-mediawiki/meta/networks.yml index b73e9c9152..f2c55ff4d3 100644 --- a/roles/web-app-mediawiki/meta/networks.yml +++ b/roles/web-app-mediawiki/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.34.0/24 diff --git a/roles/web-app-meta/meta/networks.yml b/roles/web-app-meta/meta/networks.yml index b379f7d936..bdbc2d84ab 100644 --- a/roles/web-app-meta/meta/networks.yml +++ b/roles/web-app-meta/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.35.0/24 diff --git a/roles/web-app-mini-qr/meta/networks.yml b/roles/web-app-mini-qr/meta/networks.yml index 751ad23f6f..a2c904cb44 100644 --- a/roles/web-app-mini-qr/meta/networks.yml +++ b/roles/web-app-mini-qr/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.36.0/24 diff --git a/roles/web-app-minio/README.md b/roles/web-app-minio/README.md index ff93a78729..232a1563de 100644 --- a/roles/web-app-minio/README.md +++ b/roles/web-app-minio/README.md @@ -12,16 +12,16 @@ Applications that speak β€œS3” (Pixelfed, Mastodon, Nextcloud, Flowise, etc.) ## Features -* S3-compatible API for broad app compatibility -* Buckets, users, access keys, and fine-grained policies -* Optional versioning, lifecycle rules, and object lock -* Presigned URLs for secure, time-limited uploads/downloads -* Ideal for AI stacks: datasets, embeddings, and artifacts +- S3-compatible API for broad app compatibility +- Buckets, users, access keys, and fine-grained policies +- Optional versioning, lifecycle rules, and object lock +- Presigned URLs for secure, time-limited uploads/downloads +- Ideal for AI stacks: datasets, embeddings, and artifacts ## Further Resources -* MinIO: [www.min.io](https://www.min.io) -* AWS S3 (API background): [aws.amazon.com/s3](https://aws.amazon.com/s3) +- MinIO: [www.min.io](https://www.min.io) +- AWS S3 (API background): [aws.amazon.com/s3](https://aws.amazon.com/s3) ## Persona contract opt-outs diff --git a/roles/web-app-minio/meta/networks.yml b/roles/web-app-minio/meta/networks.yml index 0600cde1bd..65a82c15f8 100644 --- a/roles/web-app-minio/meta/networks.yml +++ b/roles/web-app-minio/meta/networks.yml @@ -1,4 +1,5 @@ --- +meshes: [] local: subnet: 192.168.37.0/24 overlay: diff --git a/roles/web-app-mobilizon/meta/networks.yml b/roles/web-app-mobilizon/meta/networks.yml index 406ccfcdab..d1da62f410 100644 --- a/roles/web-app-mobilizon/meta/networks.yml +++ b/roles/web-app-mobilizon/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.38.0/24 diff --git a/roles/web-app-moodle/meta/networks.yml b/roles/web-app-moodle/meta/networks.yml index bf3863ce00..1cb973f8f9 100644 --- a/roles/web-app-moodle/meta/networks.yml +++ b/roles/web-app-moodle/meta/networks.yml @@ -1,4 +1,5 @@ --- +meshes: [] local: subnet: 192.168.39.0/24 overlay: diff --git a/roles/web-app-n8n/meta/networks.yml b/roles/web-app-n8n/meta/networks.yml index e8ef61382f..6b423e9ab3 100644 --- a/roles/web-app-n8n/meta/networks.yml +++ b/roles/web-app-n8n/meta/networks.yml @@ -1,4 +1,5 @@ --- +meshes: [] local: subnet: 192.168.218.0/24 overlay: diff --git a/roles/web-app-navigator/meta/networks.yml b/roles/web-app-navigator/meta/networks.yml index f3dcc1e17b..e24cdb1886 100644 --- a/roles/web-app-navigator/meta/networks.yml +++ b/roles/web-app-navigator/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.40.0/24 diff --git a/roles/web-app-nextcloud/meta/networks.yml b/roles/web-app-nextcloud/meta/networks.yml index 2f01a1f4c6..15fa3a0993 100644 --- a/roles/web-app-nextcloud/meta/networks.yml +++ b/roles/web-app-nextcloud/meta/networks.yml @@ -1,4 +1,5 @@ --- +meshes: [] local: subnet: 192.168.41.0/24 overlay: diff --git a/roles/web-app-odoo/meta/networks.yml b/roles/web-app-odoo/meta/networks.yml index 41aaa3940b..ffd02a6fdf 100644 --- a/roles/web-app-odoo/meta/networks.yml +++ b/roles/web-app-odoo/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.42.0/24 diff --git a/roles/web-app-openbao/meta/networks.yml b/roles/web-app-openbao/meta/networks.yml index 34ecb8d56e..82c07cb009 100644 --- a/roles/web-app-openbao/meta/networks.yml +++ b/roles/web-app-openbao/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.222.0/24 diff --git a/roles/web-app-openclaw/meta/networks.yml b/roles/web-app-openclaw/meta/networks.yml index c954900473..7fd05ef3eb 100644 --- a/roles/web-app-openclaw/meta/networks.yml +++ b/roles/web-app-openclaw/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.78.0/24 diff --git a/roles/web-app-opencloud/meta/networks.yml b/roles/web-app-opencloud/meta/networks.yml index cd758285bb..c2768c06ab 100644 --- a/roles/web-app-opencloud/meta/networks.yml +++ b/roles/web-app-opencloud/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.43.0/24 diff --git a/roles/web-app-openproject/meta/networks.yml b/roles/web-app-openproject/meta/networks.yml index 30c40e6bb2..6a4fae906f 100644 --- a/roles/web-app-openproject/meta/networks.yml +++ b/roles/web-app-openproject/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.44.0/24 diff --git a/roles/web-app-opentalk/meta/networks.yml b/roles/web-app-opentalk/meta/networks.yml index 8479252aba..fba840d0fe 100644 --- a/roles/web-app-opentalk/meta/networks.yml +++ b/roles/web-app-opentalk/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.45.0/24 diff --git a/roles/web-app-openwebui/README.md b/roles/web-app-openwebui/README.md index 97cdd1c01c..b1c41a4c0b 100644 --- a/roles/web-app-openwebui/README.md +++ b/roles/web-app-openwebui/README.md @@ -21,20 +21,20 @@ applications: ## Features -* Familiar multi-chat interface with quick model switching -* Supports local backends (Ollama) and OpenAI-compatible APIs -* Optional **offline mode** for air-gapped environments -* File/paste input for summaries and extraction (model dependent) -* Suitable for teams: predictable, private, reproducible -* With `svc-ai-agent-broker` deployed, lists `hermes` and `openclaw` only to members of the matching `agent-user` group and grants every LiteLLM model to all users; a `svc-ai-litellm` deploy re-grants the gateway models in a running Open WebUI -* Retrieval, web search and code execution come from platform services (`svc-ai-tika`, `svc-ai-searxng`, `svc-ai-jupyter`, `svc-db-qdrant`) rather than from a third-party API, each switched on per deployment -* `services.openwebui.embedding_model`, `.image_model`, `.speech_to_text_model` and `.text_to_speech_model` route embeddings, images, speech recognition and speech synthesis through the gateway; an embedding model set here also replaces the sentence-transformer the image otherwise downloads from Hugging Face on first start +- Familiar multi-chat interface with quick model switching +- Supports local backends (Ollama) and OpenAI-compatible APIs +- Optional **offline mode** for air-gapped environments +- File/paste input for summaries and extraction (model dependent) +- Suitable for teams: predictable, private, reproducible +- With `svc-ai-agent-broker` deployed, lists `hermes` and `openclaw` only to members of the matching `agent-user` group and grants every LiteLLM model to all users; a `svc-ai-litellm` deploy re-grants the gateway models in a running Open WebUI +- Retrieval, web search and code execution come from platform services (`svc-ai-tika`, `svc-ai-searxng`, `svc-ai-jupyter`, `svc-db-qdrant`) rather than from a third-party API, each switched on per deployment +- `services.openwebui.embedding_model`, `.image_model`, `.speech_to_text_model` and `.text_to_speech_model` route embeddings, images, speech recognition and speech synthesis through the gateway; an embedding model set here also replaces the sentence-transformer the image otherwise downloads from Hugging Face on first start ## Further Resources -* Open WebUI: [openwebui.com](https://openwebui.com) -* Ollama: [ollama.com](https://ollama.com) -* Corporate design review: [screenshots in light, dark, desktop and mobile](https://claude.ai/artifact/VTv2HRQf1bMXVJW4e5WJPY) +- Open WebUI: [openwebui.com](https://openwebui.com) +- Ollama: [ollama.com](https://ollama.com) +- Corporate design review: [screenshots in light, dark, desktop and mobile](https://claude.ai/artifact/VTv2HRQf1bMXVJW4e5WJPY) ## MCP Client diff --git a/roles/web-app-openwebui/meta/networks.yml b/roles/web-app-openwebui/meta/networks.yml index 9bca164b67..67cae4b474 100644 --- a/roles/web-app-openwebui/meta/networks.yml +++ b/roles/web-app-openwebui/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.46.0/24 diff --git a/roles/web-app-peertube/meta/networks.yml b/roles/web-app-peertube/meta/networks.yml index c0bfae84d1..6acfc48603 100644 --- a/roles/web-app-peertube/meta/networks.yml +++ b/roles/web-app-peertube/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.47.0/24 diff --git a/roles/web-app-penpot/meta/networks.yml b/roles/web-app-penpot/meta/networks.yml index 5e66cd343b..76af359018 100644 --- a/roles/web-app-penpot/meta/networks.yml +++ b/roles/web-app-penpot/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.48.0/24 diff --git a/roles/web-app-pgadmin/meta/networks.yml b/roles/web-app-pgadmin/meta/networks.yml index 6be5d92abf..6cb02452d7 100644 --- a/roles/web-app-pgadmin/meta/networks.yml +++ b/roles/web-app-pgadmin/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.49.0/24 diff --git a/roles/web-app-phpldapadmin/meta/networks.yml b/roles/web-app-phpldapadmin/meta/networks.yml index 5664736c80..45af1d894c 100644 --- a/roles/web-app-phpldapadmin/meta/networks.yml +++ b/roles/web-app-phpldapadmin/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.50.0/24 diff --git a/roles/web-app-phpmyadmin/meta/networks.yml b/roles/web-app-phpmyadmin/meta/networks.yml index 1f42711400..06bed3f976 100644 --- a/roles/web-app-phpmyadmin/meta/networks.yml +++ b/roles/web-app-phpmyadmin/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.51.0/24 diff --git a/roles/web-app-pihole/meta/networks.yml b/roles/web-app-pihole/meta/networks.yml index 87ec0c5300..3b8a9c8a8f 100644 --- a/roles/web-app-pihole/meta/networks.yml +++ b/roles/web-app-pihole/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.52.0/24 diff --git a/roles/web-app-pihole/meta/services.yml b/roles/web-app-pihole/meta/services.yml index 88d4e1b2ca..da52b7c52a 100644 --- a/roles/web-app-pihole/meta/services.yml +++ b/roles/web-app-pihole/meta/services.yml @@ -66,7 +66,7 @@ pihole: swarm: enabled: false image: pihole/pihole - version: "2026.09.0" + version: "2026.10.0" upstream_dns: "{{ NETWORK_PUBLIC_DNS_RESOLVERS }}" cpus: "0.5" mem_reservation: "128m" diff --git a/roles/web-app-pixelfed/README.md b/roles/web-app-pixelfed/README.md index ed7ff5de87..38d37d13c1 100644 --- a/roles/web-app-pixelfed/README.md +++ b/roles/web-app-pixelfed/README.md @@ -10,19 +10,19 @@ This Docker Compose deployment automates the installation and operation of a Pix ## Features -* **Decentralized Content Sharing:** Empower users to share photos and visual content across an interoperable, federated network with enhanced privacy controls. -* **Modern, Responsive Web Interface:** Access an intuitive and adaptive UI for effortless browsing, administration, and content management. -* **Robust Scalability & Performance:** Leverage integrated Redis caching and a reliable database (MariaDB or PostgreSQL) for smooth scaling and high performance. -* **Flexible Configuration:** Customize cache sizes, domain settings, and authentication options via environment variables and templated configuration files. -* **Maintenance & Administration Tools:** Built-in CLI and web-app-based tools to clear caches, manage the database, and monitor application health. -* **Single Sign-On (SSO) / OpenID Connect (OIDC):** Seamless integration with external identity providers for centralized authentication. +- **Decentralized Content Sharing:** Empower users to share photos and visual content across an interoperable, federated network with enhanced privacy controls. +- **Modern, Responsive Web Interface:** Access an intuitive and adaptive UI for effortless browsing, administration, and content management. +- **Robust Scalability & Performance:** Leverage integrated Redis caching and a reliable database (MariaDB or PostgreSQL) for smooth scaling and high performance. +- **Flexible Configuration:** Customize cache sizes, domain settings, and authentication options via environment variables and templated configuration files. +- **Maintenance & Administration Tools:** Built-in CLI and web-app-based tools to clear caches, manage the database, and monitor application health. +- **Single Sign-On (SSO) / OpenID Connect (OIDC):** Seamless integration with external identity providers for centralized authentication. ## Further Resources -* [Official Pixelfed website](https://pixelfed.org/) -* [Pixelfed GitHub repository](https://github.com/pixelfed/pixelfed) -* [Corporate design review: screenshots in light, dark, desktop and mobile](https://claude.ai/artifact/NZHqJBSryezaKba1jskYaZ) +- [Official Pixelfed website](https://pixelfed.org/) +- [Pixelfed GitHub repository](https://github.com/pixelfed/pixelfed) +- [Corporate design review: screenshots in light, dark, desktop and mobile](https://claude.ai/artifact/NZHqJBSryezaKba1jskYaZ) ## Persona contract opt-outs -The shared `biber` and `administrator` persona helpers are declared blocked in [templates/playwright.env.j2](./templates/playwright.env.j2). Pixelfed's login id is the account e-mail rather than the Keycloak username, and the artisan-bootstrapped administrator name is reserved, so pixelfed's first-time OIDC registration cannot mint it either. `biber` additionally needs his Keycloak e-mail rewritten to a resolvable domain through the Keycloak admin API before the first OIDC login, because pixelfed's `dns,spoof` validator rejects `.example` addresses. Both setups live in [files/playwright/_shared.js](./files/playwright/_shared.js) and drive the dedicated login specs in `files/playwright/`. +The shared `biber` and `administrator` persona helpers are declared blocked in [templates/playwright.env.j2](./templates/playwright.env.j2). Pixelfed's login id is the account e-mail rather than the Keycloak username, and the artisan-bootstrapped administrator name is reserved, so pixelfed's first-time OIDC registration cannot mint it either. `biber` additionally needs his Keycloak e-mail rewritten to a resolvable domain through the Keycloak admin API before the first OIDC login, because pixelfed's `dns,spoof` validator rejects `.example` addresses. Both setups live in [files/playwright/_shared.js](./files/playwright/_shared.js) and drive the dedicated login specs in [files/playwright](./files/playwright/). diff --git a/roles/web-app-pixelfed/meta/networks.yml b/roles/web-app-pixelfed/meta/networks.yml index 41c50c44b9..96f74b38b7 100644 --- a/roles/web-app-pixelfed/meta/networks.yml +++ b/roles/web-app-pixelfed/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.53.0/24 diff --git a/roles/web-app-postmarks/meta/networks.yml b/roles/web-app-postmarks/meta/networks.yml index 3fe215e7d7..2ba372b223 100644 --- a/roles/web-app-postmarks/meta/networks.yml +++ b/roles/web-app-postmarks/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.54.0/24 diff --git a/roles/web-app-pretix/meta/networks.yml b/roles/web-app-pretix/meta/networks.yml index 057d904b2c..4d4912dc8a 100644 --- a/roles/web-app-pretix/meta/networks.yml +++ b/roles/web-app-pretix/meta/networks.yml @@ -1,4 +1,5 @@ --- +meshes: [] local: subnet: 192.168.55.0/24 overlay: diff --git a/roles/web-app-prometheus/meta/networks.yml b/roles/web-app-prometheus/meta/networks.yml index 97ffc13ee2..9a86e76e6e 100644 --- a/roles/web-app-prometheus/meta/networks.yml +++ b/roles/web-app-prometheus/meta/networks.yml @@ -1,4 +1,5 @@ --- +meshes: [] local: subnet: 192.168.56.0/24 overlay: diff --git a/roles/web-app-roulette-wheel/meta/networks.yml b/roles/web-app-roulette-wheel/meta/networks.yml index 8b4e5b7fef..13683c2a14 100644 --- a/roles/web-app-roulette-wheel/meta/networks.yml +++ b/roles/web-app-roulette-wheel/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.57.0/24 diff --git a/roles/web-app-seaweedfs/meta/networks.yml b/roles/web-app-seaweedfs/meta/networks.yml index 09d1741834..92dfb25c5d 100644 --- a/roles/web-app-seaweedfs/meta/networks.yml +++ b/roles/web-app-seaweedfs/meta/networks.yml @@ -1,4 +1,5 @@ --- +meshes: [] local: subnet: 192.168.230.0/24 overlay: diff --git a/roles/web-app-semaphore/meta/networks.yml b/roles/web-app-semaphore/meta/networks.yml index b75a32e79b..1ec6729302 100644 --- a/roles/web-app-semaphore/meta/networks.yml +++ b/roles/web-app-semaphore/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.216.0/24 diff --git a/roles/web-app-shopware/README.md b/roles/web-app-shopware/README.md index 74a1efc285..9b9fac54f4 100644 --- a/roles/web-app-shopware/README.md +++ b/roles/web-app-shopware/README.md @@ -13,18 +13,18 @@ With automated setup, update handling, variable management, and plugin-based aut ## Features -* **Modern and Scalable:** A robust Symfony-based framework optimized for commerce innovation. -* **Automated Setup & Maintenance:** Installs, migrates, and configures Shopware automatically. -* **Extensible Architecture:** Optional Redis, OpenSearch, and plugin-based IAM integrations. -* **Centralized Database Access:** Connects seamlessly to the shared MariaDB service. -* **Integrated Configuration:** Environment and Docker Compose variables managed automatically. +- **Modern and Scalable:** A robust Symfony-based framework optimized for commerce innovation. +- **Automated Setup & Maintenance:** Installs, migrates, and configures Shopware automatically. +- **Extensible Architecture:** Optional Redis, OpenSearch, and plugin-based IAM integrations. +- **Centralized Database Access:** Connects seamlessly to the shared MariaDB service. +- **Integrated Configuration:** Environment and Docker Compose variables managed automatically. ## Further Resources -* [Shopware Official Website](https://www.shopware.com/en/) -* [Shopware Developer Documentation](https://developer.shopware.com/) -* [Shopware Store (Plugins)](https://store.shopware.com/en/) -* [Corporate design review: before/after screenshots in light, dark, desktop and mobile](https://claude.ai/artifact/TLzWb6b51sQTvihCdbdXbT) +- [Shopware Official Website](https://www.shopware.com/en/) +- [Shopware Developer Documentation](https://developer.shopware.com/) +- [Shopware Store (Plugins)](https://store.shopware.com/en/) +- [Corporate design review: before/after screenshots in light, dark, desktop and mobile](https://claude.ai/artifact/TLzWb6b51sQTvihCdbdXbT) ## Persona contract opt-outs diff --git a/roles/web-app-shopware/meta/networks.yml b/roles/web-app-shopware/meta/networks.yml index 538ae70b48..99929b8406 100644 --- a/roles/web-app-shopware/meta/networks.yml +++ b/roles/web-app-shopware/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.58.0/24 diff --git a/roles/web-app-snipe-it/meta/networks.yml b/roles/web-app-snipe-it/meta/networks.yml index 0c19e7f979..adc97eb14f 100644 --- a/roles/web-app-snipe-it/meta/networks.yml +++ b/roles/web-app-snipe-it/meta/networks.yml @@ -1,4 +1,5 @@ --- +meshes: [] local: subnet: 192.168.59.0/24 overlay: diff --git a/roles/web-app-socialhome/meta/networks.yml b/roles/web-app-socialhome/meta/networks.yml index 0f91d8aef4..65142d61b2 100644 --- a/roles/web-app-socialhome/meta/networks.yml +++ b/roles/web-app-socialhome/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.75.0/24 diff --git a/roles/web-app-stalwart/meta/networks.yml b/roles/web-app-stalwart/meta/networks.yml index 803a199191..00a5ffa8bc 100644 --- a/roles/web-app-stalwart/meta/networks.yml +++ b/roles/web-app-stalwart/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.223.0/24 diff --git a/roles/web-app-stalwart/meta/services.yml b/roles/web-app-stalwart/meta/services.yml index 0f6cfd0232..5e9667ae35 100644 --- a/roles/web-app-stalwart/meta/services.yml +++ b/roles/web-app-stalwart/meta/services.yml @@ -42,7 +42,7 @@ stalwart: # nocheck: default-placement-manager mail edge at a known IP: MX A-record, PTR and SPF bind to the stack host IP (a floating task's egress IP breaks deliverability); the mail store is NFS-hostile and IS the app β€” same rationale as web-app-mailu placement: manager image: stalwartlabs/stalwart - version: "v0.16.26" + version: "v0.16.27" webui_version: "v1.0.11" update: - key: webui_version diff --git a/roles/web-app-suitecrm/meta/networks.yml b/roles/web-app-suitecrm/meta/networks.yml index cc5e55be55..ca2a12e166 100644 --- a/roles/web-app-suitecrm/meta/networks.yml +++ b/roles/web-app-suitecrm/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.61.0/24 diff --git a/roles/web-app-taiga/meta/networks.yml b/roles/web-app-taiga/meta/networks.yml index f5c4e4c572..5e26ffc894 100644 --- a/roles/web-app-taiga/meta/networks.yml +++ b/roles/web-app-taiga/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.62.0/24 diff --git a/roles/web-app-wordpress/meta/networks.yml b/roles/web-app-wordpress/meta/networks.yml index 64f07fb205..22093a48f8 100644 --- a/roles/web-app-wordpress/meta/networks.yml +++ b/roles/web-app-wordpress/meta/networks.yml @@ -1,4 +1,5 @@ --- +meshes: [] local: subnet: 192.168.63.0/24 overlay: diff --git a/roles/web-app-xwiki/meta/networks.yml b/roles/web-app-xwiki/meta/networks.yml index 885ab96657..cbc6bb1319 100644 --- a/roles/web-app-xwiki/meta/networks.yml +++ b/roles/web-app-xwiki/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.64.0/24 diff --git a/roles/web-app-yourls/meta/networks.yml b/roles/web-app-yourls/meta/networks.yml index 3ff4ab1b94..ccee4ae4a2 100644 --- a/roles/web-app-yourls/meta/networks.yml +++ b/roles/web-app-yourls/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.65.0/24 diff --git a/roles/web-app-zammad/README.md b/roles/web-app-zammad/README.md index c6c6b8bf8b..9eb22fa5f9 100644 --- a/roles/web-app-zammad/README.md +++ b/roles/web-app-zammad/README.md @@ -17,6 +17,7 @@ This role deploys Zammad as an Infinito.Nexus web app using the upstream `ghcr.i - **Mail-to-ticket:** When `web-app-stalwart` is present, the `helpdesk` mailbox is auto-provisioned and Zammad polls it to create tickets from incoming mail. - **Server-name alias:** `zammad.helpdesk.{{ DOMAIN_PRIMARY }}` is a true vhost alias of `helpdesk.{{ DOMAIN_PRIMARY }}` (not a 301 redirect). - **Bundled Elasticsearch:** Search engine ships with the role until a central `svc-db-elasticsearch` exists. Its disk watermarks follow the disk size (85 / 90 / 95 % used, requiring at most 200 / 150 / 100 GB free, `services.search.watermark`); the CI and development variants lower those caps to 10 / 5 / 2 GB. +- **Search allocation precheck:** [search_allocation_precheck.sh](files/shell/search_allocation_precheck.sh) creates a one-shard probe index named after the container and fails with the answer of `_cluster/allocation/explain`, which names the disk watermark when the data disk is too full, unless Elasticsearch allocates it. `init` runs it in front of `zammad-init`. In compose, the one-shot `precheck` service runs it first and `init` depends on that service, so `compose up` stops on a refusal. Swarm renders no `precheck` service, because `depends_on` does not gate `init` there. Instead the deploy waits until the newest `init` task is `Complete`: a refusing Elasticsearch leaves it `Failed`, the wait stops the deploy, and `docker service logs` of `init` carries the explanation. An `init` the stack deploy did not restart is already `Complete` and passes at once. - **Search index per Elasticsearch major:** The index lives in a directory named after the Elasticsearch major inside the `zammad_search` volume. A new major starts on an empty directory and `zammad-init` rebuilds the index from the database on the same deploy. - **Wizard bypass:** First deploy seeds `auto_wizard.json` so no manual setup UI step is required. diff --git a/roles/web-app-zammad/files/shell/search_allocation_precheck.sh b/roles/web-app-zammad/files/shell/search_allocation_precheck.sh new file mode 100755 index 0000000000..d448cb73fc --- /dev/null +++ b/roles/web-app-zammad/files/shell/search_allocation_precheck.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env bash +set -euo pipefail + +ready_seconds="${1:?ready_seconds required}" +poll_seconds="${2:?poll_seconds required}" +allocation_timeout_seconds="${3:?allocation_timeout_seconds required}" +shift 3 +[ "$#" -gt 0 ] || { + echo "search_allocation_precheck: entrypoint required" >&2 + exit 2 +} + +base="${ELASTICSEARCH_SCHEMA:?}://${ELASTICSEARCH_HOST:?}:${ELASTICSEARCH_PORT:?}" +probe="${ELASTICSEARCH_NAMESPACE:?}_allocation_probe_${HOSTNAME,,}" + +deadline=$(($(date +%s) + ready_seconds)) +until curl -fsS --connect-timeout 5 --max-time 10 -o /dev/null "${base}/_cluster/health"; do + if [ "$(date +%s)" -ge "$deadline" ]; then + echo "search_allocation_precheck: ${base} did not answer within ${ready_seconds}s" >&2 + exit 1 + fi + sleep "$poll_seconds" +done + +curl -fsS --connect-timeout 5 --max-time 30 -o /dev/null -X DELETE "${base}/${probe}?ignore_unavailable=true" +created=$(curl -sS --connect-timeout 5 --max-time "$((allocation_timeout_seconds + 30))" -X PUT "${base}/${probe}?wait_for_active_shards=1&timeout=${allocation_timeout_seconds}s" \ + -H 'Content-Type: application/json' \ + -d '{"settings":{"index":{"number_of_shards":1,"number_of_replicas":0}}}') +if ! grep -q '"shards_acknowledged":true' <<<"$created"; then + { + echo "search_allocation_precheck: Elasticsearch allocated no primary shard for ${probe} within ${allocation_timeout_seconds}s" + echo "$created" + curl -sS --connect-timeout 5 --max-time 30 "${base}/_cluster/allocation/explain" \ + -H 'Content-Type: application/json' \ + -d "{\"index\":\"${probe}\",\"shard\":0,\"primary\":true}" + echo + } >&2 + curl -sS --connect-timeout 5 --max-time 30 -o /dev/null -X DELETE "${base}/${probe}" + exit 1 +fi +curl -fsS --connect-timeout 5 --max-time 30 -o /dev/null -X DELETE "${base}/${probe}" +echo "search_allocation_precheck: Elasticsearch allocates shards, starting $1" +exec "$@" diff --git a/roles/web-app-zammad/meta/networks.yml b/roles/web-app-zammad/meta/networks.yml index 635fd46e23..d11d4412ec 100644 --- a/roles/web-app-zammad/meta/networks.yml +++ b/roles/web-app-zammad/meta/networks.yml @@ -1,4 +1,5 @@ --- +meshes: [] local: subnet: 192.168.66.0/24 overlay: diff --git a/roles/web-app-zammad/meta/services.yml b/roles/web-app-zammad/meta/services.yml index 17dfb56e5a..027746409a 100644 --- a/roles/web-app-zammad/meta/services.yml +++ b/roles/web-app-zammad/meta/services.yml @@ -156,12 +156,20 @@ elasticsearch: mem_reservation: 1g mem_limit: 2g pids_limit: 512 +precheck: + name: zammad-search-precheck + cpus: "0.2" + mem_reservation: 32m + mem_limit: 128m + pids_limit: 64 init: name: zammad-init cpus: "1.0" mem_reservation: 256m mem_limit: 1g pids_limit: 1024 + # nocheck: single-replica one-shot zammad-init migrates the database; the swarm wait reads one task + replicas: 1 scheduler: name: zammad-scheduler cpus: "1.0" diff --git a/roles/web-app-zammad/meta/volumes.yml b/roles/web-app-zammad/meta/volumes.yml index aa28d32a9a..9c76f0f22b 100644 --- a/roles/web-app-zammad/meta/volumes.yml +++ b/roles/web-app-zammad/meta/volumes.yml @@ -18,6 +18,15 @@ zammad_search: mounts: - service: elasticsearch target: /usr/share/elasticsearch/data +search_allocation_precheck: + type: config + source: "{{ [lookup('container', 'web-app-zammad', 'directories.config'), 'search_allocation_precheck.sh'] | path_join }}" + mode: "0555" + mounts: + - service: precheck + target: &usr_local_bin_search_allocation_precheck_sh_target /usr/local/bin/search_allocation_precheck.sh + - service: init + target: *usr_local_bin_search_allocation_precheck_sh_target auto_wizard: type: config source: "{{ [lookup('container', 'web-app-zammad', 'directories.volumes'), 'auto_wizard.json'] | path_join }}" diff --git a/roles/web-app-zammad/tasks/01_manager_ops.yml b/roles/web-app-zammad/tasks/01_manager_ops.yml index 3d57b7d8f3..f35d9c137e 100644 --- a/roles/web-app-zammad/tasks/01_manager_ops.yml +++ b/roles/web-app-zammad/tasks/01_manager_ops.yml @@ -1,4 +1,11 @@ --- +- name: "⏳ Transferring search_allocation_precheck.sh to {{ ZAMMAD_SEARCH_PRECHECK_ABS }}" + stack_host_copy: + src: shell/search_allocation_precheck.sh + dest: "{{ ZAMMAD_SEARCH_PRECHECK_ABS }}" + mode: "0555" + notify: compose-up + - name: "πŸ” grant CREATEDB to Zammad PostgreSQL role (init runs rake db:create)" database_query: mask_values: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}" @@ -29,6 +36,18 @@ delay: 5 until: zammad_rails_ready.rc == 0 +- name: "⏳ wait for the current Zammad init task to complete" + ansible.builtin.script: "{{ lookup('path_absolute', 'roles/sys-svc-compose/files/shell/swarm/job_state.sh') }}" + environment: + JOB: "{{ lookup('container_service', application_id, ZAMMAD_INIT_SERVICE) }}" + register: zammad_init_state + changed_when: false + retries: 60 + delay: 5 + until: zammad_init_state.rc != 1 + failed_when: zammad_init_state.rc != 0 + when: DEPLOYMENT_MODE == 'swarm' + - name: "▢️ process auto_wizard.json if Zammad setup wizard incomplete (idempotent)" ansible.builtin.shell: | set -euo pipefail diff --git a/roles/web-app-zammad/templates/compose.yml.j2 b/roles/web-app-zammad/templates/compose.yml.j2 index 7377652e83..6ccbeadba1 100644 --- a/roles/web-app-zammad/templates/compose.yml.j2 +++ b/roles/web-app-zammad/templates/compose.yml.j2 @@ -1,14 +1,30 @@ {% include 'roles/sys-svc-compose/templates/base.yml.j2' %} - {% set docker_restart_policy = 'on-failure' %} + {% if DEPLOYMENT_MODE == 'compose' %} + {% set service_name = ZAMMAD_PRECHECK_SERVICE %} + {% set docker_restart_policy = 'no' %} + {{ service_name }}: + {{ lookup('container_image', application_id, 'zammad') }} + {{ lookup('compose_only', 'container_name', ZAMMAD_PRECHECK_CONTAINER) }} + {% include 'roles/sys-svc-container/templates/base.yml.j2' %} + command: ["{{ ZAMMAD_SEARCH_PRECHECK_TARGET }}", "{{ ZAMMAD_SEARCH_READY_SECONDS }}", "{{ ZAMMAD_SEARCH_POLL_SECONDS }}", "{{ ZAMMAD_SEARCH_ALLOCATION_TIMEOUT_SECONDS }}", "true"] + {{ lookup('depends_on', {ZAMMAD_SEARCH_SERVICE: 'service_started'}, indent=4) }} + {{ lookup('container_volumes', service_name) | indent(4) }} + {{ lookup('container_extra_hosts') | indent(4) }} + {{ lookup('container_networks') | indent(4) }} + + {% endif %} {% set service_name = ZAMMAD_INIT_SERVICE %} + {% set docker_restart_policy = 'on-failure' %} {{ service_name }}: {{ lookup('container_image', application_id, 'zammad') }} {{ lookup('compose_only', 'container_name', ZAMMAD_INIT_CONTAINER) }} {% include 'roles/sys-svc-container/templates/base.yml.j2' %} - command: ["zammad-init"] + command: ["{{ ZAMMAD_SEARCH_PRECHECK_TARGET }}", "{{ ZAMMAD_SEARCH_READY_SECONDS }}", "{{ ZAMMAD_SEARCH_POLL_SECONDS }}", "{{ ZAMMAD_SEARCH_ALLOCATION_TIMEOUT_SECONDS }}", "/opt/zammad/bin/docker-entrypoint", "zammad-init"] {{ lookup('container_volumes', service_name) | indent(4) }} - {{ lookup('container_depends_on', application_id) | indent(4) }} + {{ lookup('container_depends_on', application_id, extra=({ + ZAMMAD_PRECHECK_SERVICE: {'condition': 'service_completed_successfully'}, +} if DEPLOYMENT_MODE == 'compose' else {})) | indent(4) }} {{ lookup('container_extra_hosts') | indent(4) }} {{ lookup('container_networks') | indent(4) }} diff --git a/roles/web-app-zammad/vars/main.yml b/roles/web-app-zammad/vars/main.yml index d62b08bc3a..e91c01dd64 100644 --- a/roles/web-app-zammad/vars/main.yml +++ b/roles/web-app-zammad/vars/main.yml @@ -2,6 +2,7 @@ application_id: "web-app-zammad" entity_name: "{{ application_id | entity_name }}" +ZAMMAD_PRECHECK_SERVICE: "precheck" ZAMMAD_INIT_SERVICE: "init" ZAMMAD_RAILS_SERVICE: "railsserver" ZAMMAD_WEBSOCKET_SERVICE: "websocket" @@ -10,6 +11,7 @@ ZAMMAD_NGINX_SERVICE: "nginx" ZAMMAD_SEARCH_SERVICE: "elasticsearch" ZAMMAD_MEMCACHED_SERVICE: "memcached" +ZAMMAD_PRECHECK_CONTAINER: "{{ lookup('config', application_id, 'services.' ~ ZAMMAD_PRECHECK_SERVICE ~ '.name') }}" ZAMMAD_INIT_CONTAINER: "{{ lookup('config', application_id, 'services.' ~ ZAMMAD_INIT_SERVICE ~ '.name') }}" ZAMMAD_RAILS_CONTAINER: "{{ lookup('config', application_id, 'services.' ~ ZAMMAD_RAILS_SERVICE ~ '.name') }}" ZAMMAD_RAILS_CONTAINER_ADDRESS: "{{ lookup('container_address', application_id, ZAMMAD_RAILS_SERVICE) }}" @@ -26,6 +28,11 @@ ZAMMAD_SEARCH_HEAP_MB: "{{ lookup('service_memory_mb', application_id, ZAMMAD_SE ZAMMAD_SEARCH_WATERMARK: "{{ lookup('config', application_id, 'services.search.watermark') }}" ZAMMAD_SEARCH_MAJOR: "{{ (lookup('config', application_id, 'services.search.version') | string).split('.') | first }}" ZAMMAD_SEARCH_DATA_DIR: "{{ [lookup('volume', application_id, 'zammad_search').target, ZAMMAD_SEARCH_MAJOR] | path_join }}" +ZAMMAD_SEARCH_PRECHECK_ABS: "{{ [lookup('container', application_id, 'directories.config'), 'search_allocation_precheck.sh'] | path_join }}" +ZAMMAD_SEARCH_PRECHECK_TARGET: "{{ (lookup('volume', application_id, 'search_allocation_precheck').mounts | first).target }}" +ZAMMAD_SEARCH_READY_SECONDS: 600 +ZAMMAD_SEARCH_POLL_SECONDS: 5 +ZAMMAD_SEARCH_ALLOCATION_TIMEOUT_SECONDS: 60 ZAMMAD_DB_POOL: 50 diff --git a/roles/web-svc-cdn/meta/networks.yml b/roles/web-svc-cdn/meta/networks.yml index 75c60b2e2d..cfce0d4094 100644 --- a/roles/web-svc-cdn/meta/networks.yml +++ b/roles/web-svc-cdn/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.220.0/24 diff --git a/roles/web-svc-collabora/README.md b/roles/web-svc-collabora/README.md index 73a558a354..8812164e35 100644 --- a/roles/web-svc-collabora/README.md +++ b/roles/web-svc-collabora/README.md @@ -6,19 +6,19 @@ This Ansible role deploys Collabora Online (CODE) in Docker to enable real-time, ## Overview -* **Dockerized Collabora CODE:** Uses the official `collabora/code` image. -* **NGINX Reverse Proxy:** Configures a public-facing proxy with TLS termination and WebSocket support for `/cool/` paths. -* **Docker Network Management:** Creates an isolated `/28` subnet for Collabora and connects containers securely. -* **Environment Configuration:** Generates a `.env` file that names the Nextcloud origin as the only allowed WOPI host (`aliasgroup1`) and passes the extra parameters to coolwsd. +- **Dockerized Collabora CODE:** Uses the official `collabora/code` image. +- **NGINX Reverse Proxy:** Configures a public-facing proxy with TLS termination and WebSocket support for `/cool/` paths. +- **Docker Network Management:** Creates an isolated `/28` subnet for Collabora and connects containers securely. +- **Environment Configuration:** Generates a `.env` file that names the Nextcloud origin as the only allowed WOPI host (`aliasgroup1`) and passes the extra parameters to coolwsd. ## Features -* Automatic creation of a dedicated Docker network for Collabora. -* Proxy configuration template for NGINX with long timeouts and WebSocket upgrades. -* Customizable domain names and ports via Ansible variables. -* Support for SSL termination at the proxy level. -* Integration hooks to restart NGINX and recreate Docker Compose stacks on changes. +- Automatic creation of a dedicated Docker network for Collabora. +- Proxy configuration template for NGINX with long timeouts and WebSocket upgrades. +- Customizable domain names and ports via Ansible variables. +- Support for SSL termination at the proxy level. +- Integration hooks to restart NGINX and recreate Docker Compose stacks on changes. ## Further Resources -* [Official Collabora CODE website](https://www.collaboraonline.com/code/) +- [Official Collabora CODE website](https://www.collaboraonline.com/code/) diff --git a/roles/web-svc-collabora/meta/networks.yml b/roles/web-svc-collabora/meta/networks.yml index 330a723307..9e14dc4a78 100644 --- a/roles/web-svc-collabora/meta/networks.yml +++ b/roles/web-svc-collabora/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.67.0/24 diff --git a/roles/web-svc-coturn/README.md b/roles/web-svc-coturn/README.md index 408c2caaa7..efe665584b 100644 --- a/roles/web-svc-coturn/README.md +++ b/roles/web-svc-coturn/README.md @@ -12,38 +12,38 @@ Coturn solves this by acting as a **relay server** and/or **discovery service** More background: -* Wikipedia: [Traversal Using Relays around NAT](https://en.wikipedia.org/wiki/Traversal_Using_Relays_around_NAT) -* Wikipedia: [Session Traversal Utilities for NAT](https://en.wikipedia.org/wiki/STUN) -* Official Coturn Docs: [https://github.com/coturn/coturn/wiki](https://github.com/coturn/coturn/wiki) +- Wikipedia: [Traversal Using Relays around NAT](https://en.wikipedia.org/wiki/Traversal_Using_Relays_around_NAT) +- Wikipedia: [Session Traversal Utilities for NAT](https://en.wikipedia.org/wiki/STUN) +- Official Coturn Docs: [https://github.com/coturn/coturn/wiki](https://github.com/coturn/coturn/wiki) ## Overview This role deploys Coturn via Docker Compose using the `sys-stk-semi-stateless` stack. It automatically configures: -* TURN and STUN listening ports -* Relay port ranges -* TLS certificates (via Let’s Encrypt integration) -* Long-term credentials and/or REST API secrets +- TURN and STUN listening ports +- Relay port ranges +- TLS certificates (via Let’s Encrypt integration) +- Long-term credentials and/or REST API secrets Typical use cases: -* Nextcloud Talk -* Jitsi -* BigBlueButton -* Any WebRTC-based application +- Nextcloud Talk +- Jitsi +- BigBlueButton +- Any WebRTC-based application ## Features -* Stateless container deployment (no database or persistent volume required) -* Automatic TLS handling via `sys-stk-front-base` -* TURN and STUN support over TCP and UDP -* Configurable relay port ranges for scaling -* Integration into Infinito.Nexus inventory/variable system +- Stateless container deployment (no database or persistent volume required) +- Automatic TLS handling via `sys-stk-front-base` +- TURN and STUN support over TCP and UDP +- Configurable relay port ranges for scaling +- Integration into Infinito.Nexus inventory/variable system ## Further Resources -* Coturn Project: [github.com/coturn/coturn](https://github.com/coturn/coturn) -* Coturn Wiki: [github.com/coturn/coturn/wiki](https://github.com/coturn/coturn/wiki) -* TURN on Wikipedia: [en.wikipedia.org/wiki/Traversal_Using_Relays_around_NAT](https://en.wikipedia.org/wiki/Traversal_Using_Relays_around_NAT) -* STUN on Wikipedia: [en.wikipedia.org/wiki/STUN](https://en.wikipedia.org/wiki/STUN) +- Coturn Project: [github.com/coturn/coturn](https://github.com/coturn/coturn) +- Coturn Wiki: [github.com/coturn/coturn/wiki](https://github.com/coturn/coturn/wiki) +- TURN on Wikipedia: [en.wikipedia.org/wiki/Traversal_Using_Relays_around_NAT](https://en.wikipedia.org/wiki/Traversal_Using_Relays_around_NAT) +- STUN on Wikipedia: [en.wikipedia.org/wiki/STUN](https://en.wikipedia.org/wiki/STUN) diff --git a/roles/web-svc-coturn/meta/networks.yml b/roles/web-svc-coturn/meta/networks.yml index c0274f02c5..6745feaa2e 100644 --- a/roles/web-svc-coturn/meta/networks.yml +++ b/roles/web-svc-coturn/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.68.0/24 diff --git a/roles/web-svc-libretranslate/meta/networks.yml b/roles/web-svc-libretranslate/meta/networks.yml index 55c44ae48f..1aea3c0e63 100644 --- a/roles/web-svc-libretranslate/meta/networks.yml +++ b/roles/web-svc-libretranslate/meta/networks.yml @@ -8,6 +8,7 @@ cache: argos-net.com: repo: raw-argos-net read_timeout: "1800s" +meshes: [] local: subnet: 192.168.69.0/24 overlay: diff --git a/roles/web-svc-logout/meta/networks.yml b/roles/web-svc-logout/meta/networks.yml index d5c7022553..454d22d35a 100644 --- a/roles/web-svc-logout/meta/networks.yml +++ b/roles/web-svc-logout/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.70.0/24 diff --git a/roles/web-svc-onlyoffice/README.md b/roles/web-svc-onlyoffice/README.md index a405f00ec4..a52a88baff 100644 --- a/roles/web-svc-onlyoffice/README.md +++ b/roles/web-svc-onlyoffice/README.md @@ -7,22 +7,22 @@ It automates the setup of the Document Server container, NGINX reverse proxy con ## Overview -* **Dockerized ONLYOFFICE Document Server:** Uses the official `onlyoffice/documentserver` image. -* **NGINX Reverse Proxy:** Configures a public-facing proxy with TLS termination for `/` and internal API calls. -* **Docker Network Management:** Creates an isolated `/28` subnet for ONLYOFFICE and connects containers securely. -* **Environment Configuration:** Generates a `.env` file containing domain, credentials, and JWT configuration for secure document editing. +- **Dockerized ONLYOFFICE Document Server:** Uses the official `onlyoffice/documentserver` image. +- **NGINX Reverse Proxy:** Configures a public-facing proxy with TLS termination for `/` and internal API calls. +- **Docker Network Management:** Creates an isolated `/28` subnet for ONLYOFFICE and connects containers securely. +- **Environment Configuration:** Generates a `.env` file containing domain, credentials, and JWT configuration for secure document editing. ## Features -* Automatic creation of a dedicated Docker network for ONLYOFFICE. -* Proxy configuration template for NGINX with long timeouts. -* Customizable domain names and ports via Ansible variables. -* Support for SSL/TLS termination at the proxy level. -* Optional JWT signing for secure communication between Nextcloud and Document Server. -* Integration hooks to restart NGINX and recreate Docker Compose stacks on changes. +- Automatic creation of a dedicated Docker network for ONLYOFFICE. +- Proxy configuration template for NGINX with long timeouts. +- Customizable domain names and ports via Ansible variables. +- Support for SSL/TLS termination at the proxy level. +- Optional JWT signing for secure communication between Nextcloud and Document Server. +- Integration hooks to restart NGINX and recreate Docker Compose stacks on changes. ## Further Resources -* [Official ONLYOFFICE Document Server Documentation](https://helpcenter.onlyoffice.com/docs/) -* [Nextcloud β†’ ONLYOFFICE Integration App](https://apps.nextcloud.com/apps/onlyoffice) -* [ONLYOFFICE Document Server on Docker Hub](https://hub.docker.com/r/onlyoffice/documentserver) +- [Official ONLYOFFICE Document Server Documentation](https://helpcenter.onlyoffice.com/docs/) +- [Nextcloud β†’ ONLYOFFICE Integration App](https://apps.nextcloud.com/apps/onlyoffice) +- [ONLYOFFICE Document Server on Docker Hub](https://hub.docker.com/r/onlyoffice/documentserver) diff --git a/roles/web-svc-onlyoffice/meta/networks.yml b/roles/web-svc-onlyoffice/meta/networks.yml index 24d91275f4..b538115618 100644 --- a/roles/web-svc-onlyoffice/meta/networks.yml +++ b/roles/web-svc-onlyoffice/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.71.0/24 diff --git a/roles/web-svc-simpleicons/meta/networks.yml b/roles/web-svc-simpleicons/meta/networks.yml index 2479eb5ed5..66e8350b5d 100644 --- a/roles/web-svc-simpleicons/meta/networks.yml +++ b/roles/web-svc-simpleicons/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.72.0/24 diff --git a/roles/web-svc-xmpp/meta/networks.yml b/roles/web-svc-xmpp/meta/networks.yml index 402ece896b..bd449d328d 100644 --- a/roles/web-svc-xmpp/meta/networks.yml +++ b/roles/web-svc-xmpp/meta/networks.yml @@ -1,3 +1,4 @@ --- +meshes: [] local: subnet: 192.168.73.0/24 diff --git a/scripts/tests/deploy/swarm/routine/00_one.sh b/scripts/tests/deploy/swarm/routine/00_one.sh index 5e1015b2d6..be215fdda2 100755 --- a/scripts/tests/deploy/swarm/routine/00_one.sh +++ b/scripts/tests/deploy/swarm/routine/00_one.sh @@ -20,6 +20,8 @@ set -euo pipefail # variant optional matrix variant pin # disable optional provider keys to render disabled, # minus SWARM_REQUIRED_SERVICES +# INFINITO_SWARM_VPN 'true' deploys the WireGuard mesh with the +# cluster; anything else leaves it out entirely # # Exports: # MGR/WRK1/WRK2/NFS_SERVER/BACKUP_NODE and their *_IP peers, from the topology SPOT @@ -174,6 +176,7 @@ if [ "$(id -u)" -ne 0 ]; then "NFS_IP=${NFS_IP}" "variant=${variant:-}" "disable=${disable:-}" + "INFINITO_SWARM_VPN=${INFINITO_SWARM_VPN:-}" "${matrix_cmd[@]}" ) fi diff --git a/scripts/tests/deploy/swarm/routine/backup/base.sh b/scripts/tests/deploy/swarm/routine/backup/base.sh index 335a3199ae..cbc385af75 100755 --- a/scripts/tests/deploy/swarm/routine/backup/base.sh +++ b/scripts/tests/deploy/swarm/routine/backup/base.sh @@ -49,6 +49,15 @@ DEV_MOUNT="$(python3 -c "import sys, yaml; print(yaml.safe_load(open(sys.argv[1] DEV_TARGET="$(python3 -c "import sys, yaml; print(yaml.safe_load(open(sys.argv[1]))['applications']['svc-bkp-local-2-device']['services']['local-2-device']['target'])" "${DRILL_EXTRAS}")" DEV_DEST="${DEV_MOUNT}${DEV_TARGET}" +if [ "${DRILL_PROBE:-false}" = "true" ]; then + if [ -n "${PRIMARY_NFS_VOLUME}" ]; then + echo "DRILL=yes" + else + echo "DRILL=no" + fi + exit 0 +fi + if [ -z "${PRIMARY_NFS_VOLUME}" ]; then echo "SKIP drill: ${APP_ID} declares no NFS-flagged volume β€” nothing to prove a restore against" exit 0 diff --git a/tasks/stages/01_constructor.yml b/tasks/stages/01_constructor.yml index a318b4b50f..1076e5eadb 100644 --- a/tasks/stages/01_constructor.yml +++ b/tasks/stages/01_constructor.yml @@ -33,6 +33,20 @@ ansible.builtin.include_role: name: user-root +- name: "πŸ₯Ύ Bootstrap svc-net-wireguard" + when: "'svc-net-wireguard' | application_allowed(group_names, lookup('deployment').whitelist)" + block: + - name: 🧊 Carry the applications SPOT through the mesh bootstrap + applications_carrier: {} + + - name: "πŸ”Œ Load svc-net-wireguard" + ansible.builtin.include_role: + name: svc-net-wireguard + + - name: 🧊 Drop the mesh-bootstrap carrier so later stages re-render + applications_carrier: + clear: true + - name: πŸ”„ update device ansible.builtin.include_role: name: update diff --git a/tests/integration/ansible/jinja/test_variable_definitions.py b/tests/integration/ansible/jinja/test_variable_definitions.py index 0092ae1603..6237a699e7 100644 --- a/tests/integration/ansible/jinja/test_variable_definitions.py +++ b/tests/integration/ansible/jinja/test_variable_definitions.py @@ -240,6 +240,7 @@ class TestVariableDefinitions(unittest.TestCase): "ansible_play_hosts", "role_path", "playbook_dir", + "ansible_playbook_python", "ansible_become_password", "inventory_dir", "ansible_env", @@ -288,6 +289,7 @@ class TestVariableDefinitions(unittest.TestCase): "ansible_play_hosts", "role_path", "playbook_dir", + "ansible_playbook_python", "ansible_become_password", "inventory_dir", "ansible_env", diff --git a/tests/integration/meta/workflows/test_ci_retrigger_inputs.py b/tests/integration/meta/workflows/test_ci_retrigger_inputs.py index 6d093f6387..4f4c0075a0 100644 --- a/tests/integration/meta/workflows/test_ci_retrigger_inputs.py +++ b/tests/integration/meta/workflows/test_ci_retrigger_inputs.py @@ -43,6 +43,8 @@ _VALUES = { "filesystem": "btrfs", "architectures": "arm64", "tor": "enforced", + "vpn": "enforced", + "meshes": "inventories/examples/wireguard-three-meshes/wireguard.yml", "offset": "40", "chunk_size": "25", "chunk_gate": "false", diff --git a/tests/lint/ansible/roles/meta/test_mesh_subnet_pool.py b/tests/lint/ansible/roles/meta/test_mesh_subnet_pool.py new file mode 100644 index 0000000000..8b2cd7454c --- /dev/null +++ b/tests/lint/ansible/roles/meta/test_mesh_subnet_pool.py @@ -0,0 +1,137 @@ +from __future__ import annotations + +import ipaddress +import unittest + +import jinja2 + +from cli.administration.inventory.mesh.inventory import specs_of +from utils.cache.yaml import load_yaml_any +from utils.networks.mesh import APPLICATION_ID, INTERFACES_KEY, MESHES_KEY +from utils.roles.deploy import role_has_stack +from utils.roles.mapping import ROLE_FILE_META_NETWORKS + +from . import PROJECT_ROOT + +NETWORKS_FILE = PROJECT_ROOT / "group_vars" / "all" / "08_networks.yml" +DEVELOPMENT_LAYOUT = PROJECT_ROOT / "inventories" / "development" / "wireguard.yml" +EXAMPLES_DIR = PROJECT_ROOT / "inventories" / "examples" + + +def layout_files() -> list: + found = [DEVELOPMENT_LAYOUT] if DEVELOPMENT_LAYOUT.is_file() else [] + found += sorted(EXAMPLES_DIR.glob("*/wireguard.yml")) + return found + + +def _applications(path) -> dict: + return (load_yaml_any(str(path), default_if_missing={}) or {}).get( + "applications" + ) or {} + + +def _pool() -> ipaddress.IPv4Network: + data = load_yaml_any(str(NETWORKS_FILE), default_if_missing={}) or {} + pool = data.get("NETWORK_MESH_POOL") + if isinstance(pool, str) and "{{" in pool: + pool = jinja2.Template( + pool, autoescape=jinja2.select_autoescape(default_for_string=False) + ).render(**data) + if not isinstance(pool, str): + raise TypeError(f"{NETWORKS_FILE} must declare NETWORK_MESH_POOL as a string") + return ipaddress.ip_network(pool, strict=True) + + +class TestTheRolesShipNoMesh(unittest.TestCase): + def test_every_mesh_field_a_role_carries_is_empty(self) -> None: + carried = 0 + for path in sorted( + (PROJECT_ROOT / "roles").glob(f"*/{ROLE_FILE_META_NETWORKS}") + ): + networks = load_yaml_any(str(path), default_if_missing={}) or {} + for key in (MESHES_KEY, INTERFACES_KEY): + if key not in networks: + continue + carried += 1 + with self.subTest(role=path.parent.parent.name, key=key): + self.assertEqual( + [], + networks[key], + f"{path}: networks.{key} must ship empty; the values " + "belong to the deployment's inventory", + ) + self.assertGreater(carried, 0, "no role carries a mesh field at all") + + def test_every_stack_role_carries_the_membership_field(self) -> None: + stack_roles = [ + role + for role in sorted((PROJECT_ROOT / "roles").iterdir()) + if role.is_dir() and role_has_stack(role) + ] + self.assertGreater(len(stack_roles), 0, "no stack role found") + for role in stack_roles: + networks = load_yaml_any( + str(role / ROLE_FILE_META_NETWORKS), default_if_missing={} + ) + with self.subTest(role=role.name): + self.assertIn( + MESHES_KEY, + networks or {}, + f"{role.name}/{ROLE_FILE_META_NETWORKS} must carry " + f"networks.{MESHES_KEY}: [] so a compose host can join meshes " + "through it", + ) + + def test_the_declaring_role_carries_both_fields(self) -> None: + networks = load_yaml_any( + str(PROJECT_ROOT / "roles" / APPLICATION_ID / ROLE_FILE_META_NETWORKS), + default_if_missing={}, + ) + self.assertEqual({MESHES_KEY: [], INTERFACES_KEY: []}, networks) + + +class TestTheShippedLayouts(unittest.TestCase): + def setUp(self) -> None: + self.files = layout_files() + if not self.files: + self.skipTest("the repository ships no WireGuard layout") + + def test_every_declared_mesh_sits_inside_the_pool(self) -> None: + pool = _pool() + for path in self.files: + for spec in specs_of(_applications(path), []): + with self.subTest( + layout=str(path.relative_to(PROJECT_ROOT)), mesh=spec.name + ): + self.assertTrue( + ipaddress.ip_network(spec.subnet, strict=True).subnet_of(pool), + f"{path}: mesh '{spec.name}' subnet {spec.subnet} sits " + f"outside NETWORK_MESH_POOL ({pool})", + ) + + def test_no_two_meshes_of_one_layout_share_a_listen_port(self) -> None: + for path in self.files: + ports = [spec.listen_port for spec in specs_of(_applications(path), [])] + duplicated = sorted({port for port in ports if ports.count(port) > 1}) + with self.subTest(layout=str(path.relative_to(PROJECT_ROOT))): + self.assertEqual([], duplicated, f"{path}: shared listen port(s)") + + def test_every_membership_names_a_declared_mesh(self) -> None: + for path in self.files: + applications = _applications(path) + declared = {spec.name for spec in specs_of(applications, [])} + for role, config in applications.items(): + if role == APPLICATION_ID: + continue + joined = ((config or {}).get("networks") or {}).get(MESHES_KEY) or [] + with self.subTest( + layout=str(path.relative_to(PROJECT_ROOT)), role=role + ): + self.assertLessEqual(set(joined), declared) + + def test_the_platform_itself_declares_no_meshes(self) -> None: + shipped = load_yaml_any( + str(PROJECT_ROOT / "group_vars" / "all" / "21_wireguard.yml"), + default_if_missing={}, + ) + self.assertNotIn("WIREGUARD_MESHES", shipped or {}) diff --git a/tests/unit/python/cli/administration/inventory/credentials/test_reset_cli.py b/tests/unit/python/cli/administration/inventory/credentials/test_reset_cli.py index a5f4c16444..8f59073c3c 100644 --- a/tests/unit/python/cli/administration/inventory/credentials/test_reset_cli.py +++ b/tests/unit/python/cli/administration/inventory/credentials/test_reset_cli.py @@ -55,6 +55,45 @@ class TestMirrorHostVars(unittest.TestCase): "rotated: true\n", ) + def test_a_kept_subtree_stays_with_its_own_host(self): + self.source.write_text( + "rotated: true\napplications:\n svc-net-wireguard:\n" + " meshes:\n swarm:\n host: mgr-01\n", + encoding="utf-8", + ) + (self.host_vars_dir / "wrk-01.yml").write_text( + "rotated: false\napplications:\n svc-net-wireguard:\n" + " meshes:\n swarm:\n host: wrk-01\n", + encoding="utf-8", + ) + + _mirror_host_vars( + self.host_vars_dir, self.source, keep=["applications.svc-net-wireguard"] + ) + + content = (self.host_vars_dir / "wrk-01.yml").read_text( # nocheck: cache-read + encoding="utf-8" + ) + self.assertIn("rotated: true", content) + self.assertIn("host: wrk-01", content) + self.assertNotIn("host: mgr-01", content) + + def test_a_host_without_the_kept_subtree_takes_the_source(self): + self.source.write_text( + "applications:\n svc-net-wireguard:\n meshes:\n" + " swarm:\n host: mgr-01\n", + encoding="utf-8", + ) + + _mirror_host_vars( + self.host_vars_dir, self.source, keep=["applications.svc-net-wireguard"] + ) + + content = (self.host_vars_dir / "wrk-01.yml").read_text( # nocheck: cache-read + encoding="utf-8" + ) + self.assertIn("host: mgr-01", content) + def test_a_backup_is_not_mirrored_over(self): backup = _backup(self.source) _mirror_host_vars(self.host_vars_dir, self.source) diff --git a/tests/unit/python/cli/administration/inventory/mesh/__init__.py b/tests/unit/python/cli/administration/inventory/mesh/__init__.py new file mode 100644 index 0000000000..86efabd459 --- /dev/null +++ b/tests/unit/python/cli/administration/inventory/mesh/__init__.py @@ -0,0 +1,3 @@ +from pathlib import Path + +PROJECT_ROOT: Path = Path(__file__).resolve().parents[7] diff --git a/tests/unit/python/cli/administration/inventory/mesh/test_cli.py b/tests/unit/python/cli/administration/inventory/mesh/test_cli.py new file mode 100644 index 0000000000..3c5e41b559 --- /dev/null +++ b/tests/unit/python/cli/administration/inventory/mesh/test_cli.py @@ -0,0 +1,190 @@ +from __future__ import annotations + +import tempfile +import unittest +from pathlib import Path + +from cli.administration.inventory.mesh.__main__ import main +from utils.cache.yaml import dump_yaml + +from .test_write import ( + BACKUP_INVENTORY, + CLUSTER_INVENTORY, + HOSTS, + LAYOUT, + VAULT_PASSWORD, + interface_entries, + layout_applications, +) + +CONTROLLER = "deploy-controller" +SWARM_HOSTS = ("swarm-mgr-01", "swarm-wrk-01", "swarm-wrk-02") + + +class TestMeshCli(unittest.TestCase): + def setUp(self): + self._tmp = tempfile.TemporaryDirectory() + root = Path(self._tmp.name) + self.host_vars = root / "host_vars" + self.host_vars.mkdir() + layout = layout_applications(LAYOUT) + for host in HOSTS: + dump_yaml(str(self.host_vars / f"{host}.yml"), {"applications": layout}) + self.cluster = root / "devices.yml" + self.cluster.write_text(CLUSTER_INVENTORY, encoding="utf-8") + self.backup = root / "backup.yml" + self.backup.write_text(BACKUP_INVENTORY, encoding="utf-8") + self.vault_file = root / ".password" + self.vault_file.write_text(VAULT_PASSWORD, encoding="utf-8") + + def tearDown(self): + self._tmp.cleanup() + + def _text(self, host: str) -> str: + path = self.host_vars / f"{host}.yml" + return path.read_text(encoding="utf-8") # nocheck: cache-read + + def _argv(self, *extra: str) -> list[str]: + return [ + "--inventory", + str(self.cluster), + "--inventory", + str(self.backup), + "--host-vars-dir", + str(self.host_vars), + "--vault-password-file", + str(self.vault_file), + *extra, + ] + + def _mesh_names(self, host: str) -> list[str]: + return sorted( + entry["name"] for entry in interface_entries(self.host_vars, host) + ) + + def test_one_invocation_writes_every_member(self): + self.assertEqual(main(self._argv()), 0) + for host in HOSTS: + with self.subTest(host=host): + self.assertIn("$ANSIBLE_VAULT", self._text(host)) + + def test_a_missing_host_vars_dir_fails_rather_than_writing_nothing(self): + argv = self._argv() + argv[argv.index("--host-vars-dir") + 1] = str(self.host_vars / "absent") + self.assertEqual(main(argv), 1) + + def test_an_unknown_mesh_name_fails(self): + self.assertEqual(main(self._argv("--mesh", "no-such-mesh")), 1) + + def test_restricting_to_one_mesh_leaves_the_other_unwritten(self): + self.assertEqual(main(self._argv("--mesh", "swarm")), 0) + self.assertEqual([], self._mesh_names("nfs-server")) + + def test_the_controller_is_pruned_although_no_group_holds_it(self): + argv = self._argv("--controller", CONTROLLER, "--controller-mesh", "swarm") + self.assertEqual(main(argv), 0) + (self.host_vars / f"{CONTROLLER}.yml").write_text( + self._text("swarm-mgr-01"), encoding="utf-8" + ) + + self.assertEqual(main(argv), 0) + self.assertEqual(["swarm"], self._mesh_names(CONTROLLER)) + + def test_the_controller_joins_the_first_declared_mesh_by_default(self): + self.assertEqual(main(self._argv("--controller", CONTROLLER)), 0) + self.assertEqual(["swarm"], self._mesh_names(CONTROLLER)) + + def test_a_host_vars_tree_without_declarations_fails(self): + for host in HOSTS: + (self.host_vars / f"{host}.yml").write_text("---\n", encoding="utf-8") + self.assertEqual(main(self._argv()), 1) + + def test_a_controller_mesh_nobody_declared_fails(self): + argv = self._argv("--controller", CONTROLLER, "--controller-mesh", "absent") + self.assertEqual(main(argv), 1) + + def test_an_endpoint_replaces_the_hostname_peers_dial(self): + argv = self._argv("--endpoint", "swarm-mgr-01=192.168.244.10") + self.assertEqual(main(argv), 0) + text = self._text("swarm-wrk-01") + self.assertIn("endpoint: 192.168.244.10", text) + self.assertIn("host: swarm-mgr-01", text) + + def test_a_host_without_an_endpoint_is_dialled_by_name(self): + self.assertEqual(main(self._argv()), 0) + self.assertIn("endpoint: swarm-mgr-01", self._text("swarm-wrk-01")) + + def test_a_malformed_endpoint_aborts(self): + with self.assertRaises(SystemExit): + main(self._argv("--endpoint", "swarm-mgr-01")) + + def test_a_rerun_keeps_the_controller_key_too(self): + argv = self._argv("--controller", CONTROLLER, "--controller-mesh", "swarm") + self.assertEqual(main(argv), 0) + before = self._text(CONTROLLER) + + self.assertEqual(main(argv), 0) + self.assertEqual(self._text(CONTROLLER), before) + + def test_a_rotation_gives_a_host_one_key_across_every_mesh(self): + self.assertEqual(main(self._argv()), 0) + self.assertEqual(main(self._argv("--rotate")), 0) + + own = [ + entry["public_key"] + for entry in interface_entries(self.host_vars, "swarm-mgr-01") + ] + spoke_peers = [ + peer["public_key"] + for entry in interface_entries(self.host_vars, "swarm-wrk-01") + for peer in entry["peers"] + ] + + self.assertEqual(2, len(own)) + self.assertEqual(1, len(set(own))) + self.assertIn(own[0], spoke_peers) + + def _address(self, host: str, mesh_name: str) -> str: + return next( + entry["address"] + for entry in interface_entries(self.host_vars, host) + if entry["name"] == mesh_name + ) + + def test_growing_the_cluster_leaves_every_member_on_its_address(self): + self.assertEqual(main(self._argv()), 0) + before = {host: self._address(host, "swarm") for host in SWARM_HOSTS} + + dump_yaml( + str(self.host_vars / "alpha-wrk-00.yml"), + {"applications": layout_applications(LAYOUT)}, + ) + self.cluster.write_text( + CLUSTER_INVENTORY.replace( + " swarm-wrk-01: {}", + " alpha-wrk-00: {}\n swarm-wrk-01: {}", + ), + encoding="utf-8", + ) + self.assertEqual(main(self._argv()), 0) + + for host, address in before.items(): + with self.subTest(host=host): + self.assertEqual(self._address(host, "swarm"), address) + self.assertNotIn(self._address("alpha-wrk-00", "swarm"), set(before.values())) + + def test_a_rotation_leaves_every_member_on_its_address(self): + self.assertEqual(main(self._argv()), 0) + before = {host: self._address(host, "swarm") for host in SWARM_HOSTS} + self.assertEqual(main(self._argv("--rotate")), 0) + for host, address in before.items(): + with self.subTest(host=host): + self.assertEqual(self._address(host, "swarm"), address) + + def test_a_rerun_is_a_no_op(self): + self.assertEqual(main(self._argv()), 0) + before = {host: self._text(host) for host in HOSTS} + self.assertEqual(main(self._argv()), 0) + for host in HOSTS: + with self.subTest(host=host): + self.assertEqual(self._text(host), before[host]) diff --git a/tests/unit/python/cli/administration/inventory/mesh/test_full_mesh.py b/tests/unit/python/cli/administration/inventory/mesh/test_full_mesh.py new file mode 100644 index 0000000000..dc89a3a3ac --- /dev/null +++ b/tests/unit/python/cli/administration/inventory/mesh/test_full_mesh.py @@ -0,0 +1,221 @@ +from __future__ import annotations + +import io +import tempfile +import unittest +from contextlib import redirect_stdout +from pathlib import Path + +from cli.administration.inventory.mesh.__main__ import main +from cli.administration.inventory.mesh.inventory import ( + declared_specs, + groups_of, + topology_of, +) +from cli.administration.inventory.mesh.plan import plan_mesh, primary_meshes +from utils.cache.yaml import dump_yaml + +from .test_write import VAULT_PASSWORD, interface_entries + +DECLARED = { + "svc-net-wireguard": { + "networks": { + "meshes": [ + {"name": "alpha", "subnet": "10.100.20.0/24", "listen_port": 51840}, + {"name": "beta", "subnet": "10.100.21.0/24", "listen_port": 51841}, + ] + } + } +} + +INVENTORY = """\ +all: + children: + svc-net-wireguard: + hosts: + host-1: {} + host-2: {} + host-3: {} + host-4: {} + web-app-a: + hosts: + host-1: {} + host-2: {} + host-3: {} + host-4: {} +""" + +MEMBERSHIP = { + "host-1": ["alpha"], + "host-2": ["alpha", "beta"], + "host-3": ["beta"], + "host-4": ["alpha"], +} + + +class FullMeshOnDisk(unittest.TestCase): + def setUp(self): + self._tmp = tempfile.TemporaryDirectory() + self.addCleanup(self._tmp.cleanup) + self.root = Path(self._tmp.name) + self.host_vars = self.root / "host_vars" + self.host_vars.mkdir() + self.inventory = self.root / "devices.yml" + self.inventory.write_text(INVENTORY, encoding="utf-8") + self.vault_file = self.root / ".password" + self.vault_file.write_text(VAULT_PASSWORD, encoding="utf-8") + for host, meshes in MEMBERSHIP.items(): + self._host(host, meshes) + + def _host(self, host: str, meshes: list[str], declared: dict | None = None): + applications = { + **(DECLARED if declared is None else declared), + "web-app-a": {"networks": {"meshes": meshes}}, + } + dump_yaml(str(self.host_vars / f"{host}.yml"), {"applications": applications}) + + def _groups(self): + return groups_of([self.inventory]) + + def _write(self) -> str: + argv = [ + "--inventory", + str(self.inventory), + "--host-vars-dir", + str(self.host_vars), + "--vault-password-file", + str(self.vault_file), + ] + out = io.StringIO() + with redirect_stdout(out): + self.assertEqual(0, main(argv)) + return out.getvalue() + + def _entry(self, host: str, mesh: str) -> dict: + return next( + entry + for entry in interface_entries(self.host_vars, host) + if entry["name"] == mesh + ) + + +class TestDeclarations(FullMeshOnDisk, unittest.TestCase): + def test_every_host_may_declare_the_meshes(self): + specs = declared_specs(self._groups(), self.host_vars, [self.inventory]) + self.assertEqual(["alpha", "beta"], [spec.name for spec in specs]) + + def test_a_host_declaring_nothing_reads_the_others(self): + self._host("host-1", ["alpha"], declared={}) + specs = declared_specs(self._groups(), self.host_vars, [self.inventory]) + self.assertEqual(["alpha", "beta"], [spec.name for spec in specs]) + + def test_hosts_declaring_different_meshes_are_refused(self): + other = { + "svc-net-wireguard": { + "networks": { + "meshes": [ + { + "name": "alpha", + "subnet": "10.100.30.0/24", + "listen_port": 51840, + } + ] + } + } + } + self._host("host-3", ["alpha"], declared=other) + with self.assertRaises(ValueError) as raised: + declared_specs(self._groups(), self.host_vars, [self.inventory]) + self.assertIn("host-3", str(raised.exception)) + + def test_no_host_declaring_any_mesh_is_refused(self): + for host, meshes in MEMBERSHIP.items(): + self._host(host, meshes, declared={}) + with self.assertRaises(ValueError) as raised: + declared_specs(self._groups(), self.host_vars, [self.inventory]) + self.assertIn("networks.meshes", str(raised.exception)) + + +class TestPlanning(FullMeshOnDisk, unittest.TestCase): + def setUp(self): + super().setUp() + groups = self._groups() + self.specs = declared_specs(groups, self.host_vars, [self.inventory]) + self.topology = topology_of(groups, self.host_vars, self.specs) + self.alpha = plan_mesh(self.specs[0], self.topology) + + def test_there_is_no_hub(self): + self.assertIsNone(self.topology.hub) + self.assertTrue(self.alpha.is_full) + self.assertFalse(any(member.is_hub for member in self.alpha.members)) + + def test_every_member_peers_with_every_other(self): + hosts = {member.host for member in self.alpha.members} + self.assertEqual({"host-1", "host-2", "host-4"}, hosts) + for host in hosts: + with self.subTest(host=host): + peers = {peer.host for peer in self.alpha.peers_of(host)} + self.assertEqual(hosts - {host}, peers) + + def test_no_two_members_share_an_address(self): + addresses = [member.address for member in self.alpha.members] + self.assertEqual(len(addresses), len(set(addresses))) + + def test_a_host_of_two_meshes_is_primary_on_the_first(self): + primary = primary_meshes(self.specs, self.topology) + self.assertEqual("alpha", primary["host-2"]) + self.assertEqual("beta", primary["host-3"]) + + +class TestWritten(FullMeshOnDisk, unittest.TestCase): + def setUp(self): + super().setUp() + self.out = self._write() + + def test_the_cli_reports_full_meshes(self): + self.assertIn("mesh 'alpha': full mesh of 3 member(s)", self.out) + self.assertIn("mesh 'beta': full mesh of 2 member(s)", self.out) + + def test_every_peer_is_pinned_to_its_own_address(self): + for host, meshes in MEMBERSHIP.items(): + for mesh in meshes: + entry = self._entry(host, mesh) + for peer in entry["peers"]: + with self.subTest(host=host, mesh=mesh, peer=peer["host"]): + self.assertEqual(f"{peer['address']}/32", peer["allowed_ips"]) + self.assertFalse(peer["is_hub"]) + + def test_no_member_is_a_hub(self): + for host, meshes in MEMBERSHIP.items(): + for mesh in meshes: + with self.subTest(host=host, mesh=mesh): + self.assertFalse(self._entry(host, mesh)["is_hub"]) + + def test_a_host_of_one_mesh_holds_no_peer_of_the_other(self): + beta_only = {"host-3"} + for host in ("host-1", "host-4"): + with self.subTest(host=host): + self.assertEqual( + ["alpha"], + [e["name"] for e in interface_entries(self.host_vars, host)], + ) + peers = {p["host"] for p in self._entry(host, "alpha")["peers"]} + self.assertFalse(peers & beta_only) + + def test_the_host_in_both_meshes_peers_with_both(self): + alpha = {p["host"] for p in self._entry("host-2", "alpha")["peers"]} + beta = {p["host"] for p in self._entry("host-2", "beta")["peers"]} + self.assertEqual({"host-1", "host-4"}, alpha) + self.assertEqual({"host-3"}, beta) + + def test_a_second_run_leaves_every_file_byte_identical(self): + before = { + path.name: path.read_bytes() # nocheck: cache-read + for path in self.host_vars.glob("*.yml") + } + self._write() + after = { + path.name: path.read_bytes() # nocheck: cache-read + for path in self.host_vars.glob("*.yml") + } + self.assertEqual(before, after) diff --git a/tests/unit/python/cli/administration/inventory/mesh/test_inventory.py b/tests/unit/python/cli/administration/inventory/mesh/test_inventory.py new file mode 100644 index 0000000000..7a7d29d274 --- /dev/null +++ b/tests/unit/python/cli/administration/inventory/mesh/test_inventory.py @@ -0,0 +1,187 @@ +from __future__ import annotations + +import tempfile +import unittest +from pathlib import Path + +from cli.administration.inventory.mesh.inventory import ( + groups_of, + hub_of, + pool_of, + specs_of, + topology_of, +) +from utils.cache.yaml import dump_yaml, load_yaml_any + +from . import PROJECT_ROOT + +DECLARED = { + "svc-net-wireguard": { + "networks": { + "meshes": [ + {"name": "alpha", "subnet": "10.100.10.0/24", "listen_port": 51830}, + {"name": "beta", "subnet": "10.100.11.0/24", "listen_port": 51831}, + ] + } + } +} + +GROUPS = { + "svc-swarm-manager": ["mgr"], + "svc-swarm-node": ["mgr", "wrk-1", "wrk-2"], + "svc-storage-nfs-server": ["nfs"], + "svc-bkp-nfs-2-local": ["nfs"], +} + + +def _joins(role: str, *meshes: str) -> dict: + return {role: {"networks": {"meshes": list(meshes)}}} + + +class InventoryOnDisk(unittest.TestCase): + def setUp(self): + self._tmp = tempfile.TemporaryDirectory() + self.addCleanup(self._tmp.cleanup) + self.root = Path(self._tmp.name) + self.host_vars = self.root / "host_vars" + self.host_vars.mkdir() + + def _host(self, host: str, *blocks: dict) -> None: + applications: dict = {} + for block in blocks: + applications.update(block) + dump_yaml(str(self.host_vars / f"{host}.yml"), {"applications": applications}) + + def _topology(self, groups=None): + specs = specs_of(DECLARED, []) + return topology_of(groups or GROUPS, self.host_vars, specs) + + +class TestDeclarations(unittest.TestCase): + def test_the_meshes_keep_their_declaration_order(self): + self.assertEqual(["alpha", "beta"], [s.name for s in specs_of(DECLARED, [])]) + + def test_a_silent_declaration_routes_the_platform_pool(self): + self.assertEqual("10.100.0.0/16", specs_of(DECLARED, [])[0].routed_range) + + def test_an_inventory_without_declarations_is_refused(self): + with self.assertRaises(ValueError) as raised: + specs_of({}, []) + self.assertIn("networks.meshes", str(raised.exception)) + + def test_a_mesh_declared_twice_is_refused(self): + twice = { + "svc-net-wireguard": { + "networks": { + "meshes": [ + {"name": "a", "subnet": "10.100.1.0/24", "listen_port": 1}, + {"name": "a", "subnet": "10.100.2.0/24", "listen_port": 2}, + ] + } + } + } + with self.assertRaises(ValueError): + specs_of(twice, []) + + +class TestPool(InventoryOnDisk, unittest.TestCase): + def test_the_platform_pool_applies_by_default(self): + self.assertEqual("10.100.0.0/16", pool_of([])) + + def test_a_deployment_narrows_it_in_its_own_group_vars(self): + inventory = self.root / "devices.yml" + inventory.write_text("all: {}\n", encoding="utf-8") + (self.root / "group_vars").mkdir() + dump_yaml( + str(self.root / "group_vars" / "all.yml"), + {"NETWORK_MESH_POOL": "10.100.0.0/17"}, + ) + self.assertEqual("10.100.0.0/17", pool_of([inventory])) + self.assertEqual( + "10.100.0.0/17", specs_of(DECLARED, [inventory])[0].routed_range + ) + + +class TestTopology(InventoryOnDisk, unittest.TestCase): + def test_a_host_joins_what_its_roles_list(self): + self._host("wrk-1", _joins("svc-swarm-node", "alpha")) + self._host("nfs", _joins("svc-storage-nfs-server", "beta")) + topology = self._topology() + self.assertEqual(("wrk-1",), topology.spokes["alpha"]) + self.assertEqual(("nfs",), topology.spokes["beta"]) + + def test_two_hosts_of_one_role_may_sit_in_different_meshes(self): + self._host("wrk-1", _joins("svc-swarm-node", "alpha")) + self._host("wrk-2", _joins("svc-swarm-node", "beta")) + topology = self._topology() + self.assertEqual(("wrk-1",), topology.spokes["alpha"]) + self.assertEqual(("wrk-2",), topology.spokes["beta"]) + + def test_two_roles_naming_one_mesh_admit_the_host_once(self): + self._host( + "nfs", + _joins("svc-storage-nfs-server", "beta"), + _joins("svc-bkp-nfs-2-local", "beta"), + ) + self.assertEqual(("nfs",), self._topology().spokes["beta"]) + + def test_a_role_the_host_does_not_carry_admits_nothing(self): + self._host("wrk-1", _joins("svc-storage-nfs-server", "beta")) + self.assertEqual((), self._topology().spokes["beta"]) + + def test_the_hub_is_in_every_mesh_and_never_a_spoke(self): + self._host("mgr", DECLARED, _joins("svc-swarm-node", "alpha")) + topology = self._topology() + self.assertEqual("mgr", topology.hub) + self.assertNotIn("mgr", topology.spokes["alpha"]) + + def test_a_mesh_nobody_declared_is_refused(self): + self._host("wrk-1", _joins("svc-swarm-node", "omega")) + with self.assertRaises(ValueError) as raised: + self._topology() + self.assertIn("omega", str(raised.exception)) + self.assertIn("svc-swarm-node", str(raised.exception)) + + def test_the_declaring_role_itself_joins_nothing(self): + self._host("wrk-1", DECLARED) + groups = {**GROUPS, "svc-net-wireguard": ["wrk-1"]} + self.assertEqual((), self._topology(groups).spokes["alpha"]) + + def test_a_hub_role_with_two_hosts_is_refused(self): + with self.assertRaises(ValueError): + hub_of({**GROUPS, "svc-swarm-manager": ["a", "b"]}) + + def test_an_inventory_without_a_hub_host_has_no_hub(self): + self.assertIsNone(hub_of({**GROUPS, "svc-swarm-manager": []})) + + +class TestTheShippedExample(InventoryOnDisk, unittest.TestCase): + EXAMPLE = PROJECT_ROOT / "inventories" / "examples" / "wireguard-three-meshes" + + def setUp(self): + super().setUp() + layout = load_yaml_any(str(self.EXAMPLE / "wireguard.yml"))["applications"] + self.groups = groups_of([self.EXAMPLE / "inventory.yml"]) + for host in {h for members in self.groups.values() for h in members}: + self._host(host, layout) + self.specs = specs_of(layout, []) + self.topology = topology_of(self.groups, self.host_vars, self.specs) + + def test_it_declares_more_than_two_meshes(self): + self.assertEqual(["alpha", "beta", "gamma"], [s.name for s in self.specs]) + + def test_every_mesh_routes_the_whole_pool_so_the_planes_can_reach_each_other(self): + for spec in self.specs: + with self.subTest(mesh=spec.name): + self.assertEqual("10.100.0.0/16", spec.routed_range) + + def test_every_mesh_gets_the_members_its_table_promises(self): + self.assertEqual("mesh-hub-01", self.topology.hub) + self.assertEqual( + { + "alpha": ("mesh-wrk-01", "mesh-wrk-02"), + "beta": ("mesh-nfs-01",), + "gamma": ("mesh-bkp-01",), + }, + self.topology.spokes, + ) diff --git a/tests/unit/python/cli/administration/inventory/mesh/test_plan.py b/tests/unit/python/cli/administration/inventory/mesh/test_plan.py new file mode 100644 index 0000000000..3f5e99bed8 --- /dev/null +++ b/tests/unit/python/cli/administration/inventory/mesh/test_plan.py @@ -0,0 +1,363 @@ +from __future__ import annotations + +import unittest + +from cli.administration.inventory.mesh.inventory import assert_no_subnet_overlap +from cli.administration.inventory.mesh.keys import ( + generate_private_key, + is_valid_public_key, + public_key_of, +) +from cli.administration.inventory.mesh.model import MeshSpec, Topology +from cli.administration.inventory.mesh.plan import plan_mesh, primary_meshes + +SWARM = MeshSpec(name="swarm", subnet="10.100.0.0/24", listen_port=51820) + +DATA = MeshSpec(name="data", subnet="10.100.1.0/24", listen_port=51821) + +TOPOLOGY = Topology( + hub="swarm-mgr-01", + spokes={ + "swarm": ("swarm-wrk-01", "swarm-wrk-02"), + "data": ("nfs-server", "swarm-bkp-01"), + }, +) + + +def _with_spokes(**spokes: tuple[str, ...]) -> Topology: + return Topology(hub=TOPOLOGY.hub, spokes={**TOPOLOGY.spokes, **spokes}) + + +class TestMembership(unittest.TestCase): + def test_the_hub_is_not_also_listed_as_its_own_spoke(self): + mesh = plan_mesh(SWARM, _with_spokes(swarm=("swarm-mgr-01", "swarm-wrk-01"))) + self.assertEqual(mesh.hub.host, "swarm-mgr-01") + self.assertEqual([s.host for s in mesh.spokes], ["swarm-wrk-01"]) + + def test_a_host_two_roles_put_into_one_mesh_is_one_spoke(self): + topology = _with_spokes(data=("nfs-server", "swarm-bkp-01", "nfs-server")) + mesh = plan_mesh(DATA, topology) + self.assertEqual([s.host for s in mesh.spokes], ["nfs-server", "swarm-bkp-01"]) + + def test_membership_is_stable_against_inventory_ordering(self): + shuffled = _with_spokes(swarm=("swarm-wrk-02", "swarm-wrk-01")) + self.assertEqual( + [m.address for m in plan_mesh(SWARM, TOPOLOGY).members], + [m.address for m in plan_mesh(SWARM, shuffled).members], + ) + + +class TestAddressing(unittest.TestCase): + def test_every_member_is_addressed_inside_the_mesh_subnet(self): + for spec in (SWARM, DATA): + with self.subTest(mesh=spec.name): + mesh = plan_mesh(spec, TOPOLOGY) + prefix = spec.subnet.rsplit(".", 1)[0] + for member in mesh.members: + self.assertTrue(member.address.startswith(prefix + ".")) + + def test_no_two_members_share_an_address(self): + mesh = plan_mesh(SWARM, TOPOLOGY) + addresses = [m.address for m in mesh.members] + self.assertEqual(len(addresses), len(set(addresses))) + + def test_the_two_meshes_do_not_share_an_address(self): + swarm = {m.address for m in plan_mesh(SWARM, TOPOLOGY).members} + data = {m.address for m in plan_mesh(DATA, TOPOLOGY).members} + self.assertEqual(swarm & data, set()) + + +class TestAddressPersistence(unittest.TestCase): + def _held(self, spec, topology) -> dict[str, str]: + return {m.host: m.address for m in plan_mesh(spec, topology).members} + + def test_a_member_that_sorts_first_does_not_renumber_the_others(self): + before = self._held(SWARM, TOPOLOGY) + grown = _with_spokes(swarm=("alpha-wrk-00", *TOPOLOGY.spokes["swarm"])) + + mesh = plan_mesh(SWARM, grown, addresses=before) + after = {m.host: m.address for m in mesh.members} + for host, address in before.items(): + with self.subTest(host=host): + self.assertEqual(after[host], address) + self.assertNotIn(after["alpha-wrk-00"], set(before.values())) + + def test_rotation_replaces_identities_and_keeps_addresses(self): + before = self._held(SWARM, TOPOLOGY) + mesh = plan_mesh(SWARM, TOPOLOGY, rotate=True, addresses=before) + self.assertEqual({m.host: m.address for m in mesh.members}, before) + + def test_a_stored_address_outside_the_subnet_is_replaced(self): + mesh = plan_mesh(SWARM, TOPOLOGY, addresses={"swarm-wrk-01": "10.99.0.50"}) + address = mesh.member("swarm-wrk-01").address + self.assertTrue(address.startswith("10.100.0.")) + + def test_a_spoke_never_adopts_the_hub_address(self): + hub = plan_mesh(SWARM, TOPOLOGY).hub.address + mesh = plan_mesh(SWARM, TOPOLOGY, addresses={"swarm-wrk-01": hub}) + self.assertNotEqual(mesh.member("swarm-wrk-01").address, hub) + + def test_two_members_claiming_one_address_do_not_both_keep_it(self): + taken = plan_mesh(SWARM, TOPOLOGY).member("swarm-wrk-01").address + mesh = plan_mesh( + SWARM, + TOPOLOGY, + addresses={"swarm-wrk-01": taken, "swarm-wrk-02": taken}, + ) + addresses = [m.address for m in mesh.members] + self.assertEqual(len(addresses), len(set(addresses))) + + +class TestPeering(unittest.TestCase): + def test_the_hub_peers_with_every_spoke(self): + mesh = plan_mesh(SWARM, TOPOLOGY) + self.assertEqual( + {p.host for p in mesh.peers_of(mesh.hub.host)}, + {s.host for s in mesh.spokes}, + ) + + def test_a_spoke_peers_only_with_the_hub(self): + mesh = plan_mesh(SWARM, TOPOLOGY) + for spoke in mesh.spokes: + with self.subTest(spoke=spoke.host): + peers = mesh.peers_of(spoke.host) + self.assertEqual([p.host for p in peers], [mesh.hub.host]) + + def test_a_host_outside_the_mesh_has_no_peers(self): + mesh = plan_mesh(SWARM, TOPOLOGY) + self.assertEqual(mesh.peers_of("nfs-server"), ()) + + +class TestPrimaryMesh(unittest.TestCase): + def test_the_first_declared_mesh_a_host_belongs_to_is_its_primary(self): + self.assertEqual( + primary_meshes([SWARM, DATA], TOPOLOGY), + { + "swarm-mgr-01": "swarm", + "swarm-wrk-01": "swarm", + "swarm-wrk-02": "swarm", + "nfs-server": "data", + "swarm-bkp-01": "data", + }, + ) + + def test_reordering_the_declarations_moves_the_hubs_primary(self): + self.assertEqual( + primary_meshes([DATA, SWARM], TOPOLOGY)["swarm-mgr-01"], "data" + ) + + def test_a_spoke_of_two_meshes_keeps_the_first(self): + topology = _with_spokes(beta=("nfs-server",)) + beta = MeshSpec(name="beta", subnet="10.100.11.0/24", listen_port=51831) + self.assertEqual(primary_meshes([beta, DATA], topology)["nfs-server"], "beta") + + def test_the_controller_counts_only_where_it_joins(self): + primary = primary_meshes( + [SWARM, DATA], TOPOLOGY, controller="localhost", controller_mesh="data" + ) + self.assertEqual(primary["localhost"], "data") + self.assertNotIn("localhost", primary_meshes([SWARM, DATA], TOPOLOGY)) + + +class TestKeyPairing(unittest.TestCase): + def test_every_public_key_answers_for_its_private_key(self): + mesh = plan_mesh(SWARM, TOPOLOGY) + for member in mesh.members: + with self.subTest(host=member.host): + self.assertIsNotNone(member.private_key) + self.assertEqual(public_key_of(member.private_key), member.public_key) + + def test_no_two_members_share_a_keypair(self): + mesh = plan_mesh(SWARM, TOPOLOGY) + self.assertEqual(len({m.private_key for m in mesh.members}), len(mesh.members)) + + def test_a_peer_entry_never_carries_a_private_key(self): + mesh = plan_mesh(SWARM, TOPOLOGY) + secrets = {m.private_key for m in mesh.members} + for member in mesh.members: + for peer in mesh.peers_of(member.host): + with self.subTest(host=member.host, peer=peer.host): + self.assertNotIn(peer.public_key, secrets) + self.assertTrue(is_valid_public_key(peer.public_key)) + + def test_a_malformed_private_key_is_refused(self): + for bad in ("", "not-base64!", "c2hvcnQ="): + with self.subTest(value=bad), self.assertRaises(ValueError): + public_key_of(bad) + + +class TestRotation(unittest.TestCase): + def test_an_existing_member_keeps_its_key_and_is_not_rewritten(self): + held = {"swarm-wrk-01": public_key_of(generate_private_key())} + mesh = plan_mesh(SWARM, TOPOLOGY, held) + member = mesh.member("swarm-wrk-01") + self.assertEqual(member.public_key, held["swarm-wrk-01"]) + self.assertIsNone(member.private_key) + + def test_a_new_member_is_keyed_while_the_others_are_untouched(self): + held = { + host: public_key_of(generate_private_key()) + for host in ("swarm-mgr-01", "swarm-wrk-01") + } + mesh = plan_mesh(SWARM, TOPOLOGY, held) + self.assertIsNone(mesh.member("swarm-wrk-01").private_key) + self.assertIsNotNone(mesh.member("swarm-wrk-02").private_key) + + def test_rotation_replaces_every_key_including_held_ones(self): + held = { + host: public_key_of(generate_private_key()) + for host in ("swarm-mgr-01", "swarm-wrk-01", "swarm-wrk-02") + } + mesh = plan_mesh(SWARM, TOPOLOGY, held, rotate=True) + for member in mesh.members: + with self.subTest(host=member.host): + self.assertIsNotNone(member.private_key) + self.assertNotEqual(member.public_key, held[member.host]) + + def test_rotation_keeps_the_mesh_internally_consistent(self): + mesh = plan_mesh(SWARM, TOPOLOGY, rotate=True) + published = {m.host: m.public_key for m in mesh.members} + for member in mesh.members: + for peer in mesh.peers_of(member.host): + with self.subTest(host=member.host, peer=peer.host): + self.assertEqual(peer.public_key, published[peer.host]) + + +class TestSubnetGuards(unittest.TestCase): + def test_overlapping_meshes_are_refused(self): + clash = MeshSpec(name="clash", subnet="10.100.0.0/25", listen_port=51822) + with self.assertRaises(ValueError): + assert_no_subnet_overlap([SWARM, clash], "10.100.0.0/16") + + def test_a_subnet_outside_the_pool_is_refused(self): + escapee = MeshSpec(name="escapee", subnet="192.168.244.0/24", listen_port=51823) + with self.assertRaises(ValueError): + assert_no_subnet_overlap([escapee], "10.100.0.0/16") + + def test_a_shared_listen_port_is_refused(self): + twin = MeshSpec( + name="twin", subnet="10.100.9.0/24", listen_port=SWARM.listen_port + ) + with self.assertRaises(ValueError): + assert_no_subnet_overlap([SWARM, twin], "10.100.0.0/16") + + def test_the_declared_meshes_pass_their_own_guards(self): + assert_no_subnet_overlap([SWARM, DATA], "10.100.0.0/16") + + +MESH_POOL = "10.100.0.0/16" + + +def topology(mesh_count: int, seed: int) -> tuple[list[MeshSpec], Topology]: + """A hub-and-spoke topology of ``mesh_count`` meshes around one hub. + + Args: + mesh_count: how many meshes to declare. + seed: picks one arrangement of hosts over the meshes. + """ + hosts = [f"node-{index:02d}" for index in range(12)] + spokes: dict[str, tuple[str, ...]] = {} + specs: list[MeshSpec] = [] + for index in range(mesh_count): + name = f"mesh-{index}" + spokes[name] = tuple( + host + for position, host in enumerate(hosts) + if (position + seed) % (index + 2) + ) + specs.append( + MeshSpec( + name=name, subnet=f"10.100.{index}.0/24", listen_port=51820 + index + ) + ) + return specs, Topology(hub="hub-01", spokes=spokes) + + +class TestAnyNumberOfMeshes(unittest.TestCase): + COUNTS = range(1, 9) + SEEDS = range(3) + + def _planned(self, count: int, seed: int): + specs, layout = topology(count, seed) + return specs, layout, [plan_mesh(spec, layout) for spec in specs] + + def test_every_declared_count_plans_without_collision(self): + for count in self.COUNTS: + for seed in self.SEEDS: + with self.subTest(meshes=count, seed=seed): + specs, _, meshes = self._planned(count, seed) + assert_no_subnet_overlap(specs, MESH_POOL) + self.assertEqual(len(meshes), count) + + def test_every_member_is_addressed_inside_its_own_subnet(self): + for count in self.COUNTS: + for seed in self.SEEDS: + specs, _, meshes = self._planned(count, seed) + for spec, mesh in zip(specs, meshes, strict=True): + prefix = spec.subnet.rsplit(".", 1)[0] + "." + for member in mesh.members: + with self.subTest(meshes=count, seed=seed, host=member.host): + self.assertTrue(member.address.startswith(prefix)) + + def test_no_two_members_of_one_mesh_share_an_address(self): + for count in self.COUNTS: + for seed in self.SEEDS: + _, _, meshes = self._planned(count, seed) + for mesh in meshes: + with self.subTest(meshes=count, seed=seed, mesh=mesh.spec.name): + addresses = [member.address for member in mesh.members] + self.assertEqual(len(addresses), len(set(addresses))) + + def test_the_hub_joins_every_mesh_so_the_planes_can_reach_each_other(self): + for count in self.COUNTS: + for seed in self.SEEDS: + _, _, meshes = self._planned(count, seed) + for mesh in meshes: + with self.subTest(meshes=count, seed=seed, mesh=mesh.spec.name): + self.assertEqual("hub-01", mesh.hub.host) + + def test_the_hub_peers_with_every_spoke_and_a_spoke_only_with_the_hub(self): + for count in self.COUNTS: + for seed in self.SEEDS: + _, _, meshes = self._planned(count, seed) + for mesh in meshes: + with self.subTest(meshes=count, seed=seed, mesh=mesh.spec.name): + self.assertEqual( + sorted(peer.host for peer in mesh.peers_of(mesh.hub.host)), + sorted(spoke.host for spoke in mesh.spokes), + ) + for spoke in mesh.spokes: + self.assertEqual( + ["hub-01"], + [peer.host for peer in mesh.peers_of(spoke.host)], + ) + + def test_a_host_in_several_meshes_holds_one_address_per_mesh(self): + shared = 0 + for count in self.COUNTS: + for seed in self.SEEDS: + _, _, meshes = self._planned(count, seed) + held: dict[str, set[str]] = {} + for mesh in meshes: + for member in mesh.members: + held.setdefault(member.host, set()).add(member.address) + for host, addresses in held.items(): + count_in = sum( + 1 + for mesh in meshes + if any(m.host == host for m in mesh.members) + ) + if count_in > 1: + shared += 1 + with self.subTest(meshes=count, seed=seed, host=host): + self.assertEqual(count_in, len(addresses)) + self.assertGreater(shared, 0, "no host landed in several meshes") + + def test_every_peer_entry_carries_a_usable_public_key(self): + for count in self.COUNTS: + _, _, meshes = self._planned(count, 0) + for mesh in meshes: + for member in mesh.members: + for peer in mesh.peers_of(member.host): + with self.subTest(meshes=count, host=member.host): + self.assertTrue(is_valid_public_key(peer.public_key)) diff --git a/tests/unit/python/cli/administration/inventory/mesh/test_transport.py b/tests/unit/python/cli/administration/inventory/mesh/test_transport.py new file mode 100644 index 0000000000..b9a345913d --- /dev/null +++ b/tests/unit/python/cli/administration/inventory/mesh/test_transport.py @@ -0,0 +1,177 @@ +from __future__ import annotations + +import tempfile +import unittest +from pathlib import Path + +from cli.administration.inventory.mesh.inventory import ( + groups_of, + specs_of, + topology_of, +) +from cli.administration.inventory.mesh.plan import members_of, plan_mesh +from cli.administration.inventory.mesh.transport import ( + MESH_CONTROL_PERSIST, + mesh_address, + mesh_ssh_args, + repo_ssh_args, + switch_to_mesh, +) +from cli.administration.inventory.mesh.write import write_mesh +from utils.cache.yaml import dump_yaml + +from .test_write import LAYOUT, layout_applications + +CONTROLLER = "localhost" +HOSTS = ("swarm-mgr-01", "swarm-wrk-01", "nfs-server", CONTROLLER) + +CLUSTER_INVENTORY = """\ +all: + children: + svc-swarm-manager: + hosts: + swarm-mgr-01: {} + svc-swarm-node: + hosts: + swarm-mgr-01: {} + swarm-wrk-01: {} + svc-storage-nfs-server: + hosts: + nfs-server: {} +""" + + +class MeshOnDisk(unittest.TestCase): + def setUp(self): + self._tmp = tempfile.TemporaryDirectory() + root = Path(self._tmp.name) + self.host_vars = root / "host_vars" + self.host_vars.mkdir() + layout = layout_applications(LAYOUT) + for host in HOSTS: + dump_yaml(str(self.host_vars / f"{host}.yml"), {"applications": layout}) + self.cluster = root / "devices.yml" + self.cluster.write_text(CLUSTER_INVENTORY, encoding="utf-8") + self.vault_file = root / ".password" + self.vault_file.write_text("mesh-test-password\n", encoding="utf-8") + self.groups = groups_of([self.cluster]) + self.specs = specs_of(layout, []) + self.topology = topology_of(self.groups, self.host_vars, self.specs) + self.swarm = next(spec for spec in self.specs if spec.name == "swarm") + + def tearDown(self): + self._tmp.cleanup() + + def _write_swarm(self): + mesh = plan_mesh(self.swarm, self.topology, rotate=True, controller=CONTROLLER) + write_mesh(mesh, self.host_vars, self.vault_file) + return mesh + + def _text(self, host: str) -> str: + return (self.host_vars / f"{host}.yml").read_text( # nocheck: cache-read + encoding="utf-8" + ) + + +class TestTheControllerJoinsTheMesh(MeshOnDisk, unittest.TestCase): + def test_it_is_admitted_as_an_ordinary_spoke(self): + _, spokes = members_of(self.swarm, self.topology, CONTROLLER) + self.assertIn(CONTROLLER, spokes) + + def test_it_stays_out_when_it_is_not_named(self): + _, spokes = members_of(self.swarm, self.topology) + self.assertNotIn(CONTROLLER, spokes) + + def test_it_is_never_made_the_hub(self): + hub, _ = members_of(self.swarm, self.topology, CONTROLLER) + self.assertNotEqual(hub, CONTROLLER) + + def test_it_gets_an_address_of_its_own(self): + mesh = self._write_swarm() + addresses = {member.host: member.address for member in mesh.members} + self.assertIn(CONTROLLER, addresses) + self.assertEqual(len(set(addresses.values())), len(addresses)) + + +class TestSwitchingTheTransport(MeshOnDisk, unittest.TestCase): + def _switch(self): + return switch_to_mesh( + self.host_vars, + list(HOSTS), + "swarm", + user="administrator", + private_key_file="/tmp/key", + ) + + def test_every_member_is_pointed_at_its_mesh_address(self): + mesh = self._write_swarm() + switched = self._switch() + for member in mesh.members: + with self.subTest(host=member.host): + self.assertEqual(switched[member.host], member.address) + + def test_a_non_member_is_left_reachable(self): + self._write_swarm() + switched = self._switch() + self.assertNotIn("nfs-server", switched) + + def test_the_connection_moves_to_ssh(self): + self._write_swarm() + self._switch() + text = self._text("swarm-wrk-01") + self.assertIn("ansible_connection: ssh", text) + self.assertIn("ansible_user: administrator", text) + + def test_a_switched_host_carries_the_meshs_own_ssh_args(self): + self._write_swarm() + self._switch() + text = self._text("swarm-wrk-01") + self.assertIn("ansible_ssh_args:", text) + self.assertIn(f"ControlPersist={MESH_CONTROL_PERSIST}", text) + + def test_a_switched_host_asks_for_no_tty(self): + self._write_swarm() + self._switch() + self.assertIn("ansible_ssh_use_tty: false", self._text("swarm-wrk-01")) + + def test_switching_before_the_mesh_exists_changes_nothing(self): + self.assertEqual(self._switch(), {}) + + def test_the_address_is_only_read_from_the_host_that_owns_it(self): + self._write_swarm() + (self.host_vars / "swarm-wrk-01.yml").write_text( + self._text("swarm-mgr-01"), encoding="utf-8" + ) + self.assertIsNone(mesh_address(self.host_vars, "swarm-wrk-01", "swarm")) + + +class TestTheMeshRetunesItsOwnTransport(unittest.TestCase): + BASE = ( + "-o ControlMaster=auto -o ControlPersist=20s " + "-o ControlPath=~/.ssh/ansible-%h-%p-%r -o ServerAliveInterval=15" + ) + + def test_the_window_is_the_meshs_own(self): + args = mesh_ssh_args(self.BASE) + self.assertIn(f"-o ControlPersist={MESH_CONTROL_PERSIST}", args) + self.assertNotIn("ControlPersist=20s", args) + + def test_the_socket_is_left_to_ansible(self): + self.assertNotIn("ControlPath", mesh_ssh_args(self.BASE)) + + def test_every_other_option_survives(self): + args = mesh_ssh_args(self.BASE) + self.assertIn("-o ControlMaster=auto", args) + self.assertIn("-o ServerAliveInterval=15", args) + + def test_a_bare_flag_is_not_dropped(self): + self.assertIn("-C", mesh_ssh_args("-C -o ControlPersist=20s")) + + def test_the_repository_value_is_the_one_retuned(self): + base = repo_ssh_args() + self.assertIn("ControlMaster", base) + for option in base.split(" -o "): + name = option.split("=")[0].lstrip("-o ").strip() + if name and not name.startswith(("ControlPersist", "ControlPath")): + with self.subTest(option=name): + self.assertIn(name, mesh_ssh_args(base)) diff --git a/tests/unit/python/cli/administration/inventory/mesh/test_write.py b/tests/unit/python/cli/administration/inventory/mesh/test_write.py new file mode 100644 index 0000000000..c77558e414 --- /dev/null +++ b/tests/unit/python/cli/administration/inventory/mesh/test_write.py @@ -0,0 +1,396 @@ +from __future__ import annotations + +import tempfile +import unittest +from dataclasses import replace +from pathlib import Path + +from cli.administration.inventory.mesh.inventory import ( + groups_of, + specs_of, + topology_of, +) +from cli.administration.inventory.mesh.keys import generate_private_key, public_key_of +from cli.administration.inventory.mesh.plan import plan_mesh, primary_meshes +from cli.administration.inventory.mesh.write import ( + existing_addresses, + existing_public_keys, + private_key_name, + prune_foreign_meshes, + write_mesh, +) +from utils.cache.yaml import dump_yaml, load_yaml_any + +from . import PROJECT_ROOT +from .test_plan import MESH_POOL, topology + +LAYOUT = PROJECT_ROOT / "inventories/development/wireguard.yml" +EXAMPLE_LAYOUT = ( + PROJECT_ROOT / "inventories/examples/wireguard-three-meshes/wireguard.yml" +) + + +def layout_applications(path: Path) -> dict: + return load_yaml_any(str(path))["applications"] + + +def interface_entries(host_vars: Path, host: str) -> list[dict]: + document = load_yaml_any(str(host_vars / f"{host}.yml")) or {} + return ( + document.get("applications", {}) + .get("svc-net-wireguard", {}) + .get("networks", {}) + .get("interfaces", []) + ) + + +HOSTS = ("swarm-mgr-01", "swarm-wrk-01", "swarm-wrk-02", "nfs-server", "swarm-bkp-01") + +CLUSTER_INVENTORY = """\ +all: + children: + svc-swarm-manager: + hosts: + swarm-mgr-01: {} + svc-swarm-node: + hosts: + swarm-mgr-01: {} + swarm-wrk-01: {} + swarm-wrk-02: {} + svc-storage-nfs-server: + hosts: + nfs-server: {} +""" + +BACKUP_INVENTORY = """\ +all: + children: + svc-bkp-remote-2-local: + hosts: + swarm-bkp-01: {} +""" + +VAULT_PASSWORD = "mesh-test-password\n" + + +class MeshOnDisk(unittest.TestCase): + LAYOUT = LAYOUT + + def setUp(self): + self._tmp = tempfile.TemporaryDirectory() + root = Path(self._tmp.name) + self.host_vars = root / "host_vars" + self.host_vars.mkdir() + self.layout = layout_applications(self.LAYOUT) + for host in HOSTS: + dump_yaml( + str(self.host_vars / f"{host}.yml"), {"applications": self.layout} + ) + + self.cluster = root / "devices.yml" + self.cluster.write_text(self.cluster_inventory(), encoding="utf-8") + self.backup = root / "backup.yml" + self.backup.write_text(BACKUP_INVENTORY, encoding="utf-8") + + self.vault_file = root / ".password" + self.vault_file.write_text(VAULT_PASSWORD, encoding="utf-8") + + self.groups = groups_of([self.cluster, self.backup]) + self.specs = specs_of(self.layout, []) + self.topology = topology_of(self.groups, self.host_vars, self.specs) + + def cluster_inventory(self) -> str: + return CLUSTER_INVENTORY + + def tearDown(self): + self._tmp.cleanup() + + def _text(self, host: str) -> str: + path = self.host_vars / f"{host}.yml" + return path.read_text(encoding="utf-8") # nocheck: cache-read + + def _mesh_names(self, host: str) -> list[str]: + return sorted( + entry["name"] for entry in interface_entries(self.host_vars, host) + ) + + def _entry(self, host: str, mesh_name: str) -> dict: + return next( + ( + entry + for entry in interface_entries(self.host_vars, host) + if entry["name"] == mesh_name + ), + {}, + ) + + def _write_all(self, *, rotate: bool = False) -> None: + for spec in self.specs: + mesh = plan_mesh( + spec, + self.topology, + None + if rotate + else existing_public_keys(self.host_vars, list(HOSTS), spec.name), + rotate=rotate, + ) + write_mesh(mesh, self.host_vars, self.vault_file) + + +class TestBothInventoriesAreRead(MeshOnDisk, unittest.TestCase): + def test_the_backup_host_is_found_in_its_sibling_inventory(self): + self.assertIn("swarm-bkp-01", self.groups.get("svc-bkp-remote-2-local", [])) + cluster_only = groups_of([self.cluster]) + self.assertNotIn("svc-bkp-remote-2-local", cluster_only) + + +class TestPrivateKeyContainment(MeshOnDisk, unittest.TestCase): + def test_a_private_key_reaches_exactly_one_host_vars_file(self): + for spec in self.specs: + mesh = plan_mesh(spec, self.topology, rotate=True) + write_mesh(mesh, self.host_vars, self.vault_file) + with self.subTest(mesh=spec.name): + for member in mesh.members: + others = [h for h in HOSTS if h != member.host] + for other in others: + self.assertNotIn(member.private_key, self._text(other)) + + def test_no_plaintext_private_key_is_written_anywhere(self): + for spec in self.specs: + mesh = plan_mesh(spec, self.topology, rotate=True) + write_mesh(mesh, self.host_vars, self.vault_file) + with self.subTest(mesh=spec.name): + for member in mesh.members: + self.assertNotIn(member.private_key, self._text(member.host)) + + def test_the_stored_private_key_is_vault_encrypted(self): + self._write_all() + text = self._text("swarm-mgr-01") + self.assertIn(private_key_name("swarm"), text) + self.assertIn("$ANSIBLE_VAULT", text) + + +class TestMeshShapeOnDisk(MeshOnDisk, unittest.TestCase): + def test_every_member_receives_the_mesh_it_belongs_to(self): + self._write_all() + for host in ("swarm-mgr-01", "swarm-wrk-01", "swarm-wrk-02"): + with self.subTest(host=host): + self.assertIn("swarm", self._mesh_names(host)) + for host in ("nfs-server", "swarm-bkp-01"): + with self.subTest(host=host): + self.assertIn("data", self._mesh_names(host)) + + def test_a_worker_is_not_given_the_data_mesh(self): + self._write_all() + self.assertEqual(self._mesh_names("swarm-wrk-01"), ["swarm"]) + + def test_the_hub_carries_both_meshes(self): + self._write_all() + self.assertEqual(self._mesh_names("swarm-mgr-01"), ["data", "swarm"]) + + def test_a_spoke_routes_the_whole_pool_through_the_hub(self): + self._write_all() + for spec in self.specs: + mesh = plan_mesh(spec, self.topology) + self.assertEqual(spec.routed_range, "10.100.0.0/16") + for spoke in mesh.spokes: + with self.subTest(mesh=spec.name, spoke=spoke.host): + peers = self._entry(spoke.host, spec.name)["peers"] + self.assertEqual([p["host"] for p in peers], [mesh.hub.host]) + self.assertEqual( + [p["allowed_ips"] for p in peers], [spec.routed_range] + ) + + def test_the_hub_pins_each_spoke_to_a_single_address(self): + self._write_all() + for spec in self.specs: + hub = plan_mesh(spec, self.topology).hub.host + for peer in self._entry(hub, spec.name)["peers"]: + with self.subTest(mesh=spec.name, peer=peer["host"]): + self.assertFalse(peer["is_hub"]) + self.assertEqual(peer["allowed_ips"], peer["address"] + "/32") + + +class TestStoredAddresses(MeshOnDisk, unittest.TestCase): + def test_every_written_address_is_read_back(self): + self._write_all() + for spec in self.specs: + mesh = plan_mesh(spec, self.topology) + with self.subTest(mesh=spec.name): + self.assertEqual( + existing_addresses(self.host_vars, list(HOSTS), spec.name), + {m.host: m.address for m in mesh.members}, + ) + + def test_a_host_with_no_entry_is_absent_rather_than_empty(self): + self._write_all() + stored = existing_addresses(self.host_vars, list(HOSTS), "data") + self.assertNotIn("swarm-wrk-01", stored) + + def test_a_mirrored_entry_is_not_read_as_the_hosts_own_address(self): + self._write_all() + hub_text = self._text("swarm-mgr-01") + (self.host_vars / "swarm-wrk-01.yml").write_text(hub_text, encoding="utf-8") + stored = existing_addresses(self.host_vars, list(HOSTS), "swarm") + self.assertNotIn("swarm-wrk-01", stored) + + +class TestIdempotence(MeshOnDisk, unittest.TestCase): + def test_a_second_run_leaves_every_file_byte_identical(self): + self._write_all() + before = {host: self._text(host) for host in HOSTS} + self._write_all() + for host in HOSTS: + with self.subTest(host=host): + self.assertEqual(self._text(host), before[host]) + + def test_rotation_changes_every_member_file(self): + self._write_all() + before = {host: self._text(host) for host in HOSTS} + self._write_all(rotate=True) + for host in HOSTS: + with self.subTest(host=host): + self.assertNotEqual(self._text(host), before[host]) + + def test_a_mirrored_host_vars_is_reminted_rather_than_adopted(self): + self._write_all() + hub_text = self._text("swarm-mgr-01") + for host in ("swarm-wrk-01", "swarm-wrk-02"): + (self.host_vars / f"{host}.yml").write_text(hub_text, encoding="utf-8") + + keyed = existing_public_keys(self.host_vars, list(HOSTS), "swarm") + self.assertNotIn("swarm-wrk-01", keyed) + self.assertNotIn("swarm-wrk-02", keyed) + self.assertIn("swarm-mgr-01", keyed) + + self._write_all() + addresses = { + host: plan_mesh( + self.specs[0], + self.topology, + existing_public_keys(self.host_vars, list(HOSTS), "swarm"), + ) + .member(host) + .address + for host in ("swarm-mgr-01", "swarm-wrk-01", "swarm-wrk-02") + } + self.assertEqual(len(set(addresses.values())), 3) + + def test_a_mesh_a_host_does_not_own_is_pruned(self): + self._write_all() + hub_text = self._text("swarm-mgr-01") + (self.host_vars / "nfs-server.yml").write_text(hub_text, encoding="utf-8") + self.assertEqual(self._mesh_names("nfs-server"), ["data", "swarm"]) + + removed = prune_foreign_meshes(self.host_vars, list(HOSTS)) + self.assertEqual(removed.get("nfs-server"), ["data", "swarm"]) + self.assertEqual(self._mesh_names("nfs-server"), []) + + self._write_all() + self.assertEqual(self._mesh_names("nfs-server"), ["data"]) + + def test_pruning_leaves_an_owned_mesh_alone(self): + self._write_all() + before = {host: self._text(host) for host in HOSTS} + self.assertEqual(prune_foreign_meshes(self.host_vars, list(HOSTS)), {}) + for host in HOSTS: + with self.subTest(host=host): + self.assertEqual(self._text(host), before[host]) + + def test_a_member_whose_credential_vanished_is_reminted(self): + self._write_all() + keyed = existing_public_keys(self.host_vars, list(HOSTS), "swarm") + self.assertIn("swarm-wrk-01", keyed) + + stripped = self._text("swarm-wrk-01").replace( + private_key_name("swarm"), "unrelated_key" + ) + (self.host_vars / "swarm-wrk-01.yml").write_text(stripped, encoding="utf-8") + + keyed_after = existing_public_keys(self.host_vars, list(HOSTS), "swarm") + self.assertNotIn("swarm-wrk-01", keyed_after) + + +def _hub_routes(entries: list[dict]) -> dict[str, list[str]]: + return { + entry["name"]: [ + peer["allowed_ips"] for peer in entry["peers"] if peer["is_hub"] + ] + for entry in entries + if not entry["is_hub"] + } + + +class TestTheLabUnderTheThreeMeshExample(MeshOnDisk, unittest.TestCase): + LAYOUT = EXAMPLE_LAYOUT + + def cluster_inventory(self) -> str: + return ( + CLUSTER_INVENTORY + + " svc-bkp-nfs-2-local:\n hosts:\n nfs-server: {}\n" + ) + + def setUp(self): + super().setUp() + primary = primary_meshes(self.specs, self.topology) + for spec in self.specs: + write_mesh( + plan_mesh(spec, self.topology), + self.host_vars, + self.vault_file, + primary=primary, + ) + + def test_the_nfs_server_is_a_spoke_of_beta_and_gamma(self): + self.assertEqual(self._mesh_names("nfs-server"), ["beta", "gamma"]) + + def test_it_routes_the_pool_through_its_first_declared_mesh_only(self): + self.assertEqual( + _hub_routes(interface_entries(self.host_vars, "nfs-server")), + {"beta": [MESH_POOL], "gamma": ["10.100.12.0/24"]}, + ) + + def test_exactly_one_entry_per_host_is_primary(self): + for host in HOSTS: + with self.subTest(host=host): + flags = [ + entry["primary"] + for entry in interface_entries(self.host_vars, host) + ] + self.assertEqual(flags.count(True), 1) + + def test_the_hub_is_primary_on_the_first_declared_mesh(self): + self.assertTrue(self._entry("swarm-mgr-01", "alpha")["primary"]) + self.assertFalse(self._entry("swarm-mgr-01", "beta")["primary"]) + + +class TestNoTwoInterfacesClaimOneRoute(unittest.TestCase): + def test_every_host_routes_each_prefix_through_one_interface(self): + public_key = public_key_of(generate_private_key()) + for count in range(1, 9): + for seed in range(3): + specs, layout = topology(count, seed) + specs = [replace(spec, routed_range=MESH_POOL) for spec in specs] + hosts = sorted( + {layout.hub} + | {host for members in layout.spokes.values() for host in members} + ) + primary = primary_meshes(specs, layout) + with tempfile.TemporaryDirectory() as td: + root = Path(td) + for spec in specs: + mesh = plan_mesh(spec, layout, dict.fromkeys(hosts, public_key)) + write_mesh(mesh, root, root / ".password", primary=primary) + for host in hosts: + if not (root / f"{host}.yml").exists(): + continue + entries = interface_entries(root, host) + routes = [ + peer["allowed_ips"] + for entry in entries + for peer in entry["peers"] + ] + with self.subTest(meshes=count, seed=seed, host=host): + self.assertEqual(len(routes), len(set(routes))) + if _hub_routes(entries): + self.assertEqual(routes.count(MESH_POOL), 1) diff --git a/tests/unit/python/cli/meta/ci/test_plan.py b/tests/unit/python/cli/meta/ci/test_plan.py index b098ee80f9..6217b21e39 100644 --- a/tests/unit/python/cli/meta/ci/test_plan.py +++ b/tests/unit/python/cli/meta/ci/test_plan.py @@ -22,6 +22,7 @@ def _entry( "variant": variant, "mode": mode, "tor": "true" if variant == "0" else "false", + "vpn": "true" if mode == "swarm" else "false", "disable": "", "priority": "true" if priority else "false", "instructions": instructions, diff --git a/tests/unit/python/group_vars/test_swarm_advertise_addr.py b/tests/unit/python/group_vars/test_swarm_advertise_addr.py new file mode 100644 index 0000000000..892e2c1057 --- /dev/null +++ b/tests/unit/python/group_vars/test_swarm_advertise_addr.py @@ -0,0 +1,69 @@ +import unittest +from pathlib import Path +from typing import ClassVar + +from jinja2 import Environment, StrictUndefined, select_autoescape + +import plugins.lookup.mesh_address as mesh_address +from utils.cache.files import PROJECT_ROOT +from utils.cache.yaml import load_yaml + +_SWARM_VARS = Path(PROJECT_ROOT) / "group_vars" / "all" / "18_swarm.yml" + + +def _lookup(hostvars): + def lookup(name, *terms): + if name != "mesh_address": + raise AssertionError(f"unexpected lookup({name!r})") + plugin = mesh_address.LookupModule() + return plugin.run(list(terms), variables={"hostvars": hostvars})[0] + + return lookup + + +class TestSwarmAdvertiseAddr(unittest.TestCase): + env: ClassVar[Environment] + source: ClassVar[str] + + @classmethod + def setUpClass(cls): + cls.env = Environment(undefined=StrictUndefined, autoescape=select_autoescape()) + cls.env.filters["bool"] = lambda value: str(value).lower() in ("true", "1") + cls.source = load_yaml(_SWARM_VARS)["swarm"]["manager"]["advertise_addr"] + + def _render(self, *, enabled=True, interfaces=None): + applications = ( + {} + if interfaces is None + else {"svc-net-wireguard": {"networks": {"interfaces": interfaces}}} + ) + hostvars = {"mgr": {"applications": applications}} + return ( + self.env.from_string(self.source) + .render( + WIREGUARD_ENABLED=enabled, STACK_HOST="mgr", lookup=_lookup(hostvars) + ) + .strip() + ) + + @staticmethod + def _interface(name, address, primary): + return {"name": name, "host": "mgr", "address": address, "primary": primary} + + def test_a_mesh_this_repository_never_named_is_followed(self): + interfaces = [ + self._interface("alpha", "10.100.10.1", True), + self._interface("beta", "10.100.11.1", False), + ] + self.assertEqual(self._render(interfaces=interfaces), "10.100.10.1") + + def test_the_primary_wins_over_the_order_on_disk(self): + interfaces = [ + self._interface("data", "10.100.1.1", False), + self._interface("swarm", "10.100.0.1", True), + ] + self.assertEqual(self._render(interfaces=interfaces), "10.100.0.1") + + def test_no_mesh_leaves_swarm_on_its_default(self): + self.assertEqual(self._render(enabled=False), "") + self.assertEqual(self._render(interfaces=[]), "") diff --git a/tests/unit/python/group_vars/test_wireguard_enabled.py b/tests/unit/python/group_vars/test_wireguard_enabled.py new file mode 100644 index 0000000000..c6d2ace8fb --- /dev/null +++ b/tests/unit/python/group_vars/test_wireguard_enabled.py @@ -0,0 +1,29 @@ +import unittest +from pathlib import Path +from typing import ClassVar + +from jinja2 import Environment, StrictUndefined, select_autoescape + +from utils.cache.files import PROJECT_ROOT +from utils.cache.yaml import load_yaml + +_WIREGUARD_VARS = Path(PROJECT_ROOT) / "group_vars" / "all" / "21_wireguard.yml" + + +class TestWireguardEnabled(unittest.TestCase): + env: ClassVar[Environment] + source: ClassVar[str] + + @classmethod + def setUpClass(cls): + cls.env = Environment(undefined=StrictUndefined, autoescape=select_autoescape()) + cls.source = load_yaml(_WIREGUARD_VARS)["WIREGUARD_ENABLED"] + + def _render(self, *groups: str) -> str: + return self.env.from_string(self.source).render(group_names=list(groups)) + + def test_a_host_in_the_wireguard_group_runs_it(self): + self.assertEqual("True", self._render("svc-swarm-node", "svc-net-wireguard")) + + def test_a_host_outside_the_group_stays_untouched(self): + self.assertEqual("False", self._render("svc-swarm-node", "web-app-a")) diff --git a/tests/unit/python/plugins/action/test_package_install.py b/tests/unit/python/plugins/action/test_package_install.py index ade6efd690..765211c548 100644 --- a/tests/unit/python/plugins/action/test_package_install.py +++ b/tests/unit/python/plugins/action/test_package_install.py @@ -107,6 +107,27 @@ class TestModuleName(unittest.TestCase): self._module_name(GENERIC_PACKAGE, {}) +class TestManagerArguments(unittest.TestCase): + def _args(self, module, facts): + action = _action({}) + action._connection = mock.Mock(become=None, transport="local") + action._execute_module = mock.Mock(return_value={}) + action._execute(ModuleCall(module, {"name": ["wireguard-tools"]}), {}, facts) + return action._execute_module.call_args.kwargs["module_args"] + + def test_apt_installs_without_recommends(self): + args = self._args(GENERIC_PACKAGE, {"pkg_mgr": "apt"}) + self.assertFalse(args["install_recommends"]) + + def test_other_managers_keep_their_defaults(self): + args = self._args(GENERIC_PACKAGE, {"pkg_mgr": "dnf"}) + self.assertNotIn("install_recommends", args) + + def test_a_concrete_module_is_left_alone(self): + args = self._args("ansible.builtin.apt", {"pkg_mgr": "apt"}) + self.assertNotIn("install_recommends", args) + + class TestBecomeEscalation(unittest.TestCase): def setUp(self): self.become = become_loader.get("sudo") diff --git a/tests/unit/python/plugins/lookup/test_mesh_address.py b/tests/unit/python/plugins/lookup/test_mesh_address.py new file mode 100644 index 0000000000..0e6635de6d --- /dev/null +++ b/tests/unit/python/plugins/lookup/test_mesh_address.py @@ -0,0 +1,56 @@ +from __future__ import annotations + +import unittest + +from ansible.errors import AnsibleError + +import plugins.lookup.mesh_address as module + + +def _hostvars(host: str, *interfaces: dict) -> dict: + return { + host: { + "applications": { + "svc-net-wireguard": {"networks": {"interfaces": list(interfaces)}} + } + } + } + + +def _run(host: str, hostvars: dict) -> str: + return module.LookupModule().run([host], variables={"hostvars": hostvars})[0] + + +class TestMeshAddress(unittest.TestCase): + def test_the_primary_interface_is_returned(self): + hostvars = _hostvars( + "nfs", + { + "name": "gamma", + "host": "nfs", + "address": "10.100.12.11", + "primary": False, + }, + {"name": "beta", "host": "nfs", "address": "10.100.11.11", "primary": True}, + ) + self.assertEqual("10.100.11.11", _run("nfs", hostvars)) + + def test_an_entry_another_host_owns_is_ignored(self): + hostvars = _hostvars( + "wrk", + {"name": "swarm", "host": "mgr", "address": "10.100.0.1", "primary": True}, + ) + self.assertEqual("", _run("wrk", hostvars)) + + def test_a_host_off_the_mesh_has_no_address(self): + self.assertEqual("", _run("wrk", {"wrk": {}})) + self.assertEqual("", _run("absent", {})) + + def test_exactly_one_hostname_is_required(self): + for terms in ([], ["a", "b"]): + with self.subTest(terms=terms), self.assertRaises(AnsibleError): + module.LookupModule().run(terms, variables={}) + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/unit/python/plugins/lookup/test_mesh_ranges.py b/tests/unit/python/plugins/lookup/test_mesh_ranges.py new file mode 100644 index 0000000000..b4d405734d --- /dev/null +++ b/tests/unit/python/plugins/lookup/test_mesh_ranges.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +import unittest + +from ansible.errors import AnsibleError + +import plugins.lookup.mesh_ranges as module + +POOLS = "{{ [WIREGUARD_SUBNET_POOL] }}" + + +class _Templar: + def __init__(self, rendered): + self.rendered = rendered + + def template(self, value, **_): + return self.rendered.get(value, value) if isinstance(value, str) else value + + +def _run(pools, rendered=None): + lookup = module.LookupModule() + lookup._templar = _Templar(rendered or {}) + return lookup.run(None, variables={"WIREGUARD_SUBNET_POOLS": pools})[0] + + +class TestMeshRanges(unittest.TestCase): + def test_the_declared_template_is_rendered_before_it_is_returned(self): + self.assertEqual( + _run(POOLS, {POOLS: ["10.100.0.0/16"]}), + ["10.100.0.0/16"], + ) + + def test_a_pool_that_stays_a_template_fails_instead_of_leaking(self): + with self.assertRaises(AnsibleError) as raised: + _run(POOLS) + self.assertIn("did not render", str(raised.exception)) + + def test_a_literal_list_passes_through(self): + self.assertEqual(_run(["10.100.0.0/16"]), ["10.100.0.0/16"]) + + def test_terms_are_refused(self): + with self.assertRaises(AnsibleError): + module.LookupModule().run(["x"], variables={}) + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/unit/python/roles/svc-net-wireguard/__init__.py b/tests/unit/python/roles/svc-net-wireguard/__init__.py new file mode 100644 index 0000000000..8ee16d7567 --- /dev/null +++ b/tests/unit/python/roles/svc-net-wireguard/__init__.py @@ -0,0 +1,3 @@ +from pathlib import Path + +PROJECT_ROOT: Path = Path(__file__).resolve().parents[5] diff --git a/tests/unit/python/roles/svc-net-wireguard/filter_plugins/__init__.py b/tests/unit/python/roles/svc-net-wireguard/filter_plugins/__init__.py new file mode 100644 index 0000000000..9f69c70b47 --- /dev/null +++ b/tests/unit/python/roles/svc-net-wireguard/filter_plugins/__init__.py @@ -0,0 +1,3 @@ +from pathlib import Path + +PROJECT_ROOT: Path = Path(__file__).resolve().parents[6] diff --git a/tests/unit/python/roles/svc-net-wireguard/filter_plugins/test_mesh_peers.py b/tests/unit/python/roles/svc-net-wireguard/filter_plugins/test_mesh_peers.py new file mode 100644 index 0000000000..0b4e10fd35 --- /dev/null +++ b/tests/unit/python/roles/svc-net-wireguard/filter_plugins/test_mesh_peers.py @@ -0,0 +1,26 @@ +import importlib.util +import unittest + +from utils.networks.mesh import dialled_peers, listens + +from . import PROJECT_ROOT + +PLUGIN = ( + PROJECT_ROOT / "roles" / "svc-net-wireguard" / "filter_plugins" / "mesh_peers.py" +) + + +def _filters() -> dict: + spec = importlib.util.spec_from_file_location("mesh_peers_plugin", PLUGIN) + assert spec and spec.loader + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + return module.FilterModule().filters() + + +class TestMeshPeersFilters(unittest.TestCase): + def test_the_filters_are_the_mesh_spot_functions(self): + self.assertEqual( + {"mesh_dialled_peers": dialled_peers, "mesh_listens": listens}, + _filters(), + ) diff --git a/tests/unit/python/roles/web-app-n8n/files/provision/test_mcp.py b/tests/unit/python/roles/web-app-n8n/files/provision/test_mcp.py index a664866a33..67d636871d 100644 --- a/tests/unit/python/roles/web-app-n8n/files/provision/test_mcp.py +++ b/tests/unit/python/roles/web-app-n8n/files/provision/test_mcp.py @@ -472,5 +472,42 @@ class TestProvisionMcp(unittest.TestCase): self.assertIn("2 workflows", str(exit_.exception)) +class TestRecordsRejectsAShapeItCannotRead(unittest.TestCase): + def setUp(self) -> None: + self.module = load_script() + + def test_a_list_of_records_passes_through(self) -> None: + rows = [{"id": "a"}, {"id": "b"}] + self.assertEqual(rows, self.module.records({"data": rows}, "api keys")) + self.assertEqual(rows, self.module.records(rows, "api keys")) + + def test_an_absent_payload_is_empty(self) -> None: + self.assertEqual([], self.module.records({"data": None}, "api keys")) + self.assertEqual([], self.module.records(None, "api keys")) + + def test_a_string_body_names_its_type_and_the_endpoint(self) -> None: + with self.assertRaises(SystemExit) as exit_: + self.module.records("gateway timeout", "api keys") + self.assertIn("api keys", str(exit_.exception)) + self.assertIn("str", str(exit_.exception)) + + def test_a_mapping_that_is_not_the_paged_shape_names_its_keys(self) -> None: + with self.assertRaises(SystemExit) as exit_: + self.module.records({"data": {"data": [{"id": "a"}]}}, "workflows") + self.assertIn("workflows", str(exit_.exception)) + self.assertIn("data", str(exit_.exception)) + + def test_a_list_of_strings_names_the_offending_entries(self) -> None: + with self.assertRaises(SystemExit) as exit_: + self.module.records({"data": ["a", "b"]}, "credentials") + self.assertIn("credentials", str(exit_.exception)) + self.assertIn("str", str(exit_.exception)) + + def test_the_failure_never_carries_the_body(self) -> None: + with self.assertRaises(SystemExit) as exit_: + self.module.records({"data": "s3cret-token"}, "credentials") + self.assertNotIn("s3cret-token", str(exit_.exception)) + + if __name__ == "__main__": unittest.main() diff --git a/tests/unit/python/roles/web-app-zammad/files/__init__.py b/tests/unit/python/roles/web-app-zammad/files/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/unit/python/roles/web-app-zammad/files/test_search_allocation_precheck.py b/tests/unit/python/roles/web-app-zammad/files/test_search_allocation_precheck.py new file mode 100644 index 0000000000..94e753e78a --- /dev/null +++ b/tests/unit/python/roles/web-app-zammad/files/test_search_allocation_precheck.py @@ -0,0 +1,109 @@ +import os +import subprocess +import tempfile +import unittest +from pathlib import Path + +from utils import PROJECT_ROOT + +SCRIPT = PROJECT_ROOT / "roles/web-app-zammad/files/shell/search_allocation_precheck.sh" + +CURL_STUB = """#!/usr/bin/env bash +printf '%s\\n' "$*" >>"${STUB_DIR}/calls" +case "$*" in +*_cluster/health*) exit "${HEALTH_RC}" ;; +*allocation/explain*) cat "${STUB_DIR}/explain" ;; +*"-X PUT"*) cat "${STUB_DIR}/created" ;; +esac +exit 0 +""" + +ALLOCATED = ( + '{"acknowledged":true,"shards_acknowledged":true,"index":"zammad_allocation_probe"}' +) +REFUSED = '{"acknowledged":true,"shards_acknowledged":false,"index":"zammad_allocation_probe"}' +WATERMARK = ( + '{"can_allocate":"no","node_allocation_decisions":[{"deciders":[{"decider":' + '"disk_threshold","decision":"NO","explanation":"the node is above the high ' + "watermark cluster setting [cluster.routing.allocation.disk.watermark.high." + 'max_headroom=150gb]"}]}]}' +) + + +class TestSearchAllocationPrecheck(unittest.TestCase): + def run_precheck(self, created, health_rc=0, entrypoint=("echo", "ENTRYPOINT")): + """Run the precheck against a stubbed `curl` with a 1 s readiness deadline. + + Args: + created: body the stubbed index creation answers with. + health_rc: exit code of the stubbed `_cluster/health` probe. + entrypoint: command the precheck execs once shards allocate. + + Returns: + Tuple of the exit code, stdout plus stderr, and the recorded `curl` calls. + """ + with tempfile.TemporaryDirectory() as tmp: + stub_dir = Path(tmp) + curl = stub_dir / "curl" + curl.write_text(CURL_STUB) + curl.chmod(0o755) + (stub_dir / "created").write_text(created) + (stub_dir / "explain").write_text(WATERMARK) + (stub_dir / "calls").write_text("") + env = dict(os.environ) + env["PATH"] = f"{stub_dir}{os.pathsep}{env['PATH']}" + env["STUB_DIR"] = tmp + env["HEALTH_RC"] = str(health_rc) + env["ELASTICSEARCH_SCHEMA"] = "http" + env["ELASTICSEARCH_HOST"] = "elasticsearch" + env["ELASTICSEARCH_PORT"] = "9200" + env["ELASTICSEARCH_NAMESPACE"] = "zammad" + env["HOSTNAME"] = "0A1B2C3D4E5F" + done = subprocess.run( + ["bash", str(SCRIPT), "1", "1", "60", *entrypoint], + env=env, + capture_output=True, + text=True, + check=False, + ) + calls = ( + stub_dir / "calls" + ).read_text() # nocheck: cache-read tempdir fixture + return done.returncode, done.stdout + done.stderr, calls + + def test_an_allocated_probe_starts_zammad_init(self): + code, output, calls = self.run_precheck(ALLOCATED) + self.assertEqual(code, 0) + self.assertIn("ENTRYPOINT", output) + self.assertIn( + "-X PUT http://elasticsearch:9200/zammad_allocation_probe_0a1b2c3d4e5f?wait_for_active_shards=1&timeout=60s", + calls, + ) + self.assertEqual(calls.count("-X DELETE"), 2) + + def test_a_refused_shard_fails_with_the_watermark_explanation(self): + code, output, calls = self.run_precheck(REFUSED) + self.assertEqual(code, 1) + self.assertNotIn("ENTRYPOINT", output) + self.assertIn( + "allocated no primary shard for zammad_allocation_probe_0a1b2c3d4e5f", + output, + ) + self.assertIn("watermark.high.max_headroom=150gb", output) + self.assertIn("_cluster/allocation/explain", calls) + self.assertEqual(calls.count("-X DELETE"), 2) + + def test_an_unreachable_search_service_fails_after_the_deadline(self): + code, output, calls = self.run_precheck(ALLOCATED, health_rc=7) + self.assertEqual(code, 1) + self.assertIn("http://elasticsearch:9200 did not answer within 1s", output) + self.assertNotIn("-X PUT", calls) + + def test_a_missing_entrypoint_is_refused(self): + code, output, _ = self.run_precheck(ALLOCATED, entrypoint=()) + self.assertEqual(code, 2) + self.assertIn("entrypoint required", output) + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/unit/python/utils/github/variant/test_axes.py b/tests/unit/python/utils/github/variant/test_axes.py index 41d50ae904..11467a6646 100644 --- a/tests/unit/python/utils/github/variant/test_axes.py +++ b/tests/unit/python/utils/github/variant/test_axes.py @@ -113,6 +113,7 @@ class TestArtifactSlug(unittest.TestCase): entry["distro"], entry["filesystem"], entry["architecture"], + entry["vpn"] == "true", ), ), ) @@ -224,7 +225,7 @@ class TestPriorityCoverage(unittest.TestCase): def test_an_incapable_priority_variant_skips_its_onion_runs(self) -> None: rows = [_row("web-app-a", 1, ("compose", "swarm"), priority=True)] entries = _assign(rows, sweep=0, tor_mode="auto", variants_per_app=_VARIANTS) - self.assertEqual([e["tor"] for e in entries], ["false", "false"]) + self.assertEqual({e["tor"] for e in entries}, {"false"}) class TestAssign(unittest.TestCase): @@ -324,6 +325,29 @@ class TestAssign(unittest.TestCase): self.assertNotIn("false", [e["tor"] for e in entries]) +class TestMeshRotation(unittest.TestCase): + _ROWS = tuple(_row("web-app-b", 0, ("compose", "swarm")) for _ in range(8)) + + def _entries(self, sweep: int) -> list[dict[str, str]]: + return _assign( + self._ROWS, sweep=sweep, tor_mode="auto", variants_per_app=_VARIANTS + ) + + def test_every_sweep_lands_swarm_rows_on_both_arms(self) -> None: + for sweep in range(8): + with self.subTest(sweep=sweep): + arms = {e["vpn"] for e in self._entries(sweep) if e["mode"] == "swarm"} + self.assertEqual(arms, {"true", "false"}) + + def test_a_compose_row_never_carries_the_mesh(self) -> None: + for sweep in range(8): + with self.subTest(sweep=sweep): + arms = { + e["vpn"] for e in self._entries(sweep) if e["mode"] == "compose" + } + self.assertEqual(arms, {"false"}) + + class TestPinnedAxes(unittest.TestCase): def _entries(self, row: dict) -> list[dict[str, str]]: return _assign([row], sweep=0, tor_mode="auto", variants_per_app=_VARIANTS) @@ -373,9 +397,30 @@ class TestPinnedAxes(unittest.TestCase): priority=True, pin_mode="swarm", pin_tor=False, + pin_vpn=False, ) self.assertEqual(len(self._entries(row)), 1) + def test_a_held_mesh_axis_overrides_a_priority_rows_pin(self) -> None: + row = _row( + "web-app-b", 0, ("swarm",), priority=True, pin_mode="swarm", pin_vpn=False + ) + entries = _assign( + [row], + sweep=0, + tor_mode="auto", + variants_per_app=_VARIANTS, + vpn_mode="enforced", + ) + self.assertNotEqual(entries, []) + self.assertEqual({e["vpn"] for e in entries}, {"true"}) + + def test_a_priority_rows_pin_still_narrows_a_rotating_axis(self) -> None: + row = _row( + "web-app-b", 0, ("swarm",), priority=True, pin_mode="swarm", pin_vpn=False + ) + self.assertEqual({e["vpn"] for e in self._entries(row)}, {"false"}) + def test_an_unoffered_mode_aborts_the_matrix(self) -> None: row = _row("web-app-b", 0, ("compose",), pin_mode="swarm") with self.assertRaises(SystemExit): @@ -449,7 +494,13 @@ class TestDistroAndFilesystemAxes(unittest.TestCase): def test_a_priority_row_spreads_its_combinations_over_the_pool(self) -> None: rows = [_row("web-app-b", 0, ("compose", "swarm"), priority=True)] entries = _assign(rows, sweep=0, tor_mode="auto", variants_per_app=_VARIANTS) - self.assertEqual(len({e["distro"] for e in entries}), len(entries)) + self.assertEqual( + len({e["distro"] for e in entries}), + min(len(entries), len(axes.DISTROS)), + "a priority row must walk the pool, not repeat one distribution; " + "once it has more combinations than the pool has members, the " + "rotation wraps and every distribution is proven at least once", + ) def test_a_pinned_distro_replaces_the_rotation(self) -> None: rows = [_row("web-app-b", 0, ("compose",), pin_distro="fedora")] @@ -505,6 +556,7 @@ class TestDistroAndFilesystemAxes(unittest.TestCase): entry["label"].startswith( to_emoji("compose") + to_emoji("clearnet") + + to_emoji("direct") + to_emoji("debian") + to_emoji("zfs") ) diff --git a/tests/unit/python/utils/networks/test_mesh_peers.py b/tests/unit/python/utils/networks/test_mesh_peers.py new file mode 100644 index 0000000000..dd68e7a888 --- /dev/null +++ b/tests/unit/python/utils/networks/test_mesh_peers.py @@ -0,0 +1,39 @@ +import unittest + +from utils.networks.mesh import dialled_peers, is_full, listens + +HUB_PEER = {"host": "mgr", "address": "10.100.0.1", "is_hub": True} +SPOKE_PEER = {"host": "wrk", "address": "10.100.0.11", "is_hub": False} +OTHER_PEER = {"host": "nfs", "address": "10.100.0.12", "is_hub": False} + +HUB = {"name": "swarm", "is_hub": True, "peers": [SPOKE_PEER, OTHER_PEER]} +SPOKE = {"name": "swarm", "is_hub": False, "peers": [HUB_PEER]} +FULL = {"name": "alpha", "is_hub": False, "peers": [SPOKE_PEER, OTHER_PEER]} + + +class TestHubAndSpoke(unittest.TestCase): + def test_only_the_hub_listens(self): + self.assertTrue(listens(HUB)) + self.assertFalse(listens(SPOKE)) + + def test_a_spoke_dials_its_hub_alone(self): + self.assertEqual([HUB_PEER], dialled_peers(SPOKE)) + + def test_the_hub_dials_nobody(self): + self.assertEqual([], dialled_peers(HUB)) + + def test_neither_is_a_full_mesh(self): + self.assertFalse(is_full(HUB)) + self.assertFalse(is_full(SPOKE)) + + +class TestFullMesh(unittest.TestCase): + def test_a_member_listens(self): + self.assertTrue(is_full(FULL)) + self.assertTrue(listens(FULL)) + + def test_a_member_dials_every_peer(self): + self.assertEqual([SPOKE_PEER, OTHER_PEER], dialled_peers(FULL)) + + def test_a_malformed_peer_list_dials_nobody(self): + self.assertEqual([], dialled_peers({"is_hub": False, "peers": "mgr"})) diff --git a/tests/unit/python/utils/tests/swarm/test_matrix_run_reporting.py b/tests/unit/python/utils/tests/swarm/test_matrix_run_reporting.py deleted file mode 100644 index 29ffa92b2f..0000000000 --- a/tests/unit/python/utils/tests/swarm/test_matrix_run_reporting.py +++ /dev/null @@ -1,42 +0,0 @@ -import contextlib -import io -import unittest -import unittest.mock as mock - -from utils.tests.swarm import matrix - - -class TestRunReporting(unittest.TestCase): - """Every matrix phase must state what it cost. - - A phase that only announces its start leaves the reader subtracting - timestamps by hand, and a phase that produces no output of its own becomes - invisible: the credential rotation spent 17 minutes of a budget-killed job - with nothing but the 30-second sampler in between. - """ - - def _run_capturing(self, rc: int) -> tuple[int, str]: - buffer = io.StringIO() - with ( - mock.patch.object(matrix, "run_watched", return_value=rc) as watched, - contextlib.redirect_stdout(buffer), - ): - returned = matrix._run(["true"], env={"A": "b"}, label="demo phase") - watched.assert_called_once_with(["true"], env={"A": "b"}) - return returned, buffer.getvalue() - - def test_the_exit_code_passes_through(self) -> None: - returned, _ = self._run_capturing(7) - self.assertEqual(returned, 7) - - def test_the_phase_announces_its_start(self) -> None: - _, output = self._run_capturing(0) - self.assertIn("=== swarm-matrix: demo phase ===", output) - - def test_the_phase_reports_its_duration_and_outcome(self) -> None: - _, output = self._run_capturing(124) - self.assertRegex(output, r"demo phase took \d+s \(rc=124\)") - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/unit/python/utils/tests/swarm/test_mesh_steps.py b/tests/unit/python/utils/tests/swarm/test_mesh_steps.py new file mode 100644 index 0000000000..833bde442a --- /dev/null +++ b/tests/unit/python/utils/tests/swarm/test_mesh_steps.py @@ -0,0 +1,153 @@ +from __future__ import annotations + +import tempfile +import unittest +import unittest.mock as mock +from pathlib import Path + +from utils.cache.yaml import load_yaml_any +from utils.tests.swarm import mesh as mesh_steps + +MESH = """\ +applications: + svc-net-wireguard: + networks: + interfaces: + - name: swarm + host: {host} + address: {address} +""" + + +class TestSwitchToMeshTransport(unittest.TestCase): + def _inventory(self, td: str) -> Path: + host_vars = Path(td) / "host_vars" + host_vars.mkdir() + for host, address in ( + ("web-app-openbao-swarm-mgr-01", "10.100.0.1"), + ("web-app-openbao-swarm-wrk-01", "10.100.0.12"), + ("localhost", "10.100.0.11"), + ): + (host_vars / f"{host}.yml").write_text( + MESH.format(host=host, address=address), encoding="utf-8" + ) + return host_vars + + def _run(self, td: str) -> int: + env = { + "INFINITO_SWARM_VPN": "true", + "INFINITO_SWARM_MESHES": "", + "KEY_PATH": str(Path(td) / "admin.key"), + } + with mock.patch.dict("os.environ", env, clear=False): + return mesh_steps.switch_to_mesh_transport(inv_dir=td) + + def test_a_node_is_pointed_at_its_mesh_address(self): + with tempfile.TemporaryDirectory() as td: + host_vars = self._inventory(td) + self.assertEqual(self._run(td), 0) + doc = load_yaml_any(str(host_vars / "web-app-openbao-swarm-wrk-01.yml")) + + self.assertEqual(doc["ansible_host"], "10.100.0.12") + self.assertEqual(doc["ansible_connection"], "ssh") + + def test_the_controller_keeps_its_own_transport(self): + with tempfile.TemporaryDirectory() as td: + host_vars = self._inventory(td) + self.assertEqual(self._run(td), 0) + doc = load_yaml_any(str(host_vars / "localhost.yml")) + + self.assertNotIn("ansible_connection", doc) + self.assertNotIn("ansible_host", doc) + + +EXAMPLE = "inventories/examples/wireguard-three-meshes/wireguard.yml" + + +class TestLayout(unittest.TestCase): + def _env(self, meshes: str): + return mock.patch.dict( + "os.environ", + {"INFINITO_SWARM_VPN": "true", "INFINITO_SWARM_MESHES": meshes}, + clear=False, + ) + + def test_an_unset_choice_deploys_the_development_meshes(self): + with self._env(""): + self.assertEqual(mesh_steps.transport_mesh(), "swarm") + + def test_an_example_moves_the_transport_onto_its_first_mesh(self): + with self._env(EXAMPLE): + self.assertEqual(mesh_steps.transport_mesh(), "alpha") + + def test_the_layout_is_handed_over_as_inventory_values(self): + with self._env(EXAMPLE): + applications = mesh_steps.layout_applications() + self.assertEqual( + ["alpha", "beta", "gamma"], + [ + mesh["name"] + for mesh in applications["svc-net-wireguard"]["networks"]["meshes"] + ], + ) + self.assertEqual( + ["alpha"], applications["svc-swarm-node"]["networks"]["meshes"] + ) + + def test_the_writer_reads_the_meshes_from_the_inventory(self): + with ( + self._env(EXAMPLE), + mock.patch.object(mesh_steps, "run_step", return_value=0) as step, + ): + self.assertEqual(mesh_steps.write_mesh(inv_dir="/tmp/inv"), 0) + argv = step.call_args.args[0] + self.assertNotIn("--group-vars-file", argv) + self.assertEqual(argv[argv.index("--controller-mesh") + 1], "alpha") + + +LINKS = """[ + {"ifname": "alpha", "addr_info": [{"local": "10.100.10.11", "prefixlen": 24}]}, + {"ifname": "swarm", "addr_info": [{"local": "10.100.0.11", "prefixlen": 24}]}, + {"ifname": "wg0", "addr_info": [{"local": "10.8.0.2", "prefixlen": 24}]} +]""" + + +class TestStaleControllerInterfaces(unittest.TestCase): + def _stale(self) -> list[str]: + listed = mock.Mock(stdout=LINKS) + with ( + mock.patch.dict("os.environ", {"INFINITO_SWARM_MESHES": ""}, clear=False), + mock.patch.object(mesh_steps.subprocess, "run", return_value=listed), + ): + return mesh_steps.stale_controller_interfaces() + + def test_a_pool_link_no_declaration_names_is_stale(self): + self.assertIn("alpha", self._stale()) + + def test_a_declared_mesh_is_kept(self): + self.assertNotIn("swarm", self._stale()) + + def test_a_link_outside_the_pool_is_not_the_harness_to_remove(self): + self.assertNotIn("wg0", self._stale()) + + def test_the_stale_link_goes_before_the_controller_joins(self): + calls: list[list[str]] = [] + with ( + tempfile.TemporaryDirectory() as td, + mock.patch.dict("os.environ", {"INFINITO_SWARM_VPN": "true"}, clear=False), + mock.patch.object( + mesh_steps, "stale_controller_interfaces", return_value=["alpha"] + ), + mock.patch.object( + mesh_steps, + "run_step", + side_effect=lambda cmd, **_: calls.append(cmd) or 0, + ), + ): + self.assertEqual(mesh_steps.mesh_controller(inv_dir=td), 0) + self.assertEqual(calls[0][-4:], ["ip", "link", "delete", "alpha"]) + self.assertEqual(calls[1][0], "ansible-playbook") + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/unit/python/utils/tests/swarm/test_run_reporting.py b/tests/unit/python/utils/tests/swarm/test_run_reporting.py new file mode 100644 index 0000000000..73d37527e5 --- /dev/null +++ b/tests/unit/python/utils/tests/swarm/test_run_reporting.py @@ -0,0 +1,52 @@ +import contextlib +import io +import unittest +import unittest.mock as mock + +from utils.tests.swarm import matrix, run + + +class TestRunReporting(unittest.TestCase): + """Every matrix phase must state what it cost. + + A phase that only announces its start leaves the reader subtracting + timestamps by hand, and a phase that produces no output of its own becomes + invisible: the credential rotation spent 17 minutes of a budget-killed job + with nothing but the 30-second sampler in between. + """ + + _RUNNERS = ((matrix, "_run"), (run, "run_step")) + + def _run_capturing(self, module, name: str, rc: int) -> tuple[int, str]: + buffer = io.StringIO() + with ( + mock.patch.object(module, "run_watched", return_value=rc) as watched, + contextlib.redirect_stdout(buffer), + ): + returned = getattr(module, name)( + ["true"], env={"A": "b"}, label="demo phase" + ) + watched.assert_called_once_with(["true"], env={"A": "b"}) + return returned, buffer.getvalue() + + def test_the_exit_code_passes_through(self) -> None: + for module, name in self._RUNNERS: + with self.subTest(runner=f"{module.__name__}.{name}"): + returned, _ = self._run_capturing(module, name, 7) + self.assertEqual(returned, 7) + + def test_the_phase_announces_its_start(self) -> None: + for module, name in self._RUNNERS: + with self.subTest(runner=f"{module.__name__}.{name}"): + _, output = self._run_capturing(module, name, 0) + self.assertIn("=== swarm-matrix: demo phase ===", output) + + def test_the_phase_reports_its_duration_and_outcome(self) -> None: + for module, name in self._RUNNERS: + with self.subTest(runner=f"{module.__name__}.{name}"): + _, output = self._run_capturing(module, name, 124) + self.assertRegex(output, r"demo phase took \d+s \(rc=124\)") + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/unit/python/utils/tests/swarm/test_write_extras.py b/tests/unit/python/utils/tests/swarm/test_write_extras.py index 823fd8076c..d6e622b8ea 100644 --- a/tests/unit/python/utils/tests/swarm/test_write_extras.py +++ b/tests/unit/python/utils/tests/swarm/test_write_extras.py @@ -4,9 +4,10 @@ import tempfile import unittest import unittest.mock as mock from pathlib import Path +from typing import ClassVar from utils import PROJECT_ROOT -from utils.cache.yaml import load_yaml_any +from utils.cache.yaml import dump_yaml, load_yaml_any from utils.env.parser import parse_static_env from utils.tests.swarm.write import extras as write_extras @@ -40,3 +41,105 @@ class TestWriteExtrasDomainPrimary(unittest.TestCase): with tempfile.TemporaryDirectory() as td: extras = self._run(td, {"INFINITO_DOMAIN": "override.example"}) self.assertEqual(extras["DOMAIN_PRIMARY"], "override.example") + + +class TestWriteExtrasMeshAddresses(unittest.TestCase): + MESHES: ClassVar[dict[str, dict[str, tuple[str, bool]]]] = { + "swarm-mgr-01": { + "alpha": ("10.100.10.1", True), + "beta": ("10.100.11.1", False), + }, + "nfs-server": { + "beta": ("10.100.11.11", True), + "gamma": ("10.100.12.11", False), + }, + } + + def _run(self, td: str, *, meshed: bool) -> dict: + out_path = Path(td) / "extras.yml" + host_vars = Path(td) / "host_vars" + host_vars.mkdir() + if meshed: + for host, meshes in self.MESHES.items(): + dump_yaml( + str(host_vars / f"{host}.yml"), + { + "applications": { + "svc-net-wireguard": { + "networks": { + "interfaces": [ + { + "name": name, + "host": host, + "address": address, + "primary": primary, + } + for name, (address, primary) in meshes.items() + ] + } + } + } + }, + ) + env = { + "NFS_IP": "192.168.244.13", + "MGR_IP": "192.168.244.10", + "MGR": "swarm-mgr-01", + "NFS_SERVER": "nfs-server", + "OUT_PATH": str(out_path), + "KEY_PATH": str(Path(td) / "admin.key"), + "INFINITO_SWARM_BACKUP_KEY": str(Path(td) / "backup.key"), + } + with mock.patch.dict("os.environ", env, clear=False): + self.assertEqual(write_extras.main(), 0) + return load_yaml_any(str(out_path)) + + def test_the_manager_advertises_its_primary_mesh_address(self): + with tempfile.TemporaryDirectory() as td: + extras = self._run(td, meshed=True) + self.assertEqual(extras["swarm"]["manager"]["advertise_addr"], "10.100.10.1") + + def test_the_export_is_mounted_from_the_servers_primary_mesh_address(self): + with tempfile.TemporaryDirectory() as td: + extras = self._run(td, meshed=True) + self.assertEqual(extras["storage"]["nfs"]["server"], "10.100.11.11") + + def test_a_round_without_a_mesh_keeps_the_underlay(self): + with tempfile.TemporaryDirectory() as td: + extras = self._run(td, meshed=False) + self.assertEqual(extras["swarm"]["manager"]["advertise_addr"], "192.168.244.10") + self.assertEqual(extras["storage"]["nfs"]["server"], "192.168.244.13") + + +class TestWriteExtrasBecomePassword(unittest.TestCase): + def _run(self, td: str) -> tuple[dict, dict]: + out_path = Path(td) / "extras.yml" + env = { + "NFS_IP": "192.168.244.2", + "MGR_IP": "192.168.244.3", + "MGR": "swarm-mgr-01", + "OUT_PATH": str(out_path), + "KEY_PATH": str(Path(td) / "admin.key"), + "INFINITO_SWARM_BACKUP_KEY": str(Path(td) / "backup.key"), + } + with mock.patch.dict("os.environ", env, clear=False): + self.assertEqual(write_extras.main(), 0) + return ( + load_yaml_any(str(out_path)), + load_yaml_any(str(out_path.with_suffix(".deploy.yml"))), + ) + + def test_become_matches_the_administrator_account(self): + with tempfile.TemporaryDirectory() as td: + extras, deploy = self._run(td) + + declared = extras["users"]["administrator"]["password"] + self.assertEqual(declared, extras["ansible_become_password"]) + self.assertEqual(declared, deploy["ansible_become_password"]) + + def test_the_deploy_twin_carries_it_although_users_are_stripped(self): + with tempfile.TemporaryDirectory() as td: + _, deploy = self._run(td) + + self.assertNotIn("users", deploy) + self.assertIn("ansible_become_password", deploy) diff --git a/utils/env/handlers/passthrough.py b/utils/env/handlers/passthrough.py index b3d945ac4f..b01f4bef1b 100644 --- a/utils/env/handlers/passthrough.py +++ b/utils/env/handlers/passthrough.py @@ -41,6 +41,9 @@ STATIC_KEYS = ( "INFINITO_PARENT_IMAGE_TAG", "INFINITO_KEEP_SWARM_NODES", "INFINITO_SWARM_TEST_LABEL", + "INFINITO_SWARM_MESHES", + "INFINITO_SWARM_VPN", + "INFINITO_VPN", "INFINITO_SWARM_MGR_NAME", "INFINITO_SWARM_STEP_TIMEOUT_MINUTES", "INFINITO_SWARM_TEARDOWN_RESERVE_SECONDS", diff --git a/utils/github/variant/axes.py b/utils/github/variant/axes.py index ccfb15f2a8..471f4407db 100644 --- a/utils/github/variant/axes.py +++ b/utils/github/variant/axes.py @@ -1,6 +1,6 @@ """Assign the deploy axes to CI matrix rows. -Every row of the CI matrix is one ``role#variant`` selection. Five axes are +Every row of the CI matrix is one ``role#variant`` selection. Six axes are decided here, all as a deterministic rotation over the row's position in the *global* discovery order and the sweep number -- never at random, so a red job can be reproduced by re-running the same sweep, and so consecutive sweeps @@ -13,8 +13,10 @@ cover the combinations instead of sampling them: modes on consecutive sweeps. * **tor** -- whether the row deploys behind the node onion. Driven by - ``sweep // 2`` so it does NOT flip in lockstep with the mode; a row walks - all four mode/tor combinations over four sweeps instead of only two. + ``sweep // 2`` so it does NOT flip in lockstep with the mode. + +* **vpn** -- whether a swarm row deploys over the WireGuard mesh + (:mod:`utils.github.variant.vpn`); every other mode takes the direct arm. * **distro** -- which declared distribution the row deploys on. Per row rather than per run, so one sweep proves every distribution instead of proving one @@ -22,12 +24,11 @@ cover the combinations instead of sampling them: exact distribution it died on. * **filesystem** -- which kind the row's docker data root runs on. The two - read the row's position like an odometer: the distro is the low digit and - the filesystem the high one, so consecutive rows walk every pairing rather - than a diagonal through it. Turning both on the position directly would - cover only ``n`` of the ``n x m`` pairs whenever the two pools happen to be - the same length, and no sweep would unlock it, because the sweep shifts both - by the same amount. + read the row's position like an odometer, the distro as the low digit, so + consecutive rows walk every pairing rather than a diagonal through it. + Turning both on the position directly would cover only ``n`` of the + ``n x m`` pairs whenever the pools are the same length, and no sweep would + unlock it. * **architecture** -- which CPU architecture the row deploys on, and through :func:`utils.github.variant.pools.runner_of` which runner it lands on. It @@ -74,6 +75,11 @@ from utils.github.variant.tor import ( tor_states, wants_tor, ) +from utils.github.variant.vpn import ( + VPN_DEPLOY_MODES, + pinned_vpn_states, + rotated_vpn, +) from utils.roles.display import VARIANT_SEPARATOR, display_names from utils.roles.meta_lookup import get_role_architectures from utils.symbol_glossary import to_emoji @@ -260,6 +266,7 @@ def assign( distros: Sequence[str], filesystems: Sequence[str], architectures: Sequence[str] = ARCHITECTURES, + vpn_mode: str = "auto", variants_per_app: Mapping[str, Sequence[Mapping[str, Any]]] | None = None, ) -> list[dict[str, str]]: """Turn ordered discovery rows into CI matrix entries. @@ -278,12 +285,12 @@ def assign( distros: the distributions this run may draw from (:func:`resolve_pool`). filesystems: the docker data-root kinds this run may draw from. A pool - of exactly one, like a token that pins the kind, is a human naming - it: the entry then carries ``enforce_filesystem``, and a host that - cannot serve it fails instead of substituting one. A wider pool - leaves the row's kind a preference, because the matrix narrows - every row to one kind and reading that as a demand would fail rows - for conditions the applying step is built to tolerate. + of exactly one is a human naming it: the entry then carries + ``enforce_filesystem`` and a host that cannot serve it fails + instead of substituting one. A wider pool leaves the kind a + preference, because the matrix narrows every row to one anyway. + vpn_mode: ``enforced`` meshes every swarm row, ``disabled`` none, + ``auto`` rotates. variants_per_app: rendered variant configs per app, so a variant that switches the tor gate off is never counted capable. @@ -293,11 +300,10 @@ def assign( discovery ``id`` and the ``covered`` id of the earlier row that already embeds it (``0``: nothing does), so a reader of the plan can tell a redundant row from a unique one without a second query. A regular row - yields - exactly one -- the rotation picks its combination for this sweep. A - priority row yields every combination :func:`combinations` allows, so - the roles a run is told to prove are proven everywhere at once rather - than sampled over four sweeps. ``disable`` carries the provider tokens + yields exactly one. A priority row yields every combination + :func:`combinations` allows, so the roles a run is told to prove are + proven everywhere at once rather than sampled over four sweeps. + ``disable`` carries the provider tokens the deploy drill switches off; a row without tor disables the provider so no dependency edge can pull it back into the closure. The provider's own rows therefore never take the clearnet state: disabling tor there @@ -318,6 +324,7 @@ def assign( pin_distro = row.get("pin_distro") pin_filesystem = row.get("pin_filesystem") pin_architecture = row.get("pin_architecture") + pin_vpn = row.get("pin_vpn") offered_architectures = row_architectures( app, architectures, row.get("services", ()) ) @@ -338,11 +345,12 @@ def assign( ) if priority: picked = [ - (mode, state) + (mode, state, meshed) for mode, state in combinations( offered, capable=capable, tor_mode=tor_mode ) if pin_mode in (None, mode) and pin_tor in (None, state) + for meshed in pinned_vpn_states(mode, pin=pin_vpn, vpn_mode=vpn_mode) ] else: mode = pin_mode or pick_mode( @@ -351,7 +359,17 @@ def assign( sweep, ) picked = [ - (mode, state) + ( + mode, + state, + rotated_vpn( + mode, + position=position, + sweep=sweep, + pin=pin_vpn, + vpn_mode=vpn_mode, + ), + ) for state in _rotated_tor( mode, capable=capable, @@ -362,9 +380,9 @@ def assign( ) ] if app == provider: - picked = [(mode, enabled) for mode, enabled in picked if enabled] + picked = [entry for entry in picked if entry[1]] label = codec.encode(app, variant_csv) - for step, (mode, enabled) in enumerate(picked): + for step, (mode, enabled, meshed) in enumerate(picked): distro = pin_distro or rotate(distros, position + step, sweep) filesystem = pin_filesystem or rotate( filesystems, (position + step) // len(distros), sweep @@ -379,6 +397,11 @@ def assign( if mode in TOR_DEPLOY_MODES else LOCAL_GLYPH ) + + ( + to_emoji("vpn" if meshed else "direct") + if mode in VPN_DEPLOY_MODES or mode == "compose" + else "" + ) + to_emoji(distro) + to_emoji(filesystem) + to_emoji(architecture) @@ -389,6 +412,7 @@ def assign( "variant": variant_csv, "mode": mode, "tor": "true" if enabled else "false", + "vpn": "true" if meshed else "false", "distro": distro, "filesystem": filesystem, "architecture": architecture, @@ -410,6 +434,7 @@ def assign( distro, filesystem, architecture, + meshed, ), "label": f"{glyphs}{label}" + (f" {to_emoji('priority')}" if priority else ""), diff --git a/utils/github/variant/label.py b/utils/github/variant/label.py index cd344eddce..0e9046b901 100644 --- a/utils/github/variant/label.py +++ b/utils/github/variant/label.py @@ -15,7 +15,10 @@ if TYPE_CHECKING: LOCAL_GLYPH = to_emoji("test_host") _AXIS_GLYPHS = ( - "".join(to_emoji(word) for word in ("tor", "clearnet", "priority", "instructions")) + "".join( + to_emoji(word) + for word in ("tor", "clearnet", "vpn", "direct", "priority", "instructions") + ) + LOCAL_GLYPH ) @@ -29,6 +32,8 @@ LABEL_RE = re.compile( r"^.*(?P" + _alternation(MODES) + r")️?" r"(?P" + re.escape(to_emoji("tor")) + r")?" r"(?:" + re.escape(to_emoji("clearnet")) + r"|" + re.escape(LOCAL_GLYPH) + r")?️?" + r"(?P" + re.escape(to_emoji("vpn")) + r")?️?" + r"(?:" + re.escape(to_emoji("direct")) + r")?️?" r"(?P" + _alternation(DISTROS) + r")?️?" r"(?P" + _alternation(FILESYSTEMS) + r")?️?" r"(?P" + _alternation(ARCHITECTURES) + r")?️?" @@ -37,6 +42,10 @@ LABEL_RE = re.compile( r"(?:" + re.escape(VARIANT_SEPARATOR) + r"(?P[0-9,]+))?" r"[" + re.escape(_AXIS_GLYPHS) + r"️\s]*$" ) +"""The leading ``.*`` is greedy on purpose: it anchors on the LAST mode glyph. +A reusable-workflow caller path can carry a mode glyph of its own (``z / πŸ’» +Host / πŸ’» sys-front-proxy``), and matching the first one would swallow the +caller name into the role.""" class Label(NamedTuple): @@ -49,6 +58,7 @@ class Label(NamedTuple): distro: str = "" filesystem: str = "" architecture: str = "" + vpn: bool = False def parse_label(name: str) -> Label | None: @@ -67,10 +77,11 @@ def parse_label(name: str) -> Label | None: ``None`` when the title carries no deploy row. ``name`` is the display name, returned unresolved -- callers decode it through ``utils.roles.display``, which is what knows the role tree. ``tor``, - ``distro`` and ``filesystem`` matter because a priority role runs the - same mode and variant several times over, and only the glyphs tell - those jobs apart -- a retrigger built from the title alone would - otherwise replay a different combination than the one that failed. + ``distro``, ``filesystem``, ``architecture`` and ``vpn`` matter + because a priority role runs the same mode and variant several times + over, and only the glyphs tell those jobs apart -- a retrigger built + from the title alone would otherwise replay a different combination + than the one that failed. """ match = LABEL_RE.match(name.strip()) if match is None: @@ -83,6 +94,7 @@ def parse_label(name: str) -> Label | None: to_word(match.group("distro") or ""), to_word(match.group("filesystem") or ""), to_word(match.group("architecture") or ""), + match.group("vpn") is not None, ) @@ -94,6 +106,7 @@ def artifact_slug( distro: str = "", filesystem: str = "", architecture: str = "", + vpn: bool = False, ) -> str: """What identifies one deploy job's artifacts. @@ -105,5 +118,12 @@ def artifact_slug( name one row on two distros (``role#0%debian role#0%fedora``), and those are two deploys of one mode, variant and onion state. """ - shards = (variant, "tor" if tor else "", distro, filesystem, architecture) + shards = ( + variant, + "tor" if tor else "", + "vpn" if vpn else "", + distro, + filesystem, + architecture, + ) return f"{mode}-{app}" + "".join(f"-{shard}" for shard in shards if shard) diff --git a/utils/github/variant/selection.py b/utils/github/variant/selection.py index e03bfe4ed6..9e7a50a136 100644 --- a/utils/github/variant/selection.py +++ b/utils/github/variant/selection.py @@ -2,20 +2,20 @@ A selection token names a role and MAY narrow the axes that role's rows would otherwise be assigned: which variants run, which deploy mode, whether the row -goes behind the node onion, which distribution it deploys on, which -filesystem its docker data root runs on and which CPU architecture it lands -on. What a token leaves open stays open, exactly as an unpinned run leaves it: -the priority line covers every mode and onion state the row can take, and the -sweep rotation picks the distro, the filesystem and the architecture on both -lines. +goes behind the node onion, whether it runs over the WireGuard mesh, which +distribution it deploys on, which filesystem its docker data root runs on and +which CPU architecture it lands on. What a token leaves open stays open, +exactly as an unpinned run leaves it: the priority line covers every mode and +onion state the row can take, and the sweep rotation picks the distro, the +filesystem and the architecture on both lines. Two spellings are accepted, so an operator can either type the token or paste back the job title of the run they want repeated: * the job label CI emits (``πŸ³πŸ§…πŸŒ€πŸ¦“πŸ¦Ύη½‘η»œεΊ”η”¨Β·Nextcloud#2``) -- the glyphs carry - mode, onion state, distro, filesystem and architecture, the ``#`` shard the - variants; -* an ASCII form (``web-app-nextcloud#0,2@swarm+tor%debian/zfs:arm64``). + mode, onion state, mesh state, distro, filesystem and architecture, the + ``#`` shard the variants; +* an ASCII form (``web-app-nextcloud#0,2@swarm+tor%debian/zfs:arm64&vpn``). The onion state spells out as ``+tor``/``+clearnet`` rather than as a ``-tor`` suffix: a role id may itself end in ``-tor`` (``svc-net-tor``), and a suffix @@ -50,8 +50,12 @@ FILESYSTEM_SEPARATOR = "/" ARCHITECTURE_SEPARATOR = ":" +VPN_SEPARATOR = "&" + TOR_WORDS = {"tor": True, "clearnet": False} +VPN_WORDS = {"vpn": True, "direct": False} + _STRIPPED_GLYPHS = ("priority", "test_host") _VARIATION = re.compile("[︎️]") @@ -63,6 +67,7 @@ _SEPARATORS = ( + DISTRO_SEPARATOR + FILESYSTEM_SEPARATOR + ARCHITECTURE_SEPARATOR + + VPN_SEPARATOR ) _TOKEN = re.compile( @@ -72,7 +77,8 @@ _TOKEN = re.compile( r"(?:" + re.escape(TOR_SEPARATOR) + r"(?P[a-z]+))?" r"(?:" + re.escape(DISTRO_SEPARATOR) + r"(?P[a-z0-9]+))?" r"(?:" + re.escape(FILESYSTEM_SEPARATOR) + r"(?P[a-z0-9]+))?" - r"(?:" + re.escape(ARCHITECTURE_SEPARATOR) + r"(?P[a-z0-9]+))?$" + r"(?:" + re.escape(ARCHITECTURE_SEPARATOR) + r"(?P[a-z0-9]+))?" + r"(?:" + re.escape(VPN_SEPARATOR) + r"(?P[a-z]+))?$" ) _SYNTAX = ( @@ -82,6 +88,7 @@ _SYNTAX = ( f"[{DISTRO_SEPARATOR}<{'|'.join(DISTROS)}>]" f"[{FILESYSTEM_SEPARATOR}<{'|'.join(FILESYSTEMS)}>]" f"[{ARCHITECTURE_SEPARATOR}<{'|'.join(ARCHITECTURES)}>]" + f"[{VPN_SEPARATOR}<{'|'.join(VPN_WORDS)}>]" ) @@ -89,8 +96,8 @@ class Pin(NamedTuple): """One selection token, taken apart. ``variants`` empty and ``mode``/``tor``/``distro``/``filesystem``/ - ``architecture`` ``None`` each mean "not pinned": that axis keeps whatever - the line it stands in would assign. + ``architecture``/``vpn`` ``None`` each mean "not pinned": that axis keeps + whatever the line it stands in would assign. """ app: str @@ -100,6 +107,7 @@ class Pin(NamedTuple): distro: str | None = None filesystem: str | None = None architecture: str | None = None + vpn: bool | None = None @property def pinned(self) -> bool: @@ -112,15 +120,25 @@ class Pin(NamedTuple): self.distro, self.filesystem, self.architecture, + self.vpn, ) ) @property def axes( self, - ) -> tuple[str | None, bool | None, str | None, str | None, str | None]: + ) -> tuple[ + str | None, bool | None, str | None, str | None, str | None, bool | None + ]: """What the token narrows, as the key two tokens are equal under.""" - return (self.mode, self.tor, self.distro, self.filesystem, self.architecture) + return ( + self.mode, + self.tor, + self.distro, + self.filesystem, + self.architecture, + self.vpn, + ) def describe(pin: Pin) -> str: @@ -138,6 +156,11 @@ def describe(pin: Pin) -> str: + (f"{DISTRO_SEPARATOR}{pin.distro}" if pin.distro else "") + (f"{FILESYSTEM_SEPARATOR}{pin.filesystem}" if pin.filesystem else "") + (f"{ARCHITECTURE_SEPARATOR}{pin.architecture}" if pin.architecture else "") + + ( + f"{VPN_SEPARATOR}{'vpn' if pin.vpn else 'direct'}" + if pin.vpn is not None + else "" + ) ) @@ -153,13 +176,16 @@ def _word_glyph(text: str, words: Iterable[str]) -> tuple[str, str | None]: def _glyphs( text: str, -) -> tuple[str, str | None, bool | None, str | None, str | None, str | None]: +) -> tuple[ + str, str | None, bool | None, str | None, str | None, str | None, bool | None +]: """Take the label glyphs off a pasted job title and read them as axes.""" text, mode = _word_glyph(text, MODES) text, onion = _word_glyph(text, TOR_WORDS) text, distro = _word_glyph(text, DISTROS) text, filesystem = _word_glyph(text, FILESYSTEMS) text, architecture = _word_glyph(text, ARCHITECTURES) + text, mesh = _word_glyph(text, VPN_WORDS) for word in _STRIPPED_GLYPHS: text = text.replace(to_emoji(word), "") return ( @@ -169,6 +195,7 @@ def _glyphs( distro, filesystem, architecture, + None if mesh is None else VPN_WORDS[mesh], ) @@ -194,9 +221,15 @@ def parse(token: str) -> Pin: that does not exist. A typo must abort the run rather than narrow it to nothing. """ - text, glyph_mode, glyph_tor, glyph_distro, glyph_fs, glyph_arch = _glyphs( - _VARIATION.sub("", token.strip()) - ) + ( + text, + glyph_mode, + glyph_tor, + glyph_distro, + glyph_fs, + glyph_arch, + glyph_vpn, + ) = _glyphs(_VARIATION.sub("", token.strip())) match = _TOKEN.match(text) if match is None: raise SystemExit(f"unparsable selection token {token!r}; expected {_SYNTAX}") @@ -207,6 +240,7 @@ def parse(token: str) -> Pin: ("distro", "distro", DISTROS), ("filesystem", "filesystem", FILESYSTEMS), ("architecture", "architecture", ARCHITECTURES), + ("vpn", "mesh state", VPN_WORDS), ): value = match.group(group) if value is not None and value not in declared: @@ -218,6 +252,7 @@ def parse(token: str) -> Pin: name = match.group("name") variants = match.group("variants") word = match.group("tor") + mesh_word = match.group("vpn") return Pin( display_names().decode(name) or name, tuple(int(index) for index in variants.split(",")) if variants else (), @@ -226,6 +261,7 @@ def parse(token: str) -> Pin: _agree(match.group("distro"), glyph_distro, token, "distro"), _agree(match.group("filesystem"), glyph_fs, token, "filesystem"), _agree(match.group("architecture"), glyph_arch, token, "architecture"), + _agree(VPN_WORDS[mesh_word] if mesh_word else None, glyph_vpn, token, "mesh"), ) @@ -251,7 +287,10 @@ def covers(pin: Pin, entry: Mapping[str, Any]) -> bool: ): if value is not None and entry.get(key) != value: return False - return pin.tor is None or (entry.get("tor") == "true") == pin.tor + for pinned, key in ((pin.tor, "tor"), (pin.vpn, "vpn")): + if pinned is not None and (entry.get(key) == "true") != pinned: + return False + return True def parse_list(tokens: str) -> list[Pin]: @@ -334,6 +373,7 @@ def apply( "pin_distro": pin.distro, "pin_filesystem": pin.filesystem, "pin_architecture": pin.architecture, + "pin_vpn": pin.vpn, } ) for index, pin in enumerate(pins): diff --git a/utils/github/variant/vpn.py b/utils/github/variant/vpn.py new file mode 100644 index 0000000000..3c424b4a04 --- /dev/null +++ b/utils/github/variant/vpn.py @@ -0,0 +1,69 @@ +from __future__ import annotations + +import os + +VPN_MODES = ("auto", "enforced", "disabled") + +VPN_DEPLOY_MODES = ("swarm",) + + +def resolve_vpn_mode(raw: str | None = None) -> str: + """Mesh axis mode from ``INFINITO_VPN``. + + Args: + raw: explicit value; ``None`` reads the environment. + + Returns: + one of :data:`VPN_MODES`, ``auto`` for an unknown or empty value. + """ + if raw is None: + raw = os.environ.get("INFINITO_VPN") + value = (raw or "").strip().lower() + return value if value in VPN_MODES else "auto" + + +def vpn_states(mode: str, *, vpn_mode: str = "auto") -> list[bool]: + if mode not in VPN_DEPLOY_MODES: + return [False] + if vpn_mode == "enforced": + return [True] + if vpn_mode == "disabled": + return [False] + return [False, True] + + +def pinned_vpn_states( + mode: str, *, pin: bool | None = None, vpn_mode: str = "auto" +) -> list[bool]: + """The mesh states a priority row takes, global axis ahead of the pin. + + Args: + mode: the deploy mode of the row. + pin: the state the row asked for, or None for every state. + vpn_mode: the run's axis mode. + """ + states = vpn_states(mode, vpn_mode=vpn_mode) + if vpn_mode in ("enforced", "disabled") or pin is None: + return states + return [state for state in states if state == pin] + + +def wants_vpn(position: int, sweep: int) -> bool: + return (position // 2 + sweep // 4) % 2 == 0 + + +def rotated_vpn( + mode: str, + *, + position: int, + sweep: int, + pin: bool | None = None, + vpn_mode: str = "auto", +) -> bool: + if mode not in VPN_DEPLOY_MODES: + return False + if vpn_mode in ("enforced", "disabled"): + return vpn_mode == "enforced" + if pin is not None: + return pin + return wants_vpn(position, sweep) diff --git a/utils/networks/mesh.py b/utils/networks/mesh.py new file mode 100644 index 0000000000..874678cfee --- /dev/null +++ b/utils/networks/mesh.py @@ -0,0 +1,97 @@ +from __future__ import annotations + +from collections.abc import Iterable, Mapping +from typing import Any + +APPLICATION_ID = "svc-net-wireguard" +HUB_ROLE = "svc-swarm-manager" +MESHES_KEY = "meshes" +INTERFACES_KEY = "interfaces" + + +def _listed(applications: Any, role: str, key: str) -> list[Any]: + if not isinstance(applications, Mapping): + return [] + networks = (applications.get(role) or {}).get("networks") or {} + value = networks.get(key) if isinstance(networks, Mapping) else None + return list(value) if isinstance(value, (list, tuple)) else [] + + +def declared_meshes(applications: Any) -> list[Mapping[str, Any]]: + return [ + entry + for entry in _listed(applications, APPLICATION_ID, MESHES_KEY) + if isinstance(entry, Mapping) + ] + + +def joined_meshes(applications: Any, roles: Iterable[str]) -> dict[str, list[str]]: + """Mesh name to the roles that put the host into it. + + Args: + applications: the host's ``applications`` block. + roles: the role groups the host belongs to. + """ + joined: dict[str, list[str]] = {} + for role in roles: + if role == APPLICATION_ID: + continue + for name in _listed(applications, role, MESHES_KEY): + joined.setdefault(str(name), []).append(role) + return joined + + +def interfaces(applications: Any) -> list[Mapping[str, Any]]: + return [ + entry + for entry in _listed(applications, APPLICATION_ID, INTERFACES_KEY) + if isinstance(entry, Mapping) + ] + + +def owned_interface( + applications: Any, host: str, mesh: str +) -> Mapping[str, Any] | None: + for entry in interfaces(applications): + if entry.get("name") == mesh and entry.get("host") == host: + return entry + return None + + +def address_on(applications: Any, host: str, mesh: str) -> str: + entry = owned_interface(applications, host, mesh) or {} + address = entry.get("address") + return address if isinstance(address, str) else "" + + +def _peers(interface: Mapping[str, Any]) -> list[Mapping[str, Any]]: + listed = interface.get("peers") + if not isinstance(listed, (list, tuple)): + return [] + return [peer for peer in listed if isinstance(peer, Mapping)] + + +def is_full(interface: Mapping[str, Any]) -> bool: + return not interface.get("is_hub") and not any( + peer.get("is_hub") for peer in _peers(interface) + ) + + +def listens(interface: Mapping[str, Any]) -> bool: + return bool(interface.get("is_hub")) or is_full(interface) + + +def dialled_peers(interface: Mapping[str, Any]) -> list[Mapping[str, Any]]: + peers = _peers(interface) + if is_full(interface): + return peers + return [peer for peer in peers if peer.get("is_hub")] + + +def primary_address(applications: Any, host: str) -> str: + for entry in interfaces(applications): + if entry.get("primary") and entry.get("host") == host: + address = entry.get("address") + if isinstance(address, str) and address: + return address + return "" diff --git a/utils/packages/calls.py b/utils/packages/calls.py index bdb520fea1..714183b574 100644 --- a/utils/packages/calls.py +++ b/utils/packages/calls.py @@ -61,6 +61,9 @@ class ModuleCall: retry: RetryPolicy | None = None +MANAGER_ARGS: dict[str, dict[str, Any]] = {"apt": {"install_recommends": False}} + + def package_call(names: list[str], state: str) -> ModuleCall: """Install or remove *names* through the host's own package manager.""" return ModuleCall( diff --git a/utils/symbol_glossary.py b/utils/symbol_glossary.py index 76d5a4a391..8ff2ae6ab8 100644 --- a/utils/symbol_glossary.py +++ b/utils/symbol_glossary.py @@ -37,6 +37,8 @@ SYMBOLS: dict[str, str] = { "swarm": "🐝", "tor": "πŸ§…", "clearnet": "🌐", + "vpn": "πŸš‡", + "direct": "πŸ›£οΈ", "stack": "πŸ₯ž", "host": "πŸ’»", "row": "πŸ”’", diff --git a/utils/tests/swarm/extend_inventory.py b/utils/tests/swarm/extend_inventory.py index 67b2cd8cee..35d6bee847 100755 --- a/utils/tests/swarm/extend_inventory.py +++ b/utils/tests/swarm/extend_inventory.py @@ -43,6 +43,12 @@ _DOCKER_VARS: dict[str, str] = { _NAMES = parse_static_env(PROJECT_ROOT / "default.env") _PREFIX = f"{os.environ['SWARM_NAME']}-" if os.environ.get("SWARM_NAME") else "" _MANAGER = f"{_PREFIX}{_NAMES['INFINITO_SWARM_MGR_NAME']}" + + +def mesh_enabled() -> bool: + return (os.environ.get("INFINITO_SWARM_VPN") or "").strip().lower() == "true" + + _WORKERS = ( f"{_PREFIX}{_NAMES['INFINITO_SWARM_WRK1_NAME']}", f"{_PREFIX}{_NAMES['INFINITO_SWARM_WRK2_NAME']}", @@ -55,6 +61,13 @@ def _host_topology(app_id: str) -> list[tuple[str, str]]: app_hosts: list[tuple[str, str]] = [(app_id, _MANAGER)] if app_id != "svc-swarm-manager" and get_role_placement(app_id) != "manager": app_hosts.extend((app_id, w) for w in _WORKERS) + mesh_hosts: list[tuple[str, str]] = [] + if mesh_enabled(): + mesh_hosts = [ + ("svc-net-wireguard", _MANAGER), + *[("svc-net-wireguard", w) for w in _WORKERS], + ("svc-net-wireguard", _NFS_SERVER), + ] return [ ("svc-swarm-node", _MANAGER), *[("svc-swarm-node", w) for w in _WORKERS], @@ -62,6 +75,7 @@ def _host_topology(app_id: str) -> list[tuple[str, str]]: ("svc-storage-nfs-client", _MANAGER), *[("svc-storage-nfs-client", w) for w in _WORKERS], ("svc-storage-nfs-server", _NFS_SERVER), + *mesh_hosts, *app_hosts, ] @@ -128,7 +142,11 @@ def main() -> int: "all": { "children": { group: {"hosts": {_BACKUP: dict(_DOCKER_VARS)}} - for group in ("svc-bkp-remote-2-local", "svc-bkp-local-2-device") + for group in ( + "svc-bkp-remote-2-local", + "svc-bkp-local-2-device", + *(("svc-net-wireguard",) if mesh_enabled() else ()), + ) } } } diff --git a/utils/tests/swarm/matrix.py b/utils/tests/swarm/matrix.py index 47e16de60c..a64bb9d344 100644 --- a/utils/tests/swarm/matrix.py +++ b/utils/tests/swarm/matrix.py @@ -1,32 +1,28 @@ -"""Swarm variant-matrix round orchestrator. - -Mirrors the compose matrix deploy (``cli.administration.deploy.development.deploy``) -for the swarm test cluster: for each variant round of the primary app it -provisions a per-round inventory (baking that round's ``meta/variants.yml`` -overlay into ``host_vars`` so the deploy sees the round's config, e.g. the -keycloak totp-off variant), extends it with the swarm topology, writes runtime -extras, and deploys via ``cli.administration.deploy.swarm`` (the Playwright e2e -runs in-deploy). Each round mirrors the compose ``--full-cycle``: an initial -deploy then an async update pass, each followed by a convergence + reachability -wait; on the first round the backup + restore DR drill runs between them. Prior -rounds' stacks are purged between rounds. - -Runs on the cluster host (the test-deploy-swarm workflow's single orchestrator -step) and reaches the nodes through the existing ``scripts/tests/deploy/swarm`` -helpers, which it drives per round via environment variables. -""" +"""Swarm variant-matrix round orchestrator.""" from __future__ import annotations import argparse import json import os +import subprocess import sys import time +from plugins.filter.merge.with_defaults import merge_with_defaults from utils import PROJECT_ROOT from utils.storage.constrained import host_storage_constrained from utils.tests.swarm.derive_includes import derive_includes, variant_scope +from utils.tests.swarm.extend_inventory import mesh_enabled +from utils.tests.swarm.mesh import ( + bootstrap_mesh, + converge_mesh, + lab_sudo_without_prompt, + layout_applications, + mesh_controller, + switch_to_mesh_transport, + write_mesh, +) from utils.tests.swarm.watchdog import DISK_FLOOR_MB, run_watched from utils.tests.swarm.write.extras import ensure_swarm_keypairs @@ -110,18 +106,7 @@ def _write_extras(*, extras_path: str) -> int: def _reset_credentials( *, app_id: str, inv_dir: str, round_variants: dict[str, int] ) -> int: - """Regenerate the round's credentials so the update pass has to carry them. - - `administrator` stays exempt: its password is `ansible_become_password`, - and rotating it would lock the deploy out of the nodes it manages. - - The credential scope is `derive_includes`, the same source - `02_provision_inventory.sh` feeds provision's `--include`, so the gate - rotates the ids the round provisioned. A matrix host_vars file also holds - an application block per mirror artefact, and rotating those costs one - subprocess each for credentials provision never generated. Every declared - user password still rotates, so PASS 2 has to carry all of them. - """ + """Regenerate the round's credentials so the update pass has to carry them.""" return _run( [ "python3", @@ -138,6 +123,8 @@ def _reset_credentials( "--app-variants", json.dumps(round_variants, sort_keys=True), "--mirror", + "--mirror-keep", + "applications.svc-net-wireguard", "--backup", "--except", "administrator", @@ -156,6 +143,11 @@ def _deploy( total: int, update_pass: bool = False, ) -> int: + """Run one deploy of the round. + + Args: + update_pass: run it as the async update pass. + """ env = os.environ.copy() env["APP_ID"] = app_id cmd = [ @@ -229,19 +221,51 @@ def _converge_and_verify(*, app_id: str) -> int: ) -def _backup_restore_drill(*, app_id: str, inv_dir: str, extras_path: str) -> int: +def _drill_env(*, app_id: str, inv_dir: str, extras_path: str) -> dict[str, str]: env = os.environ.copy() env["APP_ID"] = app_id env["INFINITO_INVENTORY_DIR"] = inv_dir env["DRILL_EXTRAS"] = extras_path env["DISK_FLOOR_MB"] = str(DISK_FLOOR_MB) - return _run( + return env + + +def _drill_is_coming(*, app_id: str, inv_dir: str, extras_path: str) -> bool: + env = _drill_env(app_id=app_id, inv_dir=inv_dir, extras_path=extras_path) + env["DRILL_PROBE"] = "true" + probe = subprocess.run( ["bash", str(_SWARM_SCRIPTS / "backup" / "base.sh")], env=env, + check=False, + capture_output=True, + text=True, + ) + if "DRILL=no" in probe.stdout: + return False + if "DRILL=yes" not in probe.stdout: + print(f"=== drill probe gave no verdict for {app_id}; assuming it drills ===") + return True + + +def _backup_restore_drill(*, app_id: str, inv_dir: str, extras_path: str) -> int: + return _run( + ["bash", str(_SWARM_SCRIPTS / "backup" / "base.sh")], + env=_drill_env(app_id=app_id, inv_dir=inv_dir, extras_path=extras_path), label="backup + restore DR drill", ) +def _backup_phase( + *, app_id: str, inv_dir: str, deploy_extras: str, drill_extras: str +) -> int: + rc = _deploy_backup_host(app_id=app_id, inv_dir=inv_dir, extras_path=deploy_extras) + if rc == 0: + rc = _backup_restore_drill( + app_id=app_id, inv_dir=inv_dir, extras_path=drill_extras + ) + return rc + + def _verify_recovered_marker(*, app_id: str) -> int: env = os.environ.copy() env["APP_ID"] = app_id @@ -252,6 +276,32 @@ def _verify_recovered_marker(*, app_id: str) -> int: ) +def _mesh_prologue(*, app_id: str, inv_dir: str, round_variants: dict[str, int]) -> int: + """Put every node and the controller on the mesh, then move the transport. + + Args: + app_id: primary application of the round. + inv_dir: inventory directory of the round. + round_variants: the round's ``{app_id: variant_index}`` map. + """ + rc = bootstrap_mesh(inv_dir=inv_dir) + if rc == 0: + rc = lab_sudo_without_prompt(inv_dir=inv_dir) + if rc == 0: + rc = _reset_credentials( + app_id=app_id, inv_dir=inv_dir, round_variants=round_variants + ) + if rc == 0: + rc = write_mesh(inv_dir=inv_dir, rotate=True) + if rc == 0: + rc = converge_mesh(inv_dir=inv_dir) + if rc == 0: + rc = mesh_controller(inv_dir=inv_dir) + if rc == 0: + rc = switch_to_mesh_transport(inv_dir=inv_dir) + return rc + + def _purge(*, purge_set: tuple[str, ...]) -> int: if not purge_set: return 0 @@ -323,6 +373,7 @@ def main(argv: list[str] | None = None) -> int: total = len(plan) rc = 0 + meshed = mesh_enabled() for plan_index, ( round_index, inv_dir, @@ -357,9 +408,12 @@ def main(argv: list[str] | None = None) -> int: flush=True, ) pubkeys = ensure_swarm_keypairs() + applications = backup_applications_overrides(providers) + if meshed: + applications = merge_with_defaults(applications, layout_applications()) vars_payload = _bake_overrides( base_overrides={ - "applications": backup_applications_overrides(providers), + "applications": applications, "users": { name: {"authorized_keys": [key]} for name, key in pubkeys.items() }, @@ -370,6 +424,7 @@ def main(argv: list[str] | None = None) -> int: variant_payloads=variant_payloads, ) extras_path = f"{inv_root}/swarm-nfs-extras.yml" + deploy_extras = f"{inv_root}/swarm-nfs-extras.deploy.yml" rc = _provision( app_id=app_id, @@ -383,41 +438,48 @@ def main(argv: list[str] | None = None) -> int: rc = _extend_inventory( app_id=app_id, inv_dir=inv_root, round_variants=round_variants ) + if rc == 0: + rc = write_mesh(inv_dir=inv_root) if rc == 0: rc = _write_extras(extras_path=extras_path) - if rc == 0: - rc = _deploy( - app_id=app_id, - inv_dir=inv_root, - extras_path=f"{inv_root}/swarm-nfs-extras.deploy.yml", - round_index=round_index, - total=total, - ) - if rc == 0: - rc = _converge_and_verify(app_id=app_id) - if rc == 0 and round_index == 0: - rc = _deploy_backup_host( - app_id=app_id, - inv_dir=inv_root, - extras_path=f"{inv_root}/swarm-nfs-extras.deploy.yml", - ) - if rc == 0 and round_index == 0: - rc = _backup_restore_drill( + + deploy_args = { + "app_id": app_id, + "inv_dir": inv_root, + "extras_path": deploy_extras, + "round_index": round_index, + "total": total, + } + drills = ( + rc == 0 + and round_index == 0 + and _drill_is_coming( app_id=app_id, inv_dir=inv_root, extras_path=extras_path ) + ) + if rc == 0 and meshed: + rc = _mesh_prologue( + app_id=app_id, + inv_dir=inv_root, + round_variants=round_variants, + ) if rc == 0: + rc = _deploy(**deploy_args) + if rc == 0: + rc = _converge_and_verify(app_id=app_id) + if rc == 0 and drills: + rc = _backup_phase( + app_id=app_id, + inv_dir=inv_root, + deploy_extras=deploy_extras, + drill_extras=extras_path, + ) + if rc == 0 and not meshed: rc = _reset_credentials( app_id=app_id, inv_dir=inv_root, round_variants=round_variants ) if rc == 0: - rc = _deploy( - app_id=app_id, - inv_dir=inv_root, - extras_path=f"{inv_root}/swarm-nfs-extras.deploy.yml", - round_index=round_index, - total=total, - update_pass=True, - ) + rc = _deploy(**deploy_args, update_pass=True) if rc == 0: rc = _converge_and_verify(app_id=app_id) if rc == 0 and round_index == 0: diff --git a/utils/tests/swarm/mesh.py b/utils/tests/swarm/mesh.py new file mode 100644 index 0000000000..4b22ae76f5 --- /dev/null +++ b/utils/tests/swarm/mesh.py @@ -0,0 +1,230 @@ +from __future__ import annotations + +import ipaddress +import json +import os +import subprocess +import sys +from pathlib import Path + +from utils import PROJECT_ROOT +from utils.cache.yaml import dump_yaml, load_yaml_any +from utils.env.parser import parse_static_env +from utils.tests.swarm.extend_inventory import mesh_enabled +from utils.tests.swarm.run import run_step + +_CONTROLLER = "localhost" +_PLAYBOOK = "playbooks/mesh.yml" +_SUDO_PLAYBOOK = "playbooks/swarm-lab-passwordless-sudo.yml" +_DEFAULT_ADMIN_KEY = "/tmp/swarm-nfs-admin.key" # noqa: S108 - ephemeral swarm-test path, overridable via KEY_PATH + + +def layout() -> Path: + path = ( + os.environ.get("INFINITO_SWARM_MESHES") + or parse_static_env(PROJECT_ROOT / "default.env")["INFINITO_SWARM_MESHES"] + ) + return PROJECT_ROOT / path + + +def layout_applications() -> dict: + document = load_yaml_any(str(layout()), default_if_missing={}) or {} + return dict(document.get("applications") or {}) + + +def _layout_specs() -> list: + from cli.administration.inventory.mesh.inventory import specs_of + + return specs_of(layout_applications(), []) + + +def transport_mesh() -> str: + return _layout_specs()[0].name + + +def stale_controller_interfaces() -> list[str]: + specs = _layout_specs() + declared = {spec.name for spec in specs} + pools = {ipaddress.ip_network(spec.routed_range or spec.subnet) for spec in specs} + listed = subprocess.run( + ["ip", "-j", "-4", "addr", "show", "type", "wireguard"], + capture_output=True, + text=True, + check=False, + ) + return sorted( + link["ifname"] + for link in json.loads(listed.stdout or "[]") + if link.get("ifname") not in declared + and any( + ipaddress.ip_address(entry["local"]) in pool + for entry in link.get("addr_info", []) + if "local" in entry + for pool in pools + ) + ) + + +_LAB_ADDRESSES = { + "MGR": "INFINITO_SWARM_MGR_IP", + "WRK1": "INFINITO_SWARM_WRK1_IP", + "WRK2": "INFINITO_SWARM_WRK2_IP", + "NFS_SERVER": "INFINITO_SWARM_NFS_IP", + "BACKUP_NODE": "INFINITO_SWARM_BACKUP_IP", +} + + +def _lab_endpoints() -> list[str]: + arguments: list[str] = [] + for name_var, address_var in _LAB_ADDRESSES.items(): + name = os.environ.get(name_var, "").strip() + address = os.environ.get(address_var, "").strip() + if name and address: + arguments += ["--endpoint", f"{name}={address}"] + return arguments + + +def write_mesh(*, inv_dir: str, rotate: bool = False) -> int: + """Write the WireGuard meshes over both inventories of the round. + + Args: + inv_dir: inventory directory of the round. + rotate: mint a fresh keypair for every member. + """ + if not mesh_enabled(): + return 0 + args = ["--inventory", f"{inv_dir}/devices.yml"] + args += ["--inventory", f"{inv_dir}/backup.yml"] + args += ["--host-vars-dir", f"{inv_dir}/host_vars"] + args += ["--vault-password-file", f"{inv_dir}/.password"] + args += ["--controller", _CONTROLLER, "--controller-mesh", transport_mesh()] + args += _lab_endpoints() + if rotate: + args += ["--rotate"] + label = "rotate the wireguard meshes" if rotate else "write wireguard meshes" + return run_step( + ["python3", "-m", "cli.administration.inventory.mesh", *args], + env=os.environ.copy(), + label=f"{label} (cross-host credentials)", + ) + + +def bootstrap_mesh(*, inv_dir: str) -> int: + if not mesh_enabled(): + return 0 + return run_step( + [ + "ansible-playbook", + "-i", + f"{inv_dir}/devices.yml", + "--vault-password-file", + f"{inv_dir}/.password", + "-e", + "MESH_BOOTSTRAP=true", + _PLAYBOOK, + ], + env=os.environ.copy(), + label="bootstrap the mesh before the deploy", + ) + + +def converge_mesh(*, inv_dir: str) -> int: + if not mesh_enabled(): + return 0 + return run_step( + [ + "ansible-playbook", + "-i", + f"{inv_dir}/devices.yml", + "--vault-password-file", + f"{inv_dir}/.password", + _PLAYBOOK, + ], + env=os.environ.copy(), + label="converge the mesh on every node", + ) + + +def mesh_controller(*, inv_dir: str) -> int: + if not mesh_enabled(): + return 0 + escalate = [] if os.geteuid() == 0 else ["sudo", "-n"] + for name in stale_controller_interfaces(): + rc = run_step( + [*escalate, "ip", "link", "delete", name], + env=os.environ.copy(), + label=f"remove the controller's stale '{name}' interface", + ) + if rc != 0: + return rc + inventory = Path(inv_dir) / "controller.yml" + dump_yaml( + str(inventory), + { + "all": { + "children": { + "svc-net-wireguard": { + "hosts": {_CONTROLLER: {"ansible_connection": "local"}} + } + } + } + }, + ) + return run_step( + [ + "ansible-playbook", + "-i", + str(inventory), + "--vault-password-file", + f"{inv_dir}/.password", + _PLAYBOOK, + ], + env=os.environ.copy(), + label="put the deploy controller on the mesh", + ) + + +def lab_sudo_without_prompt(*, inv_dir: str) -> int: + """Take the sudo prompt off the lab's administrator before the switch. + + Args: + inv_dir: inventory directory of the round. + """ + if not mesh_enabled(): + return 0 + return run_step( + [ + "ansible-playbook", + "-i", + f"{inv_dir}/devices.yml", + "--vault-password-file", + f"{inv_dir}/.password", + _SUDO_PLAYBOOK, + ], + env=os.environ.copy(), + label="take the sudo prompt off the lab administrator", + ) + + +def switch_to_mesh_transport(*, inv_dir: str) -> int: + if not mesh_enabled(): + return 0 + from cli.administration.inventory.mesh.transport import switch_to_mesh + + host_vars = Path(inv_dir) / "host_vars" + hosts = sorted( + path.stem for path in host_vars.glob("*.yml") if path.stem != _CONTROLLER + ) + switched = switch_to_mesh( + host_vars, + hosts, + transport_mesh(), + user="administrator", + private_key_file=os.environ.get("KEY_PATH") or _DEFAULT_ADMIN_KEY, + ) + for host, address in sorted(switched.items()): + print(f"[INFO] {host}: ansible now connects over {address}", flush=True) + if not switched: + print("[FATAL] no host holds a mesh address to switch to", file=sys.stderr) + return 1 + return 0 diff --git a/utils/tests/swarm/run.py b/utils/tests/swarm/run.py new file mode 100644 index 0000000000..042e7fcb96 --- /dev/null +++ b/utils/tests/swarm/run.py @@ -0,0 +1,89 @@ +from __future__ import annotations + +import shutil +import subprocess +import time + +from utils import PROJECT_ROOT +from utils.env.runtime import mem_available_mb, mem_stall_pct, mem_total_mb + +DISK_FLOOR_MB = 6 * 2**10 +MEM_FLOOR_RATIO = 0.06 + + +def _abort(proc: subprocess.Popen[bytes], banner: str, probe: list[str]) -> int: + print(banner, flush=True) + subprocess.run(probe, check=False) + proc.terminate() + try: + proc.wait(timeout=30) + except subprocess.TimeoutExpired: + proc.kill() + proc.wait() + return 75 + + +def run_step(cmd: list[str], *, env: dict[str, str], label: str) -> int: + """Announce a matrix step, run it, and report what it cost. + + Args: + cmd: argv of the step. + env: environment the step runs with. + label: phase name for the banners. + + Returns: + The step's exit code. + """ + print(f"=== swarm-matrix: {label} ===", flush=True) + started = time.monotonic() + rc = run_watched(cmd, env=env) + print( + f"=== swarm-matrix: {label} took {time.monotonic() - started:.0f}s (rc={rc}) ===", + flush=True, + ) + return rc + + +def run_watched(cmd: list[str], *, env: dict[str, str]) -> int: + """Run a step, aborting visibly before the runner disk or RAM fills. + + The Actions Worker dies silently on ENOSPC while writing its own logs, so + a full disk truncates the job without diagnostics; terminating the step at + DISK_FLOOR_MB keeps enough room for rescue artifacts and the log upload. + + Args: + cmd: argv of the step. + env: environment the step runs with. + + Returns: + The step's exit code, or the abort code when a floor was hit. + """ + proc = subprocess.Popen(cmd, cwd=str(PROJECT_ROOT), env=env) + while True: + try: + return int(proc.wait(timeout=30)) + except subprocess.TimeoutExpired: + free_mb = shutil.disk_usage("/").free // 2**20 + if free_mb < DISK_FLOOR_MB: + return _abort( + proc, + "=== swarm-matrix: DISK EXHAUSTION IMMINENT " + f"(<{DISK_FLOOR_MB}M free on /) - aborting step ===", + ["df", "-h", "/"], + ) + avail = mem_available_mb() + total = mem_total_mb() + stall = mem_stall_pct() + print( + f"=== swarm-matrix: host mem {avail}M/{total}M available, " + f"disk {free_mb}M free on /, stall60 {stall:.1f}% ===", + flush=True, + ) + if total and avail < total * MEM_FLOOR_RATIO: + return _abort( + proc, + "=== swarm-matrix: MEMORY EXHAUSTION IMMINENT " + f"({avail}M available, below {MEM_FLOOR_RATIO:.0%} of RAM)" + " - aborting step ===", + ["free", "-m"], + ) diff --git a/utils/tests/swarm/write/extras.py b/utils/tests/swarm/write/extras.py index 5b42a4e77f..f04bcc34b0 100755 --- a/utils/tests/swarm/write/extras.py +++ b/utils/tests/swarm/write/extras.py @@ -21,7 +21,8 @@ NOT into the extras file: extra-vars replace the whole inventory ``applications`` dict and would strip every generated credential. ``users`` carries the same hazard for the same reason, and its authorized_keys travel the same merge channel. The deploy-facing twin ``.deploy.yml`` -therefore carries everything except ``applications`` and ``users``. +therefore carries everything except ``applications`` and ``users``, plus +``ansible_become_password``. """ from __future__ import annotations @@ -36,6 +37,7 @@ from cli.meta.runtime import detect_runtime from utils import PROJECT_ROOT from utils.cache.yaml import dump_yaml, load_yaml from utils.env.parser import parse_static_env +from utils.networks.mesh import primary_address from utils.paths import DIR_BACKUPS _DEFAULT_INVENTORY = PROJECT_ROOT / "inventories" / "development" / "default.yml" @@ -128,6 +130,14 @@ def ensure_swarm_keypairs() -> dict[str, str]: } +def _mesh_address(host_vars_dir: Path, host: str, fallback: str) -> str: + path = host_vars_dir / f"{host}.yml" + if not path.exists(): + return fallback + applications = load_yaml(str(path)).get("applications", {}) + return primary_address(applications, host) or fallback + + def main() -> int: nfs_ip = os.environ["NFS_IP"] mgr_ip = os.environ["MGR_IP"] @@ -135,6 +145,10 @@ def main() -> int: # nocheck: environ-get-default nothing in the repo sets OUT_PATH; this script is the writer of the extras file, so where it lands is its own decision, not the inventory's out_path = Path(os.environ.get("OUT_PATH", "/tmp/swarm-nfs-extras.yml")) # noqa: S108 - ephemeral swarm-test path, overridable via OUT_PATH + host_vars_dir = out_path.parent / "host_vars" + mgr_addr = _mesh_address(host_vars_dir, mgr, mgr_ip) + nfs_addr = _mesh_address(host_vars_dir, os.environ.get("NFS_SERVER", ""), nfs_ip) + pubkeys = ensure_swarm_keypairs() static_env = parse_static_env(PROJECT_ROOT / "default.env") @@ -155,11 +169,12 @@ def main() -> int: "storage": { "backend": "nfs", "nfs": { - "server": nfs_ip, + "server": nfs_addr, + "controller_server": nfs_ip, }, }, "swarm": { - "manager": {"advertise_addr": mgr_ip}, + "manager": {"advertise_addr": mgr_addr}, "registry": {"host": mgr, "port": 5000}, "network": {"encryption": True}, }, @@ -167,6 +182,8 @@ def main() -> int: "users": default_users, "applications": device_applications_overrides(), } + if admin.get("password"): + extras["ansible_become_password"] = admin["password"] dump_yaml(str(out_path), extras) deploy_extras = {