···
2
+
services.hedgedoc = {
5
+
domain = "pad.pyrox.dev";
7
+
# Use HTTPS for links, but unencrypted between server and Caddy.
8
+
protocolUseSSL = true;
15
+
dialect = "postgres";
16
+
database = "hedgedoc";
17
+
host = "192.168.100.10";
20
+
# Web security settings
25
+
addGoogleAnalytics = false;
26
+
upgradeInsecureRequests = true;
27
+
allowFraming = false;
28
+
allowPDFEmbed = false;
31
+
# Disable Libravatar
32
+
allowGravatar = false;
34
+
# Anonymous user perms
35
+
allowAnonymous = false;
36
+
allowAnonymousEdits = false;
38
+
# Disable email signin
40
+
allowEmailRegister = false;
42
+
# Require auth to use FreeURL
43
+
requireFreeURLAuthentication = true;
45
+
# OAuth2 Login with PyroServ Auth
47
+
baseURL = "https://auth.pyrox.dev";
48
+
userProfileURL = "https://auth.pyrox.dev/application/o/userinfo/";
49
+
userProfileUsernameAttr = "preferred_username";
50
+
userProfileDisplayNameAttr = "name";
51
+
userProfileEmailAttr = "email";
52
+
providerName = "PyroServ Auth";
53
+
rolesClaim = "groups";
54
+
accessRole = "users";
55
+
tokenURL = "https://auth.pyrox.dev/application/o/token/";
56
+
authorizationURL = "https://auth.pyrox.dev/application/o/authorize/";
57
+
clientID = "01610eacdee22b4c353195f6515682faefe22f0e";
62
+
containers.hedgedoc-postgres = {
64
+
privateNetwork = true;
65
+
hostAddress = "192.168.100.10";
66
+
localAddress = "192.168.100.11";
67
+
hostAddress6 = "fc00::1";
68
+
localAddress6 = "fc00::2";
70
+
# Persistant DB storage
71
+
bindMounts.data.hostPath = "/var/lib/hedgedoc/db";
72
+
bindMounts.data.mountPoint = "/var/lib/postgresql/15";
73
+
bindMounts.data.isReadOnly = false;
75
+
# Actual config for the container.
76
+
config = { config, pkgs, ... }: {
77
+
system.stateVersion = "23.05";
78
+
services.postgresql = {
80
+
package = pkgs.postgesql_15;
83
+
ensurePermissions = {
84
+
"DATABASE hedgedoc" = "ALL PRIVILEGES";
87
+
ensureDatabases = ["hedgedoc"];
89
+
networking.firewall = {
91
+
allowedTCPPorts = [ 5432 ];
92
+
allowedUDPPorts = [ 5432 ];