]>
Commit | Line | Data |
---|---|---|
1 | { lib, pkgs, config, ... }: | |
2 | let | |
3 | cfg = config.services.myWebsites.Leila; | |
4 | varDir = "/var/lib/ftp/leila"; | |
5 | in { | |
6 | options.services.myWebsites.Leila = { | |
7 | production = { | |
8 | enable = lib.mkEnableOption "enable Leila's website in production"; | |
9 | }; | |
10 | }; | |
11 | ||
12 | config = (lib.mkIf cfg.production.enable { | |
13 | security.acme.certs."leila" = config.services.myCertificates.certConfig // { | |
14 | domain = "leila.bouya.org"; | |
15 | extraDomains = { | |
16 | "chorale.leila.bouya.org" = null; | |
17 | "chorale-vocanta.fr.nf" = null; | |
18 | "www.chorale-vocanta.fr.nf" = null; | |
19 | }; | |
20 | }; | |
21 | ||
22 | services.myPhpfpm.poolConfigs.leila = '' | |
23 | listen = /run/phpfpm/leila.sock | |
24 | user = wwwrun | |
25 | group = wwwrun | |
26 | listen.owner = wwwrun | |
27 | listen.group = wwwrun | |
28 | ||
29 | pm = ondemand | |
30 | pm.max_children = 5 | |
31 | pm.process_idle_timeout = 60 | |
32 | ||
33 | php_admin_value[open_basedir] = "${varDir}:/tmp" | |
34 | ''; | |
35 | ||
36 | services.webstats.sites = [ | |
37 | { name = "leila.bouya.org"; } | |
38 | { name = "chorale.leila.bouya.org"; } | |
39 | ]; | |
40 | ||
41 | services.myWebsites.production.modules = [ "proxy_fcgi" ]; | |
42 | services.myWebsites.production.vhostConfs.leila_chorale = { | |
43 | certName = "leila"; | |
44 | hosts = [ "chorale.leila.bouya.org" "chorale-vocanta.fr.nf" "www.chorale-vocanta.fr.nf" ]; | |
45 | root = "${varDir}/Chorale"; | |
46 | extraConfig = [ | |
47 | '' | |
48 | Use Stats chorale.leila.bouya.org | |
49 | <Directory ${varDir}/Chorale> | |
50 | DirectoryIndex index.php index.htm index.html | |
51 | Options Indexes FollowSymLinks MultiViews Includes | |
52 | AllowOverride None | |
53 | ||
54 | Use LDAPConnect | |
55 | Require ldap-group cn=chorale.leila.bouya.org,cn=httpd,ou=services,dc=immae,dc=eu | |
56 | ||
57 | <FilesMatch "\.php$"> | |
58 | SetHandler "proxy:unix:/run/phpfpm/leila.sock|fcgi://localhost" | |
59 | </FilesMatch> | |
60 | </Directory> | |
61 | '' | |
62 | ]; | |
63 | }; | |
64 | services.myWebsites.production.vhostConfs.leila = { | |
65 | certName = "leila"; | |
66 | hosts = [ "leila.bouya.org" ]; | |
67 | root = varDir; | |
68 | extraConfig = [ | |
69 | '' | |
70 | Use Stats leila.bouya.org | |
71 | <Directory ${varDir}/Chorale> | |
72 | DirectoryIndex index.htm index.html | |
73 | Options Indexes FollowSymLinks MultiViews Includes | |
74 | AllowOverride None | |
75 | ||
76 | Use LDAPConnect | |
77 | Require ldap-group cn=chorale.leila.bouya.org,cn=httpd,ou=services,dc=immae,dc=eu | |
78 | ||
79 | <FilesMatch "\.php$"> | |
80 | SetHandler "proxy:unix:/run/phpfpm/leila.sock|fcgi://localhost" | |
81 | </FilesMatch> | |
82 | </Directory> | |
83 | <Directory ${varDir}> | |
84 | DirectoryIndex index.htm index.html | |
85 | Options Indexes FollowSymLinks MultiViews Includes | |
86 | AllowOverride None | |
87 | Require all granted | |
88 | </Directory> | |
89 | '' | |
90 | ]; | |
91 | }; | |
92 | }); | |
93 | } |