Forgejo configuration for git.torbjorn.dev
- Shell 100%
| forgejo-public/assets/img | ||
| forgejo-templates | ||
| .gitignore | ||
| forgejo-config.ini.example | ||
| forgejo-data.volume | ||
| forgejo.container | ||
| forgejo.env.example | ||
| forgejo.network | ||
| install.sh | ||
| README.md | ||
| runner-compose.yml | ||
Forgejo Podman Quadlet Setup
A rootless Forgejo instance running as a Podman Quadlet with systemd.
What's included
forgejo.container— Podman Quadlet container definitionforgejo.network— Podman networkforgejo-data.volume— Persistent data volumeforgejo-config.ini.example— Forgejo configuration template (no secrets)forgejo.env.example— Template for secrets (tokens, SMTP credentials)forgejo-templates/— Custom templates (landing page, analytics header)forgejo-public/— Custom static assetsinstall.sh— Setup script that generates secrets and starts the service
Configuration highlights
- SQLite database, no external dependencies
- Public registration with manual admin approval
- New users cannot create repos or orgs (contribute-only by default)
- SMTP via mailbox.org (STARTTLS on port 587)
- Email notifications enabled
- Gravatar disabled
- Default repo visibility: private
- Time tracking disabled
- Secrets kept out of config via
FORGEJO__section__keyenv var overrides
Install
# Clone into the systemd quadlet directory
git clone <repo-url> ~/.config/containers/systemd
# Run the install script
cd ~/.config/containers/systemd
chmod +x install.sh
./install.sh
The script generates cryptographic secrets, prompts for SMTP credentials, and starts Forgejo.
Post-install
Create an admin user:
podman exec --user git forgejo forgejo admin user create \
--admin --username <name> --email <email>
Customization
- Edit
forgejo-config.inifor Forgejo settings - Edit
forgejo.envfor secrets and SMTP credentials - Replace
forgejo-public/assets/img/landing.webpwith your own landing image - Edit
forgejo-templates/home.tmplfor the landing page - Edit
forgejo-templates/custom/header.tmplfor injected<head>content (analytics, etc.)
After changes:
systemctl --user daemon-reload
systemctl --user restart forgejo.service
Reverse proxy
Forgejo listens on 127.0.0.1:3000. You'll need a reverse proxy (Caddy, nginx, etc.) to terminate TLS and forward traffic.