diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-01-05 20:18:32 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-01-05 20:18:32 +0100 |
commit | edba35fea979ba470d7b802bbf3a69749f37b5de (patch) | |
tree | 118b76be29edecb4effd3d56e5bb80cc52052d6d | |
parent | 2a3d1941c30354c0592a50958f1c15108a5bcb9b (diff) | |
download | Nix-edba35fea979ba470d7b802bbf3a69749f37b5de.tar.gz Nix-edba35fea979ba470d7b802bbf3a69749f37b5de.tar.zst Nix-edba35fea979ba470d7b802bbf3a69749f37b5de.zip |
Add discourse capitaine landing page
-rw-r--r-- | modules/private/monitoring/objects_immae-eu.nix | 5 | ||||
-rw-r--r-- | modules/private/websites/capitaines/discourse_static/discourse.png | bin | 0 -> 2440 bytes | |||
-rw-r--r-- | modules/private/websites/capitaines/discourse_static/index.html | 28 | ||||
-rw-r--r-- | modules/private/websites/capitaines/production.nix | 34 |
4 files changed, 54 insertions, 13 deletions
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 | |||
@@ -111,11 +111,6 @@ in | |||
111 | 111 | ||
112 | #### Web scenarios | 112 | #### Web scenarios |
113 | { | 113 | { |
114 | service_description = "discourse website is running on discourse.capitaines.fr"; | ||
115 | freshness_threshold = "1800"; | ||
116 | } | ||
117 | |||
118 | { | ||
119 | service_description = "Default website site is running on ns208507.ip-188-165-209.eu"; | 114 | service_description = "Default website site is running on ns208507.ip-188-165-209.eu"; |
120 | freshness_threshold = "1800"; | 115 | freshness_threshold = "1800"; |
121 | } | 116 | } |
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 --- /dev/null +++ b/modules/private/websites/capitaines/discourse_static/discourse.png | |||
Binary files 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 @@ | |||
1 | <!DOCTYPE html> | ||
2 | <html lang='en'> | ||
3 | <head> | ||
4 | <meta content='text/html; charset=UTF-8' http-equiv='Content-Type'> | ||
5 | <title>This instance is now closed - Discourse</title> | ||
6 | <style> | ||
7 | body { | ||
8 | text-align: center; | ||
9 | background: #f9f9f9; | ||
10 | font-family: sans-serif; | ||
11 | } | ||
12 | img { | ||
13 | max-width: 235px; | ||
14 | width: 100%; | ||
15 | } | ||
16 | h1 { | ||
17 | font-size: 20px; | ||
18 | font-weight: 400; | ||
19 | } | ||
20 | </style> | ||
21 | </head> | ||
22 | <body> | ||
23 | <div> | ||
24 | <img alt='Discourse capitaines' src='/discourse.png'> | ||
25 | <h1>Sorry, this instance is closed now.</h1> | ||
26 | </div> | ||
27 | </body> | ||
28 | </html> | ||
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 @@ | |||
1 | { lib, pkgs, config, ... }: | 1 | { lib, pkgs, config, ... }: |
2 | let | 2 | let |
3 | cfg = config.myServices.websites.capitaines.production; | 3 | cfg = config.myServices.websites.capitaines.production; |
4 | env = config.myEnv.websites.capitaines; | 4 | env = config.myEnv.websites.capitaines; |
5 | webappName = "capitaines_mastodon"; | ||
6 | root = "/run/current-system/webapps/${webappName}"; | ||
7 | siteDir = ./mastodon_static; | ||
8 | in { | 5 | in { |
9 | options.myServices.websites.capitaines.production.enable = lib.mkEnableOption "enable Capitaines's website"; | 6 | options.myServices.websites.capitaines.production.enable = lib.mkEnableOption "enable Capitaines's website"; |
10 | 7 | ||
11 | config = lib.mkIf cfg.enable { | 8 | config = lib.mkIf cfg.enable { |
12 | myServices.websites.webappDirs."${webappName}" = siteDir; | 9 | myServices.websites.webappDirs.capitaines_mastodon = ./mastodon_static; |
13 | 10 | services.websites.env.production.vhostConfs.capitaines_mastodon = let | |
14 | services.websites.env.production.vhostConfs.capitaines_mastodon = { | 11 | root = "/run/current-system/webapps/capitaines_mastodon"; |
12 | in { | ||
15 | certName = "capitaines"; | 13 | certName = "capitaines"; |
16 | certMainHost = "mastodon.capitaines.fr"; | 14 | certMainHost = "mastodon.capitaines.fr"; |
17 | hosts = [ "mastodon.capitaines.fr" ]; | 15 | hosts = [ "mastodon.capitaines.fr" ]; |
@@ -28,6 +26,26 @@ in { | |||
28 | ]; | 26 | ]; |
29 | }; | 27 | }; |
30 | 28 | ||
29 | myServices.websites.webappDirs.capitaines_discourse = ./discourse_static; | ||
30 | services.websites.env.production.vhostConfs.capitaines_discourse = let | ||
31 | root = "/run/current-system/webapps/capitaines_discourse"; | ||
32 | in { | ||
33 | certName = "capitaines"; | ||
34 | addToCerts = true; | ||
35 | hosts = [ "discourse.capitaines.fr" ]; | ||
36 | root = root; | ||
37 | extraConfig = [ | ||
38 | '' | ||
39 | ErrorDocument 404 /index.html | ||
40 | <Directory ${root}> | ||
41 | DirectoryIndex index.html | ||
42 | Options Indexes FollowSymLinks MultiViews Includes | ||
43 | Require all granted | ||
44 | </Directory> | ||
45 | '' | ||
46 | ]; | ||
47 | }; | ||
48 | |||
31 | services.websites.env.production.vhostConfs.capitaines = { | 49 | services.websites.env.production.vhostConfs.capitaines = { |
32 | certName = "capitaines"; | 50 | certName = "capitaines"; |
33 | addToCerts = true; | 51 | addToCerts = true; |