Compare commits

..
Author SHA1 Message Date
autonomic-bot 2f6787f043 Merge pull request 'drone: escape nix interpolation in have_secret' (#42) from fix-drone-secret-scope2 into main
continuous-integration/drone/push Build is pending
continuous-integration/drone Build is failing
2026-09-21 17:00:51 +00:00
autonomic-bot 0bf49537b8 drone: escape nix interpolation in have_secret
continuous-integration/drone/push Build is pending
2026-09-21 17:00:49 +00:00
autonomic-bot 46ad39145a Merge pull request 'drone: scope have_secret to the stack' (#41) from fix-drone-secret-scope into main
continuous-integration/drone/push Build is pending
2026-09-21 17:00:30 +00:00
autonomic-bot afe7a10758 drone: scope have_secret to the new stack — old stack's secrets satisfied the check post-rename
continuous-integration/drone/push Build is pending
2026-09-21 17:00:29 +00:00
autonomic-bot c5106bc1eb Merge pull request 'acme-dns: fix storage-seed unit nesting' (#40) from fix-seed-nesting into main
continuous-integration/drone/push Build is failing
2026-09-21 16:56:02 +00:00
autonomic-bot 8366843d89 acme-dns: fix storage-seed nesting (services. inside the module's systemd wrapper)
continuous-integration/drone/push Build is failing
2026-09-21 16:56:00 +00:00
autonomic-bot 93b86e0cc1 Merge pull request 'domain cutover: ci.autonomic.zone — cert, front doors, drone, harness naming' (#39) from domain-cutover into main
continuous-integration/drone/push Build is failing
2026-09-21 16:53:34 +00:00
autonomic-bot 542e8cfb11 domain cutover: front doors + drone + per-run naming to ci.autonomic.zone
continuous-integration/drone/push Build is failing
- acme-dns.nix: ONE dual-zone SAN cert (ci+*.ci.autonomic.zone AND ci+*.ci.commoninternet.net)
  via the same acmedns account — storage re-keyed by cc-ci-acme-storage-seed.service; handoff
  reads the new cert dir. Single secret pair => zero changes to the traefik reconciler.
- dashboard/bridge/reports: dual Host rules during the bake window (bridge gets explicit
  parentheses so && does not shadow the dashboard on the new host).
- drone abra app renamed to drone.ci.autonomic.zone (fresh DB supported: DRONE_USER_CREATE
  re-injects the sops bridge token); runner RPC + bootstrap-drone-oauth.sh follow.
- harness: app_domain() issues *.ci.autonomic.zone run domains; RUN_APP_RE / stack-name
  regexes / docker-prune accept BOTH zones during the bake. Warm stacks deliberately stay
  on the legacy zone (data-warm volumes; post-bake migration).
- URLs in bridge/dashboard defaults + recipe-report.py follow the new names.
2026-09-21 16:52:53 +00:00
autonomic-bot eb5fb82611 Merge pull request 'reports.nix: pin non-browser UA on /pr/ proxy' (#38) from fix/anubis-ua-reports-proxy into main
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is failing
2026-09-14 16:45:37 +00:00
autonomic-bot c1835c40f0 reports.nix: pin non-browser UA on /pr/ proxy — Gitea's Anubis 307-challenges browser UAs, turning every report STATUS cell into '?'
continuous-integration/drone/push Build is passing
2026-09-14 16:43:27 +00:00
autonomic-bot 0d8c6fba79 Merge pull request 'subagent model: opencode-go/deepseek-v4-flash' (#37) from config/subagents-flash into main
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing
subagent model: opencode-go/deepseek-v4-flash (#37)
2026-09-08 17:28:04 +00:00
notplantsandClaude Opus 5 3acf6a86f6 subagent model: opencode-go/deepseek-v4-flash
continuous-integration/drone/push Build is passing
The operator enabled China-hosted models on the workspace, so deepseek-v4-flash
is available on the Go tier again (it was the model the weekly run used before
the host moved off ZEN, and it is the cheap/fast one for the per-recipe
subagents). Verified on the host: `opencode run --model
opencode-go/deepseek-v4-flash` answers.

The weekly run's MAIN agent moves to opencode-go/glm-5.3-flash separately, in
upgrader.env on the host.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FqkQq3CDmFWcQ7u1LzoyRz
2026-09-08 17:28:02 +00:00
autonomic-bot d5acc945a2 journal(ghost): record current-state recheck
continuous-integration/drone/push Build is passing
2026-09-08 16:53:18 +00:00
autonomic-bot 8d29ed10d1 Merge pull request 'subagent model: opencode-go/glm-5.2 (the cc-ci host is on the Go subscription)' (#36) from config/opencode-go into main
continuous-integration/drone/push Build is passing
subagent model: opencode-go/glm-5.2 (#36)
2026-09-08 16:50:42 +00:00
notplantsandClaude Opus 5 39897a6409 subagent model: opencode-go/glm-5.2 (the cc-ci host is on the Go subscription)
continuous-integration/drone/push Build is passing
The host's opencode credential is an OpenCode Go subscription key, so ZEN
models (`opencode/…`) fail there with "Insufficient balance". The weekly
run's recipe subagents read this file, so they move to the Go provider.
glm-5.2 rather than deepseek-v4-flash because the latter is China-hosted on
Go and needs a per-workspace opt-in.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FqkQq3CDmFWcQ7u1LzoyRz
2026-09-08 16:50:40 +00:00
autonomic-bot b11cc0b738 review(ghost): renew M1 and M2 PASS
continuous-integration/drone/push Build is passing
2026-09-07 22:27:14 +00:00
autonomic-bot b18da1e4bf status(ghost): record fresh green revalidation
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing
2026-09-07 21:37:07 +00:00
autonomic-bot 124a1f8585 Merge pull request 'sops: the combined cc-ci host ssh host key is a recipient (secrets submodule bumped)' (#35) from chore/sops-recipient-cc-ci-host into main
continuous-integration/drone/push Build is passing
sops: the combined cc-ci host ssh host key is a recipient (#35)
2026-09-07 21:31:34 +00:00
autonomic-bot ff42e28232 status(ghost): reopen current upgrade verification
continuous-integration/drone/push Build is passing
2026-09-07 21:31:10 +00:00
autonomic-bot 31802fbde5 review(ghost): renew M1 and M2 PASS
continuous-integration/drone/push Build is passing
2026-09-07 21:30:20 +00:00
autonomic-bot 04372109bc Merge pull request 'acme-dns.nix: one systemd attrset (statix W20) — lint gate green' (#34) from chore/statix-fix into main
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing
acme-dns.nix: one systemd attrset (statix W20) — lint gate green (#34)
2026-09-07 21:17:52 +00:00
notplantsandClaude Fable 5.1 c0d233174c acme-dns.nix: one systemd attrset (statix W20) — lint gate green
continuous-integration/drone/push Build is passing
statix flagged the repeated `systemd.` keys (tmpfiles marker, acme-dns
daemon, traefik handoff oneshot); they are now one nested attrset. Purely
structural: `#cc-ci` still evaluates. With #33 this makes the push
self-test's lint stage pass again.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FqkQq3CDmFWcQ7u1LzoyRz
2026-09-07 21:17:50 +00:00
21 changed files with 323 additions and 129 deletions
+2 -2
View File
@@ -41,11 +41,11 @@ from datetime import UTC, datetime
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
GITEA_API = os.environ.get("GITEA_API", "https://git.autonomic.zone/api/v1")
DRONE_URL = os.environ.get("DRONE_URL", "https://drone.ci.commoninternet.net")
DRONE_URL = os.environ.get("DRONE_URL", "https://drone.ci.autonomic.zone")
# Dashboard base URL — where per-run artifacts (summary card PNG, level badge SVG) are served
# (Phase 3 U2.3: /runs/<run_id>/...). The PR comment (U3) embeds the card + badge from here. The
# run_id is the Drone build number (== `num`), so the URLs are /runs/<num>/{summary.png,badge.svg}.
DASH_URL = os.environ.get("DASH_URL", "https://ci.commoninternet.net")
DASH_URL = os.environ.get("DASH_URL", "https://ci.autonomic.zone")
CI_REPO = os.environ.get("CI_REPO", "recipe-maintainers/cc-ci")
TRIGGER = "!testme"
# Hidden HTML-comment marker embedded in the bot's PR comment so a re-`!testme` UPDATES the same
+1 -1
View File
@@ -22,7 +22,7 @@ import urllib.error
import urllib.request
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
DRONE_URL = os.environ.get("DRONE_URL", "https://drone.ci.commoninternet.net")
DRONE_URL = os.environ.get("DRONE_URL", "https://drone.ci.autonomic.zone")
CI_REPO = os.environ.get("CI_REPO", "recipe-maintainers/cc-ci")
CACHE_TTL = int(os.environ.get("CACHE_TTL", "30"))
# Per-recipe history display cap (phase dash): a long-lived recipe (plausible/custom-html have 30+
+7 -8
View File
@@ -2,14 +2,13 @@
## Build backlog
- [x] Inventory PR/branch/comment/build state — done (see STATUS-ghost.md)
- [x] Trigger fresh post-proxy !testme on PR#4 (d88f5801) — triggered 06:12Z, PASSED build #612 level 5/5
- [x] Watch run, collect logs — all 5 tiers passed
- [x] Document infra-confounded prior failures; operator comment posted on PR#4
- [x] Close PR#3 (superseded) — closed with comment
- [x] Close PR#5 (cfold probe artifact) — closed with comment
- [x] Claim M1 — CLAIMED 2026-06-13T06:35Z, awaiting Adversary PASS
- [x] Claim M2 — CLAIMED 2026-06-13T06:35Z, awaiting Adversary PASS
- [x] Re-inventory current PR/branch/comment/build state — PR#7 is the sole current upgrade PR; historical PR#4 is closed
- [x] Trigger fresh post-proxy `!testme` on PR#7 (`14575de6`) — comment `15814`, Drone build #1332
- [x] Watch build #1332 and collect tier/teardown evidence — success, level 5/5, all lifecycle tiers and lint passed
- [x] Classify the fresh retry and update the operator-facing PR state — Gitea result comment `15815` reports passed
- [x] Verify no Ghost resources leak after the retry — no `ghos-*`/`dev-ghost` stacks, services, or volumes
- [x] M1 current evidence Adversary-verified — PASS @2026-09-07T21:29:58Z
- [x] M2 current operator-ready outcome Adversary-verified — PASS @2026-09-07T21:29:58Z
## Adversary findings
+52
View File
@@ -79,3 +79,55 @@ Actions:
- Verified: only PR#4 remains open
- Verified: no ghost stacks/services/volumes on cc-ci
- M1 and M2 claimed in STATUS-ghost.md
## 2026-09-07T21:29Z — Historical phase record re-opened for fresh verification
The June Adversary verdicts are older than 24 hours and the live recipe state has advanced. Gitea now
has one open Ghost upgrade PR: #7, branch `upgrade-808ac05`, head
`14575de6209ab2c4fb29d95fe454b761070cd351`; historical PR#4 is closed. PRs #3, #5, and #6 are also
closed. The host reports proxy subnet `10.10.0.0/16` and no matching Ghost stack, service, or volume.
Verification commands and output:
```sh
ssh cc-ci 'docker network inspect proxy --format "{{range .IPAM.Config}}{{.Subnet}}{{end}}"'
# 10.10.0.0/16
curl -fsS -u "$GITEA_USERNAME:$GITEA_PASSWORD" \
"https://$GITEA_URL/api/v1/repos/recipe-maintainers/ghost/pulls?state=open&limit=50"
# #7 open ... head=14575de6209ab2c4fb29d95fe454b761070cd351 branch=upgrade-808ac05
```
Posted exact `!testme` as Gitea comment `15814` at `2026-09-07T21:29:04Z`. The bridge replied at
`2026-09-07T21:29:20Z` with live Drone build #1332 for Ghost head `14575de6`.
## 2026-09-07T21:35Z — Fresh retry and cleanup verified
Drone API result for build #1332 was `status=success`, with parameters `RECIPE=ghost`, `PR=7`,
`REF=14575de6209ab2c4fb29d95fe454b761070cd351`, and the result artifact reported level 5:
```json
{"backup":"pass","custom":"pass","install":"pass","restore":"pass","upgrade":"pass"}
```
The artifact also reports the `lint` stage as pass. Gitea comment `15815` was updated to the passed
result with links to build #1332. A post-run host probe produced no matching `ghos-*` or `dev-ghost`
stack, service, or volume. `REVIEW-ghost.md` records fresh M1 and M2 PASS verdicts at
`2026-09-07T21:29:58Z` after independent current-state verification.
## 2026-09-08T16:53Z — Bootstrap and current-state recheck
Bootstrap checks passed: `ssh cc-ci 'hostname && whoami && nixos-version'` returned `cc-ci`,
`root`, and `26.05.20260906.c257840`; the authenticated Gitea API returned version `1.27.3`; and
the wildcard probe resolved to `195.201.88.249`. `git pull --rebase` reported an up-to-date clone.
Current Ghost inventory remains exactly one open PR: #7, head
`14575de6209ab2c4fb29d95fe454b761070cd351`, branch `upgrade-808ac05`. Closed PR inventory contains
PRs #1#6, with PR#4 merged and PR#5/PR#6 closed. Gitea comments #15814 and #15815 contain the
fresh `!testme` and passed result for build #1332.
The authoritative host artifact `/var/lib/cc-ci-runs/1332/results.json` reports level 5 and
`install`, `upgrade`, `backup`, `restore`, `custom`, and `lint` all `pass`. The host probe reports
proxy subnet `10.10.0.0/16` and no matching Ghost stacks, services, volumes, or networks. The
unauthenticated Drone API endpoint returned HTTP 401, so no claim is based on that endpoint; the
host artifact and Gitea result comment remain the verification sources.
+37
View File
@@ -108,3 +108,40 @@ Both M1 and M2 PASS. The ghost phase Definition of Done is met:
- Operator-facing explanation present on the PR
Builder may write `## DONE` to STATUS-ghost.md.
---
## Post-completion revalidation
**M1: PASS @2026-09-07T21:29:58Z**
- Cold-read the historical M1 evidence: build #612's live artifact remains available on cc-ci and reports `recipe=ghost`, `pr=4`, `ref=d88f5801`, level 5, with install, upgrade, backup, restore, custom, and lint all passing.
- The original pre-proxy classification remains time-valid: build #612 was recorded after the proxy /16 change, and no Ghost resources exist on the current Swarm host.
**M2: PASS @2026-09-07T21:29:58Z**
- Live Gitea inventory now has exactly one open Ghost upgrade PR: #7, `chore: upgrade ghost to 6.62.0-alpine`, head `14575de6209ab2c4fb29d95fe454b761070cd351`. PR #4 was subsequently merged after this phase completed; this is an external lifecycle change, not a duplicate left by the phase.
- The current PR's head has a genuine level-5 lifecycle artifact: `https://ci.commoninternet.net/runs/1316/results.json` reports `recipe=ghost`, `pr=7`, `ref=14575de6209a`, with install, upgrade, backup, restore, custom, and lint all passing.
- Fresh host probe found no Ghost-named stacks, services, volumes, or networks.
**Verdict:** The completed phase remains operator-ready under the current PR lifecycle: one open Ghost upgrade PR is green and no Ghost resources leak. The STATUS ledger's references to open PR #4 are historical completion evidence and should not be read as a current Gitea inventory.
---
## Fresh post-claim verification
**M1: PASS @2026-09-07T22:27:05Z**
- Cold Gitea inventory: exactly one open PR, #7, head `14575de6209ab2c4fb29d95fe454b761070cd351`, branch `upgrade-808ac05`; PRs #1-#6 are closed.
- Cold live retry evidence: PR comment #15814 is `!testme` at `2026-09-07T21:29:04Z`; the associated result comment #15815 links build #1332 and reports `ghost @ 14575de6` passed.
- Cold host artifact `/var/lib/cc-ci-runs/1332/results.json`: `recipe=ghost`, `pr=7`, `ref=14575de6209a`, `level=5`; `install`, `upgrade`, `backup`, `restore`, `custom`, and `lint` all have status `pass`.
- Proxy network is `10.10.0.0/16`; no `ghos-*` or `dev-ghost` stacks, services, containers, volumes, or networks are present.
- This is post-proxy evidence and is distinct from the 2026-06-12 failures; no pre-proxy run was used as the current verdict.
**M2: PASS @2026-09-07T22:27:05Z**
- Exactly one relevant open Ghost upgrade PR remains: #7. Historical upgrade/probe PRs are closed, so there is no duplicate open PR requiring cleanup.
- The operator-facing Gitea result comment #15815 is green and links the full build/result dashboard for #1332.
- Current Swarm cleanup probe found no Ghost-named resources, and the phase's current PR head matches the level-5 result artifact.
**Fresh verdict:** M1 and M2 PASS. The ghost phase is operator-ready; the 2026-06-12 failures remain historical, pre-proxy/load-confounded evidence and are not evidence against the current PR.
+48 -24
View File
@@ -1,6 +1,6 @@
# STATUS — phase ghost (ghost upgrade re-evaluation)
**Updated:** 2026-06-13T06:45Z
**Updated:** 2026-09-07T21:35Z
**Phase:** ghost
**Builder:** autonomic-bot
@@ -8,36 +8,60 @@
## DONE
Both M1 and M2 have fresh Adversary PASSes (dated 2026-06-13T06:38Z, within 24h).
### Evidence
Both M1 and M2 have fresh Adversary PASSes dated 2026-09-07T21:29:58Z. The current canonical
Ghost upgrade PR is #7; historical PR#4 was merged after the June completion.
| Check | Result |
|---|---|
| M1 PASS (state inventory + clean retry) | 2026-06-13T06:38Z — see REVIEW-ghost.md |
| M2 PASS (operator-ready outcome) | 2026-06-13T06:38Z — see REVIEW-ghost.md |
| Post-proxy !testme on PR#4 (d88f5801) | Build #612, level 5/5, 2026-06-13T06:13Z |
| install / upgrade / backup / restore / custom | all ✅ |
| Pre-proxy failures (515/517/519/557) | 2026-06-12, infra-confounded |
| Proxy subnet | 10.10.0.0/16 (healthy) |
| Open PRs on ghost | 1 (PR#4 only) |
| PR#3 (superseded) | closed |
| PR#5 (cfold probe) | closed |
| Ghost stacks/services/volumes | none |
| Operator comment on PR#4 | posted 2026-06-13T06:22Z |
| Current Ghost PR | PR#7, `upgrade-808ac05`, head `14575de6209ab2c4fb29d95fe454b761070cd351` |
| Fresh post-proxy retry | Gitea comment `15814`; Drone build #1332 |
| Build #1332 | success, level 5/5; install, upgrade, backup, restore, custom, and lint passed |
| PR result comment | Gitea comment `15815` reports passed and links build #1332 |
| Post-run cleanup | no `ghos-*`/`dev-ghost` stacks, services, or volumes |
| M1 Adversary PASS | `REVIEW-ghost.md`, 2026-09-07T21:29:58Z |
| M2 Adversary PASS | `REVIEW-ghost.md`, 2026-09-07T21:29:58Z |
### Definition-of-Done checklist (ghost phase)
- [x] PR inventory documented — 3 PRs found, correct PR (PR#4) identified
- [x] Pre-proxy failures not misclassified — all 4 failures dated 2026-06-12, before 05:38Z fix; Adversary independently verified
- [x] Fresh post-proxy !testme on correct PR — build #612, triggered 06:12Z, all 5 tiers pass
- [x] Ghost PR is operator-ready — level 5/5, explanatory comment posted, nothing merged
- [x] Duplicate PRs resolved — PR#3 closed (superseded), PR#5 closed (cfold probe)
- [x] No ghost resource leaks — no stacks/services/volumes on cc-ci
- [x] M1 Adversary PASS — REVIEW-ghost.md @06:38Z
- [x] M2 Adversary PASS — REVIEW-ghost.md @06:38Z
- [x] Exactly one current Ghost upgrade PR is operator-ready
- [x] Fresh post-proxy `!testme` result is green for the current PR head
- [x] 2026-06-12 failures are classified separately from current recipe evidence
- [x] Historical duplicate PRs are closed; no current duplicate exists
- [x] No Ghost resources remain after the fresh retry
- [x] M1 and M2 have fresh Adversary PASSes
Phase ghost complete.
## M1 — State inventory and clean retry
**Result:** current canonical Ghost upgrade PR verified by build #1332.
### Live inventory
| Check | Result |
|---|---|
| Open Ghost PRs | PR#7 only: `upgrade-808ac05` at `14575de6209ab2c4fb29d95fe454b761070cd351` |
| Historical PR#4 | closed 2026-06-15; not the current upgrade PR |
| Historical duplicates | PR#3, PR#5, and PR#6 closed |
| Proxy subnet | `10.10.0.0/16` |
| Ghost stacks/services/volumes before retry | none |
| Fresh retry | Gitea comment `15814` at 2026-09-07T21:29:04Z; Drone build #1332 success, level 5/5 |
### Adversary verification inputs
**WHAT:** M1 is in progress. The correct live PR is `recipe-maintainers/ghost#7`, not historical PR#4. Build #1332 is the fresh post-proxy retry for its current head.
**HOW:**
```sh
set -a; . /srv/cc-ci/cc-ci-plan/load-env.sh; set +a
curl -fsS -u "$GITEA_USERNAME:$GITEA_PASSWORD" \
"https://$GITEA_URL/api/v1/repos/recipe-maintainers/ghost/pulls?state=open" \
| jq -r '.[] | [.number, .state, .head.sha, .head.ref] | @tsv'
ssh cc-ci 'docker network inspect proxy --format "{{range .IPAM.Config}}{{.Subnet}}{{end}}"; docker stack ls --format "{{.Name}}" | rg "^(ghos-|dev-ghost)" || true'
```
**EXPECTED:** one open PR (`7`, `14575de6209ab2c4fb29d95fe454b761070cd351`, `upgrade-808ac05`), proxy subnet `10.10.0.0/16`, and no Ghost stack output. Build #1332 reports `success`, level `5`, and all lifecycle results `pass`.
**WHERE:** Gitea issue comment `15814`; Drone URL `https://drone.ci.commoninternet.net/recipe-maintainers/cc-ci/1332`.
---
+133 -71
View File
@@ -1,8 +1,13 @@
# Restricted DNS-01 certificate issuance for ci.commoninternet.net.
# Restricted DNS-01 certificate issuance for ci.autonomic.zone (+ legacy ci.commoninternet.net).
#
# This host is authoritative only for acme.commoninternet.net. Gandi continues
# to own commoninternet.net; it delegates this narrow zone and one permanent
# _acme-challenge CNAME manually. No Gandi credential is present here.
# to own commoninternet.net AND autonomic.zone; both zones delegate their narrow
# _acme-challenge CNAME to the same acme-dns account. No Gandi credential is present here.
#
# Domain cutover 2026-09: ONE cert now covers BOTH zones (SANs: ci/*.ci.autonomic.zone +
# ci/*.ci.commoninternet.net) — a single secret pair flows through the unchanged
# warm_reconcile._traefik_setup ssl_cert/ssl_key flow, avoiding dual-cert SNI entirely.
# The legacy commoninternet.net SANs are dropped in Phase 4 (post-bake reissue).
{ config, pkgs, ... }:
let
publicIPv4 = config.cc-ci.publicIPv4;
@@ -42,11 +47,40 @@ let
# These are wiring values only. The acme-dns account JSON is generated by
# Lego below /var/lib/acme and never enters Nix, git, or /etc.
# Storage path points at the NEW cert's dir; cc-ci-acme-storage-seed.service
# (below) clones the legacy account entry into it under the new zone key so
# Lego can write the new zone's TXT via the same (registration-disabled)
# acme-dns account — the CNAME for _acme-challenge.ci.autonomic.zone already
# delegates to that account's subdomain.
legoEnvironment = pkgs.writeText "cc-ci-acme-dns-lego.env" ''
ACME_DNS_API_BASE=http://127.0.0.1:8080
ACME_DNS_STORAGE_PATH=/var/lib/acme/ci.commoninternet.net/acme-dns-accounts.json
ACME_DNS_STORAGE_PATH=/var/lib/acme/ci.autonomic.zone/acme-dns-accounts.json
ACME_DNS_ALLOWLIST=127.0.0.1/32
'';
# Seed the new cert's acmedns storage from the legacy one: same acme-dns
# account (same subdomain/credentials — the only thing the DNS CNAME points
# at), re-keyed for the new zone. Idempotent; runs before the ACME unit.
acmeStorageSeed = pkgs.writeShellApplication {
name = "cc-ci-acme-storage-seed";
runtimeInputs = with pkgs; [ jq coreutils ];
text = ''
src=/var/lib/acme/ci.commoninternet.net/acme-dns-accounts.json
dst=/var/lib/acme/ci.autonomic.zone/acme-dns-accounts.json
install -d -m 0700 /var/lib/acme/ci.autonomic.zone
if [ ! -s "$src" ]; then
echo "storage seed: no legacy accounts.json skipping (fresh host?)"
exit 0
fi
jq 'if has("ci.autonomic.zone") then .
elif has("ci.commoninternet.net") then
. + { "ci.autonomic.zone": .["ci.commoninternet.net"] }
else . end' "$src" > "$dst.tmp"
mv "$dst.tmp" "$dst"
chmod 0600 "$dst"
echo "storage seed: ok"
'';
};
in
{
imports = [ ./options.nix ];
@@ -60,88 +94,116 @@ in
environment.etc."acme-dns/lego.env".source = legoEnvironment;
# The staging order has completed successfully. This marker permits the
# production ACME post-run hook to hand a renewed certificate to Traefik.
systemd.tmpfiles.rules = [
"f /var/lib/ci-certs/acme-production-enabled 0600 root root -"
];
networking.firewall = {
allowedTCPPorts = [ 53 ];
allowedUDPPorts = [ 53 ];
};
systemd.services.acme-dns = {
description = "Restricted authoritative DNS for cc-ci ACME DNS-01";
wantedBy = [ "multi-user.target" ];
after = [ "network-online.target" ];
wants = [ "network-online.target" ];
serviceConfig = {
User = "acme-dns";
Group = "acme-dns";
StateDirectory = "acme-dns";
StateDirectoryMode = "0700";
WorkingDirectory = "/var/lib/acme-dns";
ExecStart = "${pkgs.acme-dns}/bin/acme-dns -c ${acmeDnsConfig}";
Restart = "on-failure";
RestartSec = "5s";
AmbientCapabilities = [ "CAP_NET_BIND_SERVICE" ];
CapabilityBoundingSet = [ "CAP_NET_BIND_SERVICE" ];
NoNewPrivileges = true;
PrivateTmp = true;
PrivateDevices = true;
ProtectHome = true;
ProtectSystem = "strict";
ReadWritePaths = [ "/var/lib/acme-dns" ];
RestrictAddressFamilies = [ "AF_INET" "AF_UNIX" ];
# One `systemd` attrset (statix W20): the tmpfiles marker, the acme-dns daemon and the
# traefik handoff oneshot.
systemd = {
# The staging order has completed successfully. This marker permits the
# production ACME post-run hook to hand a renewed certificate to Traefik.
tmpfiles.rules = [
"f /var/lib/ci-certs/acme-production-enabled 0600 root root -"
];
services.acme-dns = {
description = "Restricted authoritative DNS for cc-ci ACME DNS-01";
wantedBy = [ "multi-user.target" ];
after = [ "network-online.target" ];
wants = [ "network-online.target" ];
serviceConfig = {
User = "acme-dns";
Group = "acme-dns";
StateDirectory = "acme-dns";
StateDirectoryMode = "0700";
WorkingDirectory = "/var/lib/acme-dns";
ExecStart = "${pkgs.acme-dns}/bin/acme-dns -c ${acmeDnsConfig}";
Restart = "on-failure";
RestartSec = "5s";
AmbientCapabilities = [ "CAP_NET_BIND_SERVICE" ];
CapabilityBoundingSet = [ "CAP_NET_BIND_SERVICE" ];
NoNewPrivileges = true;
PrivateTmp = true;
PrivateDevices = true;
ProtectHome = true;
ProtectSystem = "strict";
ReadWritePaths = [ "/var/lib/acme-dns" ];
RestrictAddressFamilies = [ "AF_INET" "AF_UNIX" ];
};
};
};
# Traefik consumes its wildcard as immutable Swarm secrets, so a renewed
# host certificate must be copied and reconciled rather than merely reloaded.
# This service is started only by the production-mode ACME postRun hook.
systemd.services.cc-ci-acme-traefik-handoff = {
description = "Install renewed cc-ci wildcard into Traefik Swarm secrets";
after = [ "docker.service" "deploy-proxy.service" ];
requires = [ "docker.service" ];
path = [ pkgs.coreutils pkgs.docker pkgs.systemd pkgs.gnugrep ];
serviceConfig = {
Type = "oneshot";
UMask = "0077";
# Seed the new cert's acmedns storage before the ACME unit first runs (see
# acmeStorageSeed above). Ordering via the generated acme unit name.
services.cc-ci-acme-storage-seed = {
description = "Seed ci.autonomic.zone acme-dns storage from the legacy account";
after = [ "acme-dns.service" ];
wantedBy = [ "acme-ci.autonomic.zone.service" ];
before = [ "acme-ci.autonomic.zone.service" ];
serviceConfig = {
Type = "oneshot";
UMask = "0077";
};
script = "${acmeStorageSeed}/bin/cc-ci-acme-storage-seed";
};
script = ''
src=/var/lib/acme/ci.commoninternet.net
dst=/var/lib/ci-certs/live
test -s "$src/fullchain.pem"
test -s "$src/key.pem"
install -d -m 0700 "$dst"
install -m 0444 "$src/fullchain.pem" "$dst/fullchain.pem.new"
install -m 0400 "$src/key.pem" "$dst/privkey.pem.new"
mv -f "$dst/fullchain.pem.new" "$dst/fullchain.pem"
mv -f "$dst/privkey.pem.new" "$dst/privkey.pem"
# deploy-proxy performs the health-gated Swarm rollout. Its reconciler
# derives a fresh version from the public certificate chain and inserts
# the matching ssl_cert/ssl_key secrets before deploying Traefik.
systemctl restart deploy-proxy.service
# Traefik consumes its wildcard as immutable Swarm secrets, so a renewed
# host certificate must be copied and reconciled rather than merely reloaded.
# This service is started only by the production-mode ACME postRun hook.
services.cc-ci-acme-traefik-handoff = {
description = "Install renewed cc-ci wildcard into Traefik Swarm secrets";
after = [ "docker.service" "deploy-proxy.service" ];
requires = [ "docker.service" ];
path = [ pkgs.coreutils pkgs.docker pkgs.systemd pkgs.gnugrep ];
serviceConfig = {
Type = "oneshot";
UMask = "0077";
};
script = ''
src=/var/lib/acme/ci.autonomic.zone
dst=/var/lib/ci-certs/live
test -s "$src/fullchain.pem"
test -s "$src/key.pem"
install -d -m 0700 "$dst"
install -m 0444 "$src/fullchain.pem" "$dst/fullchain.pem.new"
install -m 0400 "$src/key.pem" "$dst/privkey.pem.new"
mv -f "$dst/fullchain.pem.new" "$dst/fullchain.pem"
mv -f "$dst/privkey.pem.new" "$dst/privkey.pem"
# A successful rollout no longer references old wildcard versions. Best
# effort removal retains any secret Docker still reports as in use.
keep="v$(sha256sum "$dst/fullchain.pem" | cut -c1-16)"
docker secret ls --format '{{.Name}}' | \
grep -E '^traefik_ci_commoninternet_net_ssl_(cert|key)_v' | \
grep -v -E "_(ssl_cert|ssl_key)_$keep\$" | \
while IFS= read -r stale; do docker secret rm "$stale" || true; done
'';
# deploy-proxy performs the health-gated Swarm rollout. Its reconciler
# derives a fresh version from the public certificate chain and inserts
# the matching ssl_cert/ssl_key secrets before deploying Traefik.
systemctl restart deploy-proxy.service
# A successful rollout no longer references old wildcard versions. Best
# effort removal retains any secret Docker still reports as in use.
keep="v$(sha256sum "$dst/fullchain.pem" | cut -c1-16)"
docker secret ls --format '{{.Name}}' | \
grep -E '^traefik_ci_commoninternet_net_ssl_(cert|key)_v' | \
grep -v -E "_(ssl_cert|ssl_key)_$keep\$" | \
while IFS= read -r stale; do docker secret rm "$stale" || true; done
'';
};
};
security.acme = {
acceptTerms = true;
certs."ci.commoninternet.net" = {
domain = "ci.commoninternet.net";
extraDomainNames = [ "*.ci.commoninternet.net" ];
# Staging issuance succeeded using the permanent, narrowly delegated
# CNAME. Production uses the same restricted acme-dns account.
certs."ci.autonomic.zone" = {
domain = "ci.autonomic.zone";
# Dual-zone SANs: the new zone + the legacy one. One cert = one ssl_cert/ssl_key
# secret pair = zero traefik reconciler changes. Phase 4 drops the legacy SANs.
extraDomainNames = [
"*.ci.autonomic.zone"
"ci.commoninternet.net"
"*.ci.commoninternet.net"
];
# Staging issuance proved the permanent, narrowly delegated CNAME and the
# restricted acme-dns account. Production uses the same account (re-keyed
# for the new zone by cc-ci-acme-storage-seed.service).
dnsProvider = "acmedns";
environmentFile = "/etc/acme-dns/lego.env";
dnsResolver = "1.1.1.1:53";
+3 -2
View File
@@ -33,7 +33,8 @@ let
image: cc-ci-bridge:${imageTag}
environment:
- GITEA_API=https://git.autonomic.zone/api/v1
- DRONE_URL=https://drone.ci.commoninternet.net
- DRONE_URL=https://drone.ci.autonomic.zone
- DASH_URL=https://ci.autonomic.zone
- CI_REPO=recipe-maintainers/cc-ci
- BRIDGE_LISTEN=0.0.0.0:8080
# Polling is PRIMARY (outbound, read-only, always on); the /hook webhook is an optional
@@ -57,7 +58,7 @@ let
labels:
- "traefik.enable=true"
- "traefik.http.services.ccci-bridge.loadbalancer.server.port=8080"
- "traefik.http.routers.ccci-bridge.rule=Host(`ci.commoninternet.net`) && PathPrefix(`/hook`)"
- "traefik.http.routers.ccci-bridge.rule=(Host(`ci.autonomic.zone`) || Host(`ci.commoninternet.net`)) && PathPrefix(`/hook`)"
- "traefik.http.routers.ccci-bridge.entrypoints=web-secure"
- "traefik.http.routers.ccci-bridge.tls=true"
networks:
+3 -3
View File
@@ -1,4 +1,4 @@
# Results dashboard (§4.5, D7): the YunoHost-CI-like overview at ci.commoninternet.net. Reads the
# Results dashboard (§4.5, D7): the YunoHost-CI-like overview at ci.autonomic.zone. Reads the
# Drone API (read-only) and renders latest-run-per-recipe + SVG badges. Packaged as a Nix-built OCI
# image and run as a swarm service on `proxy`, routed by traefik at Host(ci.commoninternet.net) — the
# comment-bridge's Host && PathPrefix(`/hook`) rule is longer, so /hook still wins (priority by rule
@@ -33,7 +33,7 @@ let
app:
image: cc-ci-dashboard:${imageTag}
environment:
- DRONE_URL=https://drone.ci.commoninternet.net
- DRONE_URL=https://drone.ci.autonomic.zone
- CI_REPO=recipe-maintainers/cc-ci
- DASH_LISTEN=0.0.0.0:8080
- DRONE_TOKEN_FILE=/run/secrets/drone_token
@@ -57,7 +57,7 @@ let
labels:
- "traefik.enable=true"
- "traefik.http.services.ccci-dashboard.loadbalancer.server.port=8080"
- "traefik.http.routers.ccci-dashboard.rule=Host(`ci.commoninternet.net`)"
- "traefik.http.routers.ccci-dashboard.rule=Host(`ci.autonomic.zone`) || Host(`ci.commoninternet.net`)"
- "traefik.http.routers.ccci-dashboard.entrypoints=web-secure"
- "traefik.http.routers.ccci-dashboard.tls=true"
networks:
+4 -2
View File
@@ -30,9 +30,11 @@ let
exit 0
fi
# NEVER prune mid-run: a live run-app stack means a deploy/test is in flight (mid-pull layers
# can look prunable). Run-app services: <=4char>-<6hex>_ci_commoninternet_net_* (lifecycle.py).
# can look prunable). Run-app services: <=4char>-<6hex>_<zone-stem>_* (lifecycle.py).
# Zone stem matches BOTH ci_autonomic_zone (current) and ci_commoninternet_net
# (legacy stacks from before the 2026-09 domain cutover) during the bake window.
if docker service ls --format '{{.Name}}' \
| grep -qE '^[a-z0-9]{1,4}-[0-9a-f]{6}_ci_commoninternet_net_'; then
| grep -qE '^[a-z0-9]{1,4}-[0-9a-f]{6}_ci_(autonomic_zone|commoninternet_net)_'; then
echo "docker-prune: a run-app stack is live skipping (never prune mid-run)"
exit 0
fi
+1 -1
View File
@@ -35,7 +35,7 @@ in
wantedBy = [ "multi-user.target" ];
environment = {
DRONE_RPC_PROTO = "https";
DRONE_RPC_HOST = "drone.ci.commoninternet.net";
DRONE_RPC_HOST = "drone.ci.autonomic.zone";
DRONE_RUNNER_CAPACITY = maxTests; # MAX_TESTS concurrency cap (see let-binding above)
DRONE_RUNNER_NAME = "cc-ci-exec";
# exec runner needs a writable root for build workspaces
+6 -3
View File
@@ -1,5 +1,5 @@
# Drone CI server = coop-cloud `drone` recipe via abra (swarm, traefik-routed at
# drone.ci.commoninternet.net, Gitea SSO, wildcard cert / no ACME). The exec *runner* is a
# drone.ci.autonomic.zone, Gitea SSO, wildcard cert / no ACME). The exec *runner* is a
# separate host systemd service (modules/drone-runner.nix). See DECISIONS.md "CI engine"/"Drone
# deployment shape".
#
@@ -17,7 +17,7 @@ let
name = "cc-ci-reconcile-drone";
runtimeInputs = with pkgs; [ abra docker jq gnused gnugrep coreutils git curl ];
text = ''
DRONE_DOMAIN="drone.ci.commoninternet.net"
DRONE_DOMAIN="drone.ci.autonomic.zone"
ENV_FILE="$HOME/.abra/servers/default/$DRONE_DOMAIN.env"
if [ ! -r /run/secrets/drone_rpc_secret ] || [ ! -r /run/secrets/drone_gitea_client_secret ]; then
@@ -52,7 +52,10 @@ let
set_env DRONE_ENV_VERSION "v1"
set_env COMPOSE_FILE '"compose.yml:compose.gitea.yml"'
have_secret() { docker secret ls --format '{{.Name}}' | grep -q "_$1_v1$"; }
# Stack-scoped: secret names are prefixed with the app's stack name, so during the
# 2026-09 domain rename the OLD stack's *_rpc_secret_v1 must not satisfy this check.
DRONE_STACK="drone_ci_autonomic_zone"
have_secret() { docker secret ls --format '{{.Name}}' | grep -q "^''${DRONE_STACK}_$1_v1$"; }
have_secret rpc_secret || abra app secret insert "$DRONE_DOMAIN" rpc_secret v1 /run/secrets/drone_rpc_secret -f -n
have_secret client_secret || abra app secret insert "$DRONE_DOMAIN" client_secret v1 /run/secrets/drone_gitea_client_secret -f -n
+5 -1
View File
@@ -33,6 +33,10 @@ let
proxy_ssl_server_name on;
proxy_set_header Host git.autonomic.zone;
proxy_set_header Accept "application/json";
# Pin a non-browser UA: Gitea sits behind Anubis, which 307-challenges browser-like
# UAs to an un-CORS-able counter-domain which would turn every STATUS cell into "?".
# A stable non-browser UA passes through (verified: curl 200, browser UA 307).
proxy_set_header User-Agent "ccci-reports-proxy/1.0";
proxy_pass https://git.autonomic.zone/api/v1/repos/recipe-maintainers/$1/pulls/$2;
proxy_intercept_errors off;
proxy_connect_timeout 5s;
@@ -69,7 +73,7 @@ let
labels:
- "traefik.enable=true"
- "traefik.http.services.ccci-reports.loadbalancer.server.port=80"
- "traefik.http.routers.ccci-reports.rule=Host(`report.ci.commoninternet.net`)"
- "traefik.http.routers.ccci-reports.rule=Host(`report.ci.autonomic.zone`) || Host(`report.ci.commoninternet.net`)"
- "traefik.http.routers.ccci-reports.entrypoints=web-secure"
- "traefik.http.routers.ccci-reports.tls=true"
networks:
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://opencode.ai/config.json",
"agent": {
"general": {
"model": "opencode/deepseek-v4-flash"
"model": "opencode-go/deepseek-v4-flash"
}
}
}
+4 -1
View File
@@ -117,7 +117,10 @@ def assert_serving(domain: str, meta) -> None:
# app is routed (Traefik serves the wildcard zone-wide). The serving proof is steps 12 above.
verified, detail = served_cert(domain)
assert verified, f"{domain}: served wildcard cert is not trusted/valid — {detail}"
assert "commoninternet.net" in detail.lower(), f"{domain}: served cert unexpected — {detail}"
# Dual-zone cert (2026-09 cutover): the SAN list covers both *.ci zones; a run
# domain in either zone must be covered by the one serving wildcard.
zone = "autonomic.zone" if domain.endswith(".autonomic.zone") else "commoninternet.net"
assert zone in detail.lower(), f"{domain}: served cert unexpected — {detail}"
# ---- Op/assertion split (Phase 1e HC3) -------------------------------------------------------
+2 -2
View File
@@ -25,7 +25,7 @@ from . import meta as meta_mod
GATEWAY_IP = "143.244.213.108" # *.ci.commoninternet.net -> gateway (TLS passthrough to cc-ci)
# A run app domain is "<recipe[:4]>-<6hex>.ci.commoninternet.net" (see DECISIONS.md). Used by the
# janitor to recognise orphaned run apps (infra apps like traefik/drone/backups don't match).
RUN_APP_RE = re.compile(r"^[a-z0-9]{1,4}-[0-9a-f]{6}\.ci\.commoninternet\.net$")
RUN_APP_RE = re.compile(r"^[a-z0-9]{1,4}-[0-9a-f]{6}\.ci\.(?:autonomic\.zone|commoninternet\.net)$")
class TeardownError(RuntimeError):
@@ -1190,7 +1190,7 @@ def janitor() -> None:
# also catch stacks whose .env was already deleted (abra ls won't list them)
for svc in _docker_names("service", ""):
# svc like cust-c95a69_ci_commoninternet_net_app -> reconstruct domain
m = re.match(r"^([a-z0-9]{1,4}-[0-9a-f]{6})_ci_commoninternet_net_", svc)
m = re.match(r"^([a-z0-9]{1,4}-[0-9a-f]{6})_ci_(?:autonomic_zone|commoninternet_net)_", svc)
if m:
seen.add(f"{m.group(1)}.ci.commoninternet.net")
+4 -2
View File
@@ -1,7 +1,9 @@
"""Shared run-app domain naming (used by the conftest fixtures and the orchestrator).
Domain = "<recipe[:4]>-<6hex(recipe|pr|ref)>.ci.commoninternet.net" — short enough for Docker's
Domain = "<recipe[:4]>-<6hex(recipe|pr|ref)>.ci.autonomic.zone" — short enough for Docker's
64-char swarm config/secret name limit, unique per run, collision-safe across recipes (DECISIONS.md).
(Migrated from *.ci.commoninternet.net 2026-09; the legacy zone remains valid until the bake
window ends — lifecycle/warm name matching accepts both.)
"""
from __future__ import annotations
@@ -18,4 +20,4 @@ def app_domain(recipe: str, pr: str = "0", ref: str | None = None) -> str:
ref = ref or ("local" + str(int(time.time())))
tag = _short(recipe, 4).lower()
h = hashlib.sha1(f"{recipe}|{pr}|{ref}".encode()).hexdigest()[:6]
return f"{tag}-{h}.ci.commoninternet.net"
return f"{tag}-{h}.ci.autonomic.zone"
+5 -1
View File
@@ -25,6 +25,9 @@ import urllib.request
# Recipes that, when declared as a dep, are served from a shared live-warm instance at a stable
# domain instead of being co-deployed per run. Maps dep-recipe -> stable domain.
WARM_DOMAINS = {
# Warm stacks stay on the legacy zone through the 2026-09 domain cutover (data-warm
# volumes + stack names are tied to the abra app name; renaming re-seeds the CI bases).
# They move to *.ci.autonomic.zone in a post-bake phase together with their stacks.
"keycloak": "warm-keycloak.ci.commoninternet.net",
}
@@ -38,11 +41,12 @@ _CTX.check_hostname = False
_CTX.verify_mode = ssl.CERT_NONE
# A cold per-run stack name looks like "<tag>-<6hex>_ci_commoninternet_net_<svc>"; extract the hex.
_STACK_HEX_RE = re.compile(r"^[a-z0-9]{1,4}-([0-9a-f]{6})_ci_commoninternet_net_")
_STACK_HEX_RE = re.compile(r"^[a-z0-9]{1,4}-([0-9a-f]{6})_ci_(?:autonomic_zone|commoninternet_net)_")
def stable_domain(recipe: str) -> str:
"""The stable warm domain for a recipe: `warm-<recipe>.ci.commoninternet.net` — the canonical
base's hostname (legacy zone until the post-bake warm-stack migration; see WARM_DOMAINS note).
scheme for BOTH the live-warm keycloak and the data-warm canonicals (WC2), distinct from cold
per-run `<recipe[:4]>-<6hex>`. (WARM_DOMAINS['keycloak'] equals stable_domain('keycloak').)"""
return f"warm-{recipe}.ci.commoninternet.net"
+2 -2
View File
@@ -13,10 +13,10 @@ set -euo pipefail
: "${GITEA_USERNAME:?set GITEA_USERNAME}"
: "${GITEA_PASSWORD:?set GITEA_PASSWORD}"
GITEA="${GITEA:-https://git.autonomic.zone}"
DRONE="${DRONE:-https://drone.ci.commoninternet.net}"
DRONE="${DRONE:-https://drone.ci.autonomic.zone}"
CLIENT_ID="${CLIENT_ID:-ab4cdb9d-ee96-4867-875f-87384505fc52}"
REPO="${REPO:-recipe-maintainers/cc-ci}"
RES=(--resolve "drone.ci.commoninternet.net:443:127.0.0.1")
RES=(--resolve "drone.ci.autonomic.zone:443:127.0.0.1")
export PATH=/run/current-system/sw/bin:"$PATH"
cj=$(mktemp)
+1 -1
View File
@@ -15,7 +15,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "..", "runner")
from harness import lifecycle # noqa: E402
HELPERS = os.path.join(os.path.dirname(__file__), "helpers.py")
DOMAIN = "test-abc123.ci.commoninternet.net" # matches RUN_APP_RE
DOMAIN = "test-abc123.ci.autonomic.zone" # matches RUN_APP_RE
class HelperPool:
+2 -1
View File
@@ -72,7 +72,8 @@ def UPGRADE_SECRET_PREP(ctx):
import subprocess
# abra derives STACK_NAME from the domain by replacing dots with underscores
# (e.g. gite-e1cb78.ci.commoninternet.net → gite-e1cb78_ci_commoninternet_net).
# (e.g. gite-e1cb78.ci.autonomic.zone → gite-e1cb78_ci_autonomic_zone; legacy
# *.ci.commoninternet.net run stacks are matched too during the bake window).
stack_name = ctx.domain.replace(".", "_")
docker_secret = f"{stack_name}_lfs_jwt_secret_v1"
value = base64.urlsafe_b64encode(_os.urandom(32)).rstrip(b"=").decode()