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/isabelle/iridologie.nix | |
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/isabelle/iridologie.nix')
-rw-r--r-- | modules/private/websites/isabelle/iridologie.nix | 113 |
1 files changed, 0 insertions, 113 deletions
diff --git a/modules/private/websites/isabelle/iridologie.nix b/modules/private/websites/isabelle/iridologie.nix deleted file mode 100644 index cd733c1..0000000 --- a/modules/private/websites/isabelle/iridologie.nix +++ /dev/null | |||
@@ -1,113 +0,0 @@ | |||
1 | { lib, pkgs, config, ... }: | ||
2 | let | ||
3 | icfg = config.myEnv.websites.isabelle.iridologie; | ||
4 | cfg = config.myServices.websites.isabelle.iridologie; | ||
5 | app = pkgs.callPackage ./iridologie_app { | ||
6 | inherit (icfg) environment; | ||
7 | inherit (pkgs.webapps) spip; | ||
8 | varDir = "/var/lib/isabelle_iridologie"; | ||
9 | }; | ||
10 | |||
11 | apacheUser = config.services.httpd.Prod.user; | ||
12 | apacheGroup = config.services.httpd.Prod.group; | ||
13 | secretsPath = config.secrets.fullPaths."websites/isabelle/iridologie"; | ||
14 | in { | ||
15 | options.myServices.websites.isabelle.iridologie.enable = lib.mkEnableOption "enable Iridologie's website"; | ||
16 | |||
17 | config = lib.mkIf cfg.enable { | ||
18 | secrets.keys."websites/isabelle/iridologie" = { | ||
19 | user = apacheUser; | ||
20 | group = apacheGroup; | ||
21 | permissions = "0400"; | ||
22 | text = '' | ||
23 | SetEnv SPIP_CONFIG_DIR "${./config}" | ||
24 | SetEnv SPIP_VAR_DIR "${app.varDir}" | ||
25 | SetEnv SPIP_SITE "iridologie-${app.environment}" | ||
26 | SetEnv SPIP_LDAP_BASE "dc=immae,dc=eu" | ||
27 | SetEnv SPIP_LDAP_HOST "ldaps://ldap.immae.eu" | ||
28 | SetEnv SPIP_LDAP_SEARCH_DN "${icfg.ldap.dn}" | ||
29 | SetEnv SPIP_LDAP_SEARCH_PW "${icfg.ldap.password}" | ||
30 | SetEnv SPIP_LDAP_SEARCH "${icfg.ldap.filter}" | ||
31 | SetEnv SPIP_MYSQL_HOST "${icfg.mysql.host}" | ||
32 | SetEnv SPIP_MYSQL_PORT "${icfg.mysql.port}" | ||
33 | SetEnv SPIP_MYSQL_DB "${icfg.mysql.database}" | ||
34 | SetEnv SPIP_MYSQL_USER "${icfg.mysql.user}" | ||
35 | SetEnv SPIP_MYSQL_PASSWORD "${icfg.mysql.password}" | ||
36 | ''; | ||
37 | }; | ||
38 | services.webstats.sites = [ { name = "iridologie.icommandeur.org"; } ]; | ||
39 | |||
40 | systemd.services.phpfpm-isabelle_iridologie.after = lib.mkAfter [ "mysql.service" ]; | ||
41 | systemd.services.phpfpm-isabelle_iridologie.wants = [ "mysql.service" ]; | ||
42 | services.phpfpm.pools.isabelle_iridologie = { | ||
43 | user = config.services.httpd.Prod.user; | ||
44 | group = config.services.httpd.Prod.group; | ||
45 | settings = { | ||
46 | "listen.owner" = "${apacheUser}"; | ||
47 | "listen.group" = "${apacheGroup}"; | ||
48 | "php_admin_value[upload_max_filesize]" = "20M"; | ||
49 | "php_admin_value[post_max_size]" = "20M"; | ||
50 | #"php_admin_flag[log_errors]" = "on"; | ||
51 | "php_admin_value[open_basedir]" = "${app.spipConfig}:${./config}:${app}:${app.varDir}:/tmp"; | ||
52 | "php_admin_value[session.save_path]" = "${app.varDir}/phpSessions"; | ||
53 | "pm" = "dynamic"; | ||
54 | "pm.max_children" = "20"; | ||
55 | "pm.start_servers" = "2"; | ||
56 | "pm.min_spare_servers" = "1"; | ||
57 | "pm.max_spare_servers" = "3"; | ||
58 | }; | ||
59 | phpPackage = pkgs.php72; | ||
60 | }; | ||
61 | system.activationScripts.isabelle_iridologie = { | ||
62 | deps = [ "wrappers" ]; | ||
63 | text = '' | ||
64 | install -m 0755 -o ${apacheUser} -g ${apacheGroup} -d ${app.varDir} ${app.varDir}/IMG ${app.varDir}/tmp ${app.varDir}/local | ||
65 | install -m 0750 -o ${apacheUser} -g ${apacheGroup} -d ${app.varDir}/phpSessions | ||
66 | ''; | ||
67 | }; | ||
68 | services.websites.env.production.modules = [ "proxy_fcgi" ]; | ||
69 | services.websites.env.production.vhostConfs.isabelle_iridologie = { | ||
70 | certName = "isabelle"; | ||
71 | addToCerts = true; | ||
72 | hosts = [ "iridologie.icommandeur.org" "icommandeur.org" "www.icommandeur.org" ]; | ||
73 | root = app.webRoot; | ||
74 | extraConfig = [ | ||
75 | '' | ||
76 | RewriteEngine On | ||
77 | RewriteCond "%{HTTP_HOST}" "!^iridologie\.icommandeur\.org$" [NC] | ||
78 | RewriteRule ^(.+)$ https://iridologie.icommandeur.org$1 [R=302,L] | ||
79 | |||
80 | Include ${secretsPath} | ||
81 | |||
82 | RewriteEngine On | ||
83 | |||
84 | <FilesMatch "\.php$"> | ||
85 | SetHandler "proxy:unix:${config.services.phpfpm.pools.isabelle_iridologie.socket}|fcgi://localhost" | ||
86 | </FilesMatch> | ||
87 | |||
88 | <Directory ${app.webRoot}> | ||
89 | DirectoryIndex index.php index.htm index.html | ||
90 | Options -Indexes +FollowSymLinks +MultiViews +Includes | ||
91 | Include ${app.webRoot}/htaccess.txt | ||
92 | |||
93 | AllowOverride AuthConfig FileInfo Limit | ||
94 | Require all granted | ||
95 | </Directory> | ||
96 | |||
97 | <DirectoryMatch "${app.webRoot}/squelettes"> | ||
98 | Require all denied | ||
99 | </DirectoryMatch> | ||
100 | |||
101 | <FilesMatch "(.htaccess|rewrite-rules|.gitignore)$"> | ||
102 | Require all denied | ||
103 | </FilesMatch> | ||
104 | |||
105 | Use Stats iridologie.icommandeur.org | ||
106 | '' | ||
107 | ]; | ||
108 | }; | ||
109 | services.websites.env.production.watchPaths = [ | ||
110 | secretsPath | ||
111 | ]; | ||
112 | }; | ||
113 | } | ||