added forgejo to code.randogoth.com

This commit is contained in:
randogoth 2026-07-23 11:39:18 +02:00
parent 0818303bc6
commit 37f98eee1b
2 changed files with 36 additions and 0 deletions

View file

@ -64,6 +64,7 @@
./modules/services/webhook-deploy.nix
./modules/services/jirorian.nix
./modules/services/oberon.nix
./modules/services/forgejo.nix
./modules/services/nip05.nix
./modules/services/torrent-tracker.nix
./modules/services/backup.nix

View file

@ -0,0 +1,35 @@
{ ... }:
let
domain = "code.randogoth.com";
port = 3000; # localhost-only HTTP backend, proxied by Caddy
in
{
services.forgejo = {
enable = true;
database.type = "sqlite3"; # default; explicit for clarity
lfs.enable = true; # git-LFS support
settings = {
server = {
DOMAIN = domain;
ROOT_URL = "https://${domain}/";
HTTP_ADDR = "127.0.0.1";
HTTP_PORT = port;
DISABLE_SSH = true; # HTTPS-only git access
};
service = {
DISABLE_REGISTRATION = true; # admin creates accounts
};
# Quiet, sane defaults for a private instance.
"repository".DEFAULT_PRIVATE = "private";
session.COOKIE_SECURE = true;
log.LEVEL = "Info";
};
};
# Caddy reverse proxy fragment — picked up via the glob import in caddy.nix.
environment.etc."caddy/Caddyfile.d/forgejo.caddyfile".text = ''
${domain} {
reverse_proxy localhost:${toString port}
}
'';
}