diff --git a/.github/actionlint.yaml b/.github/actionlint.yaml new file mode 100644 index 0000000000..978712b9f1 --- /dev/null +++ b/.github/actionlint.yaml @@ -0,0 +1,3 @@ +self-hosted-runner: + labels: + - ubuntu-26.04 diff --git a/.github/workflows/call-images-build-ci.yml b/.github/workflows/call-images-build-ci.yml index 6167740b27..50e9aef161 100644 --- a/.github/workflows/call-images-build-ci.yml +++ b/.github/workflows/call-images-build-ci.yml @@ -43,7 +43,7 @@ concurrency: jobs: build: name: ๐Ÿ’ฟ Image - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 permissions: contents: read packages: write diff --git a/.github/workflows/call-images-mirror-missing.yml b/.github/workflows/call-images-mirror-missing.yml index 3127bc68ef..0c6fa3bc08 100644 --- a/.github/workflows/call-images-mirror-missing.yml +++ b/.github/workflows/call-images-mirror-missing.yml @@ -78,7 +78,7 @@ concurrency: jobs: sync: name: ๐Ÿชž Mirror - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 permissions: contents: read packages: write diff --git a/.github/workflows/call-lint.yml b/.github/workflows/call-lint.yml index d0d54bbff1..679feb93f1 100644 --- a/.github/workflows/call-lint.yml +++ b/.github/workflows/call-lint.yml @@ -10,7 +10,7 @@ permissions: jobs: lint: name: ๐Ÿงน Lint - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 timeout-minutes: 45 env: INFINITO_LINT_RUNNER: host diff --git a/.github/workflows/call-orchestrator.yml b/.github/workflows/call-orchestrator.yml index 45da030b22..e458f00687 100644 --- a/.github/workflows/call-orchestrator.yml +++ b/.github/workflows/call-orchestrator.yml @@ -343,7 +343,7 @@ jobs: - test-deploy-chunk-2 - test-deploy-chunk-3 if: ${{ always() && github.ref == 'refs/heads/main' && (contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')) }} - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 permissions: issues: write actions: read @@ -374,7 +374,7 @@ jobs: - lint - security-codeql if: ${{ always() }} - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 steps: - name: ๐Ÿ›‘ Fail if any upstream job failed or was cancelled if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} diff --git a/.github/workflows/call-release-version.yml b/.github/workflows/call-release-version.yml index c6cc449a20..3410e44a35 100644 --- a/.github/workflows/call-release-version.yml +++ b/.github/workflows/call-release-version.yml @@ -30,7 +30,7 @@ env: jobs: check-ci-images: name: ๐Ÿ”Ž Check CI images - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 outputs: missing: ${{ steps.check.outputs.missing }} ci_tag: ${{ steps.citag.outputs.ci_tag }} @@ -123,7 +123,7 @@ jobs: needs.build-ci-images-if-missing.result == 'success' || needs.build-ci-images-if-missing.result == 'skipped' ) - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 permissions: contents: read packages: write diff --git a/.github/workflows/call-test-deploy.yml b/.github/workflows/call-test-deploy.yml index 41ba48eae0..206385bc63 100644 --- a/.github/workflows/call-test-deploy.yml +++ b/.github/workflows/call-test-deploy.yml @@ -163,7 +163,7 @@ env: jobs: discover: name: ๐Ÿ” Chunk ${{ inputs.index }}${{ inputs.marker }} - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 timeout-minutes: 60 outputs: apps: ${{ steps.discover.outputs.apps }} @@ -251,7 +251,7 @@ jobs: deploy: name: "${{ matrix.label }}" if: needs.discover.outputs.apps != '' && needs.discover.outputs.apps != '[]' - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 timeout-minutes: 355 needs: discover @@ -308,6 +308,11 @@ jobs: shell: bash run: ./scripts/github/runner/relocate_docker_dataroot.sh + - name: ๐Ÿ›ก๏ธ Tear down host AppArmor profiles (dev-host parity) + if: ${{ !env.ACT }} + shell: bash + run: make security-apparmor-teardown + - name: ๐Ÿ” Resolve repository owner shell: bash run: | diff --git a/.github/workflows/call-test-dns.yml b/.github/workflows/call-test-dns.yml index 133b4194bf..05c4c9ed3b 100644 --- a/.github/workflows/call-test-dns.yml +++ b/.github/workflows/call-test-dns.yml @@ -23,7 +23,7 @@ permissions: jobs: dns: name: ๐ŸŒ DNS - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 timeout-minutes: 30 steps: - name: ๐Ÿงน Free disk space @@ -41,6 +41,11 @@ jobs: - name: โฌ‡๏ธ Checkout uses: actions/checkout@v7.0.0 + - name: ๐Ÿ›ก๏ธ Tear down host AppArmor profiles (dev-host parity) + if: ${{ !env.ACT }} + shell: bash + run: make security-apparmor-teardown + - name: ๐Ÿ”‘ Login to GHCR uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0 # v4.4.0 with: diff --git a/.github/workflows/call-test-install-make.yml b/.github/workflows/call-test-install-make.yml index 06acb0304f..080b6fcd22 100644 --- a/.github/workflows/call-test-install-make.yml +++ b/.github/workflows/call-test-install-make.yml @@ -10,7 +10,7 @@ permissions: jobs: test-install-make: name: ๐Ÿ› ๏ธ Makefile - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 timeout-minutes: 30 env: NIX_CONFIG: | diff --git a/.github/workflows/call-test-install-pkgmgr.yml b/.github/workflows/call-test-install-pkgmgr.yml index 836eb87a31..688e5ce28a 100644 --- a/.github/workflows/call-test-install-pkgmgr.yml +++ b/.github/workflows/call-test-install-pkgmgr.yml @@ -10,7 +10,7 @@ permissions: jobs: test-install-pkgmgr: name: ๐Ÿ“ฆ PKGMGR - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 timeout-minutes: 30 env: NIX_CONFIG: | diff --git a/.github/workflows/call-test-workspace.yml b/.github/workflows/call-test-workspace.yml index 102f25ae7d..a888feb280 100644 --- a/.github/workflows/call-test-workspace.yml +++ b/.github/workflows/call-test-workspace.yml @@ -21,7 +21,7 @@ permissions: jobs: prepare: name: ๐Ÿง‘โ€๐Ÿ’ป Workspace Matrix - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 timeout-minutes: 5 outputs: matrix: ${{ steps.matrix.outputs.matrix }} @@ -44,7 +44,7 @@ jobs: test-workspace: name: ${{ matrix.icon }} Workspace (${{ matrix.label }}) - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 timeout-minutes: 345 needs: prepare @@ -88,6 +88,11 @@ jobs: - name: โฌ‡๏ธ Checkout repository uses: actions/checkout@v7.0.0 + - name: ๐Ÿ›ก๏ธ Tear down host AppArmor profiles (dev-host parity) + if: ${{ !env.ACT }} + shell: bash + run: make security-apparmor-teardown + - name: "๐Ÿ“ฅ Load the rescue paths into job env" shell: bash run: | diff --git a/.github/workflows/call-test.yml b/.github/workflows/call-test.yml index ac26225993..ae113752e1 100644 --- a/.github/workflows/call-test.yml +++ b/.github/workflows/call-test.yml @@ -10,7 +10,7 @@ permissions: jobs: test: name: ๐Ÿงช Test - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 timeout-minutes: 45 env: INFINITO_TEST_RUNNER: host diff --git a/.github/workflows/call-validation.yml b/.github/workflows/call-validation.yml index 78585c4e86..1a1e17d979 100644 --- a/.github/workflows/call-validation.yml +++ b/.github/workflows/call-validation.yml @@ -84,7 +84,7 @@ permissions: jobs: validation: name: โœ… Validation - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 steps: - name: โฌ‡๏ธ Checkout the calling ref for its tooling uses: actions/checkout@v7.0.0 @@ -148,7 +148,7 @@ jobs: wait-fork-prereq-run: name: โณ Wait for fork run if: ${{ inputs.fork_prereqs }} - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 env: WAIT_REQUIRED: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && !inputs.trusted_pr }} steps: @@ -194,7 +194,7 @@ jobs: name: ๐Ÿšฆ Gate Dependencies needs: wait-fork-prereq-run if: ${{ !cancelled() && inputs.fork_prereqs }} - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 steps: - uses: actions/checkout@v7.0.0 - name: โœ… Assert privileged prerequisites are ready diff --git a/.github/workflows/cron-cleanup-stale.yml b/.github/workflows/cron-cleanup-stale.yml index 35a5d0168e..68a1a1cf4c 100644 --- a/.github/workflows/cron-cleanup-stale.yml +++ b/.github/workflows/cron-cleanup-stale.yml @@ -12,7 +12,7 @@ permissions: jobs: stale: name: ๐Ÿท๏ธ Close inactive issues and pull requests - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 permissions: issues: write pull-requests: write @@ -45,7 +45,7 @@ jobs: delete-stale-branches: name: ๐ŸŒฟ Delete inactive branches - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 permissions: contents: write issues: write @@ -65,7 +65,7 @@ jobs: cleanup-ghcr-ci-images: name: ๐Ÿ“ฆ Delete old GHCR CI images - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 permissions: contents: read packages: write diff --git a/.github/workflows/cron-collection-source.yml b/.github/workflows/cron-collection-source.yml index 50dc753b10..877415b27e 100644 --- a/.github/workflows/cron-collection-source.yml +++ b/.github/workflows/cron-collection-source.yml @@ -18,7 +18,7 @@ jobs: benchmark-collection-sources: name: โš–๏ธ Time Galaxy against the git fallback if: vars.CI_ENABLE_AUTO_UPDATES == 'true' - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 env: HISTORY_PATH: build/collection-source-history.json steps: diff --git a/.github/workflows/cron-images-cleanup-ci.yml b/.github/workflows/cron-images-cleanup-ci.yml index 6f54549d13..bdde2e46bd 100644 --- a/.github/workflows/cron-images-cleanup-ci.yml +++ b/.github/workflows/cron-images-cleanup-ci.yml @@ -22,7 +22,7 @@ concurrency: jobs: cleanup: name: ๐Ÿงน Delete old ci-* image versions - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 permissions: actions: read contents: read diff --git a/.github/workflows/cron-images-mirror-all.yml b/.github/workflows/cron-images-mirror-all.yml index 6b84158dfc..3f1619f873 100644 --- a/.github/workflows/cron-images-mirror-all.yml +++ b/.github/workflows/cron-images-mirror-all.yml @@ -61,7 +61,7 @@ concurrency: jobs: sync: name: ๐Ÿชž Mirror - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 permissions: contents: read packages: write diff --git a/.github/workflows/cron-release-highest.yml b/.github/workflows/cron-release-highest.yml index 8e17fadbae..76f4a4ee35 100644 --- a/.github/workflows/cron-release-highest.yml +++ b/.github/workflows/cron-release-highest.yml @@ -19,7 +19,7 @@ env: jobs: check-and-trigger: name: ๐Ÿ”Ž Backfill highest missing release tag - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 permissions: contents: read packages: read diff --git a/.github/workflows/cron-security-codeql.yml b/.github/workflows/cron-security-codeql.yml index 35f47e7b7f..f5242ad964 100644 --- a/.github/workflows/cron-security-codeql.yml +++ b/.github/workflows/cron-security-codeql.yml @@ -34,7 +34,7 @@ jobs: # - https://gh.io/supported-runners-and-hardware-resources # - https://gh.io/using-larger-runners (GitHub.com only) # Consider using larger runners or machines with greater resources for possible analysis time improvements. - runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} + runs-on: ubuntu-26.04 permissions: security-events: write packages: read diff --git a/.github/workflows/cron-security-fuzz.yml b/.github/workflows/cron-security-fuzz.yml index 56e4a1e9f1..ec8a3005ef 100644 --- a/.github/workflows/cron-security-fuzz.yml +++ b/.github/workflows/cron-security-fuzz.yml @@ -16,7 +16,7 @@ permissions: jobs: fuzz-yaml-bootstrap: name: ๐Ÿงฌ Fuzz the bootstrap YAML reader - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 timeout-minutes: 30 steps: - name: โฌ‡๏ธ Checkout diff --git a/.github/workflows/cron-security-scorecard.yml b/.github/workflows/cron-security-scorecard.yml index 69eb85746f..144bd06067 100644 --- a/.github/workflows/cron-security-scorecard.yml +++ b/.github/workflows/cron-security-scorecard.yml @@ -26,7 +26,7 @@ permissions: read-all jobs: analysis: name: ๐Ÿ” Scorecard analysis - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 # `publish_results: true` only works when run from the default branch. conditional can be removed if disabled. if: github.event.repository.default_branch == github.ref_name || github.event_name == 'pull_request' permissions: diff --git a/.github/workflows/cron-update.yml b/.github/workflows/cron-update.yml index 57f610fc05..a396a9d1f0 100644 --- a/.github/workflows/cron-update.yml +++ b/.github/workflows/cron-update.yml @@ -21,7 +21,7 @@ jobs: update-docker-image-versions: name: ๐Ÿณ Update Docker image versions if: vars.CI_ENABLE_AUTO_UPDATES == 'true' - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 steps: - name: โฌ‡๏ธ Checkout uses: actions/checkout@v7.0.0 @@ -68,7 +68,7 @@ jobs: update-version-sources: name: ๐Ÿ”– Update declared version sources if: vars.CI_ENABLE_AUTO_UPDATES == 'true' - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 steps: - name: โฌ‡๏ธ Checkout uses: actions/checkout@v7.0.0 @@ -115,7 +115,7 @@ jobs: update-pip-pins: name: ๐Ÿ Update pinned pip requirements if: vars.CI_ENABLE_AUTO_UPDATES == 'true' - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 steps: - name: โฌ‡๏ธ Checkout uses: actions/checkout@v7.0.0 @@ -162,7 +162,7 @@ jobs: update-galaxy-pins: name: ๐ŸŒŒ Update pinned Ansible collections if: vars.CI_ENABLE_AUTO_UPDATES == 'true' - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 steps: - name: โฌ‡๏ธ Checkout uses: actions/checkout@v7.0.0 @@ -209,7 +209,7 @@ jobs: update-repository-refs: name: ๐ŸŒฟ Update repository refs if: vars.CI_ENABLE_AUTO_UPDATES == 'true' - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 steps: - name: โฌ‡๏ธ Checkout uses: actions/checkout@v7.0.0 @@ -252,3 +252,45 @@ jobs: UPDATE_PR_BODY: "Automated update of semver-based git `ref:` values in `roles/*/meta/services.yml`. Upstream tags resolved via `git ls-remote --tags`." UPDATE_BASE_BRANCH: main run: bash scripts/github/update/open/role_prs.sh roles + + update-runner-labels: + name: ๐Ÿƒ Update GitHub-hosted runner labels + if: vars.CI_ENABLE_AUTO_UPDATES == 'true' + runs-on: ubuntu-26.04 + steps: + - name: โฌ‡๏ธ Checkout + uses: actions/checkout@v7.0.0 + with: + ref: main + + - name: ๐Ÿ”ง Set up Python + uses: actions/setup-python@v6 + with: + python-version: "3.12" + + - name: ๐Ÿ”„ Update runner labels + run: bash scripts/github/update/runner_labels.sh + + - name: ๐Ÿ”Ž Check for changes + id: diff + run: bash scripts/github/resolve/check_git_changes.sh .github/workflows + + - name: โš™๏ธ Generate app token + if: steps.diff.outputs.changed == 'true' + id: app-token + uses: actions/create-github-app-token@v3 + with: + client-id: ${{ secrets.BOT_APP_CLIENT_ID }} + private-key: ${{ secrets.BOT_APP_PRIVATE_KEY }} + + - name: ๐Ÿ“‚ Open PR if runner labels changed + if: steps.diff.outputs.changed == 'true' + env: + GH_TOKEN: ${{ steps.app-token.outputs.token }} + APP_SLUG: ${{ steps.app-token.outputs.app-slug }} + UPDATE_BRANCH_PREFIX: update/runner-labels + UPDATE_COMMIT_MESSAGE: "update(ci): raise GitHub-hosted runner labels" + UPDATE_PR_TITLE: "update(ci): raise GitHub-hosted runner labels" + UPDATE_PR_BODY: "Automated raise of every `runs-on: ubuntu-NN.NN` in `.github/workflows/` to the newest GA x64 Ubuntu image listed in https://github.com/actions/runner-images. Its CI run is the proof that the stack works on the new image." + UPDATE_BASE_BRANCH: main + run: bash scripts/github/update/open/pr.sh .github/workflows diff --git a/.github/workflows/entry-cancel-superseded.yml b/.github/workflows/entry-cancel-superseded.yml index dfd1df7907..85ed6ee1db 100644 --- a/.github/workflows/entry-cancel-superseded.yml +++ b/.github/workflows/entry-cancel-superseded.yml @@ -27,7 +27,7 @@ jobs: cancel-branch-runs: name: ๐Ÿšซ Cancel superseded branch runs if: ${{ github.event_name == 'push' && (github.ref_name != 'main' || (github.ref_name == 'main' && startsWith(github.event.head_commit.message, 'Release version '))) }} - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 permissions: actions: write contents: read @@ -52,7 +52,7 @@ jobs: cancel-pull-request-runs: name: ๐Ÿšซ Cancel superseded pull request runs if: ${{ github.event_name == 'pull_request_target' }} - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 permissions: actions: write contents: read diff --git a/.github/workflows/entry-delete-branch.yml b/.github/workflows/entry-delete-branch.yml index 8b9113032e..21499359ae 100644 --- a/.github/workflows/entry-delete-branch.yml +++ b/.github/workflows/entry-delete-branch.yml @@ -20,7 +20,7 @@ permissions: jobs: cancel-branch-runs: if: ${{ github.event.ref_type == 'branch' }} - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 permissions: actions: write contents: read diff --git a/.github/workflows/entry-manual-mirror-cleanup.yml b/.github/workflows/entry-manual-mirror-cleanup.yml index efc372ad24..5f4436dbc7 100644 --- a/.github/workflows/entry-manual-mirror-cleanup.yml +++ b/.github/workflows/entry-manual-mirror-cleanup.yml @@ -40,7 +40,7 @@ permissions: jobs: cleanup: name: ๐Ÿ—‘๏ธ Delete private GHCR mirror packages - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 permissions: contents: read packages: write diff --git a/.github/workflows/entry-pr-change-orchestrate.yml b/.github/workflows/entry-pr-change-orchestrate.yml index 36d4aa63ee..0a3c46f036 100644 --- a/.github/workflows/entry-pr-change-orchestrate.yml +++ b/.github/workflows/entry-pr-change-orchestrate.yml @@ -29,7 +29,7 @@ jobs: detect-pr-scope: name: ๐Ÿ”Ž Detect PR scope if: ${{ github.event.pull_request.draft == false && (github.event_name == 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository) }} - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 outputs: scope: ${{ steps.resolve.outputs.scope }} run_ci_orchestrator: ${{ steps.resolve.outputs.run_ci_orchestrator }} @@ -59,7 +59,7 @@ jobs: - detect-pr-scope - validation if: ${{ needs.detect-pr-scope.outputs.run_ci_orchestrator == 'false' }} - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 steps: - name: โœ… Confirm lightweight PR scope shell: bash @@ -73,7 +73,7 @@ jobs: - detect-pr-scope - validation if: ${{ needs.detect-pr-scope.outputs.run_ci_orchestrator == 'true' }} - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 outputs: whitelist: ${{ steps.resolve.outputs.whitelist }} steps: @@ -124,7 +124,7 @@ jobs: - detect-pr-scope - validation if: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && needs.detect-pr-scope.outputs.run_ci_orchestrator == 'true' }} - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 outputs: checkout_ref: ${{ steps.out.outputs.checkout_ref }} image_tag: ${{ steps.out.outputs.image_tag }} diff --git a/.github/workflows/entry-pr-closed-cancel-workflows.yml b/.github/workflows/entry-pr-closed-cancel-workflows.yml index c2f8e6ae12..e11ae6d0be 100644 --- a/.github/workflows/entry-pr-closed-cancel-workflows.yml +++ b/.github/workflows/entry-pr-closed-cancel-workflows.yml @@ -15,7 +15,7 @@ permissions: jobs: cancel-pr-runs: - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 permissions: actions: write contents: read diff --git a/.github/workflows/entry-pr-open-dependabot-close.yml b/.github/workflows/entry-pr-open-dependabot-close.yml index a3ced798c0..e6ea74258d 100644 --- a/.github/workflows/entry-pr-open-dependabot-close.yml +++ b/.github/workflows/entry-pr-open-dependabot-close.yml @@ -19,7 +19,7 @@ jobs: close-when-disabled: name: ๐Ÿšซ Close Dependabot PR while gated if: github.event.pull_request.user.login == 'dependabot[bot]' && vars.CI_ENABLE_AUTO_UPDATES != 'true' - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 steps: - name: ๐Ÿ“ช Close PR env: diff --git a/.github/workflows/entry-push-latest.yml b/.github/workflows/entry-push-latest.yml index a22ee0ca8b..59070de57b 100644 --- a/.github/workflows/entry-push-latest.yml +++ b/.github/workflows/entry-push-latest.yml @@ -21,7 +21,7 @@ permissions: jobs: run-policy: name: ๐Ÿงญ Decide CI policy - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 permissions: contents: read pull-requests: read @@ -59,7 +59,7 @@ jobs: name: โญ๏ธ Skip CI needs: run-policy if: needs.run-policy.outputs.should_run != 'true' - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 steps: - name: โญ๏ธ Explain skip shell: bash @@ -72,7 +72,7 @@ jobs: if: needs.run-policy.outputs.should_run == 'true' needs: run-policy name: ๐Ÿท๏ธ Detect release tag - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 outputs: is_version: ${{ steps.pick.outputs.is_version }} version_tag: ${{ steps.pick.outputs.version_tag }} @@ -91,7 +91,7 @@ jobs: if: needs.run-policy.outputs.should_run == 'true' name: โญ Resolve new-role priority needs: run-policy - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 outputs: priority: ${{ steps.resolve.outputs.priority }} steps: @@ -132,7 +132,7 @@ jobs: - run-policy - detect-release - ci-orchestrator - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 outputs: allowed: ${{ steps.guard.outputs.allowed }} steps: diff --git a/CHANGELOG.md b/CHANGELOG.md index e994c583c6..2a1626fff7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,46 @@ # Changelog +## [16.1.0] - 2026-10-19 + +Added: + +- Wazuh: new *web-app-wazuh* role runs Wazuh 4.14.6 as a single-node SIEM +- Wazuh: Keycloak OIDC login, LDAP group roles and three RBAC tiers +- Wazuh: the SIEM console is served on clearnet only, never as an onion + +Fixed: + +- NFS client: swarm backups stay on local disk with their extended attributes +- NFS client: the backup user keeps access; a changed mount line remounts +- Docker: RedHat installs iptables-nft, so Fedora no longer needs ip_tables +- Compose: worktree stacks no longer take the primary stack's static IPs +- Backup: the baudolo version comes from *pyproject.toml* alone +- CI: runners with sudo-rs keep the environment the swarm matrix needs + +Version jumps (net since 16.0.1): + +- *pkgmgr*: v2.0.2 to v2.0.4 +- *web-app-gitea*: 28.1.0 to 28.2.0, MCP server 1.9.0 to 1.10.0 +- *web-app-n8n*: 2.44.3 to 2.44.4 +- *web-app-pixelfed*: 20261017 to 20261019 +- *web-app-semaphore*: v2.19.16 to v2.19.17 +- *web-app-stalwart*: v0.16.26 to v0.16.27 +- *web-app-stalwart*: webmail 1.7.4-apache to 1.7.5-apache +- *ruff* (dev): 0.17.0 to 0.17.1 +- *@playwright/test* (dev): ^1.64.0 to ^1.64.1 + +Upgrade notes: + +- Dev: run *make dotenv* once; compose now requires *INFINITO_IP_RANGE* +- Dev: a compose network created earlier keeps no IP pool until recreated +- NFS client: [older generations](roles/svc-storage-nfs-client/README.md) stay on the share; delete them by hand + +Contributors: + +- [Prageeth Panicker](https://github.com/pragepani): the Wazuh role +- [Evangelos Tsakoudis](https://evangelostsak.com): the WireGuard CLI test +- [Kevin Veen-Birkenbach](https://veen.world): NFS backups, compose IPs + ## [16.0.1] - 2026-10-18 Fixed: diff --git a/Makefile b/Makefile index 05e69ffd5c..9a6ac45290 100644 --- a/Makefile +++ b/Makefile @@ -227,6 +227,11 @@ compose-inner-run: compose-inventory-refresh: @bash scripts/tests/deploy/local/reset/inventory.sh +.PHONY: compose-network-recreate +# Recreate the stack's default network after an IPAM change, keeping volumes and reattaching foreign stacks. +compose-network-recreate: install + @"$${PYTHON}" -m cli.administration.deploy.development recreate + .PHONY: compose-playwright # Rerun a role-local Playwright spec against the live running stack (no redeploy). # Usage: make compose-playwright role= [pw="--grep "] [keep=true] diff --git a/aliases b/aliases index 13f9873567..00d47d37a3 100644 --- a/aliases +++ b/aliases @@ -27,6 +27,7 @@ alias i8co2='m console' alias i8coape='m compose-app-exec' alias i8codo='m compose-down' alias i8cone='m compose-entity-purge' +alias i8conere='m compose-network-recreate' alias i8coni='m compose-inner-run' alias i8conire='m compose-inventory-refresh' alias i8copa='m compose-playwright' diff --git a/cli/administration/deploy/development/cli.py b/cli/administration/deploy/development/cli.py index 686cb52fe9..1c3fe3e3e8 100644 --- a/cli/administration/deploy/development/cli.py +++ b/cli/administration/deploy/development/cli.py @@ -53,6 +53,7 @@ def _build_parser(base_pkg: str) -> argparse.ArgumentParser: "run", "exec", "logs", + "recreate", ] for _, mod in _iter_command_modules(base_pkg, command_names): diff --git a/cli/administration/deploy/development/recreate.py b/cli/administration/deploy/development/recreate.py new file mode 100644 index 0000000000..24fc3e65c2 --- /dev/null +++ b/cli/administration/deploy/development/recreate.py @@ -0,0 +1,74 @@ +from __future__ import annotations + +import argparse +import json +import subprocess + +from .common import make_compose +from .up import handler as up_handler + + +def foreign_endpoints(rows: str, project: str) -> list[str]: + """Return the running containers of other projects on the network. + + Args: + rows: ``docker ps`` lines of ``\\t``. + project: compose project that owns the network. + """ + names = [] + for row in rows.splitlines(): + name, _, owner = row.partition("\t") + if name and owner != project: + names.append(name) + return names + + +def _docker(*args: str, capture: bool = False) -> str: + result = subprocess.run( + ["docker", *args], check=True, capture_output=capture, text=True + ) + return result.stdout if capture else "" + + +def add_parser(sub: argparse._SubParsersAction) -> None: + p = sub.add_parser( + "recreate", + help="Recreate the default network, keeping volumes and foreign stacks.", + ) + p.set_defaults(_handler=handler) + + +def handler(args: argparse.Namespace) -> int: + compose = make_compose() + rendered = compose.run(["config", "--format", "json"], capture=True).stdout + config = json.loads(rendered) + project = config["name"] + network = config["networks"]["default"]["name"] + + rows = _docker( + "ps", + "--filter", + f"network={network}", + "--format", + '{{.Names}}\t{{.Label "com.docker.compose.project"}}', + capture=True, + ) + detached = foreign_endpoints(rows, project) + for name in detached: + print(f">>> Detaching {name} from {network}") + _docker("network", "disconnect", network, name) + + rc = 1 + try: + compose.run(["down", "--remove-orphans"]) + rc = up_handler(argparse.Namespace(skip_entry_init=False, when_down=False)) + finally: + if rc != 0 and detached: + print(f">>> Still detached from {network}: {' '.join(detached)}") + if rc != 0: + return rc + + for name in detached: + print(f">>> Attaching {name} to {network}") + _docker("network", "connect", network, name) + return 0 diff --git a/cli/contributing/update/runner/__init__.py b/cli/contributing/update/runner/__init__.py new file mode 100644 index 0000000000..9b7a055ab0 --- /dev/null +++ b/cli/contributing/update/runner/__init__.py @@ -0,0 +1,5 @@ +"""CLI entry point package for the GitHub-hosted runner label update.""" + +from pathlib import Path + +PROJECT_ROOT: Path = Path(__file__).resolve().parents[4] diff --git a/cli/contributing/update/runner/__main__.py b/cli/contributing/update/runner/__main__.py new file mode 100755 index 0000000000..1e6444aa45 --- /dev/null +++ b/cli/contributing/update/runner/__main__.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import argparse +from pathlib import Path + +from utils.update.fetch import document +from utils.update.runner import IMAGES_README, bump_workflows, newest_ubuntu_label + +from . import PROJECT_ROOT + + +def main() -> int: + parser = argparse.ArgumentParser( + description=( + "Raise every workflow's runs-on Ubuntu label to the newest GA " + "GitHub-hosted x64 image." + ) + ) + parser.add_argument( + "--repo-root", + type=Path, + default=PROJECT_ROOT, + help="Repository root whose .github/workflows are updated", + ) + args = parser.parse_args() + + label = newest_ubuntu_label(document(IMAGES_README)) + if label is None: + print(f"No GA x64 Ubuntu label found in {IMAGES_README}.") + return 1 + + repo_root = args.repo_root.resolve() + changed = bump_workflows(repo_root / ".github" / "workflows", label) + if not changed: + print(f"Every workflow already runs on {label} or newer.") + return 0 + + print(f"Raised runs-on to {label} in:") + for path in changed: + print(f"- {path.relative_to(repo_root)}") + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/compose.yml b/compose.yml index 8d12571046..910f176e03 100644 --- a/compose.yml +++ b/compose.yml @@ -132,4 +132,5 @@ networks: ipam: config: - subnet: ${INFINITO_SUBNET:?Run 'make dotenv' to generate the .env single source of truth} + ip_range: ${INFINITO_IP_RANGE:?Run 'make dotenv' to generate the .env single source of truth} gateway: ${INFINITO_GATEWAY:?Run 'make dotenv' to generate the .env single source of truth} diff --git a/default.env b/default.env index 98edc195ca..40cde21954 100644 --- a/default.env +++ b/default.env @@ -229,6 +229,9 @@ INFINITO_IP4=172.30.0.10 # IPv6 loopback / public address the playbook's `internet` network defaults to when no host_var pin is set. INFINITO_IP6=::1 +# Dynamic IPAM pool: upper half of INFINITO_SUBNET, derived after custom.env; every static IP sits below it. +INFINITO_IP_RANGE=172.30.0.128/25 + # True when /proc/version identifies the host as WSL2; generator overrides via runtime detection. INFINITO_IS_WSL2=false diff --git a/docs/contributing/actions/debugging/ci.md b/docs/contributing/actions/debugging/ci.md index 9ee6075aff..6fbb377978 100644 --- a/docs/contributing/actions/debugging/ci.md +++ b/docs/contributing/actions/debugging/ci.md @@ -49,11 +49,11 @@ Some CI failures (most notably OOM-kills such as [#162](https://github.com/infin ### GitHub-Hosted Runner Specs -All [workflows](../../../../.github/workflows/) target `runs-on: ubuntu-latest`, which maps to the GitHub-hosted standard Linux runner. The effective ceiling depends on the repository's visibility and plan: +All [workflows](../../../../.github/workflows/) target `runs-on: ubuntu-26.04`, the GitHub-hosted standard Linux runner pinned to one Ubuntu release. GitHub still refreshes that image weekly. The `๐Ÿƒ Update GitHub-hosted runner labels` job of [cron-update.yml](../../../../.github/workflows/cron-update.yml) opens a pull request when a newer GA x64 Ubuntu image is listed in [actions/runner-images](https://github.com/actions/runner-images), and `tests/lint/repository/test_workflow_runner_pinned.py` rejects `*-latest` labels. The effective ceiling depends on the repository's visibility and plan: | Repository / plan | vCPU | RAM | SSD | |------------------------------------------|------|--------|-------| -| Public repo (this repo, `ubuntu-latest`) | 4 | 16 GB | 14 GB | +| Public repo (this repo, `ubuntu-26.04`) | 4 | 16 GB | 14 GB | | Private repo on Free / Pro / Team | 2 | 7 GB | 14 GB | | Private repo on Enterprise | 4 | 16 GB | 14 GB | @@ -70,7 +70,7 @@ For the authoritative specs, see the upstream docs for [standard hosted runners] Pick the profile that matches the runner you want to mimic: ```sh -# Public repo runner (ubuntu-latest, 4 vCPU / 16 GB): the default CI target +# Public repo runner (ubuntu-26.04, 4 vCPU / 16 GB): the default CI target INFINITO_MEM_LIMIT=16g INFINITO_MEMSWAP_LIMIT=16g INFINITO_CPUS=4 make # Private repo runner on Free/Pro/Team (2 vCPU / 7 GB) diff --git a/docs/contributing/artefact/files/compose.yml.md b/docs/contributing/artefact/files/compose.yml.md index 0348e1982a..a55fb3f4b2 100644 --- a/docs/contributing/artefact/files/compose.yml.md +++ b/docs/contributing/artefact/files/compose.yml.md @@ -91,6 +91,7 @@ The env-var contracts each service expects strictly via `${VAR:?โ€ฆ}` (consumed | `INFINITO_DOMAIN` | Base domain exported into the container environment. Default in [default.env](../../../../default.env). | | `INFINITO_BIND_IP` | Host address that all published ports bind to. | | `INFINITO_SUBNET` | IPAM subnet for the default bridge network. | +| `INFINITO_IP_RANGE` | IPAM pool for containers that join the default bridge without a static address, such as worktree stacks on the primary's cache network. It is the upper half of `INFINITO_SUBNET`, derived after `custom.env` by [ip_range.py](../../../../utils/env/handlers/infinito/ip_range.py); every static address stays below it. | | `INFINITO_GATEWAY` | IPAM gateway for the default bridge network. | | `INFINITO_OUTER_NETWORK_MTU` | MTU for the bridge network. Lower when the host network is tunneled. | diff --git a/package-lock.json b/package-lock.json index 19db992e0f..07d86f4b59 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,8 +9,8 @@ "version": "0.0.0", "devDependencies": { "@eslint/js": "^10.0.1", - "@playwright/test": "^1.64.0", - "eslint": "^10.12.0", + "@playwright/test": "^1.64.1", + "eslint": "^10.13.0", "eslint-plugin-playwright": "^2.12.1", "globals": "^17.13.0", "stylelint": "^17.16.0" @@ -484,13 +484,13 @@ } }, "node_modules/@playwright/test": { - "version": "1.64.0", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.64.0.tgz", - "integrity": "sha512-oTN9FNYuN6bqQMwiho6jJKLCG2/QOYCixGXuCjRmzOq23eODeukuY2XiAVoVpAECbuezMt1MHQjAiQxK8F+Y+g==", + "version": "1.64.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.64.1.tgz", + "integrity": "sha512-IaYGml/nSOiZWROfPtuIL7neuu9qDOZ3TNvNljUIrhDMxiGTgPjzj/g9p9RxpS2tSepPDRY+UwAaEeiKtUvIAg==", "dev": true, "license": "Apache-2.0", "dependencies": { - "playwright": "1.64.0" + "playwright": "1.64.1" }, "bin": { "playwright": "cli.js" @@ -848,9 +848,9 @@ } }, "node_modules/eslint": { - "version": "10.12.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.12.0.tgz", - "integrity": "sha512-npHjrHb2o4ehH3mE+YuxABR+0gyb0aVWCIolgJDArwCiHEIsonBm3ZKjel5b0U5+a+MbEvIyRCGCzD3eKKK2NA==", + "version": "10.13.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.13.0.tgz", + "integrity": "sha512-UohDjD4zSzEwhf58M3O7vc/ycc8O1I7dNlhtD0WxE8Px8EHNJKtUwzBqrzeGhisRuv2ag4sAYswszCJRgKXYUg==", "dev": true, "license": "MIT", "workspaces": [ @@ -1817,13 +1817,13 @@ } }, "node_modules/playwright": { - "version": "1.64.0", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.64.0.tgz", - "integrity": "sha512-kVzTnYFYEyQ9RGzBjNCd2+yEqWmVbxl3AHPynv3qQ6JTjv4a+kwRcnqQwIpuP3NnrnIrE/Q6wWAIAvMfIE2/Yg==", + "version": "1.64.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.64.1.tgz", + "integrity": "sha512-HCrVhHr5QQuwYoswEUGTb7gGp522yflbv/ST8nF4sFWGuLjQCt17Q/EubpGGSNKYn1tsTCPZxqHhHCfVURu7UA==", "dev": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.64.0" + "playwright-core": "1.64.1" }, "bin": { "playwright": "cli.js" @@ -1833,9 +1833,9 @@ } }, "node_modules/playwright-core": { - "version": "1.64.0", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.64.0.tgz", - "integrity": "sha512-T9r+MZkTECl2+oUcZ26YgZzTrYidTsIhYYkJix+6iDOymOb1FB2RLLSOxRGnZGv5DStt+aduIVbt+E8WygXYpg==", + "version": "1.64.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.64.1.tgz", + "integrity": "sha512-BC4s8y6SEVA6Q1rSxZTto8hI1KUI3xXlHGZgvGqP4IqPdI/a6FX9H29IDNz7vKo9l21b6LfYosScPL6M3xxyDQ==", "dev": true, "license": "Apache-2.0", "bin": { diff --git a/package.json b/package.json index 529ad81295..61ab507135 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,8 @@ }, "devDependencies": { "@eslint/js": "^10.0.1", - "@playwright/test": "^1.64.0", - "eslint": "^10.12.0", + "@playwright/test": "^1.64.1", + "eslint": "^10.13.0", "eslint-plugin-playwright": "^2.12.1", "globals": "^17.13.0", "stylelint": "^17.16.0" diff --git a/packaging/arch/PKGBUILD b/packaging/arch/PKGBUILD index bb869b0ff2..32b4c239a6 100644 --- a/packaging/arch/PKGBUILD +++ b/packaging/arch/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Kevin Veen-Birkenbach pkgname=infinito-nexus -pkgver=16.0.1 +pkgver=16.1.0 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 b8cf49388e..7130893af6 100644 --- a/packaging/debian/changelog +++ b/packaging/debian/changelog @@ -1,3 +1,46 @@ +infinito-nexus (16.1.0-1) unstable; urgency=medium + + Added: + + - Wazuh: new *web-app-wazuh* role runs Wazuh 4.14.6 as a single-node SIEM + - Wazuh: Keycloak OIDC login, LDAP group roles and three RBAC tiers + - Wazuh: the SIEM console is served on clearnet only, never as an onion + + Fixed: + + - NFS client: swarm backups stay on local disk with their extended attributes + - NFS client: the backup user keeps access; a changed mount line remounts + - Docker: RedHat installs iptables-nft, so Fedora no longer needs ip_tables + - Compose: worktree stacks no longer take the primary stack's static IPs + - Backup: the baudolo version comes from *pyproject.toml* alone + - CI: runners with sudo-rs keep the environment the swarm matrix needs + + Version jumps (net since 16.0.1): + + - *pkgmgr*: v2.0.2 to v2.0.4 + - *web-app-gitea*: 28.1.0 to 28.2.0, MCP server 1.9.0 to 1.10.0 + - *web-app-n8n*: 2.44.3 to 2.44.4 + - *web-app-pixelfed*: 20261017 to 20261019 + - *web-app-semaphore*: v2.19.16 to v2.19.17 + - *web-app-stalwart*: v0.16.26 to v0.16.27 + - *web-app-stalwart*: webmail 1.7.4-apache to 1.7.5-apache + - *ruff* (dev): 0.17.0 to 0.17.1 + - *@playwright/test* (dev): ^1.64.0 to ^1.64.1 + + Upgrade notes: + + - Dev: run *make dotenv* once; compose now requires *INFINITO_IP_RANGE* + - Dev: a compose network created earlier keeps no IP pool until recreated + - NFS client: [older generations](roles/svc-storage-nfs-client/README.md) stay on the share; delete them by hand + + Contributors: + + - [Prageeth Panicker](https://github.com/pragepani): the Wazuh role + - [Evangelos Tsakoudis](https://evangelostsak.com): the WireGuard CLI test + - [Kevin Veen-Birkenbach](https://veen.world): NFS backups, compose IPs + + -- Kevin Veen-Birkenbach Mon, 19 Oct 2026 15:29:01 +0200 + infinito-nexus (16.0.1-1) unstable; urgency=medium Fixed: diff --git a/packaging/fedora/infinito-nexus.spec b/packaging/fedora/infinito-nexus.spec index 1c2016ba6b..fa0b42a559 100644 --- a/packaging/fedora/infinito-nexus.spec +++ b/packaging/fedora/infinito-nexus.spec @@ -1,5 +1,5 @@ Name: infinito-nexus -Version: 16.0.1 +Version: 16.1.0 Release: 1%{?dist} Summary: Meta package for Infinito.Nexus host dependencies @@ -58,6 +58,46 @@ install -d %{buildroot}%{_docdir}/%{name} %doc %{_docdir}/%{name}/DEPENDENCIES %changelog +* Mon Oct 19 2026 Kevin Veen-Birkenbach - 16.1.0-1 +- Added: + +- - Wazuh: new *web-app-wazuh* role runs Wazuh 4.14.6 as a single-node SIEM +- - Wazuh: Keycloak OIDC login, LDAP group roles and three RBAC tiers +- - Wazuh: the SIEM console is served on clearnet only, never as an onion + +- Fixed: + +- - NFS client: swarm backups stay on local disk with their extended attributes +- - NFS client: the backup user keeps access; a changed mount line remounts +- - Docker: RedHat installs iptables-nft, so Fedora no longer needs ip_tables +- - Compose: worktree stacks no longer take the primary stack's static IPs +- - Backup: the baudolo version comes from *pyproject.toml* alone +- - CI: runners with sudo-rs keep the environment the swarm matrix needs + +- Version jumps (net since 16.0.1): + +- - *pkgmgr*: v2.0.2 to v2.0.4 +- - *web-app-gitea*: 28.1.0 to 28.2.0, MCP server 1.9.0 to 1.10.0 +- - *web-app-n8n*: 2.44.3 to 2.44.4 +- - *web-app-pixelfed*: 20261017 to 20261019 +- - *web-app-semaphore*: v2.19.16 to v2.19.17 +- - *web-app-stalwart*: v0.16.26 to v0.16.27 +- - *web-app-stalwart*: webmail 1.7.4-apache to 1.7.5-apache +- - *ruff* (dev): 0.17.0 to 0.17.1 +- - *@playwright/test* (dev): ^1.64.0 to ^1.64.1 + +- Upgrade notes: + +- - Dev: run *make dotenv* once; compose now requires *INFINITO_IP_RANGE* +- - Dev: a compose network created earlier keeps no IP pool until recreated +- - NFS client: [older generations](roles/svc-storage-nfs-client/README.md) stay on the share; delete them by hand + +- Contributors: + +- - [Prageeth Panicker](https://github.com/pragepani): the Wazuh role +- - [Evangelos Tsakoudis](https://evangelostsak.com): the WireGuard CLI test +- - [Kevin Veen-Birkenbach](https://veen.world): NFS backups, compose IPs + * Sun Oct 18 2026 Kevin Veen-Birkenbach - 16.0.1-1 - Fixed: diff --git a/plugins/lookup/version.py b/plugins/lookup/version.py index 7beaedbcbd..d32fd2b664 100644 --- a/plugins/lookup/version.py +++ b/plugins/lookup/version.py @@ -1,13 +1,15 @@ """ Ansible lookup plugin: version -No parameters. Reads ``pyproject.toml`` from the repository root, located by walking parents from this plugin file's location. -Resolution order: -1) [project].version (PEP 621) -2) [tool.poetry].version (Poetry fallback) +Args: + terms: empty for the project's own version, resolved as + 1) [project].version (PEP 621) + 2) [tool.poetry].version (Poetry fallback); + or one distribution name, for the version its exact ``==`` pin in + [project.dependencies] names. """ from __future__ import annotations @@ -40,6 +42,17 @@ def _get_nested(data: dict, path: list[str]): return cur +def _dependency_pin(data: dict, package: str, pyproject_path: str) -> str: + prefix = f"{package}==" + for requirement in _get_nested(data, ["project", "dependencies"]) or []: + if isinstance(requirement, str) and requirement.startswith(prefix): + return requirement[len(prefix) :].strip() + raise AnsibleError( + f"version lookup: {package} has no exact '==' pin in " + f"[project.dependencies] of {pyproject_path}." + ) + + class LookupModule(LookupBase): def run(self, terms, variables=None, **kwargs): @@ -56,6 +69,13 @@ class LookupModule(LookupBase): f"version lookup: failed to parse TOML: {pyproject_path}: {exc}" ) from exc + if len(terms) > 1: + raise AnsibleError( + "version lookup accepts at most one term: a distribution name" + ) + if terms: + return [_dependency_pin(data, str(terms[0]), pyproject_path)] + version = _get_nested(data, ["project", "version"]) if not version: version = _get_nested(data, ["tool", "poetry", "version"]) diff --git a/pyproject.toml b/pyproject.toml index 83f7b704f3..91d16d1233 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "infinito-nexus" -version = "16.0.1" +version = "16.1.0" description = "Infinito.Nexus" readme = "README.md" requires-python = ">=3.11" @@ -33,7 +33,7 @@ deploy = [ "requests", ] dev = [ - "ruff==0.17.0", + "ruff==0.17.1", "import-linter", "pre-commit", "git-maintainer-tools", diff --git a/roles/pkgmgr/meta/services.yml b/roles/pkgmgr/meta/services.yml index b2c3923eba..079f44d0e8 100644 --- a/roles/pkgmgr/meta/services.yml +++ b/roles/pkgmgr/meta/services.yml @@ -3,4 +3,4 @@ pkgmgr: lifecycle: beta repository: https://github.com/kevinveenbirkenbach/package-manager.git - ref: v2.0.2 + ref: v2.0.4 diff --git a/roles/svc-bkp-volume-2-local/tasks/01_install.yml b/roles/svc-bkp-volume-2-local/tasks/01_install.yml index 6a1424737a..78939d60cc 100644 --- a/roles/svc-bkp-volume-2-local/tasks/01_install.yml +++ b/roles/svc-bkp-volume-2-local/tasks/01_install.yml @@ -3,7 +3,7 @@ include_role: name: sys-pip-install vars: - package_name: "backup-docker-to-local==7.1.1" + package_name: "backup-docker-to-local=={{ lookup('version', 'backup-docker-to-local') }}" global_install: true - name: โœ… Assert required baudolo commands are available diff --git a/roles/svc-db-rabbitmq/meta/services.yml b/roles/svc-db-rabbitmq/meta/services.yml index b3183f721d..9a416080a5 100644 --- a/roles/svc-db-rabbitmq/meta/services.yml +++ b/roles/svc-db-rabbitmq/meta/services.yml @@ -12,7 +12,7 @@ rabbitmq: bond: 1 image: rabbitmq name: rabbitmq - version: "4.3-management-alpine" + version: "4.4-management-alpine" min_storage: 289MB backup: database_routine: true diff --git a/roles/svc-net-wireguard/files/test/inventory.py b/roles/svc-net-wireguard/files/test/inventory.py new file mode 100644 index 0000000000..2808018021 --- /dev/null +++ b/roles/svc-net-wireguard/files/test/inventory.py @@ -0,0 +1,82 @@ +"""Write the inventory of the svc-net-wireguard CLI test. + +Usage: + python inventory.py =... + +Args: + layout: YAML file declaring the meshes and which member joins which. + work_dir: directory that receives devices.yml and host_vars/. + mesh_role: role whose networks.meshes puts each host into its meshes. + member=host: the container that plays each member of the layout. +""" + +from __future__ import annotations + +import sys +from pathlib import Path + +from utils.cache.yaml import dump_yaml, load_yaml + +APPLICATION_ID = "svc-net-wireguard" + + +def host_vars(host: str, meshes: list[dict], joined: list[str], mesh_role: str) -> dict: + """The host_vars of one test host. + + Args: + host: container name, which is also the inventory hostname. + meshes: every mesh the layout declares. + joined: the meshes this host joins. + mesh_role: role whose networks.meshes carries the membership. + + Returns: + The host_vars mapping for that host. + """ + return { + "ansible_connection": "docker", + "ansible_host": host, + "ansible_user": "root", + "ansible_python_interpreter": "/usr/bin/python3", + "applications": { + APPLICATION_ID: {"networks": {"meshes": meshes}}, + mesh_role: {"networks": {"meshes": joined}}, + }, + } + + +def devices(hosts: list[str], mesh_role: str) -> dict: + """The inventory putting every test host into both groups. + + Args: + hosts: container names of the test hosts. + mesh_role: role whose group the hosts join next to svc-net-wireguard. + + Returns: + The devices.yml mapping. + """ + return { + "all": { + "children": { + group: {"hosts": {host: {} for host in hosts}} + for group in (APPLICATION_ID, mesh_role) + } + } + } + + +def main(argv: list[str]) -> int: + layout_path, work_dir, mesh_role, *pairs = argv + layout = load_yaml(layout_path) + hosts = dict(pair.split("=", 1) for pair in pairs) + work = Path(work_dir) + for member, host in hosts.items(): + dump_yaml( + work / "host_vars" / f"{host}.yml", + host_vars(host, layout["meshes"], layout["members"][member], mesh_role), + ) + dump_yaml(work / "devices.yml", devices(list(hosts.values()), mesh_role)) + return 0 + + +if __name__ == "__main__": + raise SystemExit(main(sys.argv[1:])) diff --git a/roles/svc-net-wireguard/files/test/layout.yml b/roles/svc-net-wireguard/files/test/layout.yml new file mode 100644 index 0000000000..ffac3a4035 --- /dev/null +++ b/roles/svc-net-wireguard/files/test/layout.yml @@ -0,0 +1,13 @@ +--- +meshes: + - name: alpha + subnet: 10.100.200.0/24 + listen_port: 51900 + - name: beta + subnet: 10.100.201.0/24 + listen_port: 51901 + +members: + I: [alpha] + II: [alpha, beta] + III: [beta] diff --git a/roles/svc-net-wireguard/files/test/lib/checks.sh b/roles/svc-net-wireguard/files/test/lib/checks.sh new file mode 100644 index 0000000000..1fe066b50c --- /dev/null +++ b/roles/svc-net-wireguard/files/test/lib/checks.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env bash +# shellcheck shell=bash +# +# Expects from test.sh: BULK_BYTES, and the probes from lib/probes.sh. + +failures=0 + +check() { + local description="$1" + shift + if "$@"; then + echo "[PASS] ${description}" + else + echo "[FAIL] ${description}" >&2 + failures=$((failures + 1)) + fi +} + +not() { + ! "$@" +} + +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}" +} diff --git a/roles/svc-net-wireguard/files/test/lib/hosts.sh b/roles/svc-net-wireguard/files/test/lib/hosts.sh new file mode 100644 index 0000000000..f9454d429e --- /dev/null +++ b/roles/svc-net-wireguard/files/test/lib/hosts.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +# shellcheck shell=bash +# +# Expects from test.sh: COMPOSE_FILE, PREFIX, NETWORK, HOST_I, HOST_II, +# HOST_III and HOSTS. + +hosts_compose() { + HOST_I="${HOST_I}" HOST_II="${HOST_II}" HOST_III="${HOST_III}" NETWORK="${NETWORK}" \ + container compose --file "${COMPOSE_FILE}" --project-name "${PREFIX}" "$@" +} + +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 +} diff --git a/roles/svc-net-wireguard/files/test/lib/probes.sh b/roles/svc-net-wireguard/files/test/lib/probes.sh new file mode 100644 index 0000000000..71b7b9206a --- /dev/null +++ b/roles/svc-net-wireguard/files/test/lib/probes.sh @@ -0,0 +1,61 @@ +#!/usr/bin/env bash +# shellcheck shell=bash +# +# Expects from test.sh: BULK_BYTES, PING_COUNT, SSH_TIMEOUT, PYTHON, +# REPO_ROOT, DIR and WORK, and on() from lib/hosts.sh. + +SSH_ARGS=() + +repo_python() { + PYTHONPATH="${REPO_ROOT}" "${PYTHON}" "$@" +} + +mesh_helper() { + repo_python "${DIR}/mesh.py" "$@" +} + +load_mesh_ssh_args() { + mapfile -t SSH_ARGS < <(mesh_helper ssh-args) + SSH_ARGS+=(-o BatchMode=yes -o "ConnectTimeout=${SSH_TIMEOUT}") +} + +address() { + mesh_helper address "${WORK}/host_vars" "$1" "$2" +} + +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"* ]] +} diff --git a/roles/svc-net-wireguard/files/test/mesh.py b/roles/svc-net-wireguard/files/test/mesh.py new file mode 100644 index 0000000000..31e706d76b --- /dev/null +++ b/roles/svc-net-wireguard/files/test/mesh.py @@ -0,0 +1,39 @@ +"""Read what the mesh CLI wrote, for the svc-net-wireguard CLI test. + +Usage: + python mesh.py address + python mesh.py ssh-args + +Args: + address: print the address holds on , or nothing. + ssh-args: print the SSH options a mesh hop uses, one per line. +""" + +from __future__ import annotations + +import shlex +import sys +from pathlib import Path + +from cli.administration.inventory.mesh.transport import ( + mesh_address, + mesh_ssh_args, + repo_ssh_args, +) + + +def main(argv: list[str]) -> int: + command, *args = argv + if command == "address": + host_vars_dir, host, mesh = args + print(mesh_address(Path(host_vars_dir), host, mesh) or "") + return 0 + if command == "ssh-args": + print("\n".join(shlex.split(mesh_ssh_args(repo_ssh_args())))) + return 0 + print(f"unknown command: {command}", file=sys.stderr) + return 2 + + +if __name__ == "__main__": + raise SystemExit(main(sys.argv[1:])) diff --git a/roles/svc-net-wireguard/files/test/test.sh b/roles/svc-net-wireguard/files/test/test.sh index 800c21a217..e8cedfddf6 100644 --- a/roles/svc-net-wireguard/files/test/test.sh +++ b/roles/svc-net-wireguard/files/test/test.sh @@ -20,7 +20,8 @@ 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" +DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +COMPOSE_FILE="${DIR}/compose.yml" PREFIX="wg-mesh-$$" NETWORK="${PREFIX}" HOST_I="${PREFIX}-1" @@ -28,13 +29,13 @@ 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}" "$@" -} +# shellcheck source=roles/svc-net-wireguard/files/test/lib/hosts.sh +source "${DIR}/lib/hosts.sh" +# shellcheck source=roles/svc-net-wireguard/files/test/lib/probes.sh +source "${DIR}/lib/probes.sh" +# shellcheck source=roles/svc-net-wireguard/files/test/lib/checks.sh +source "${DIR}/lib/checks.sh" cleanup() { hosts_compose down --remove-orphans >/dev/null 2>&1 @@ -42,160 +43,7 @@ cleanup() { } 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 @@ -206,23 +54,9 @@ for host in "${HOSTS[@]}"; do done authorize_every_host -cat >"${WORK}/devices.yml" <