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:
@@ -1,16 +0,0 @@
|
||||
version: 2
|
||||
updates:
|
||||
# Backend Python dependencies (backend/requirements.txt)
|
||||
- package-ecosystem: "pip"
|
||||
directory: "/backend"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
open-pull-requests-limit: 5
|
||||
labels: ["dependencies"]
|
||||
|
||||
# GitHub Actions workflow pins
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
labels: ["dependencies"]
|
||||
@@ -5,6 +5,15 @@ on:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
|
||||
# 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:
|
||||
test:
|
||||
name: Tests (Postgres ${{ matrix.postgres }})
|
||||
|
||||
+3
-3
@@ -6,7 +6,7 @@
|
||||
# docker buildx imagetools inspect python:3.12-slim
|
||||
|
||||
# ── 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` (python:3.12-slim ships none) and a
|
||||
# credential.
|
||||
#
|
||||
@@ -39,8 +39,8 @@ RUN --mount=type=secret,id=dredd_core_token,required=true \
|
||||
test -s /run/secrets/dredd_core_token \
|
||||
|| { echo "build secret dredd_core_token is empty - export DREDD_CORE_TOKEN" >&2; exit 1; }; \
|
||||
GIT_CONFIG_COUNT=1 \
|
||||
GIT_CONFIG_KEY_0="url.https://x-access-token:$(tr -d '\r\n' < /run/secrets/dredd_core_token)@github.com/.insteadOf" \
|
||||
GIT_CONFIG_VALUE_0="https://github.com/" \
|
||||
GIT_CONFIG_KEY_0="url.http://x-access-token:$(tr -d '\r\n' < /run/secrets/dredd_core_token)@77.216.148.202:3000/.insteadOf" \
|
||||
GIT_CONFIG_VALUE_0="http://77.216.148.202:3000/" \
|
||||
pip install --prefix=/install -r requirements.txt
|
||||
|
||||
# ── runtime stage: no git, no credential ─────────────────────────────────────
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Counsel Scorecard 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 (one database for Atrium, Galena, Sygna and Counsel Scorecard; Counsel
|
||||
|
||||
+2
-2
@@ -13,7 +13,7 @@
|
||||
# On the platform the modules publish nothing and Atrium's front door keeps :80.
|
||||
#
|
||||
# cp .env.example .env # then edit the change_me_* values
|
||||
# DREDD_CORE_TOKEN=github_pat_... docker compose up -d --build
|
||||
# DREDD_CORE_TOKEN=<read-only Gitea token> docker compose up -d --build
|
||||
#
|
||||
# The token (read access to the private dredd-core repository) is a BuildKit build secret: keep it in
|
||||
# the shell, never in .env (see `secrets:` at the end of this file).
|
||||
@@ -108,6 +108,6 @@ secrets:
|
||||
# Used only by the build stage's one `pip install` (backend/Dockerfile); no running container gets it.
|
||||
# Compose resolves the variable from the shell OR the project .env (shell wins). Keep it in the shell,
|
||||
# because migrate and backend load .env at runtime and would receive the token:
|
||||
# DREDD_CORE_TOKEN=github_pat_... docker compose up -d --build
|
||||
# DREDD_CORE_TOKEN=<read-only Gitea token> docker compose up -d --build
|
||||
dredd_core_token:
|
||||
environment: DREDD_CORE_TOKEN
|
||||
|
||||
Reference in New Issue
Block a user