homek8s/apps/base/sirius-growth/deployment-api.yaml
Sirius DevOps bc942e2571 registry(auth): require auth for image pulls (audit F11)
Forgejo 16 mints an anonymous ("ghost user") registry token on /v2/token and
grants it Read on every package regardless of repo visibility, so all 18 app
images were world-downloadable — including images of private repos
(siriusdevops-site, phs-site, sirius-growth-*, sgs-leadgen).

* FORGEJO__service__REQUIRE_SIGNIN_VIEW=true: /v2/token answers UNAUTHORIZED
  to anonymous clients, anonymous manifests get 401. This is the documented
  switch in routers/api/packages/container (Authenticate) and
  services/context/package.go (determineAccessMode). Side effect: the Forgejo
  web UI/API becomes login-only for anonymous visitors.
* imagePullSecrets: [forgejo-pull] on all 18 workloads that pull from the
  registry (osint, piedmont, sirius-growth, siriusdevops). The
  kubernetes.io/dockerconfigjson Secret is per-namespace and out of band
  (never in git); docs/registry-pull-auth.md documents why, how to recreate
  it, and the verification commands. No containerd-level credential.
2026-11-27 00:15:20 -05:00

56 lines
1.6 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: sirius-growth-contact
namespace: sirius-growth
spec:
replicas: 1
selector:
matchLabels:
app: sirius-growth-contact
template:
metadata:
labels:
app: sirius-growth-contact
spec:
imagePullSecrets:
- name: forgejo-pull
tolerations:
- key: dedicated
operator: Exists
effect: PreferNoSchedule
nodeSelector:
kubernetes.io/hostname: siriussec
containers:
- name: contact-api
# Built and pushed by sirius-growth/.forgejo/workflows/deploy-contact.yml
# as :$sha (see docs/site-image-pinning.md).
image: forgejo.siriusdevops.com/sirius/sirius-growth-contact:c9c9379ebceca6879d3bbeff1c2601b6484e87b0
imagePullPolicy: IfNotPresent
command: ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8090"]
ports:
- containerPort: 8090
name: http
env:
- name: TG_TOKEN
valueFrom:
secretKeyRef:
name: sirius-growth-contact
key: TG_TOKEN
- name: TG_CHAT
valueFrom:
secretKeyRef:
name: sirius-growth-contact
key: TG_CHAT
readinessProbe:
httpGet:
path: /health
port: 8090
initialDelaySeconds: 5
periodSeconds: 10
resources:
requests:
cpu: 50m
memory: 128Mi
limits:
memory: 256Mi