diff options
Diffstat (limited to 'modules/private/websites')
-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 |
3 files changed, 54 insertions, 8 deletions
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; |