]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Add discourse capitaine landing page
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Sun, 5 Jan 2020 19:18:32 +0000 (20:18 +0100)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Sun, 5 Jan 2020 19:18:32 +0000 (20:18 +0100)
modules/private/monitoring/objects_immae-eu.nix
modules/private/websites/capitaines/discourse_static/discourse.png [new file with mode: 0644]
modules/private/websites/capitaines/discourse_static/index.html [new file with mode: 0644]
modules/private/websites/capitaines/production.nix

index 3dda999d8982860575440f7a4d4477fb988c21c4..a1d1adb74dc842a0a46fe7a7b7443e78674b9e92 100644 (file)
@@ -110,11 +110,6 @@ in
     }
 
     #### Web scenarios
-    {
-      service_description = "discourse website is running on discourse.capitaines.fr";
-      freshness_threshold = "1800";
-    }
-
     {
       service_description = "Default website site is running on ns208507.ip-188-165-209.eu";
       freshness_threshold = "1800";
diff --git a/modules/private/websites/capitaines/discourse_static/discourse.png b/modules/private/websites/capitaines/discourse_static/discourse.png
new file mode 100644 (file)
index 0000000..91ce42d
Binary files /dev/null and b/modules/private/websites/capitaines/discourse_static/discourse.png differ
diff --git a/modules/private/websites/capitaines/discourse_static/index.html b/modules/private/websites/capitaines/discourse_static/index.html
new file mode 100644 (file)
index 0000000..4c2ead0
--- /dev/null
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html lang='en'>
+  <head>
+    <meta content='text/html; charset=UTF-8' http-equiv='Content-Type'>
+    <title>This instance is now closed - Discourse</title>
+    <style>
+      body {
+        text-align: center;
+        background: #f9f9f9;
+        font-family: sans-serif;
+      }
+      img {
+        max-width: 235px;
+        width: 100%;
+      }
+      h1 {
+        font-size: 20px;
+        font-weight: 400;
+      }
+    </style>
+  </head>
+  <body>
+    <div>
+      <img alt='Discourse capitaines' src='/discourse.png'>
+      <h1>Sorry, this instance is closed now.</h1>
+    </div>
+  </body>
+</html>
index 044ff1d04b56137f5e443bf3725b23e581384960..ee1698b0b5aca4f66d960019e58d19cdd6bf122b 100644 (file)
@@ -1,17 +1,15 @@
 { lib, pkgs, config,  ... }:
 let
-    cfg = config.myServices.websites.capitaines.production;
-    env = config.myEnv.websites.capitaines;
-    webappName = "capitaines_mastodon";
-    root = "/run/current-system/webapps/${webappName}";
-    siteDir = ./mastodon_static;
+  cfg = config.myServices.websites.capitaines.production;
+  env = config.myEnv.websites.capitaines;
 in {
   options.myServices.websites.capitaines.production.enable = lib.mkEnableOption "enable Capitaines's website";
 
   config = lib.mkIf cfg.enable {
-    myServices.websites.webappDirs."${webappName}" = siteDir;
-
-    services.websites.env.production.vhostConfs.capitaines_mastodon = {
+    myServices.websites.webappDirs.capitaines_mastodon = ./mastodon_static;
+    services.websites.env.production.vhostConfs.capitaines_mastodon = let
+      root = "/run/current-system/webapps/capitaines_mastodon";
+    in {
       certName     = "capitaines";
       certMainHost = "mastodon.capitaines.fr";
       hosts        = [ "mastodon.capitaines.fr" ];
@@ -28,6 +26,26 @@ in {
       ];
     };
 
+    myServices.websites.webappDirs.capitaines_discourse = ./discourse_static;
+    services.websites.env.production.vhostConfs.capitaines_discourse = let
+      root = "/run/current-system/webapps/capitaines_discourse";
+    in {
+      certName     = "capitaines";
+      addToCerts   = true;
+      hosts        = [ "discourse.capitaines.fr" ];
+      root         = root;
+      extraConfig  = [
+        ''
+        ErrorDocument 404 /index.html
+        <Directory ${root}>
+          DirectoryIndex index.html
+          Options Indexes FollowSymLinks MultiViews Includes
+          Require all granted
+        </Directory>
+          ''
+      ];
+    };
+
     services.websites.env.production.vhostConfs.capitaines = {
       certName   = "capitaines";
       addToCerts = true;