aboutsummaryrefslogtreecommitdiff
path: root/modules/private/websites/evariste
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2020-03-25 00:34:28 +0100
committerIsmaël Bouya <ismael.bouya@normalesup.org>2020-03-25 00:34:28 +0100
commitab97f6e7a32d37e3aefc260d8b8ed35a40261518 (patch)
tree67c5f13aa9e3e5ab8899304a1cf75ac5545760d0 /modules/private/websites/evariste
parent360b270415155fb5eaade600b5bff90bc695a245 (diff)
downloadNix-ab97f6e7a32d37e3aefc260d8b8ed35a40261518.tar.gz
Nix-ab97f6e7a32d37e3aefc260d8b8ed35a40261518.tar.zst
Nix-ab97f6e7a32d37e3aefc260d8b8ed35a40261518.zip
Add evariste website
Diffstat (limited to 'modules/private/websites/evariste')
-rw-r--r--modules/private/websites/evariste/production.nix101
1 files changed, 101 insertions, 0 deletions
diff --git a/modules/private/websites/evariste/production.nix b/modules/private/websites/evariste/production.nix
new file mode 100644
index 0000000..00e6fe1
--- /dev/null
+++ b/modules/private/websites/evariste/production.nix
@@ -0,0 +1,101 @@
1{ lib, pkgs, config, ... }:
2let
3 cfg = config.myServices.websites.evariste.production;
4 nsiVarDir = "/var/lib/ftp/nsievariste";
5 stmgVarDir = "/var/lib/ftp/stmgevariste";
6in {
7 options.myServices.websites.evariste.production.enable = lib.mkEnableOption "enable NSI/STMG Evariste website";
8
9 config = lib.mkIf cfg.enable {
10 services.webstats.sites = [
11 { name = "nsievariste.immae.eu"; }
12 { name = "stmgevariste.immae.eu"; }
13 ];
14
15 services.websites.env.production.modules = [ "proxy_fcgi" ];
16 system.activationScripts.evariste = {
17 deps = [ "httpd" ];
18 text = ''
19 install -m 0755 -o wwwrun -g wwwrun -d /var/lib/php/sessions/nsievariste
20 install -m 0755 -o wwwrun -g wwwrun -d /var/lib/php/sessions/stmgevariste
21 '';
22 };
23 services.phpfpm.pools.nsievariste = {
24 listen = "/run/phpfpm/nsievariste.sock";
25 extraConfig = ''
26 user = wwwrun
27 group = wwwrun
28 listen.owner = wwwrun
29 listen.group = wwwrun
30
31 pm = ondemand
32 pm.max_children = 5
33 pm.process_idle_timeout = 60
34
35 php_admin_value[open_basedir] = "/var/lib/php/sessions/nsievariste:${nsiVarDir}:/tmp"
36 php_admin_value[session.save_path] = "/var/lib/php/sessions/nsievariste"
37 '';
38 };
39 services.websites.env.production.vhostConfs.nsievariste = {
40 certName = "eldiron";
41 addToCerts = true;
42 hosts = ["nsievariste.immae.eu" ];
43 root = nsiVarDir;
44 extraConfig = [
45 ''
46 Use Stats nsievariste.immae.eu
47
48 <FilesMatch "\.php$">
49 SetHandler "proxy:unix:/run/phpfpm/nsievariste.sock|fcgi://localhost"
50 </FilesMatch>
51
52 <Directory ${nsiVarDir}>
53 DirectoryIndex index.php index.htm index.html
54 Options Indexes FollowSymLinks MultiViews Includes
55 AllowOverride None
56 Require all granted
57 </Directory>
58 ''
59 ];
60 };
61
62 services.phpfpm.pools.stmgevariste = {
63 listen = "/run/phpfpm/stmgevariste.sock";
64 extraConfig = ''
65 user = wwwrun
66 group = wwwrun
67 listen.owner = wwwrun
68 listen.group = wwwrun
69
70 pm = ondemand
71 pm.max_children = 5
72 pm.process_idle_timeout = 60
73
74 php_admin_value[open_basedir] = "/var/lib/php/sessions/stmgevariste:${stmgVarDir}:/tmp"
75 php_admin_value[session.save_path] = "/var/lib/php/sessions/stmgevariste"
76 '';
77 };
78 services.websites.env.production.vhostConfs.stmgevariste = {
79 certName = "eldiron";
80 addToCerts = true;
81 hosts = ["stmgevariste.immae.eu" ];
82 root = stmgVarDir;
83 extraConfig = [
84 ''
85 Use Stats stmgevariste.immae.eu
86
87 <FilesMatch "\.php$">
88 SetHandler "proxy:unix:/run/phpfpm/stmgevariste.sock|fcgi://localhost"
89 </FilesMatch>
90
91 <Directory ${stmgVarDir}>
92 DirectoryIndex index.php index.htm index.html
93 Options Indexes FollowSymLinks MultiViews Includes
94 AllowOverride None
95 Require all granted
96 </Directory>
97 ''
98 ];
99 };
100 };
101}