stockholm/lass/2configs/codimd.nix

46 lines
1.1 KiB
Nix
Raw Normal View History

2019-11-17 14:45:06 +00:00
{ config, pkgs, lib, ... }:
2019-05-29 13:20:45 +00:00
with import <stockholm/lib>;
2021-10-12 13:35:52 +00:00
let
domain = "codi.lassul.us";
in {
services.nginx.virtualHosts.${domain} = {
2019-05-29 13:20:45 +00:00
enableACME = true;
2021-10-12 13:35:52 +00:00
forceSSL = true;
locations."/" = {
proxyPass = "https://localhost:3091";
proxyWebsockets = true;
};
};
security.acme.certs.${domain}.group = "hedgecert";
users.groups.hedgecert.members = [ "codimd" "nginx" ];
security.dhparams = {
enable = true;
params.hedgedoc = {};
2019-05-29 13:20:45 +00:00
};
services.hedgedoc = {
2019-05-29 13:20:45 +00:00
enable = true;
2021-10-12 13:35:52 +00:00
configuration.allowOrigin = [ domain ];
2019-05-29 13:20:45 +00:00
configuration = {
db = {
dialect = "sqlite";
storage = "/var/lib/codimd/db.codimd.sqlite";
};
2021-10-12 13:35:52 +00:00
useCDN = false;
2019-05-29 13:20:45 +00:00
port = 3091;
2021-10-12 13:35:52 +00:00
domain = domain;
allowFreeURL = true;
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;
2019-05-29 13:20:45 +00:00
};
};
}