]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Fix maison bbc website and monitoring
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Tue, 3 Mar 2020 16:02:47 +0000 (17:02 +0100)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Tue, 3 Mar 2020 16:02:47 +0000 (17:02 +0100)
modules/acme2.nix
modules/private/monitoring/plugins/check_maison_bbc
modules/private/websites/papa/maison_bbc.nix

index 6c6d9a7a4c2211c1fd93d3e10b2de4f82390bf35..b22e4ccc3e7687f51b103f82656cdb5ae743bfd7 100644 (file)
@@ -232,7 +232,8 @@ in
                     # gets changed, the activation phase restarts it, meaning
                     # the permissions of the StateDirectory get adjusted
                     # according to the specified group
-                    RemainAfterExit = true;
+                    # Edit: Timers will never run because of this
+                    # RemainAfterExit = true;
                     SuccessExitStatus = [ "0" "1" ];
                     User = data.user;
                     Group = data.group;
index 43a5817aa4befa7bad65c12411dc39ad0b52645b..4a2f7991c80f3729b49257820d7a2a24e952ddf4 100755 (executable)
@@ -6,10 +6,10 @@
 alert=$(date +"%F %H:%M:%S" -d "3 hours ago")
 res=$(curl https://maison.bbc.bouya.org/stats.php)
 
-ignored_text="th_hr Exterieure th_hr Soufflage"
+ignored_text="Exterieure Soufflage Mezzanine"
 
-ignored_bat="^$"
-ignored="^(th_hr Exterieure|th_hr Soufflage)$"
+ignored_bat="^(Temp_Nord|Exterieure|Soufflage|Mezzanine)$"
+ignored="^(th_hr Exterieure|th_hr Soufflage|th_hr Mezzanine)$"
 
 missing() {
   echo "to_entries|[.[]|select(.value < \"$alert\" and .key != \"bat\" $1)|.key + \": \" + .value]|join(\" ; \")"
index 7295de81a01120707bfdc726017e805db37fbded..eb61b6d95e02f78672e7a18013a481c7c263c8b9 100644 (file)
@@ -23,6 +23,7 @@ in {
         php_admin_value[open_basedir] = "${varDir}"
         '';
       phpOptions = config.services.phpfpm.phpOptions + ''
+        date.timezone = 'Europe/Paris'
         extension=${pkgs.php}/lib/php/extensions/mysqli.so
         '';
     };
@@ -33,6 +34,7 @@ in {
       root         = varDir;
       extraConfig  = [
         ''
+        Alias /.well-known/acme-challenge ${config.security.acme2.certs.papa.webroot}/.well-known/acme-challenge
         RedirectMatch 301 ^/((?!(\.well-known|add.php).*$).*)$ https://maison.bbc.bouya.org/$1
         <Directory ${varDir}>
           DirectoryIndex index.php index.htm index.html
@@ -41,6 +43,11 @@ in {
           <FilesMatch "\.php$">
             SetHandler "proxy:unix:/run/phpfpm/papa_maison_bbc.sock|fcgi://localhost"
           </FilesMatch>
+        </Directory>
+        <Directory "${config.security.acme2.certs.papa.webroot}">
+          Options Indexes FollowSymLinks
+          AllowOverride None
+          Require all granted
         </Directory>
           ''
       ];