about summary refs log tree commit diff
path: root/ops/modules/www/inbox.tvl.su.nix
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-12-27T11·53+0300
committertazjin <tazjin@tvl.su>2022-12-28T08·17+0000
commit62e19a83216d6294b4c3469d3e05e7f0d00db69d (patch)
tree56c958536bdce4805d8b7c06cf6f0abaf6bb68a6 /ops/modules/www/inbox.tvl.su.nix
parentfe4cdff4426327be15ffa8e98f6c2b278dd9c84d (diff)
feat(web/inbox): add landing page for inbox.tvl.su r/5515
This landing page explains how to use the public-inbox.

Change-Id: I37d74decad5173ab35051970593f1d28001af2b4
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7645
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
Diffstat (limited to 'ops/modules/www/inbox.tvl.su.nix')
-rw-r--r--ops/modules/www/inbox.tvl.su.nix11
1 files changed, 9 insertions, 2 deletions
diff --git a/ops/modules/www/inbox.tvl.su.nix b/ops/modules/www/inbox.tvl.su.nix
index a9af18e3481b..38db5d2a8eda 100644
--- a/ops/modules/www/inbox.tvl.su.nix
+++ b/ops/modules/www/inbox.tvl.su.nix
@@ -1,4 +1,4 @@
-{ config, ... }:
+{ config, depot, ... }:
 
 {
   imports = [
@@ -11,10 +11,17 @@
       forceSSL = true;
 
       extraConfig = ''
+        # nginx is incapable of serving a single file at /, hence this hack:
         location = / {
-          return 302 https://inbox.tvl.su/depot;
+          index /landing-page;
         }
 
+        location = /landing-page {
+          types { } default_type "text/html; charset=utf-8";
+          alias ${depot.web.inbox};
+        }
+
+        # rest of requests is proxied to public-inbox-httpd
         location / {
           proxy_pass http://localhost:${toString config.services.public-inbox.http.port};
         }