aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/private/default.nix2
-rw-r--r--modules/private/websites/default.nix2
-rw-r--r--modules/private/websites/patrick_fodella/production.nix72
3 files changed, 76 insertions, 0 deletions
diff --git a/modules/private/default.nix b/modules/private/default.nix
index 9ea136e..b821488 100644
--- a/modules/private/default.nix
+++ b/modules/private/default.nix
@@ -63,6 +63,8 @@ set = {
63 papaMaisonBbc = ./websites/papa/maison_bbc.nix; 63 papaMaisonBbc = ./websites/papa/maison_bbc.nix;
64 papaSurveillance = ./websites/papa/surveillance.nix; 64 papaSurveillance = ./websites/papa/surveillance.nix;
65 65
66 patrickFodellaProd = ./websites/patrick_fodella/production.nix;
67
66 piedsjalouxInte = ./websites/piedsjaloux/integration.nix; 68 piedsjalouxInte = ./websites/piedsjaloux/integration.nix;
67 piedsjalouxProd = ./websites/piedsjaloux/production.nix; 69 piedsjalouxProd = ./websites/piedsjaloux/production.nix;
68 70
diff --git a/modules/private/websites/default.nix b/modules/private/websites/default.nix
index 9467055..90a8c1a 100644
--- a/modules/private/websites/default.nix
+++ b/modules/private/websites/default.nix
@@ -284,6 +284,8 @@ in
284 maison_bbc.enable = true; 284 maison_bbc.enable = true;
285 }; 285 };
286 286
287 patrick_fodella.production.enable = true;
288
287 piedsjaloux = { 289 piedsjaloux = {
288 integration.enable = true; 290 integration.enable = true;
289 production.enable = true; 291 production.enable = true;
diff --git a/modules/private/websites/patrick_fodella/production.nix b/modules/private/websites/patrick_fodella/production.nix
new file mode 100644
index 0000000..2812cf7
--- /dev/null
+++ b/modules/private/websites/patrick_fodella/production.nix
@@ -0,0 +1,72 @@
1{ lib, pkgs, config, ... }:
2let
3 cfg = config.myServices.websites.patrick_fodella.production;
4 varDir = "/var/lib/ftp/patrick_fodella";
5 apacheUser = config.services.httpd.Prod.user;
6 apacheGroup = config.services.httpd.Prod.group;
7in {
8 options.myServices.websites.patrick_fodella.production.enable = lib.mkEnableOption "enable Patrick Fodella's website";
9
10 config = lib.mkIf cfg.enable {
11 services.webstats.sites = [ { name = "ecolyeu-pessicart-nice.fr"; } ];
12
13 system.activationScripts.patrick_fodella = {
14 deps = [ "httpd" ];
15 text = ''
16 install -m 0755 -o ${apacheUser} -g ${apacheGroup} -d /var/lib/php/sessions/patrick_fodella
17 '';
18 };
19 systemd.services.phpfpm-patrick_fodella.after = lib.mkAfter [ "mysql.service" ];
20 systemd.services.phpfpm-patrick_fodella.wants = [ "mysql.service" ];
21 services.phpfpm.pools.patrick_fodella = {
22 user = apacheUser;
23 group = apacheGroup;
24 settings = {
25 "listen.owner" = apacheUser;
26 "listen.group" = apacheGroup;
27
28 "pm" = "ondemand";
29 "pm.max_children" = "5";
30 "pm.process_idle_timeout" = "60";
31
32 "php_admin_value[open_basedir]" = "/var/lib/php/sessions/patrick_fodella:${varDir}:/tmp";
33 "php_admin_value[session.save_path]" = "/var/lib/php/sessions/patrick_fodella";
34 };
35 phpOptions = config.services.phpfpm.phpOptions + ''
36 disable_functions = "mail"
37 '';
38 phpPackage = pkgs.php72;
39 };
40 services.websites.env.production.modules = [ "proxy_fcgi" ];
41 services.websites.env.production.vhostConfs.patrick_fodella = {
42 certName = "patrick_fodella";
43 certMainHost = "ecolyeu-pessicart-nice.fr";
44 hosts = ["ecolyeu-pessicart-nice.fr" "www.ecolyeu-pessicart-nice.fr" ];
45 root = varDir;
46 extraConfig = [
47 ''
48 Use Stats ecolyeu-pessicart-nice.fr
49
50 RewriteEngine on
51 RewriteCond "%{HTTP_HOST}" "!^www\.ecolyeu-pessicart-nice\.fr$" [NC]
52 RewriteRule ^(.+)$ https://www.ecolyeu-pessicart-nice.fr$1 [R=302,L]
53
54 <FilesMatch "\.php$">
55 SetHandler "proxy:unix:${config.services.phpfpm.pools.patrick_fodella.socket}|fcgi://localhost"
56 </FilesMatch>
57
58 <Location /xmlrpc.php>
59 AllowOverride None
60 Require all denied
61 </Location>
62 <Directory ${varDir}>
63 DirectoryIndex index.php index.htm index.html
64 Options Indexes FollowSymLinks MultiViews Includes
65 AllowOverride all
66 Require all granted
67 </Directory>
68 ''
69 ];
70 };
71 };
72}