diff --git a/hosts/parsons/configuration.nix b/hosts/parsons/configuration.nix index 7ad9e55..f20b716 100644 --- a/hosts/parsons/configuration.nix +++ b/hosts/parsons/configuration.nix @@ -12,8 +12,8 @@ ../../services/mattermost.nix ../../services/thelounge.nix ../../services/murmur.nix - ../../services/hedgedoc_hacc.nix - ../../services/hedgedoc_i4f.nix + ../../services/hedgedoc-hacc.nix + ../../services/hedgedoc-i4f.nix ]; hexchen.encboot = { diff --git a/services/hedgedoc_hacc.nix b/services/hedgedoc-hacc.nix similarity index 80% rename from services/hedgedoc_hacc.nix rename to services/hedgedoc-hacc.nix index 696ef6d..087e5d7 100644 --- a/services/hedgedoc_hacc.nix +++ b/services/hedgedoc-hacc.nix @@ -1,7 +1,7 @@ { config, lib, pkgs, profiles, modules, evalConfig, sources, ... }: { - containers.hedgedoc = { + containers.pad-hacc = { privateNetwork = true; hostAddress = "192.168.100.1"; localAddress = "192.168.100.5"; @@ -43,7 +43,7 @@ allowFreeURL = true; allowGravatar = false; allowOrigin = [ "localhost" "pad.hacc.space" "fff-muc.de" ]; - dbURL = "postgres://hedgedoc:hedgedoc@localhost:5432/hedgedoc"; + dbURL = "postgres://codimd:codimd@localhost:5432/codimd"; defaultPermission = "limited"; domain = "pad.hacc.space"; host = "0.0.0.0"; @@ -67,18 +67,19 @@ }; services.postgresql = { enable = true; - ensureDatabases = [ "hedgedoc" ]; + ensureDatabases = [ "codimd" ]; ensureUsers = [{ - name = "hedgedoc"; + name = "codimd"; ensurePermissions = { - "DATABASE hedgedoc" = "ALL PRIVILEGES"; + "DATABASE codimd" = "ALL PRIVILEGES"; }; }]; }; services.postgresqlBackup = { enable = true; - databases = [ "hedgedoc" ]; + databases = [ "codimd" ]; startAt = "*-*-* 23:45:00"; + location = "/persist/backups/postgres"; }; })).config.system.build.toplevel; }; @@ -92,16 +93,8 @@ forceSSL = true; enableACME = true; locations."/" = { - proxyPass = "http://192.168.100.3:3000"; + proxyPass = "http://${config.containers.pad-hacc.localAddress}:3000"; extraConfig = '' - proxy_pass_request_headers on; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-Host $http_host; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection $http_connection; add_header Access-Control-Allow-Origin "*"; proxy_buffering off; ''; diff --git a/services/hedgedoc_i4f.nix b/services/hedgedoc-i4f.nix similarity index 84% rename from services/hedgedoc_i4f.nix rename to services/hedgedoc-i4f.nix index 95b1016..b904cb4 100644 --- a/services/hedgedoc_i4f.nix +++ b/services/hedgedoc-i4f.nix @@ -70,6 +70,7 @@ enable = true; databases = [ "hedgedoc" ]; startAt = "*-*-* 23:45:00"; + location = "/persist/backups/postgres"; }; })).config.system.build.toplevel; }; @@ -78,16 +79,8 @@ forceSSL = true; enableACME = true; locations."/" = { - proxyPass = "http://192.168.100.41:3000"; + proxyPass = "http://${config.containers.pad-i4f.localAddress}:3000"; extraConfig = '' - proxy_pass_request_headers on; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-Host $http_host; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection $http_connection; add_header Access-Control-Allow-Origin "*"; proxy_buffering off; '';