Fetch private dredd-core from the Haski Gitea, not GitHub
The Dockerfiles still rewrote credentials for github.com only, so the build token never reached Gitea and installs worked only while dredd-core was public. Rewrite http://77.216.148.202:3000/ instead, give every workflow that pip-installs the same rewrite (org secret DREDD_CORE_TOKEN, the read-only haski-reader token), and drop the GitHub PAT leftovers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,15 @@ on:
|
||||
pull_request:
|
||||
workflow_dispatch: # manual run: Actions -> CI -> Run workflow
|
||||
|
||||
# dredd-core is private on the Haski Gitea, and so is every repository this workflow may fetch.
|
||||
# All git traffic to the Gitea host (pip installing dredd-core from requirements, above all) goes
|
||||
# through the read-only bot haski-reader: its token is the Haski org secret DREDD_CORE_TOKEN,
|
||||
# which Gitea masks in logs. Docker builds get the same token as a BuildKit secret instead.
|
||||
env:
|
||||
GIT_CONFIG_COUNT: "1"
|
||||
GIT_CONFIG_KEY_0: url.http://x-access-token:${{ secrets.DREDD_CORE_TOKEN }}@77.216.148.202:3000/.insteadOf
|
||||
GIT_CONFIG_VALUE_0: http://77.216.148.202:3000/
|
||||
|
||||
jobs:
|
||||
backend:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -61,15 +70,15 @@ jobs:
|
||||
# genuinely copied) and `test_galena_contract.py` (every path Sygna calls must exist in
|
||||
# Galena's router table — the check that would have caught `/files/` vs `/projects/`).
|
||||
# Both skip cleanly without it, so a fork or a contributor without access still gets a
|
||||
# green build; they simply get a smaller one. Needs GALENA_REPO_TOKEN, a fine-grained
|
||||
# read-only PAT for Alpaq92/Galena — secrets are per-repository and DREDD_CORE_TOKEN does
|
||||
# not reach it.
|
||||
# green build; they simply get a smaller one. Needs GALENA_REPO_TOKEN (Haski org secret,
|
||||
# haski-reader's read-only token): Galena is private and the job token only reaches Sygna.
|
||||
- name: Check out Galena (for the cross-application checks)
|
||||
if: env.HAS_GALENA == 'true'
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
repository: Haski/Galena
|
||||
path: .galena
|
||||
token: ${{ secrets.GALENA_REPO_TOKEN }}
|
||||
- name: Install deps
|
||||
working-directory: backend
|
||||
run: pip install -r requirements-dev.txt
|
||||
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
# ── build stage: resolve dependencies, including the private one ─────────────
|
||||
# `dredd-core` is a private GitHub repository pinned by tag in requirements.txt, so installing it
|
||||
# `dredd-core` is a private repository on the Haski Gitea pinned by tag in requirements.txt, so installing it
|
||||
# needs two things the runtime image should never have: `git`, and a credential.
|
||||
#
|
||||
# The credential arrives as a BuildKit SECRET, not a build argument. A build arg is baked into the
|
||||
@@ -21,8 +21,8 @@ WORKDIR /build
|
||||
COPY requirements.txt .
|
||||
RUN --mount=type=secret,id=dredd_core_token,required=true \
|
||||
GIT_CONFIG_COUNT=1 \
|
||||
GIT_CONFIG_KEY_0="url.https://x-access-token:$(cat /run/secrets/dredd_core_token)@github.com/.insteadOf" \
|
||||
GIT_CONFIG_VALUE_0="https://github.com/" \
|
||||
GIT_CONFIG_KEY_0="url.http://x-access-token:$(cat /run/secrets/dredd_core_token)@77.216.148.202:3000/.insteadOf" \
|
||||
GIT_CONFIG_VALUE_0="http://77.216.148.202:3000/" \
|
||||
pip install --no-cache-dir --prefix=/install -r requirements.txt
|
||||
|
||||
# ── runtime stage: no git, no credential, no compiler ────────────────────────
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Sygna on a managed PostgreSQL database (the family's shared one, or any Postgres 16/17 reached
|
||||
# over a network): an override for docker-compose.yml.
|
||||
#
|
||||
# DREDD_CORE_TOKEN=github_pat_... \
|
||||
# DREDD_CORE_TOKEN=<read-only Gitea token> \
|
||||
# docker compose -f docker-compose.yml -f docker-compose.managed-db.yml up -d --build
|
||||
#
|
||||
# The database lives elsewhere, so the local postgres service is switched off and nothing waits
|
||||
|
||||
+2
-2
@@ -18,10 +18,10 @@
|
||||
# On the platform the modules publish nothing and Atrium's front door keeps :80.
|
||||
#
|
||||
# BUILDING NEEDS A CREDENTIAL. dredd-core is a private repository, so the image build clones it
|
||||
# with DREDD_CORE_TOKEN (a fine-grained, read-only GitHub PAT) supplied as a BuildKit secret —
|
||||
# with DREDD_CORE_TOKEN (a read-only Gitea access token) supplied as a BuildKit secret —
|
||||
# never a build arg, which would be readable in `docker history` of any pushed image:
|
||||
#
|
||||
# DREDD_CORE_TOKEN=github_pat_... docker compose up -d --build
|
||||
# DREDD_CORE_TOKEN=<read-only Gitea token> docker compose up -d --build
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16
|
||||
|
||||
Reference in New Issue
Block a user