diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2023-10-04 01:35:06 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2023-10-04 02:11:48 +0200 |
commit | 1a64deeb894dc95e2645a75771732c6cc53a79ad (patch) | |
tree | 1b9df4838f894577a09b9b260151756272efeb53 /modules/private/websites/ressourcerie_banon | |
parent | fa25ffd4583cc362075cd5e1b4130f33306103f0 (diff) | |
download | Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.gz Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.zst Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.zip |
Squash changes containing private information
There were a lot of changes since the previous commit, but a lot of them
contained personnal information about users. All thos changes got
stashed into a single commit (history is kept in a different place) and
private information was moved in a separate private repository
Diffstat (limited to 'modules/private/websites/ressourcerie_banon')
3 files changed, 0 insertions, 139 deletions
diff --git a/modules/private/websites/ressourcerie_banon/cloud.nix b/modules/private/websites/ressourcerie_banon/cloud.nix deleted file mode 100644 index 5179218..0000000 --- a/modules/private/websites/ressourcerie_banon/cloud.nix +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | { lib, pkgs, config, ... }: | ||
2 | let | ||
3 | cfg = config.myServices.websites.ressourcerie_banon.cloud; | ||
4 | nextcloud = config.myServices.tools.cloud.farm.package; | ||
5 | in { | ||
6 | options.myServices.websites.ressourcerie_banon.cloud.enable = lib.mkEnableOption "enable Ressourcerie Banon’s cloud"; | ||
7 | |||
8 | config = lib.mkIf cfg.enable { | ||
9 | myServices.tools.cloud.farm.instances = [ "ressourcerie_banon" ]; | ||
10 | services.websites.env.production.modules = [ "proxy_fcgi" ]; | ||
11 | services.websites.env.production.vhostConfs.ressourcerie_banon_cloud = { | ||
12 | certName = "ressourcerie_banon"; | ||
13 | addToCerts = true; | ||
14 | hosts = ["cloud.le-garage-autonome.org"]; | ||
15 | root = nextcloud; | ||
16 | extraConfig = [ config.myServices.tools.cloud.farm.vhosts.ressourcerie_banon ]; | ||
17 | }; | ||
18 | }; | ||
19 | } | ||
20 | |||
diff --git a/modules/private/websites/ressourcerie_banon/cryptpad.nix b/modules/private/websites/ressourcerie_banon/cryptpad.nix deleted file mode 100644 index 7aea728..0000000 --- a/modules/private/websites/ressourcerie_banon/cryptpad.nix +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
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 | } | ||
diff --git a/modules/private/websites/ressourcerie_banon/production.nix b/modules/private/websites/ressourcerie_banon/production.nix deleted file mode 100644 index fa00d92..0000000 --- a/modules/private/websites/ressourcerie_banon/production.nix +++ /dev/null | |||
@@ -1,70 +0,0 @@ | |||
1 | { lib, pkgs, config, ... }: | ||
2 | let | ||
3 | cfg = config.myServices.websites.ressourcerie_banon.production; | ||
4 | varDir = "/var/lib/ftp/ressourcerie_banon"; | ||
5 | apacheUser = config.services.httpd.Prod.user; | ||
6 | apacheGroup = config.services.httpd.Prod.group; | ||
7 | in { | ||
8 | options.myServices.websites.ressourcerie_banon.production.enable = lib.mkEnableOption "enable Ressourcerie Banon's website"; | ||
9 | |||
10 | config = lib.mkIf cfg.enable { | ||
11 | services.webstats.sites = [ { name = "ressourcerie-banon.org"; } ]; | ||
12 | |||
13 | system.activationScripts.ressourcerie_banon = { | ||
14 | deps = [ "httpd" ]; | ||
15 | text = '' | ||
16 | install -m 0755 -o ${apacheUser} -g ${apacheGroup} -d /var/lib/php/sessions/ressourcerie_banon | ||
17 | ''; | ||
18 | }; | ||
19 | systemd.services.phpfpm-ressourcerie_banon.after = lib.mkAfter [ "mysql.service" ]; | ||
20 | systemd.services.phpfpm-ressourcerie_banon.wants = [ "mysql.service" ]; | ||
21 | services.phpfpm.pools.ressourcerie_banon = { | ||
22 | user = apacheUser; | ||
23 | group = apacheGroup; | ||
24 | settings = { | ||
25 | "listen.owner" = apacheUser; | ||
26 | "listen.group" = apacheGroup; | ||
27 | |||
28 | "pm" = "ondemand"; | ||
29 | "pm.max_children" = "5"; | ||
30 | "pm.process_idle_timeout" = "60"; | ||
31 | |||
32 | "php_admin_value[open_basedir]" = "/var/lib/php/sessions/ressourcerie_banon:${varDir}:/tmp"; | ||
33 | "php_admin_value[session.save_path]" = "/var/lib/php/sessions/ressourcerie_banon"; | ||
34 | }; | ||
35 | phpOptions = config.services.phpfpm.phpOptions + '' | ||
36 | disable_functions = "mail" | ||
37 | ''; | ||
38 | phpPackage = pkgs.php72; | ||
39 | }; | ||
40 | services.websites.env.production.modules = [ "proxy_fcgi" ]; | ||
41 | services.websites.env.production.vhostConfs.ressourcerie_banon = { | ||
42 | certName = "ressourcerie_banon"; | ||
43 | certMainHost = "ressourcerie-banon.org"; | ||
44 | hosts = ["ressourcerie-banon.org" "www.ressourcerie-banon.org" "ressourcerie-sault.org" "www.ressourcerie-sault.org" "le-garage-autonome.org" | ||
45 | "www.le-garage-autonome.org"]; | ||
46 | root = varDir; | ||
47 | extraConfig = [ | ||
48 | '' | ||
49 | Use Stats ressourcerie-banon.org | ||
50 | |||
51 | RewriteEngine on | ||
52 | RewriteCond "%{HTTP_HOST}" "!^ressourcerie-banon\.org$" [NC] | ||
53 | RewriteRule ^(.+)$ https://ressourcerie-banon.org$1 [R=302,L] | ||
54 | |||
55 | <FilesMatch "\.php$"> | ||
56 | SetHandler "proxy:unix:${config.services.phpfpm.pools.ressourcerie_banon.socket}|fcgi://localhost" | ||
57 | </FilesMatch> | ||
58 | |||
59 | <Directory ${varDir}> | ||
60 | DirectoryIndex index.php index.htm index.html | ||
61 | Options Indexes FollowSymLinks MultiViews Includes | ||
62 | AllowOverride all | ||
63 | Require all granted | ||
64 | </Directory> | ||
65 | '' | ||
66 | ]; | ||
67 | }; | ||
68 | }; | ||
69 | } | ||
70 | |||