]>
Commit | Line | Data |
---|---|---|
1 | { lib, pkgs, config, ... }: | |
2 | let | |
3 | cfg = config.myServices.websites.ressourcerie_banon.cryptpad; | |
4 | envCfg = config.myEnv.tools.cryptpad.ressourcerie_banon; | |
5 | port = envCfg.port; | |
6 | configFile = pkgs.writeText "config.js" '' | |
7 | // ${pkgs.cryptpad}/lib/node_modules/cryptpad/config/config.example.js | |
8 | module.exports = { | |
9 | httpUnsafeOrigin: 'https://${domain}', | |
10 | httpPort: ${toString port}, | |
11 | adminEmail: '${envCfg.email}', | |
12 | filePath: './datastore/', | |
13 | archivePath: './data/archive', | |
14 | pinPath: './data/pins', | |
15 | taskPath: './data/tasks', | |
16 | blockPath: './block', | |
17 | blobPath: './blob', | |
18 | blobStagingPath: './data/blobstage', | |
19 | decreePath: './data/decrees', | |
20 | logPath: './data/logs', | |
21 | logToStdout: false, | |
22 | logLevel: 'info', | |
23 | logFeedback: false, | |
24 | verbose: false, | |
25 | inactiveTime: false, | |
26 | adminKeys: ${builtins.toJSON envCfg.admins}, | |
27 | }; | |
28 | ''; | |
29 | domain = "pad.le-garage-autonome.org"; | |
30 | in { | |
31 | options.myServices.websites.ressourcerie_banon.cryptpad.enable = lib.mkEnableOption "Enable Ressourcerie Banon’s cryptpad"; | |
32 | ||
33 | config = lib.mkIf cfg.enable { | |
34 | myServices.tools.cryptpad.farm.hosts.ressourcerie_banon = { | |
35 | inherit domain port; | |
36 | config = configFile; | |
37 | }; | |
38 | services.websites.env.production.modules = [ "proxy_wstunnel" ]; | |
39 | services.websites.env.production.vhostConfs.ressourcerie_banon_cryptpad = { | |
40 | certName = "ressourcerie_banon"; | |
41 | addToCerts = true; | |
42 | hosts = [domain]; | |
43 | root = config.myServices.tools.cryptpad.farm.vhostRoots.ressourcerie_banon; | |
44 | extraConfig = [ | |
45 | config.myServices.tools.cryptpad.farm.vhosts.ressourcerie_banon | |
46 | ]; | |
47 | }; | |
48 | }; | |
49 | } |