parsons: fix hegedocs

This commit is contained in:
schweby 2021-08-07 20:27:04 +02:00 committed by hexchen
parent 76c9b07d56
commit 632bf21200
3 changed files with 12 additions and 26 deletions

View file

@ -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 = {

View file

@ -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;
'';

View file

@ -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;
'';