gerd.hedgedoc: switched to use postgresql instead of sqlite

This commit is contained in:
eyjhb 2024-08-24 21:38:37 +02:00
parent 0201eed966
commit e54d7373d8
No known key found for this signature in database
GPG key ID: 609F508E3239F920

View file

@ -4,6 +4,8 @@ let
svc_domain = "hedgedoc.${config.mine.shared.settings.domain}";
stateDir = config.mine.zfsMounts."rpool/safe/svcs/hedgedoc";
hedgedoc_user = config.users.users.hedgedoc.name;
in {
services.hedgedoc = {
enable = true;
@ -14,8 +16,11 @@ in {
protocolUseSSL = true;
debug = true;
uploadsPath = stateDir + "/uploads";
db.dialect = "sqlite";
db.storage = stateDir + "/db.sqlite";
db = {
dialect = "postgresql";
host = "/run/postgresql";
};
# disable annonymous notes, but allow annonymous edits
allowAnonymous = false;
@ -44,6 +49,15 @@ in {
systemd.services.hedgedoc.serviceConfig.ReadWritePaths = [ stateDir ];
systemd.services.hedgedoc.serviceConfig.EnvironmentFile = config.age.secrets.lldap-bind-user-pass-hedgedoc-env.path;
# setup postgresql
services.postgresql = {
ensureDatabases = [ hedgedoc_user ];
ensureUsers = [{
name = hedgedoc_user;
ensureDBOwnership = true;
}];
};
services.nginx.virtualHosts."${svc_domain}" = {
forceSSL = true;
enableACME = true;