diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-03-03 17:02:47 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-03-03 17:02:47 +0100 |
commit | d5b16fe0827745409206fc5df0fe06d8fa293ff7 (patch) | |
tree | fbdec297937798c3e0e62f821395315017a6e146 | |
parent | 10dad16b8bff75321112ff7145bd958d5a6c5546 (diff) | |
download | Nix-d5b16fe0827745409206fc5df0fe06d8fa293ff7.tar.gz Nix-d5b16fe0827745409206fc5df0fe06d8fa293ff7.tar.zst Nix-d5b16fe0827745409206fc5df0fe06d8fa293ff7.zip |
Fix maison bbc website and monitoring
-rw-r--r-- | modules/acme2.nix | 3 | ||||
-rwxr-xr-x | modules/private/monitoring/plugins/check_maison_bbc | 6 | ||||
-rw-r--r-- | modules/private/websites/papa/maison_bbc.nix | 7 |
3 files changed, 12 insertions, 4 deletions
diff --git a/modules/acme2.nix b/modules/acme2.nix index 6c6d9a7..b22e4cc 100644 --- a/modules/acme2.nix +++ b/modules/acme2.nix | |||
@@ -232,7 +232,8 @@ in | |||
232 | # gets changed, the activation phase restarts it, meaning | 232 | # gets changed, the activation phase restarts it, meaning |
233 | # the permissions of the StateDirectory get adjusted | 233 | # the permissions of the StateDirectory get adjusted |
234 | # according to the specified group | 234 | # according to the specified group |
235 | RemainAfterExit = true; | 235 | # Edit: Timers will never run because of this |
236 | # RemainAfterExit = true; | ||
236 | SuccessExitStatus = [ "0" "1" ]; | 237 | SuccessExitStatus = [ "0" "1" ]; |
237 | User = data.user; | 238 | User = data.user; |
238 | Group = data.group; | 239 | Group = data.group; |
diff --git a/modules/private/monitoring/plugins/check_maison_bbc b/modules/private/monitoring/plugins/check_maison_bbc index 43a5817..4a2f799 100755 --- a/modules/private/monitoring/plugins/check_maison_bbc +++ b/modules/private/monitoring/plugins/check_maison_bbc | |||
@@ -6,10 +6,10 @@ | |||
6 | alert=$(date +"%F %H:%M:%S" -d "3 hours ago") | 6 | alert=$(date +"%F %H:%M:%S" -d "3 hours ago") |
7 | res=$(curl https://maison.bbc.bouya.org/stats.php) | 7 | res=$(curl https://maison.bbc.bouya.org/stats.php) |
8 | 8 | ||
9 | ignored_text="th_hr Exterieure th_hr Soufflage" | 9 | ignored_text="Exterieure Soufflage Mezzanine" |
10 | 10 | ||
11 | ignored_bat="^$" | 11 | ignored_bat="^(Temp_Nord|Exterieure|Soufflage|Mezzanine)$" |
12 | ignored="^(th_hr Exterieure|th_hr Soufflage)$" | 12 | ignored="^(th_hr Exterieure|th_hr Soufflage|th_hr Mezzanine)$" |
13 | 13 | ||
14 | missing() { | 14 | missing() { |
15 | echo "to_entries|[.[]|select(.value < \"$alert\" and .key != \"bat\" $1)|.key + \": \" + .value]|join(\" ; \")" | 15 | echo "to_entries|[.[]|select(.value < \"$alert\" and .key != \"bat\" $1)|.key + \": \" + .value]|join(\" ; \")" |
diff --git a/modules/private/websites/papa/maison_bbc.nix b/modules/private/websites/papa/maison_bbc.nix index 7295de8..eb61b6d 100644 --- a/modules/private/websites/papa/maison_bbc.nix +++ b/modules/private/websites/papa/maison_bbc.nix | |||
@@ -23,6 +23,7 @@ in { | |||
23 | php_admin_value[open_basedir] = "${varDir}" | 23 | php_admin_value[open_basedir] = "${varDir}" |
24 | ''; | 24 | ''; |
25 | phpOptions = config.services.phpfpm.phpOptions + '' | 25 | phpOptions = config.services.phpfpm.phpOptions + '' |
26 | date.timezone = 'Europe/Paris' | ||
26 | extension=${pkgs.php}/lib/php/extensions/mysqli.so | 27 | extension=${pkgs.php}/lib/php/extensions/mysqli.so |
27 | ''; | 28 | ''; |
28 | }; | 29 | }; |
@@ -33,6 +34,7 @@ in { | |||
33 | root = varDir; | 34 | root = varDir; |
34 | extraConfig = [ | 35 | extraConfig = [ |
35 | '' | 36 | '' |
37 | Alias /.well-known/acme-challenge ${config.security.acme2.certs.papa.webroot}/.well-known/acme-challenge | ||
36 | RedirectMatch 301 ^/((?!(\.well-known|add.php).*$).*)$ https://maison.bbc.bouya.org/$1 | 38 | RedirectMatch 301 ^/((?!(\.well-known|add.php).*$).*)$ https://maison.bbc.bouya.org/$1 |
37 | <Directory ${varDir}> | 39 | <Directory ${varDir}> |
38 | DirectoryIndex index.php index.htm index.html | 40 | DirectoryIndex index.php index.htm index.html |
@@ -42,6 +44,11 @@ in { | |||
42 | SetHandler "proxy:unix:/run/phpfpm/papa_maison_bbc.sock|fcgi://localhost" | 44 | SetHandler "proxy:unix:/run/phpfpm/papa_maison_bbc.sock|fcgi://localhost" |
43 | </FilesMatch> | 45 | </FilesMatch> |
44 | </Directory> | 46 | </Directory> |
47 | <Directory "${config.security.acme2.certs.papa.webroot}"> | ||
48 | Options Indexes FollowSymLinks | ||
49 | AllowOverride None | ||
50 | Require all granted | ||
51 | </Directory> | ||
45 | '' | 52 | '' |
46 | ]; | 53 | ]; |
47 | }; | 54 | }; |