From: Ismaƫl Bouya Date: Sun, 5 Jan 2020 19:18:32 +0000 (+0100) Subject: Add discourse capitaine landing page X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FConfig%2FNix.git;a=commitdiff_plain;h=edba35fea979ba470d7b802bbf3a69749f37b5de Add discourse capitaine landing page --- diff --git a/modules/private/monitoring/objects_immae-eu.nix b/modules/private/monitoring/objects_immae-eu.nix index 3dda999..a1d1adb 100644 --- a/modules/private/monitoring/objects_immae-eu.nix +++ b/modules/private/monitoring/objects_immae-eu.nix @@ -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 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 index 0000000..4c2ead0 --- /dev/null +++ b/modules/private/websites/capitaines/discourse_static/index.html @@ -0,0 +1,28 @@ + + + + + This instance is now closed - Discourse + + + +
+ Discourse capitaines +

Sorry, this instance is closed now.

+
+ + diff --git a/modules/private/websites/capitaines/production.nix b/modules/private/websites/capitaines/production.nix index 044ff1d..ee1698b 100644 --- a/modules/private/websites/capitaines/production.nix +++ b/modules/private/websites/capitaines/production.nix @@ -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 + + DirectoryIndex index.html + Options Indexes FollowSymLinks MultiViews Includes + Require all granted + + '' + ]; + }; + services.websites.env.production.vhostConfs.capitaines = { certName = "capitaines"; addToCerts = true;