docs: Forgejo rootless on git.hacktivism.ch (no free signup)

This commit is contained in:
Hernâni Marques 2026-07-10 14:36:10 +02:00
parent 19c9fed12a
commit dc2262b056
No known key found for this signature in database
6 changed files with 168 additions and 2 deletions

View file

@ -0,0 +1,15 @@
# 9024 forgejo HTTP (SSH :2222 host-direct, not via Caddy)
# Apply on host: merge into /etc/caddy/Caddyfile, validate, reload
git.hacktivism.ch {
header Alt-Svc "clear"
reverse_proxy 127.0.0.1:9024 {
header_up Host {host}
header_up X-Forwarded-For {remote_host}
header_up X-Forwarded-Proto {scheme}
flush_interval -1
transport http {
read_timeout 3600s
write_timeout 3600s
}
}
}

View file

@ -0,0 +1,84 @@
# koopa-forgejo — ROOTLESS Forgejo image + rootless podman (user hernani)
# Site: https://git.hacktivism.ch | HTTP :9024 | SSH :2222
services:
forgejo:
image: codeberg.org/forgejo/forgejo:11-rootless
container_name: koopa-forgejo
restart: unless-stopped
user: "1000:1000"
userns_mode: keep-id
env_file: [.env]
environment:
USER_UID: "1000"
USER_GID: "1000"
FORGEJO__database__DB_TYPE: postgres
FORGEJO__database__HOST: db:5432
FORGEJO__database__NAME: forgejo
FORGEJO__database__USER: forgejo
FORGEJO__database__PASSWD: ${FORGEJO_DB_PASSWORD}
FORGEJO__server__DOMAIN: git.hacktivism.ch
FORGEJO__server__SSH_DOMAIN: git.hacktivism.ch
FORGEJO__server__ROOT_URL: https://git.hacktivism.ch/
FORGEJO__server__HTTP_PORT: "3000"
FORGEJO__server__SSH_PORT: "2222"
FORGEJO__server__SSH_LISTEN_PORT: "2222"
FORGEJO__server__START_SSH_SERVER: "true"
FORGEJO__server__DISABLE_SSH: "false"
FORGEJO__server__LANDING_PAGE: explore
FORGEJO__service__DISABLE_REGISTRATION: "true"
FORGEJO__service__ALLOW_ONLY_EXTERNAL_REGISTRATION: "false"
FORGEJO__service__SHOW_REGISTRATION_BUTTON: "false"
FORGEJO__service__REQUIRE_SIGNIN_VIEW: "false"
FORGEJO__service__DEFAULT_ALLOW_CREATE_ORGANIZATION: "true"
FORGEJO__openid__ENABLE_OPENID_SIGNIN: "false"
FORGEJO__openid__ENABLE_OPENID_SIGNUP: "false"
FORGEJO__repository__DEFAULT_PRIVATE: public
FORGEJO__repository__ENABLE_PUSH_CREATE_USER: "true"
FORGEJO__repository__ENABLE_PUSH_CREATE_ORG: "true"
FORGEJO__security__INSTALL_LOCK: "true"
FORGEJO__session__PROVIDER: memory
FORGEJO__log__LEVEL: Info
FORGEJO____APP_NAME: "hacktivism git"
ports:
- "9024:3000"
- "2222:2222"
volumes:
- ./data:/var/lib/gitea
- ./config:/etc/gitea
- /etc/localtime:/etc/localtime:ro
depends_on:
db:
condition: service_healthy
labels:
org.hacktivism.service: forgejo
org.hacktivism.variant: rootless
org.hacktivism.host_port: "9024"
org.hacktivism.ssh_port: "2222"
org.hacktivism.site: git.hacktivism.ch
org.hacktivism.managed_by: koopa-admin
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://127.0.0.1:3000/api/healthz"]
interval: 30s
timeout: 10s
retries: 10
start_period: 90s
db:
image: docker.io/library/postgres:16-alpine
container_name: koopa-forgejo-db
restart: unless-stopped
environment:
POSTGRES_USER: forgejo
POSTGRES_PASSWORD: ${FORGEJO_DB_PASSWORD}
POSTGRES_DB: forgejo
volumes:
- db-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U forgejo -d forgejo"]
interval: 5s
timeout: 5s
retries: 20
start_period: 10s
volumes:
db-data: