1
0
mirror of https://github.com/kmein/niveum synced 2026-03-21 04:11:07 +01:00

fix(hedgedoc): serve ssl correctly

This commit is contained in:
2021-11-09 22:08:45 +01:00
parent 1002fd8b43
commit bdd4bda339

View File

@@ -1,25 +1,34 @@
{ pkgs, ... }: { config, pkgs, ... }:
let let
backupLocation = "/var/lib/codimd-backup"; backupLocation = "/var/lib/codimd-backup";
stateLocation = "/var/lib/codimd/state.sqlite"; stateLocation = "/var/lib/codimd/state.sqlite";
nixpkgs-unstable = import <nixpkgs-unstable> {}; nixpkgs-unstable = import <nixpkgs-unstable> {};
domain = "pad.xn--kiern-0qa.de";
in in
{ {
imports = [ <stockholm/krebs/3modules/permown.nix> ]; imports = [ <stockholm/krebs/3modules/permown.nix> ];
services.nginx.virtualHosts."pad.xn--kiern-0qa.de" = { services.nginx.virtualHosts.${domain} = {
enableACME = true; enableACME = true;
addSSL = true; forceSSL = true;
locations."/".extraConfig = '' locations."/" = {
client_max_body_size 4G; proxyPass = "https://localhost:3091";
proxy_set_header Host $host; proxyWebsockets = true;
proxy_pass http://localhost:3091; };
''; };
security.acme.certs.${domain}.group = "hedgecert";
users.groups.hedgecert.members = [ "codimd" "nginx" ];
security.dhparams = {
enable = true;
params.hedgedoc = {};
}; };
services.hedgedoc = { services.hedgedoc = {
enable = true; enable = true;
configuration = { configuration = {
allowOrigin = [ domain ];
allowAnonymous = true; allowAnonymous = true;
allowGravatar = false; allowGravatar = false;
allowFreeURL = true; allowFreeURL = true;
@@ -28,6 +37,13 @@ in
storage = stateLocation; storage = stateLocation;
}; };
port = 3091; port = 3091;
domain = domain;
useSSL = true;
protocolUseSSL = true;
sslCAPath = [ "/etc/ssl/certs/ca-certificates.crt" ];
sslCertPath = "/var/lib/acme/${domain}/cert.pem";
sslKeyPath = "/var/lib/acme/${domain}/key.pem";
dhParamPath = config.security.dhparams.params.hedgedoc.path;
}; };
}; };