]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - modules/private/websites/tools/tools/default.nix
Move csp report credentials out of the store
[perso/Immae/Config/Nix.git] / modules / private / websites / tools / tools / default.nix
index cdfc7eb29e32befea94b8cfb715c3a2805467125..7903ca55984a51d997d773510e30dbe154796e33 100644 (file)
@@ -17,7 +17,7 @@ let
   wallabag = pkgs.callPackage ./wallabag.nix {
     wallabag = pkgs.webapps.wallabag.override {
       composerEnv = pkgs.composerEnv.override {
-        php = pkgs.php73.withExtensions(e: pkgs.php73.enabledExtensions ++ [e.tidy]);
+        php = pkgs.php73.withExtensions({ enabled, all }: enabled ++ [all.tidy]);
       };
     };
     env = config.myEnv.tools.wallabag;
@@ -55,6 +55,9 @@ let
   dmarc-reports = pkgs.callPackage ./dmarc_reports.nix {
     env = config.myEnv.tools.dmarc_reports;
   };
+  csp-reports = pkgs.callPackage ./csp_reports.nix {
+    env = config.myEnv.tools.csp_reports;
+  };
 
   landing = pkgs.callPackage ./landing.nix {};
 
@@ -74,6 +77,7 @@ in {
       ++ wallabag.keys
       ++ yourls.keys
       ++ dmarc-reports.keys
+      ++ csp-reports.keys
       ++ webhooks.keys;
 
     services.duplyBackup.profiles = {
@@ -112,6 +116,7 @@ in {
         ''
           Timeout 600
           ProxyTimeout 600
+          Header always set Content-Security-Policy-Report-Only "${config.myEnv.tools.csp_reports.policies.inline}"
           <Directory "/var/lib/ftp/devtools.immae.eu">
             DirectoryIndex index.php index.htm index.html
             AllowOverride all
@@ -167,8 +172,8 @@ in {
             Options -Indexes
           </Directory>
 
-          Alias /BIP39 /var/lib/buildbot/outputs/bip39
-          <Directory "/var/lib/buildbot/outputs/bip39">
+          Alias /BIP39 /var/lib/buildbot/outputs/immae/bip39
+          <Directory "/var/lib/buildbot/outputs/immae/bip39">
             DirectoryIndex index.html
             AllowOverride None
             Require all granted
@@ -301,6 +306,7 @@ in {
             "/run/wrappers/bin/sendmail" landing "/tmp"
             "${config.secrets.location}/webapps/webhooks"
           ];
+          "include" = "${config.secrets.location}/webapps/tools-csp-reports.conf";
         };
         phpEnv = {
           CONTACT_EMAIL = config.myEnv.tools.contact;
@@ -321,7 +327,7 @@ in {
 
           "php_admin_value[open_basedir]" = "/run/wrappers/bin/sendmail:/var/lib/ftp/devtools.immae.eu:/tmp";
         };
-        phpPackage = pkgs.php72.withExtensions(e: pkgs.php72.enabledExtensions ++ [e.mysqli e.redis e.apcu e.opcache ]);
+        phpPackage = pkgs.php72.withExtensions({ enabled, all }: enabled ++ [all.mysqli all.redis all.apcu all.opcache ]);
       };
       adminer = adminer.phpFpm;
       ttrss = {
@@ -334,7 +340,7 @@ in {
         user = "wwwrun";
         group = "wwwrun";
         settings = wallabag.phpFpm.pool;
-        phpPackage = pkgs.php73.withExtensions(e: pkgs.php73.enabledExtensions ++ [e.tidy]);
+        phpPackage = pkgs.php73.withExtensions({ enabled, all }: enabled ++ [all.tidy]);
       };
       yourls = {
         user = "wwwrun";