1 { config, pkgs, lib, ... }:
3 cfg = config.myServices.websites.tools.cryptpad;
4 envCfg = config.myEnv.tools.cryptpad;
5 domain = "cryptpad.immae.eu";
7 configFile = pkgs.writeText "config.js" ''
8 // ${pkgs.cryptpad}/lib/node_modules/cryptpad/config/config.example.js
10 httpUnsafeOrigin: 'https://${domain}',
11 httpPort: ${toString port},
12 adminEmail: '${envCfg.email}',
13 filePath: './datastore/',
14 archivePath: './data/archive',
15 pinPath: './data/pins',
16 taskPath: './data/tasks',
19 blobStagingPath: './data/blobstage',
20 decreePath: './data/decrees',
21 logPath: './data/logs',
27 maxUploadSize: 100 * 1024 * 1024,
28 adminKeys: ${builtins.toJSON envCfg.admins},
33 options.myServices.websites.tools.cryptpad.enable = lib.mkEnableOption "Enable Cryptpad";
34 config = lib.mkIf cfg.enable {
35 myServices.dns.zones."immae.eu".subdomains.cryptpad =
36 with config.myServices.dns.helpers; ips servers.eldiron.ips.main;
38 myServices.chatonsProperties.hostings.cryptpad = {
39 file.datetime = "2022-08-21T01:20:00";
42 description = "Collaboration suite, encrypted and open-source";
43 website = "https://cryptpad.immae.eu/";
44 logo = "https://cryptpad.immae.eu/customize/favicon/main-favicon.png";
47 status.description = "OK";
48 registration.load = "OPEN";
49 install.type = "PACKAGE";
52 myServices.chatonsProperties.services.cryptpad = {
53 file.datetime = "2022-08-21T01:20:00";
56 description = "Collaboration suite, encrypted and open-source";
57 website = "https://cryptpad.immae.eu/";
58 logo = "https://cryptpad.immae.eu/customize/favicon/main-favicon.png";
60 status.description = "OK";
61 registration."" = ["NONE" "FREE" "MEMBER" "CLIENT"];
62 registration.load = "OPEN";
63 install.type = "PACKAGE";
67 website = "https://cryptpad.org/";
68 license.url = "https://github.com/xwiki-labs/cryptpad/blob/main/LICENSE";
69 license.name = "GNU Affero General Public License v3.0";
70 version = pkgs.cryptpad.version;
71 source.url = "https://github.com/xwiki-labs/cryptpad";
74 myServices.tools.cryptpad.farm.hosts.immaeEu = {
78 services.borgBackup.profiles.global.includedPaths = [
81 services.websites.env.tools.modules = [ "proxy_wstunnel" ];
82 security.acme.certs.eldiron.extraDomainNames = [ domain ];
83 services.websites.env.tools.vhostConfs.cryptpad = {
86 root = config.myServices.tools.cryptpad.farm.vhostRoots.immaeEu;
88 config.myServices.tools.cryptpad.farm.vhosts.immaeEu