unix socket forgejo?
This commit is contained in:
parent
2232ad3f31
commit
b482fbc2ea
2 changed files with 52 additions and 55 deletions
|
@ -6,11 +6,6 @@ in {
|
|||
config = {
|
||||
modules = {
|
||||
services = {
|
||||
forgejo = {
|
||||
enable = true;
|
||||
domain = "git.reidlab.pink";
|
||||
port = 3000;
|
||||
};
|
||||
|
||||
# you should probably keep this on
|
||||
# actually enables nginx, configures acme,
|
||||
|
@ -22,6 +17,11 @@ in {
|
|||
"reidlab.pink".dataDir = "/var/www/reidlab.pink";
|
||||
};
|
||||
|
||||
forgejo = {
|
||||
enable = true;
|
||||
domain = "git.reidlab.pink";
|
||||
};
|
||||
|
||||
matomo = {
|
||||
enable = true;
|
||||
domain = "analytics.reidlab.pink";
|
||||
|
|
|
@ -10,16 +10,12 @@ in {
|
|||
type = types.str;
|
||||
default = "git.reidlab.pink";
|
||||
};
|
||||
port = mkOption {
|
||||
type = types.int;
|
||||
default = 3000;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services = {
|
||||
forgejo = {
|
||||
services.forgejo = {
|
||||
enable = true;
|
||||
|
||||
stateDir = "/var/lib/${cfg.domain}";
|
||||
database.type = "postgres";
|
||||
settings = {
|
||||
|
@ -37,7 +33,7 @@ in {
|
|||
};
|
||||
"server" = {
|
||||
DOMAIN = cfg.domain;
|
||||
HTTP_PORT = cfg.port;
|
||||
PROTOCOL = "http+unix";
|
||||
ROOT_URL = "https://${cfg.domain}/";
|
||||
};
|
||||
"repository" = {
|
||||
|
@ -60,12 +56,13 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
nginx.virtualHosts."${cfg.domain}" = {
|
||||
services.nginx.virtualHosts."${cfg.domain}" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
locations."/".extraConfig = ''
|
||||
client_max_body_size 600M;
|
||||
proxy_pass http://127.0.0.1:${toString cfg.port};
|
||||
locations."/" = {
|
||||
proxyPass = "http://unix:${config.services.forgejo.settings.server.HTTP_ADDR}";
|
||||
extraConfig = ''
|
||||
client_max_body_size 512M;
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue