2024-12-12 14:41:43 +01:00
|
|
|
# SPDX-FileCopyrightText: 2024 Tom Hubrecht <tom.hubrecht@dgnum.eu>
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: EUPL-1.2
|
|
|
|
|
2023-10-05 09:52:13 +02:00
|
|
|
{ config, lib, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
host = "pads.dgnum.eu";
|
|
|
|
port = 3007;
|
2024-02-02 10:51:31 +01:00
|
|
|
in
|
|
|
|
{
|
2023-10-05 09:52:13 +02:00
|
|
|
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";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
postgresql = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
ensureDatabases = [ "hedgedoc" ];
|
|
|
|
|
2024-02-02 10:51:31 +01:00
|
|
|
ensureUsers = [
|
|
|
|
{
|
|
|
|
name = "hedgedoc";
|
|
|
|
ensureDBOwnership = true;
|
|
|
|
}
|
|
|
|
];
|
2023-10-05 09:52:13 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-10-12 19:30:36 +02:00
|
|
|
dgn-web.simpleProxies.hedgedoc = {
|
|
|
|
inherit host port;
|
|
|
|
proxyWebsockets = true;
|
|
|
|
};
|
|
|
|
|
2024-02-02 10:51:31 +01:00
|
|
|
systemd.services.hedgedoc.serviceConfig.StateDirectory = lib.mkForce [
|
|
|
|
"hedgedoc"
|
|
|
|
"hedgedoc/uploads"
|
|
|
|
];
|
2024-02-21 17:18:14 +01:00
|
|
|
|
|
|
|
dgn-backups.jobs.hedgedoc.settings.paths = [ "/var/lib/hedgedoc" ];
|
2024-02-21 22:49:20 +01:00
|
|
|
dgn-backups.postgresDatabases = [ "hedgedoc" ];
|
2023-10-05 09:52:13 +02:00
|
|
|
}
|