successfull interplay between gitea and postgres

This commit is contained in:
Rachel Lambda Samuelsson 2024-05-24 22:54:44 +02:00
parent 3f21fc215d
commit 70c96d504d
3 changed files with 7 additions and 6 deletions

1
result Symbolic link
View File

@ -0,0 +1 @@
/nix/store/cy1mab4p2g1zf38bcdpb3ix034wxs8a8-nixos-vm

View File

@ -10,6 +10,7 @@
port = 3306;
name = "gitea";
user = "gitea";
createDatabase = false;
passwordFile = ../secrets/gitea_postgres_pass;
};
settings.server = {

View File

@ -6,12 +6,11 @@
enableTCPIP = true;
port = 3306;
ensureDatabases = [ "gitea" ];
initialScript = pkgs.writeText "backend-initScript" ''
CREATE USER gitea WITH LOGIN PASSWORD '${pkgs.lib.strings.fileContents ../secrets/gitea_postgres_pass}' CREATEDB;
CREATE DATABASE gitea;
GRANT ALL PRIVILEGES ON DATABASE gitea TO gitea;
'';
authentication = pkgs.lib.mkOverride 10 ''
ensureUsers = [{
name = "gitea";
ensureDBOwnership = true;
}];
authentication = ''
host all all 10.10.0.0/16 trust
'';
};