Public: anyone can read this; nobody can change it.
sweep the escaped domain spelling; seed-release in-cluster API (#258, #263) #264
Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.
immune-fixes → main 1 commit
2 files
changed +30
−5
.forgejo/workflows/seed-release.yml +8 −2
| @@ -12,8 +12,14 @@ | ||
| 12 | 12 | # published at build time (publish_seed) never do. |
| 13 | 13 | # |
| 14 | 14 | # Needs the same PLAT_PAT repo secret reseed.yml uses. |
| 15 | # | |
| 16 | # The isolated pool's egress reaches in-cluster services ONLY — every API call | |
| 17 | # goes through $REGISTRY; the public $FORGEJO_URL is for printed links, never | |
| 18 | # for calling (issue #263: every firing failed while the API base was public). | |
| 19 | # workflow_dispatch re-fires for the CURRENT genesis — idempotent (409 = done). | |
| 15 | 20 | name: seed-release |
| 16 | 21 | on: |
| 22 | workflow_dispatch: | |
| 17 | 23 | push: |
| 18 | 24 | branches: [main] |
| 19 | 25 | paths: |
| @@ -54,7 +60,7 @@ jobs: | ||
| 54 | 60 | - name: create release + attach seed |
| 55 | 61 | run: | |
| 56 | 62 | set -eu |
| 57 | API="$FORGEJO_URL/api/v1" | |
| 63 | API="http://$REGISTRY/api/v1" # in-cluster — the pool cannot reach the public host | |
| 58 | 64 | AUTH="Authorization: token $PLAT_PAT" |
| 59 | 65 | PROFILE=$(sed -n 's/^profile:[[:space:]]*//p' manifest.yaml | head -1) |
| 60 | 66 | BODY=$(printf 'Gate-validated genesis seed (profile %s).\n\nManifest refs:\n```\n%s\n```\nPackage: %s/%s/-/packages\nFetch: SEED=latest bin/germinate (resolve_seed)' \ |
| @@ -85,7 +91,7 @@ jobs: | ||
| 85 | 91 | OWNER="${GITHUB_REPOSITORY%%/*}"; REPO_NAME="${GITHUB_REPOSITORY##*/}" |
| 86 | 92 | code=$(curl -s -o /tmp/link.out -w '%{http_code}' -X POST \ |
| 87 | 93 | -H "Authorization: token $PLAT_PAT" \ |
| 88 | "$FORGEJO_URL/api/v1/packages/$OWNER/generic/seed/-/link/$REPO_NAME") | |
| 94 | "http://$REGISTRY/api/v1/packages/$OWNER/generic/seed/-/link/$REPO_NAME") | |
| 89 | 95 | case "$code" in |
| 90 | 96 | 201|204) echo "package $OWNER/seed linked to $GITHUB_REPOSITORY" ;; |
| 91 | 97 | 409) echo "package already linked" ;; |
bin/lib.sh +22 −3
| @@ -152,12 +152,31 @@ rewrite_identity_domain() { # $1=gitops $2=seed/old domain $3=new domain [$4=fl | ||
| 152 | 152 | sedx=(-e "s/\*\.//g" -e "s/\.//g" \ |
| 153 | 153 | -e "s///g" -e "s///g" -e "s//*./g") |
| 154 | 154 | else |
| 155 | # The domain has a SECOND cleartext spelling: regex-escaped, dots as `\.` | |
| 156 | # (render_front_door's apex redirectRegex). The plain sweep cannot see it — | |
| 157 | # sed's `\.` matches a real dot, and the escaped text has a backslash there | |
| 158 | # instead — so gauntlet run 880: rehome moved the Host() rules but left the | |
| 159 | # old domain inside the redirect regex; it never matched, the apex fell | |
| 160 | # through to www as 200 and A12 failed. An identity's escaped spelling IS | |
| 161 | # the identity: rewrite it FIRST (its output contains no plain-spelling | |
| 162 | # $old, so the two passes cannot double), with the same shield for values | |
| 163 | # already escaped-correct. $pat's literal characters ARE the escaped | |
| 164 | # spelling; epat/enewpat match that text as regex, erep emits it through | |
| 165 | # sed's replacement unescaping. (The flat sweep skips this: front-door is | |
| 166 | # the only escaped-identity artifact and flat germination re-renders it.) | |
| 167 | local epat enewpat erep ekeep='__MITOSIS_KEEP_ESCAPED_DOMAIN__' | |
| 168 | epat= | |
| 169 | enewpat= | |
| 170 | erep= | |
| 155 | 171 | case "" in |
| 156 | *""*) sedx=(-e "s///g" -e "s///g" -e "s///g") ;; | |
| 157 | *) sedx=(-e "s///g") ;; | |
| 172 | *""*) sedx=(-e "s///g" -e "s///g" -e "s///g" | |
| 173 | -e "s///g" -e "s///g" -e "s///g") ;; | |
| 174 | *) sedx=(-e "s///g" -e "s///g") ;; | |
| 158 | 175 | esac |
| 159 | 176 | fi |
| 160 | grep -rIl --include='*.yaml' "" "/clusters/local" 2>/dev/null | while read -r f; do | |
| 177 | # -F: fixed strings — select files carrying EITHER spelling ($pat's literal | |
| 178 | # text is the escaped one). Plain-BRE "$old" would miss escaped-only files. | |
| 179 | grep -rIlF --include='*.yaml' -e "" -e "" "/clusters/local" 2>/dev/null | while read -r f; do | |
| 161 | 180 | sed -i.bak "" "" && rm -f ".bak" |
| 162 | 181 | done |
| 163 | 182 | # Verify the surgical invariant held: the CA tokens must SURVIVE intact. If they |
new above
offline