]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - systems/eldiron/websites/immae/production.nix
Squash changes containing private information
[perso/Immae/Config/Nix.git] / systems / eldiron / websites / immae / production.nix
similarity index 56%
rename from modules/private/websites/immae/production.nix
rename to systems/eldiron/websites/immae/production.nix
index 8b4998f39c42df7de04fed3539e33cce495433cb..e4060ba4852220ee2cee06359a58800ef0c10fc8 100644 (file)
@@ -2,22 +2,26 @@
 let
   cfg = config.myServices.websites.immae.production;
   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";
   docsDir = "/var/lib/buildbot/outputs/immae/docs/";
-  env = config.myEnv.websites.immae;
 in {
   options.myServices.websites.immae.production.enable = lib.mkEnableOption "enable Immae's website";
 
   config = lib.mkIf cfg.enable {
+    myServices.dns.zones."immae.eu".subdomains = with config.myServices.dns.helpers;
+      {
+        www = ips servers.eldiron.ips.production;
+        matrix.CNAME = [ "immae.element.io." ];
+      };
     services.webstats.sites = [ { name = "www.immae.eu"; } ];
 
+    security.acme.certs.immae.domain = "www.immae.eu";
+    security.acme.certs.immae.extraDomainNames = [ "immae.eu" ];
+    services.websites.env.production.bindMounts."${varDir}" = {};
+    services.websites.env.production.bindMounts."${docsDir}" = {};
+    services.websites.env.production.bindMounts."${historyDir}" = {};
     services.websites.env.production.vhostConfs.immae_production = {
       certName     = "immae";
-      addToCerts   = true;
-      certMainHost = "www.immae.eu";
       hosts        = [ "www.immae.eu" "immae.eu" ];
       root         = varDir;
       extraConfig  = [
@@ -44,13 +48,6 @@ 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
@@ -59,14 +56,6 @@ in {
           Header always set Access-Control-Allow-Origin "*"
         </Directory>
 
-        Alias /cours ${coursDir}
-        <Directory ${coursDir}>
-          DirectoryIndex index.htm index.html
-          Options Indexes FollowSymLinks MultiViews Includes
-          AllowOverride All
-          Require all granted
-        </Directory>
-
         Alias /docs ${docsDir}
         <Directory ${docsDir}>
           DirectoryIndex index.htm index.html
@@ -75,63 +64,44 @@ in {
           Require all granted
         </Directory>
 
-        Alias /eurl ${./eurl}
-        <Directory ${./eurl}>
+        Alias /eurl ${./sarl}
+        Alias /eurl ${./sarl}
+        <Directory ${./sarl}>
           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
-          Options Indexes FollowSymLinks MultiViews Includes
-          AllowOverride All
-          Require all granted
-        </Directory>
-
-        Alias /recettes ${recettesDir}
-        <Directory ${recettesDir}>
-          DirectoryIndex index.htm index.html
-          Options Indexes FollowSymLinks MultiViews Includes
-          AllowOverride All
-          Require all granted
-        </Directory>
-
         Alias /history ${historyDir}
         <Directory ${historyDir}>
           DirectoryIndex index.html
           AllowOverride None
           Require all granted
         </Directory>
-        ''
-      ];
-    };
 
-    services.websites.env.production.vhostConfs.immae_fr = {
-      certName    = "immae";
-      addToCerts  = true;
-      hosts       = [ "www.immae.fr" "immae.fr" ];
-      root        = null;
-      extraConfig = [ ''
-        RedirectMatch 301 ^/((?!\.well-known.*$).*)$ https://www.immae.eu/chapeaux/
-        '' ];
-    };
-
-    services.websites.env.production.vhostConfs.immae_bouya = {
-      certName    = "immae";
-      addToCerts  = true;
-      hosts       = [ "bouya.org" "www.bouya.org" ];
-      root        = rechercheDir;
-      extraConfig = [ ''
-        <Directory ${rechercheDir}>
-          DirectoryIndex index.htm index.html
+        Alias /.well-known/chatonsinfos ${config.myServices.chatonsProperties.propertiesPath}
+        <Directory ${config.myServices.chatonsProperties.propertiesPath}>
           Options Indexes FollowSymLinks MultiViews Includes
-          AllowOverride All
+          AllowOverride None
           Require all granted
         </Directory>
-        '' ];
+        ''
+      ];
     };
+
+    myServices.monitoring.fromMasterActivatedPlugins = [ "http" ];
+    myServices.monitoring.fromMasterObjects.service = [
+      {
+        service_description = "blog website is running on immae.eu";
+        host_name = config.hostEnv.fqdn;
+        use = "external-web-service";
+        check_command = ["check_https" "www.immae.eu" "/blog/" "egrep -ri TODO /etc"];
+
+        servicegroups = "webstatus-websites";
+        _webstatus_name = "Immae’s Blog";
+        _webstatus_url = "https://www.immae.eu/blog";
+      }
+    ];
   };
 }