gerd.hedgedoc: switched to use postgresql instead of sqlite
This commit is contained in:
parent
0201eed966
commit
e54d7373d8
1 changed files with 16 additions and 2 deletions
|
@ -4,6 +4,8 @@ let
|
||||||
svc_domain = "hedgedoc.${config.mine.shared.settings.domain}";
|
svc_domain = "hedgedoc.${config.mine.shared.settings.domain}";
|
||||||
|
|
||||||
stateDir = config.mine.zfsMounts."rpool/safe/svcs/hedgedoc";
|
stateDir = config.mine.zfsMounts."rpool/safe/svcs/hedgedoc";
|
||||||
|
|
||||||
|
hedgedoc_user = config.users.users.hedgedoc.name;
|
||||||
in {
|
in {
|
||||||
services.hedgedoc = {
|
services.hedgedoc = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -14,8 +16,11 @@ in {
|
||||||
protocolUseSSL = true;
|
protocolUseSSL = true;
|
||||||
debug = true;
|
debug = true;
|
||||||
uploadsPath = stateDir + "/uploads";
|
uploadsPath = stateDir + "/uploads";
|
||||||
db.dialect = "sqlite";
|
|
||||||
db.storage = stateDir + "/db.sqlite";
|
db = {
|
||||||
|
dialect = "postgresql";
|
||||||
|
host = "/run/postgresql";
|
||||||
|
};
|
||||||
|
|
||||||
# disable annonymous notes, but allow annonymous edits
|
# disable annonymous notes, but allow annonymous edits
|
||||||
allowAnonymous = false;
|
allowAnonymous = false;
|
||||||
|
@ -44,6 +49,15 @@ in {
|
||||||
systemd.services.hedgedoc.serviceConfig.ReadWritePaths = [ stateDir ];
|
systemd.services.hedgedoc.serviceConfig.ReadWritePaths = [ stateDir ];
|
||||||
systemd.services.hedgedoc.serviceConfig.EnvironmentFile = config.age.secrets.lldap-bind-user-pass-hedgedoc-env.path;
|
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}" = {
|
services.nginx.virtualHosts."${svc_domain}" = {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
|
|
Loading…
Reference in a new issue