]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - nixops/modules/websites/ftp/leila.nix
Fix secret permissions
[perso/Immae/Config/Nix.git] / nixops / modules / websites / ftp / leila.nix
1 { lib, 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 imports = [
13 ../commons/stats.nix
14 ];
15
16 config = (lib.mkIf cfg.production.enable {
17 security.acme.certs."leila" = config.services.myCertificates.certConfig // {
18 domain = "leila.bouya.org";
19 extraDomains = {
20 "chorale.leila.bouya.org" = null;
21 "chorale-vocanta.fr.nf" = null;
22 "www.chorale-vocanta.fr.nf" = null;
23 };
24 };
25
26 services.myPhpfpm.poolConfigs.leila = ''
27 listen = /run/phpfpm/leila.sock
28 user = wwwrun
29 group = wwwrun
30 listen.owner = wwwrun
31 listen.group = wwwrun
32
33 pm = ondemand
34 pm.max_children = 5
35 pm.process_idle_timeout = 60
36
37 php_admin_value[open_basedir] = "${varDir}:/tmp"
38 '';
39
40 services.myWebsites.commons.stats.enable = true;
41 services.myWebsites.commons.stats.sites = [
42 {
43 name = "leila.bouya.org";
44 conf = ./leila_goaccess.conf;
45 }
46 {
47 name = "chorale.leila.bouya.org";
48 conf = ./leila_chorale_goaccess.conf;
49 }
50 ];
51
52 services.myWebsites.production.modules = [ "proxy_fcgi" ];
53 services.myWebsites.production.vhostConfs.leila_chorale = {
54 certName = "leila";
55 hosts = [ "chorale.leila.bouya.org" "chorale-vocanta.fr.nf" "www.chorale-vocanta.fr.nf" ];
56 root = "${varDir}/Chorale";
57 extraConfig = [
58 ''
59 Use Stats chorale.leila.bouya.org
60 <Directory ${varDir}/Chorale>
61 DirectoryIndex index.php index.htm index.html
62 Options Indexes FollowSymLinks MultiViews Includes
63 AllowOverride None
64
65 Use LDAPConnect
66 Require ldap-group cn=chorale.leila.bouya.org,cn=httpd,ou=services,dc=immae,dc=eu
67
68 <FilesMatch "\.php$">
69 SetHandler "proxy:unix:/run/phpfpm/leila.sock|fcgi://localhost"
70 </FilesMatch>
71 </Directory>
72 ''
73 ];
74 };
75 services.myWebsites.production.vhostConfs.leila = {
76 certName = "leila";
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$">
91 SetHandler "proxy:unix:/run/phpfpm/leila.sock|fcgi://localhost"
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 }