gogs
by QuenchWorks
Gogs, the painless self-hosted Git service: repositories, issues, pull requests, wikis and webhooks over HTTP and a built-in SSH server, on SQLite, PostgreSQL or MySQL. Hardened by QuenchWorks, nonroot, CVE-gated, cosign-signed and pinned by digest.
About this chart
Gogs
Gogs is a painless self-hosted Git service: repositories, issues, pull requests, wikis and webhooks, over HTTP and its own built-in SSH server. This chart runs it on the QuenchWorks gogs image. The image is nonroot, 0 fixable CVEs, cosign-signed and pinned by digest.
Install
helm install gogs oci://ghcr.io/quenchworks/charts/gogs \
--set externalURL=https://git.example.com/ --set sshDomain=git.example.com
kubectl get secret gogs -o jsonpath='{.data.admin-password}' | base64 -d
kubectl port-forward svc/gogs 3000:3000
The chart locks the install page. It renders app.ini into a ConfigMap, generates a
secret key (kept across upgrades), and creates the admin from admin once the database
is ready. Self-registration is off (registration.enabled).
Database
SQLite on the data volume by default. For PostgreSQL or MySQL set database.type,
database.host (host:port), database.name, database.user and
database.existingSecret with the password. Secrets reach app.ini as environment
variables, which Gogs expands in every value, so a literal $ in extraConfig must be
written $$.
SSH
The built-in SSH server listens on 2222 in the pod and on ssh.port (22) on the Service.
Clone URLs show git@<sshDomain>. Expose the Service's ssh port (a LoadBalancer or a
TCP route) to reach it from outside.
Values
| Key | Default | Meaning |
|---|---|---|
externalURL | http://gogs.local/ | public URL for links and clone URLs |
sshDomain | gogs.local | host in SSH clone URLs |
tls.enabled | false | port 3000 serves https (PROTOCOL = https, cert at /tls); set externalURL to the https URL |
tls.existingSecret | "" | a kubernetes.io/tls Secret to use (1st choice) |
tls.certManager.enabled | false | request a cert-manager Certificate from tls.certManager.issuerRef (2nd choice) |
tls.selfSigned.validityDays | 365 | otherwise Helm generates a CA + certificate, kept across upgrades |
admin.username / admin.email | gogs-admin | first administrator |
admin.password | generated | or admin.existingSecret (key admin-password) |
database.type | sqlite3 | sqlite3, postgres or mysql |
ssh.enabled | true | built-in SSH server |
persistence.size | 10Gi | repositories, SQLite, attachments |
extraConfig | "" | more app.ini, appended |
One replica: repositories and SQLite live on a single ReadWriteOnce volume. Pods run
with a read-only root filesystem and all capabilities dropped; everything Gogs writes
is under /data.
The release gate installs the chart on kind, gets an API token as the admin, creates a repository, clones and pushes to it over HTTP (the push runs Gogs' server-side hooks), checks the SSH server answers, recreates the pod and reads the pushed file back.
The chart depends on the quench-common chart from oci://ghcr.io/quenchworks/charts.
Deploy gogs with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has gogs on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartgogs is pinned at v0.0.11 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply