]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - modules/private/websites/leila/production.nix
Upgrade nixos
[perso/Immae/Config/Nix.git] / modules / private / websites / leila / production.nix
CommitLineData
f8026b6e
IB
1{ lib, pkgs, config, ... }:
2let
3 cfg = config.myServices.websites.leila.production;
4 varDir = "/var/lib/ftp/leila";
5in {
2a670f71 6 options.myServices.websites.leila.production.enable = lib.mkEnableOption "enable Leila's websites in production";
f8026b6e
IB
7
8 config = lib.mkIf cfg.enable {
441da8aa 9 services.phpfpm.pools.leila = {
5400b9b6
IB
10 user = "wwwrun";
11 group = "wwwrun";
12 settings = {
13 "listen.owner" = "wwwrun";
14 "listen.group" = "wwwrun";
f8026b6e 15
5400b9b6
IB
16 "pm" = "ondemand";
17 "pm.max_children" = "5";
18 "pm.process_idle_timeout" = "60";
f8026b6e 19
5400b9b6
IB
20 "php_admin_value[open_basedir]" = "${varDir}:/tmp";
21 };
441da8aa 22 };
f8026b6e
IB
23
24 services.webstats.sites = [
25 { name = "leila.bouya.org"; }
26 { name = "chorale.leila.bouya.org"; }
2a670f71 27 { name = "syrwennecreation.bouya.org"; }
f8026b6e
IB
28 ];
29
29f8cb85
IB
30 services.websites.env.production.modules = [ "proxy_fcgi" ];
31 services.websites.env.production.vhostConfs.leila_chorale = {
f8026b6e
IB
32 certName = "leila";
33 addToCerts = true;
34 hosts = [ "chorale.leila.bouya.org" "chorale-vocanta.fr.nf" "www.chorale-vocanta.fr.nf" ];
35 root = "${varDir}/Chorale";
36 extraConfig = [
37 ''
38 Use Stats chorale.leila.bouya.org
39 <Directory ${varDir}/Chorale>
40 DirectoryIndex index.php index.htm index.html
41 Options Indexes FollowSymLinks MultiViews Includes
42 AllowOverride None
43
44 Use LDAPConnect
45 Require ldap-group cn=chorale.leila.bouya.org,cn=httpd,ou=services,dc=immae,dc=eu
46
2a670f71 47 <FilesMatch "\.php$">
5400b9b6 48 SetHandler "proxy:unix:${config.services.phpfpm.pools.leila.socket}|fcgi://localhost"
2a670f71
IB
49 </FilesMatch>
50 </Directory>
51 ''
52 ];
53 };
54 services.websites.env.production.vhostConfs.leila_syrwenne = {
55 certName = "leila";
56 addToCerts = true;
57 hosts = [ "syrwennecreation.bouya.org" ];
58 root = "${varDir}/Syrwennecreation";
59 extraConfig = [
60 ''
61 Use Stats syrwennecreation.bouya.org
62 <Directory ${varDir}/Syrwennecreation>
63 DirectoryIndex index.php index.htm index.html
64 Options Indexes FollowSymLinks MultiViews Includes
65 AllowOverride None
66
f8026b6e 67 <FilesMatch "\.php$">
5400b9b6 68 SetHandler "proxy:unix:${config.services.phpfpm.pools.leila.socket}|fcgi://localhost"
f8026b6e
IB
69 </FilesMatch>
70 </Directory>
71 ''
72 ];
73 };
29f8cb85 74 services.websites.env.production.vhostConfs.leila = {
f8026b6e
IB
75 certName = "leila";
76 certMainHost = "leila.bouya.org";
77 hosts = [ "leila.bouya.org" ];
78 root = varDir;
79 extraConfig = [
80 ''
81 Use Stats leila.bouya.org
82 <Directory ${varDir}/Chorale>
83 DirectoryIndex index.htm index.html
84 Options Indexes FollowSymLinks MultiViews Includes
85 AllowOverride None
86
87 Use LDAPConnect
88 Require ldap-group cn=chorale.leila.bouya.org,cn=httpd,ou=services,dc=immae,dc=eu
89
90 <FilesMatch "\.php$">
5400b9b6 91 SetHandler "proxy:unix:${config.services.phpfpm.pools.leila.socket}|fcgi://localhost"
f8026b6e
IB
92 </FilesMatch>
93 </Directory>
94 <Directory ${varDir}>
95 DirectoryIndex index.htm index.html
96 Options Indexes FollowSymLinks MultiViews Includes
97 AllowOverride None
98 Require all granted
99 </Directory>
100 ''
101 ];
102 };
103 };
104}