enable gitea

This commit is contained in:
Ivan Dimitrov 2023-12-16 11:50:47 +02:00
parent 2eafbfa1c0
commit 01906f483c
4 changed files with 37 additions and 2 deletions

View File

@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{
imports = [ ./configuration.nix ./mailserver ./roundcube ./postgres ./wireguard ./nginx ./webshite ./tor ./i2pd ];
imports = [ ./configuration.nix ./mailserver ./roundcube ./postgres ./wireguard ./nginx ./webshite ./tor ./i2pd ./gitea ];
}

View File

@ -0,0 +1,17 @@
{ config, pkgs, ... }:
{
services.gitea = {
enable = true;
appName = "idimitrov: Gitea";
database = {
type = "postgres";
};
settings = {
server = {
DOMAIN = "git.idimitrov.dev";
ROOT_URL = "https://git.idimitrov.dev/";
HTTP_PORT = 3001;
};
};
};
}

View File

@ -32,7 +32,15 @@
proxyPass = "http://127.0.0.1:3000";
};
};
"git.idimitrov.dev" = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://127.0.0.1:3001";
};
};
};
};
};
}

View File

@ -3,12 +3,16 @@
services = {
postgresql = {
enable = true;
ensureDatabases = [ "roundcube" ];
ensureDatabases = [ "roundcube" "gitea" ];
ensureUsers = [
{
name = "roundcube";
ensureDBOwnership = true;
}
{
name = "gitea";
ensureDBOwnership = true;
}
{
name = "root";
ensureClauses = {
@ -18,6 +22,12 @@
};
}
];
authentication = ''
local gitea all ident map=gitea-users
'';
identMap = ''
gitea-users gitea gitea
'';
initialScript = pkgs.writeText "init" ''
GRANT ALL PRIVILEGES ON DATABASE roundcube TO roundcube;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO roundcube;