]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - modules/private/websites/immae/production.nix
Add matrix configuration
[perso/Immae/Config/Nix.git] / modules / private / websites / immae / production.nix
index dc89ae33b0895d19b6b7974bb9ef512da3669d15..ff9cf9df3910f5558d450f3f95ce0baf84ea0f60 100644 (file)
@@ -1,10 +1,11 @@
 { lib, pkgs, config,  ... }:
 let
   cfg = config.myServices.websites.immae.production;
-  varDir = "/var/lib/buildbot/outputs/immaeEu";
-  coursDir = "/var/lib/buildbot/outputs/cours";
-  rechercheDir = "/var/lib/buildbot/outputs/recherche";
-  recettesDir = "/var/lib/buildbot/outputs/recettes";
+  varDir = "/var/lib/buildbot/outputs/immae/blog";
+  coursDir = "/var/lib/buildbot/outputs/immae/cours";
+  rechercheDir = "/var/lib/buildbot/outputs/immae/recherche";
+  recettesDir = "/var/lib/buildbot/outputs/immae/recettes";
+  historyDir = "/var/lib/buildbot/outputs/immae/history";
   env = config.myEnv.websites.immae;
 in {
   options.myServices.websites.immae.production.enable = lib.mkEnableOption "enable Immae's website";
@@ -21,10 +22,10 @@ in {
       extraConfig  = [
         ''
         Use Stats www.immae.eu
+        Header always set Strict-Transport-Security "max-age=31536000"
 
         <LocationMatch /.well-known/(webfinger|host-meta)>
           Header always set Referrer-Policy "strict-origin-when-cross-origin"
-          Header always set Strict-Transport-Security "max-age=31536000"
           RequestHeader set X-Forwarded-Proto "https"
 
           RewriteRule ^(.*)$ https://mastodon.immae.eu%{REQUEST_URI} [QSA,L]
@@ -42,6 +43,21 @@ in {
           Require all granted
         </Directory>
 
+        Alias /.well-known/chatonsinfos ${./chatons}
+        <Directory ${./chatons}>
+          Options Indexes FollowSymLinks MultiViews Includes
+          AllowOverride None
+          Require all granted
+        </Directory>
+
+        Alias /.well-known/matrix ${./matrix}
+        <Directory ${./matrix}>
+          Options Indexes FollowSymLinks MultiViews Includes
+          AllowOverride None
+          Require all granted
+          Header always set Access-Control-Allow-Origin "*"
+        </Directory>
+
         Alias /cours ${coursDir}
         <Directory ${coursDir}>
           DirectoryIndex index.htm index.html
@@ -50,6 +66,14 @@ in {
           Require all granted
         </Directory>
 
+        Alias /eurl ${./eurl}
+        <Directory ${./eurl}>
+          DirectoryIndex index.htm index.html
+          Options Indexes FollowSymLinks MultiViews Includes
+          AllowOverride None
+          Require all granted
+        </Directory>
+
         Alias /recherche ${rechercheDir}
         <Directory ${rechercheDir}>
           DirectoryIndex index.htm index.html
@@ -65,6 +89,13 @@ in {
           AllowOverride All
           Require all granted
         </Directory>
+
+        Alias /history ${historyDir}
+        <Directory ${historyDir}>
+          DirectoryIndex index.html
+          AllowOverride None
+          Require all granted
+        </Directory>
         ''
       ];
     };
@@ -83,9 +114,14 @@ in {
       certName    = "immae";
       addToCerts  = true;
       hosts       = [ "bouya.org" "www.bouya.org" ];
-      root        = null;
+      root        = rechercheDir;
       extraConfig = [ ''
-        RedirectMatch 301 ^/((?!\.well-known.*$).*)$ https://www.normalesup.org/~bouya/
+        <Directory ${rechercheDir}>
+          DirectoryIndex index.htm index.html
+          Options Indexes FollowSymLinks MultiViews Includes
+          AllowOverride All
+          Require all granted
+        </Directory>
         '' ];
     };
   };