2023-10-05 09:52:13 +02:00
|
|
|
{ config, lib, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
host = "pads.dgnum.eu";
|
|
|
|
port = 3007;
|
|
|
|
in {
|
|
|
|
services = {
|
|
|
|
hedgedoc = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
environmentFile = config.age.secrets."hedgedoc-environment_file".path;
|
|
|
|
|
|
|
|
settings = {
|
|
|
|
inherit port;
|
|
|
|
|
|
|
|
domain = host;
|
|
|
|
host = "127.0.0.1";
|
|
|
|
allowOrigin = [ host ];
|
|
|
|
|
2024-01-11 17:21:43 +01:00
|
|
|
protocolUseSSL = true;
|
|
|
|
|
2023-12-04 18:44:59 +01:00
|
|
|
allowFreeURL = true;
|
2023-12-03 13:24:22 +01:00
|
|
|
|
2023-10-05 09:52:13 +02:00
|
|
|
db = {
|
|
|
|
dialect = "postgres";
|
|
|
|
host = "/run/postgresql";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
nginx.virtualHosts.${host} = {
|
|
|
|
forceSSL = true;
|
|
|
|
enableACME = true;
|
|
|
|
|
|
|
|
locations."/" = {
|
|
|
|
proxyPass = "http://127.0.0.1:${builtins.toString port}";
|
|
|
|
proxyWebsockets = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
postgresql = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
ensureDatabases = [ "hedgedoc" ];
|
|
|
|
|
|
|
|
ensureUsers = [{
|
|
|
|
name = "hedgedoc";
|
2023-11-29 16:12:24 +01:00
|
|
|
ensureDBOwnership = true;
|
2023-10-05 09:52:13 +02:00
|
|
|
}];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.services.hedgedoc.serviceConfig.StateDirectory =
|
|
|
|
lib.mkForce [ "hedgedoc" "hedgedoc/uploads" ];
|
|
|
|
}
|