diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-09-07 10:59:55 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-09-07 11:01:44 +0200 |
commit | 93531b30f0c08f6c549fac338a1cb8070c3c0a9a (patch) | |
tree | 895aa5fc23d8ee2aea30ae7afcd7d07a95fb2bf4 /modules | |
parent | 6551e648310639c215b3b8ea79066df761d950e1 (diff) | |
download | Nix-93531b30f0c08f6c549fac338a1cb8070c3c0a9a.tar.gz Nix-93531b30f0c08f6c549fac338a1cb8070c3c0a9a.tar.zst Nix-93531b30f0c08f6c549fac338a1cb8070c3c0a9a.zip |
Add Telio Tortay website
Diffstat (limited to 'modules')
-rw-r--r-- | modules/private/default.nix | 1 | ||||
-rw-r--r-- | modules/private/websites/default.nix | 1 | ||||
-rw-r--r-- | modules/private/websites/teliotortay/production.nix | 76 |
3 files changed, 78 insertions, 0 deletions
diff --git a/modules/private/default.nix b/modules/private/default.nix index 5f97f7f..cf15499 100644 --- a/modules/private/default.nix +++ b/modules/private/default.nix | |||
@@ -32,6 +32,7 @@ set = { | |||
32 | ludivinecassalProd = ./websites/ludivinecassal/production.nix; | 32 | ludivinecassalProd = ./websites/ludivinecassal/production.nix; |
33 | nassimeProd = ./websites/nassime/production.nix; | 33 | nassimeProd = ./websites/nassime/production.nix; |
34 | naturaloutilProd = ./websites/naturaloutil/production.nix; | 34 | naturaloutilProd = ./websites/naturaloutil/production.nix; |
35 | telioTortayProd = ./websites/teliotortay/production.nix; | ||
35 | papaSurveillance = ./websites/papa/surveillance.nix; | 36 | papaSurveillance = ./websites/papa/surveillance.nix; |
36 | piedsjalouxInte = ./websites/piedsjaloux/integration.nix; | 37 | piedsjalouxInte = ./websites/piedsjaloux/integration.nix; |
37 | piedsjalouxProd = ./websites/piedsjaloux/production.nix; | 38 | piedsjalouxProd = ./websites/piedsjaloux/production.nix; |
diff --git a/modules/private/websites/default.nix b/modules/private/websites/default.nix index 63dd53d..f55f7e3 100644 --- a/modules/private/websites/default.nix +++ b/modules/private/websites/default.nix | |||
@@ -248,6 +248,7 @@ in | |||
248 | nassime.production.enable = true; | 248 | nassime.production.enable = true; |
249 | 249 | ||
250 | naturaloutil.production.enable = true; | 250 | naturaloutil.production.enable = true; |
251 | telioTortay.production.enable = true; | ||
251 | 252 | ||
252 | papa.surveillance.enable = true; | 253 | papa.surveillance.enable = true; |
253 | 254 | ||
diff --git a/modules/private/websites/teliotortay/production.nix b/modules/private/websites/teliotortay/production.nix new file mode 100644 index 0000000..445117d --- /dev/null +++ b/modules/private/websites/teliotortay/production.nix | |||
@@ -0,0 +1,76 @@ | |||
1 | { lib, pkgs, config, myconfig, ... }: | ||
2 | let | ||
3 | adminer = pkgs.callPackage ../commons/adminer.nix {}; | ||
4 | cfg = config.myServices.websites.telioTortay.production; | ||
5 | varDir = "/var/lib/ftp/telio_tortay"; | ||
6 | env = myconfig.env.websites.telioTortay; | ||
7 | in { | ||
8 | options.myServices.websites.telioTortay.production.enable = lib.mkEnableOption "enable Telio Tortay's website"; | ||
9 | |||
10 | config = lib.mkIf cfg.enable { | ||
11 | services.webstats.sites = [ { name = "telio-tortay.immae.eu"; } ]; | ||
12 | |||
13 | security.acme.certs."ftp".extraDomains."telio-tortay.immae.eu" = null; | ||
14 | |||
15 | system.activationScripts.telio-tortay = { | ||
16 | deps = [ "httpd" ]; | ||
17 | text = '' | ||
18 | install -m 0755 -o wwwrun -g wwwrun -d /var/lib/ftp/telio_tortay/logs | ||
19 | install -m 0755 -o wwwrun -g wwwrun -d /var/lib/php/sessions/telio-tortay | ||
20 | ''; | ||
21 | }; | ||
22 | systemd.services.phpfpm-telio-tortay.after = lib.mkAfter [ "mysql.service" ]; | ||
23 | systemd.services.phpfpm-telio-tortay.wants = [ "mysql.service" ]; | ||
24 | services.phpfpm.pools.telio-tortay = { | ||
25 | listen = "/run/phpfpm/telio-tortay.sock"; | ||
26 | extraConfig = '' | ||
27 | user = wwwrun | ||
28 | group = wwwrun | ||
29 | listen.owner = wwwrun | ||
30 | listen.group = wwwrun | ||
31 | |||
32 | pm = ondemand | ||
33 | pm.max_children = 5 | ||
34 | pm.process_idle_timeout = 60 | ||
35 | |||
36 | php_admin_value[open_basedir] = "/var/lib/php/sessions/telio-tortay:${varDir}:/tmp" | ||
37 | php_admin_value[session.save_path] = "/var/lib/php/sessions/telio-tortay" | ||
38 | ''; | ||
39 | phpOptions = config.services.phpfpm.phpOptions + '' | ||
40 | disable_functions = "mail" | ||
41 | extension=${pkgs.php}/lib/php/extensions/mysqli.so | ||
42 | ''; | ||
43 | }; | ||
44 | services.websites.env.production.modules = adminer.apache.modules ++ [ "proxy_fcgi" ]; | ||
45 | services.websites.env.production.vhostConfs.telio-tortay = { | ||
46 | certName = "telio-tortay"; | ||
47 | certMainHost = "telio-tortay.immae.eu"; | ||
48 | hosts = ["telio-tortay.immae.eu" "os-tv.fr" ]; | ||
49 | root = varDir; | ||
50 | extraConfig = [ | ||
51 | adminer.apache.vhostConf | ||
52 | '' | ||
53 | Use Stats telio-tortay.immae.eu | ||
54 | ServerAdmin ${env.server_admin} | ||
55 | ErrorLog "${varDir}/logs/error_log" | ||
56 | CustomLog "${varDir}/logs/access_log" combined | ||
57 | |||
58 | <FilesMatch "\.php$"> | ||
59 | SetHandler "proxy:unix:/run/phpfpm/telio-tortay.sock|fcgi://localhost" | ||
60 | </FilesMatch> | ||
61 | |||
62 | <Directory ${varDir}/logs> | ||
63 | AllowOverride None | ||
64 | Require all denied | ||
65 | </Directory> | ||
66 | <Directory ${varDir}> | ||
67 | DirectoryIndex index.php index.htm index.html | ||
68 | Options Indexes FollowSymLinks MultiViews Includes | ||
69 | AllowOverride all | ||
70 | Require all granted | ||
71 | </Directory> | ||
72 | '' | ||
73 | ]; | ||
74 | }; | ||
75 | }; | ||
76 | } | ||