2026-09-11 00:08:31 -04:00
|
|
|
apiVersion: apps/v1
|
|
|
|
|
kind: Deployment
|
|
|
|
|
metadata:
|
|
|
|
|
name: forgejo
|
|
|
|
|
namespace: forgejo
|
|
|
|
|
spec:
|
2026-09-14 23:46:40 -04:00
|
|
|
strategy:
|
|
|
|
|
type: Recreate
|
2026-09-11 00:08:31 -04:00
|
|
|
replicas: 1
|
|
|
|
|
selector:
|
|
|
|
|
matchLabels:
|
|
|
|
|
app: forgejo
|
|
|
|
|
template:
|
|
|
|
|
metadata:
|
|
|
|
|
labels:
|
|
|
|
|
app: forgejo
|
|
|
|
|
spec:
|
|
|
|
|
nodeSelector:
|
|
|
|
|
kubernetes.io/hostname: siriussec
|
|
|
|
|
containers:
|
|
|
|
|
- name: forgejo
|
2026-09-14 23:46:40 -04:00
|
|
|
image: codeberg.org/forgejo/forgejo:16
|
2026-09-11 00:08:31 -04:00
|
|
|
imagePullPolicy: IfNotPresent
|
|
|
|
|
ports:
|
|
|
|
|
- containerPort: 3000
|
|
|
|
|
name: http
|
|
|
|
|
env:
|
|
|
|
|
- name: FORGEJO__database__DB_TYPE
|
|
|
|
|
value: postgres
|
|
|
|
|
- name: FORGEJO__database__HOST
|
|
|
|
|
value: pg-rw:5432
|
|
|
|
|
- name: FORGEJO__database__NAME
|
|
|
|
|
value: forgejo
|
|
|
|
|
- name: FORGEJO__database__USER
|
|
|
|
|
valueFrom:
|
|
|
|
|
secretKeyRef:
|
|
|
|
|
name: forgejo-pg-app
|
|
|
|
|
key: username
|
|
|
|
|
- name: FORGEJO__database__PASSWD
|
|
|
|
|
valueFrom:
|
|
|
|
|
secretKeyRef:
|
|
|
|
|
name: forgejo-pg-app
|
|
|
|
|
key: password
|
|
|
|
|
- name: FORGEJO__server__ROOT_URL
|
|
|
|
|
value: https://forgejo.siriusdevops.com/
|
|
|
|
|
- name: FORGEJO__server__DOMAIN
|
|
|
|
|
value: forgejo.siriusdevops.com
|
|
|
|
|
- name: FORGEJO__server__SSH_DOMAIN
|
|
|
|
|
value: forgejo.siriusdevops.com
|
|
|
|
|
- name: FORGEJO__server__SSH_PORT
|
|
|
|
|
value: "222"
|
|
|
|
|
- name: FORGEJO__server__PROTOCOL
|
|
|
|
|
value: http
|
|
|
|
|
- name: FORGEJO__security__INSTALL_LOCK
|
|
|
|
|
value: "true"
|
|
|
|
|
- name: FORGEJO__packages__ENABLED
|
|
|
|
|
value: "true"
|
2026-11-20 18:46:17 -05:00
|
|
|
# Bot signup lockdown: admin-only account creation (web + API).
|
|
|
|
|
- name: FORGEJO__service__DISABLE_REGISTRATION
|
|
|
|
|
value: "true"
|
2026-12-01 22:27:43 -05:00
|
|
|
# Public-repo browsing is ON. Audit F11 had turned this on because
|
|
|
|
|
# Forgejo issues anonymous ("ghost user") registry tokens at
|
|
|
|
|
# /v2/token with Read on every package, so with public browsing
|
|
|
|
|
# every app image was world-pullable. That coupling is now cut at
|
|
|
|
|
# the edge instead: a Cloudflare zone custom rule ("Block anonymous
|
|
|
|
|
# Forgejo registry tokens") blocks /v2/token unless the request
|
|
|
|
|
# carries Basic auth, so anonymous pulls get 403 while containerd
|
|
|
|
|
# (which sends its `forgejo-pull` dockerconfigjson credentials)
|
|
|
|
|
# still pulls. Re-check that rule before turning this back to true.
|
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
|
|
|
- name: FORGEJO__service__REQUIRE_SIGNIN_VIEW
|
2026-12-01 22:27:43 -05:00
|
|
|
value: "false"
|
2026-09-11 00:08:31 -04:00
|
|
|
volumeMounts:
|
|
|
|
|
- name: data
|
|
|
|
|
mountPath: /data
|
2026-11-23 22:50:52 -05:00
|
|
|
# Custom site-root assets (robots.txt). GITEA_CUSTOM=/data/gitea,
|
|
|
|
|
# so Forgejo serves /data/gitea/public/robots.txt at /robots.txt.
|
|
|
|
|
- name: custom-public
|
|
|
|
|
mountPath: /data/gitea/public
|
|
|
|
|
readOnly: true
|
2026-09-11 00:08:31 -04:00
|
|
|
readinessProbe:
|
|
|
|
|
httpGet:
|
|
|
|
|
path: /
|
|
|
|
|
port: 3000
|
|
|
|
|
initialDelaySeconds: 20
|
|
|
|
|
periodSeconds: 10
|
|
|
|
|
resources:
|
|
|
|
|
requests:
|
|
|
|
|
cpu: 100m
|
|
|
|
|
memory: 256Mi
|
|
|
|
|
limits:
|
|
|
|
|
memory: 2Gi
|
|
|
|
|
volumes:
|
|
|
|
|
- name: data
|
|
|
|
|
persistentVolumeClaim:
|
|
|
|
|
claimName: forgejo-data
|
2026-11-23 22:50:52 -05:00
|
|
|
- name: custom-public
|
|
|
|
|
configMap:
|
|
|
|
|
name: forgejo-custom-public
|