feat(compute01): Deploy hedgedoc on pads.dgnum.eu

This commit is contained in:
Tom Hubrecht 2023-10-05 09:52:13 +02:00
parent 7873680895
commit c2d7adfcd0
4 changed files with 53 additions and 0 deletions

View file

@ -10,6 +10,7 @@ lib.extra.mkConfig {
enabledServices = [
# List of services to enable
"ds-fr"
"hedgedoc"
"kanidm"
"mastodon"
"nextcloud"

View file

@ -0,0 +1,51 @@
{ 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 ];
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";
ensurePermissions = { "DATABASE hedgedoc" = "ALL PRIVILEGES"; };
}];
};
};
systemd.services.hedgedoc.serviceConfig.StateDirectory =
lib.mkForce [ "hedgedoc" "hedgedoc/uploads" ];
}

Binary file not shown.

View file

@ -5,6 +5,7 @@ in
lib.setDefault { inherit publicKeys; } [
"ds_fr-secret_file"
"hedgedoc-environment_file"
"mastodon-extra_env_file"
"nextcloud-adminpass_file"
"nextcloud-s3_secret_file"