unix socket forgejo?

This commit is contained in:
Reid 2025-01-09 23:36:22 -08:00
parent 2232ad3f31
commit b482fbc2ea
Signed by: reidlab
GPG key ID: DAF5EAF6665839FD
2 changed files with 52 additions and 55 deletions

View file

@ -6,11 +6,6 @@ in {
config = { config = {
modules = { modules = {
services = { services = {
forgejo = {
enable = true;
domain = "git.reidlab.pink";
port = 3000;
};
# you should probably keep this on # you should probably keep this on
# actually enables nginx, configures acme, # actually enables nginx, configures acme,
@ -22,6 +17,11 @@ in {
"reidlab.pink".dataDir = "/var/www/reidlab.pink"; "reidlab.pink".dataDir = "/var/www/reidlab.pink";
}; };
forgejo = {
enable = true;
domain = "git.reidlab.pink";
};
matomo = { matomo = {
enable = true; enable = true;
domain = "analytics.reidlab.pink"; domain = "analytics.reidlab.pink";

View file

@ -10,16 +10,12 @@ in {
type = types.str; type = types.str;
default = "git.reidlab.pink"; default = "git.reidlab.pink";
}; };
port = mkOption {
type = types.int;
default = 3000;
};
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
services = { services.forgejo = {
forgejo = {
enable = true; enable = true;
stateDir = "/var/lib/${cfg.domain}"; stateDir = "/var/lib/${cfg.domain}";
database.type = "postgres"; database.type = "postgres";
settings = { settings = {
@ -37,7 +33,7 @@ in {
}; };
"server" = { "server" = {
DOMAIN = cfg.domain; DOMAIN = cfg.domain;
HTTP_PORT = cfg.port; PROTOCOL = "http+unix";
ROOT_URL = "https://${cfg.domain}/"; ROOT_URL = "https://${cfg.domain}/";
}; };
"repository" = { "repository" = {
@ -60,12 +56,13 @@ in {
}; };
}; };
nginx.virtualHosts."${cfg.domain}" = { services.nginx.virtualHosts."${cfg.domain}" = {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
locations."/".extraConfig = '' locations."/" = {
client_max_body_size 600M; proxyPass = "http://unix:${config.services.forgejo.settings.server.HTTP_ADDR}";
proxy_pass http://127.0.0.1:${toString cfg.port}; extraConfig = ''
client_max_body_size 512M;
''; '';
}; };
}; };