]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - modules/private/websites/leila/production.nix
Add bitlbee plugins
[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";
d3452fc5
IB
5 apacheUser = config.services.httpd.Prod.user;
6 apacheGroup = config.services.httpd.Prod.group;
f8026b6e 7in {
2a670f71 8 options.myServices.websites.leila.production.enable = lib.mkEnableOption "enable Leila's websites in production";
f8026b6e
IB
9
10 config = lib.mkIf cfg.enable {
441da8aa 11 services.phpfpm.pools.leila = {
d3452fc5
IB
12 user = apacheUser;
13 group = apacheGroup;
5400b9b6 14 settings = {
d3452fc5
IB
15 "listen.owner" = apacheUser;
16 "listen.group" = apacheGroup;
f8026b6e 17
73f88539
IB
18 "pm" = "dynamic";
19 "pm.max_children" = "20";
20 "pm.start_servers" = "2";
21 "pm.min_spare_servers" = "1";
22 "pm.max_spare_servers" = "3";
f8026b6e 23
5400b9b6 24 "php_admin_value[open_basedir]" = "${varDir}:/tmp";
b26e1b45
IB
25 "php_admin_value[max_execution_time]" = "1800";
26 };
ca367c14
IB
27 phpOptions = config.services.phpfpm.phpOptions + ''
28 disable_functions = "mail"
29 '';
2053ddac 30 phpPackage = pkgs.php72.withExtensions({ enabled, all }: enabled ++ [ all.imagick ]);
b26e1b45
IB
31 phpEnv = {
32 PATH = lib.makeBinPath [ pkgs.imagemagick ];
5400b9b6 33 };
441da8aa 34 };
f8026b6e
IB
35
36 services.webstats.sites = [
37 { name = "leila.bouya.org"; }
38 { name = "chorale.leila.bouya.org"; }
2a670f71 39 { name = "syrwennecreation.bouya.org"; }
f8026b6e
IB
40 ];
41
29f8cb85
IB
42 services.websites.env.production.modules = [ "proxy_fcgi" ];
43 services.websites.env.production.vhostConfs.leila_chorale = {
f8026b6e
IB
44 certName = "leila";
45 addToCerts = true;
46 hosts = [ "chorale.leila.bouya.org" "chorale-vocanta.fr.nf" "www.chorale-vocanta.fr.nf" ];
47 root = "${varDir}/Chorale";
48 extraConfig = [
49 ''
50 Use Stats chorale.leila.bouya.org
51 <Directory ${varDir}/Chorale>
52 DirectoryIndex index.php index.htm index.html
53 Options Indexes FollowSymLinks MultiViews Includes
54 AllowOverride None
55
56 Use LDAPConnect
57 Require ldap-group cn=chorale.leila.bouya.org,cn=httpd,ou=services,dc=immae,dc=eu
58
2a670f71 59 <FilesMatch "\.php$">
5400b9b6 60 SetHandler "proxy:unix:${config.services.phpfpm.pools.leila.socket}|fcgi://localhost"
2a670f71
IB
61 </FilesMatch>
62 </Directory>
63 ''
64 ];
65 };
66 services.websites.env.production.vhostConfs.leila_syrwenne = {
67 certName = "leila";
68 addToCerts = true;
69 hosts = [ "syrwennecreation.bouya.org" ];
70 root = "${varDir}/Syrwennecreation";
71 extraConfig = [
72 ''
73 Use Stats syrwennecreation.bouya.org
74 <Directory ${varDir}/Syrwennecreation>
75 DirectoryIndex index.php index.htm index.html
76 Options Indexes FollowSymLinks MultiViews Includes
77 AllowOverride None
78
f8026b6e 79 <FilesMatch "\.php$">
5400b9b6 80 SetHandler "proxy:unix:${config.services.phpfpm.pools.leila.socket}|fcgi://localhost"
f8026b6e
IB
81 </FilesMatch>
82 </Directory>
83 ''
84 ];
85 };
29f8cb85 86 services.websites.env.production.vhostConfs.leila = {
f8026b6e
IB
87 certName = "leila";
88 certMainHost = "leila.bouya.org";
89 hosts = [ "leila.bouya.org" ];
90 root = varDir;
91 extraConfig = [
92 ''
93 Use Stats leila.bouya.org
94 <Directory ${varDir}/Chorale>
95 DirectoryIndex index.htm index.html
96 Options Indexes FollowSymLinks MultiViews Includes
97 AllowOverride None
98
99 Use LDAPConnect
100 Require ldap-group cn=chorale.leila.bouya.org,cn=httpd,ou=services,dc=immae,dc=eu
101
102 <FilesMatch "\.php$">
5400b9b6 103 SetHandler "proxy:unix:${config.services.phpfpm.pools.leila.socket}|fcgi://localhost"
f8026b6e
IB
104 </FilesMatch>
105 </Directory>
106 <Directory ${varDir}>
107 DirectoryIndex index.htm index.html
108 Options Indexes FollowSymLinks MultiViews Includes
109 AllowOverride None
110 Require all granted
111 </Directory>
112 ''
113 ];
114 };
115 };
116}