services/{bitwarden,gitea}: Postgres

This commit is contained in:
kat witch 2021-03-29 06:05:13 +01:00
parent 925d4d02dd
commit 92c12dd991
No known key found for this signature in database
GPG key ID: 1B477797DCA5EC72
2 changed files with 28 additions and 1 deletions

View file

@ -1,14 +1,26 @@
{ config, pkgs, witch, ... }: { config, pkgs, witch, ... }:
{ {
services.postgresql = {
ensureDatabases = [ "bitwarden_rs" ];
ensureUsers = [{
name = "bitwarden_rs";
ensurePermissions = {
"DATABASE bitwarden_rs" = "ALL PRIVILEGES";
};
}];
};
services.bitwarden_rs = { services.bitwarden_rs = {
enable = true; enable = true;
dbBackend = "postgresql";
config = { config = {
rocketPort = 4000; rocketPort = 4000;
websocketEnabled = true; websocketEnabled = true;
signupsAllowed = false; signupsAllowed = false;
adminToken = witch.secrets.hosts.athame.bitwarden_secret; adminToken = witch.secrets.hosts.athame.bitwarden_secret;
domain = "https://vault.kittywit.ch"; domain = "https://vault.kittywit.ch";
databaseUrl = "postgresql://bitwarden_rs@/bitwarden_rs";
}; };
}; };

View file

@ -1,6 +1,16 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
services.postgresql = {
enable = true;
ensureDatabases = [ "gitea" ];
ensureUsers = [
{ name = "gitea";
ensurePermissions."DATABASE gitea" = "ALL PRIVILEGES";
}
];
};
services.gitea = { services.gitea = {
enable = true; enable = true;
disableRegistration = true; disableRegistration = true;
@ -11,6 +21,11 @@
ssh = { clonePort = 62954; }; ssh = { clonePort = 62954; };
settings = { settings = {
security = { DISABLE_GIT_HOOKS = false; }; security = { DISABLE_GIT_HOOKS = false; };
database = {
type = "postgres";
name = "gitea";
user = "gitea";
};
mailer = { mailer = {
ENABLED = true; ENABLED = true;
MAILER_TYPE = "sendmail"; MAILER_TYPE = "sendmail";
@ -19,7 +34,7 @@
}; };
ui = { ui = {
THEMES = "gitea,arc-green,kittywitch"; THEMES = "gitea,arc-green,kittywitch";
DEFAULT_THEME = "kittywitch"; DEFAULT_THEME = "gitea";
THEME_COLOR_META_TAG = "#222222"; THEME_COLOR_META_TAG = "#222222";
}; };
}; };