infrastructure/machines/compute01/hedgedoc.nix
sinavir 8bfa7ede84
All checks were successful
build configuration / build_vault01 (push) Successful in 52s
build configuration / build_storage01 (push) Successful in 53s
build configuration / build_web01 (push) Successful in 1m9s
build configuration / build_compute01 (push) Successful in 1m20s
build configuration / build_web02 (push) Successful in 42s
ds-fr update / npins_update (push) Successful in 2m1s
fix(pads): better configuration of reverse proxy
2024-01-11 17:21:43 +01:00

55 lines
1 KiB
Nix

{ 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 ];
protocolUseSSL = true;
allowFreeURL = true;
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";
ensureDBOwnership = true;
}];
};
};
systemd.services.hedgedoc.serviceConfig.StateDirectory =
lib.mkForce [ "hedgedoc" "hedgedoc/uploads" ];
}