This repository has no description
1.4 kB
49 lines
1{
2 config,
3 pkgs,
4 ...
5}:
6{
7 services.docuseal = {
8 enable = true;
9 host = "127.0.0.1";
10 port = 3200;
11 extraConfig = {
12 SMTP_ADDRESS = "localhost";
13 SMTP_PORT = "25";
14 SMTP_DOMAIN = "lassul.us";
15 SMTP_ENABLE_STARTTLS = "false";
16 };
17 };
18
19 clan.core.vars.generators.docuseal = {
20 files.secret-key-base = { };
21 runtimeInputs = [ pkgs.openssl ];
22 script = ''
23 openssl rand -hex 64 | tr -d '\n' > $out/secret-key-base
24 '';
25 };
26
27 services.docuseal.secretKeyBaseFile = "/run/credentials/docuseal.service/secret-key-base";
28
29 systemd.services.docuseal.serviceConfig = {
30 LoadCredential = "secret-key-base:${config.clan.core.vars.generators.docuseal.files.secret-key-base.path}";
31 # relax syscall filter — Rails/Ruby needs more syscalls than the default allows
32 SystemCallFilter = pkgs.lib.mkForce [ ];
33 SystemCallArchitectures = pkgs.lib.mkForce "";
34 };
35
36 services.nginx.virtualHosts."docuseal.lassul.us" = {
37 enableACME = true;
38 forceSSL = true;
39 locations."/" = {
40 proxyPass = "http://127.0.0.1:${toString config.services.docuseal.port}";
41 proxyWebsockets = true;
42 extraConfig = ''
43 proxy_set_header Host $host;
44 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
45 proxy_set_header X-Forwarded-Proto $scheme;
46 '';
47 };
48 };
49}