fix(review): point new gitea helpers at jc-capital owner (post-org-migration)
P0 from v1.1 multi-persona code review (Pass 1, correctness sweep).
The three v1.1-introduced shell helpers (backup.sh, restore.sh,
rotate_secrets.sh) hardcoded the old cto-inboxos owner in the clone URL,
push URL, and default REPO_OWNER. With the org migration to jc-capital
landed at a068c8a, those hardcodes would fail at first invocation:
- scripts/backup.sh:151 clone URL
- scripts/restore.sh:145 push --mirror URL
- scripts/rotate_secrets.sh:32-33 default REPO_OWNER
- scripts/rotate_secrets.sh:101,131 string-literal fallback
The runbook §6.2 service-account line (562) also referenced the old
owner; the runbook lines that are CPO-managed were left alone.
---ci---
project: inboxos
phase: 1
milestone: v1.1
status: review
---/ci---
This commit is contained in:
@@ -559,7 +559,7 @@ contract and the helper's exit-code table in its header comment.
|
||||
|
||||
- `.gitignore` excludes `.env` and `.env.*` except `.env.example`. The example file contains placeholder values only.
|
||||
- The CTO host deliberately does **not** have write-capable S3 credentials (only the read-only S3 keys used for verification). A leaked CTO host key cannot corrupt the `.eml` archive.
|
||||
- The Gitea service account used for the REST API (`GITEA_USER=cto` in `.env.example`) is scoped to the `cto-inboxos/inboxos` repo. It can read/write workflow secrets, but it cannot create new repos or admin the Gitea instance.
|
||||
- The Gitea service account used for the REST API (`GITEA_USER=cto` in `.env.example`) is scoped to the `jc-capital/inboxos` repo. It can read/write workflow secrets, but it cannot create new repos or admin the Gitea instance.
|
||||
- All secret reads happen via `${{ secrets.X }}` in the workflow YAMLs; the values are injected as environment variables into the ephemeral runner container and never appear in the build log.
|
||||
|
||||
### 6.3 Data-sovereignty posture
|
||||
|
||||
+3
-3
@@ -17,7 +17,7 @@
|
||||
# a different host. Requires SEAWEEDFS_S3_BACKUP_BUCKET
|
||||
# and SEAWEEDFS_S3_BACKUP_ENDPOINT env vars to be
|
||||
# set; exits 4 with a clear message if either is unset.
|
||||
# gitea -> writes a `git bundle` of the cto-inboxos/inboxos
|
||||
# gitea -> writes a `git bundle` of the jc-capital/inboxos
|
||||
# repo to backups/gitea/<ts>/inboxos.bundle.
|
||||
#
|
||||
# The script prints a one-line summary on success:
|
||||
@@ -137,7 +137,7 @@ if [[ "${SERVICE}" == "gitea" ]]; then
|
||||
exit 2
|
||||
fi
|
||||
mkdir -p "${BACKUP_ROOT}"
|
||||
# `git bundle` of the cto-inboxos/inboxos repo. The bundle is a
|
||||
# `git bundle` of the jc-capital/inboxos repo. The bundle is a
|
||||
# single file that captures the full history; restore.sh clones
|
||||
# the bundle to a temp dir and pushes via the Gitea REST API.
|
||||
BUNDLE_PATH="${BACKUP_ROOT}/inboxos.bundle"
|
||||
@@ -148,7 +148,7 @@ if [[ "${SERVICE}" == "gitea" ]]; then
|
||||
git -c credential.helper= \
|
||||
-c credential.username="${GITEA_USER}" \
|
||||
-c credential.password="${GITEA_PASS}" \
|
||||
clone "${GITEA_INSTANCE_URL%/}/cto-inboxos/inboxos.git" "${TMP_DIR}/inboxos" 2>&1 \
|
||||
clone "${GITEA_INSTANCE_URL%/}/jc-capital/inboxos.git" "${TMP_DIR}/inboxos" 2>&1 \
|
||||
|| { echo "Gitea clone failed" >&2; rm -rf "${TMP_DIR}"; exit 3; }
|
||||
(cd "${TMP_DIR}/inboxos" && git bundle create "${BUNDLE_PATH}" --all)
|
||||
rm -rf "${TMP_DIR}"
|
||||
|
||||
+1
-1
@@ -142,7 +142,7 @@ if [[ "${SERVICE}" == "gitea" ]]; then
|
||||
git -c credential.helper= \
|
||||
-c credential.username="${GITEA_USER}" \
|
||||
-c credential.password="${GITEA_PASS}" \
|
||||
push --force --mirror "${GITEA_INSTANCE_URL%/}/cto-inboxos/inboxos.git" 2>&1) \
|
||||
push --force --mirror "${GITEA_INSTANCE_URL%/}/jc-capital/inboxos.git" 2>&1) \
|
||||
|| { echo "Gitea push failed" >&2; rm -rf "${TMP_DIR}"; exit 3; }
|
||||
rm -rf "${TMP_DIR}"
|
||||
echo "restored backup_id=${BACKUP_ID} service=gitea verified=by-mirror-push"
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
# GITEA_INSTANCE_URL e.g. http://gitea:3000 or https://git.cloudinit.dev
|
||||
# GITEA_USER HTTP Basic Auth user (the cto service account)
|
||||
# GITEA_PASS HTTP Basic Auth password
|
||||
# REPO_OWNER cto-inboxos (default)
|
||||
# REPO_OWNER jc-capital (default)
|
||||
# REPO_NAME inboxos (default)
|
||||
#
|
||||
# Exit codes:
|
||||
@@ -29,7 +29,7 @@
|
||||
# 4 helper internal error (e.g. requests module import failure)
|
||||
set -euo pipefail
|
||||
|
||||
REPO_OWNER="${REPO_OWNER:-cto-inboxos}"
|
||||
REPO_OWNER="${REPO_OWNER:-jc-capital}"
|
||||
REPO_NAME="${REPO_NAME:-inboxos}"
|
||||
|
||||
MODE="dry-run"
|
||||
@@ -98,7 +98,7 @@ cfg = GiteaConfig.from_env()
|
||||
secret_name, new_value = sys.argv[1], sys.argv[2]
|
||||
body = {"name": secret_name, "data": new_value, "kind": "secret"}
|
||||
resp = gitea_request(cfg, "PUT",
|
||||
f"/api/v1/repos/{os.environ.get('REPO_OWNER', 'cto-inboxos')}/"
|
||||
f"/api/v1/repos/{os.environ.get('REPO_OWNER', 'jc-capital')}/"
|
||||
f"{os.environ.get('REPO_NAME', 'inboxos')}/actions/secrets/"
|
||||
f"{secret_name}",
|
||||
json_body=body)
|
||||
@@ -128,7 +128,7 @@ except Exception as exc:
|
||||
cfg = GiteaConfig.from_env()
|
||||
secret_name = sys.argv[1]
|
||||
resp = gitea_request(cfg, "GET",
|
||||
f"/api/v1/repos/{os.environ.get('REPO_OWNER', 'cto-inboxos')}/"
|
||||
f"/api/v1/repos/{os.environ.get('REPO_OWNER', 'jc-capital')}/"
|
||||
f"{os.environ.get('REPO_NAME', 'inboxos')}/actions/secrets/"
|
||||
f"{secret_name}")
|
||||
if not resp.ok:
|
||||
|
||||
Reference in New Issue
Block a user