]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - nixops/modules/websites/ftp/leila.nix
Start moving websites configuration to modules
[perso/Immae/Config/Nix.git] / nixops / modules / websites / ftp / leila.nix
CommitLineData
b7ee93fc 1{ lib, pkgs, config, ... }:
c336bac4
IB
2let
3 cfg = config.services.myWebsites.Leila;
4 varDir = "/var/lib/ftp/leila";
5in {
6 options.services.myWebsites.Leila = {
7 production = {
8 enable = lib.mkEnableOption "enable Leila's website in production";
9 };
10 };
11
c336bac4
IB
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
9eae2b47 36 services.webstats.sites = [
b7ee93fc
IB
37 { name = "leila.bouya.org"; }
38 { name = "chorale.leila.bouya.org"; }
c336bac4
IB
39 ];
40
daf64e3f
IB
41 services.websites.production.modules = [ "proxy_fcgi" ];
42 services.websites.production.vhostConfs.leila_chorale = {
c336bac4
IB
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 };
daf64e3f 64 services.websites.production.vhostConfs.leila = {
c336bac4
IB
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}