about summary refs log tree commit diff
path: root/ops/modules/www/deploys.tvl.fyi.nix
diff options
context:
space:
mode:
authorGriffin Smith <grfn@gws.fyi>2021-05-23T16·18+0200
committergrfn <grfn@gws.fyi>2021-09-10T14·37+0000
commit79b39bb66e39bc1e00e4ceca75f32412e5f4f0de (patch)
tree65f686cd1c95bab9aee0b57ada3004099fc611da /ops/modules/www/deploys.tvl.fyi.nix
parent6e8b6b33741a2fe267c99c9862e7299ca3703729 (diff)
feat(whitby): Serve static HTML dir for deploys.tvl.fyi r/2837
Add a new domain and nginx virtual host at deploys.tvl.fyi, serving out
of a static directory on whitby which is created by systemd-tmpfiles.

This will be used to serve diffs rendered by nix-diff for
pending deploys for whitby

Since this contains stateful data, it is added to the restic backups
on whitby.

Refs: b/110
Change-Id: I5869d40800bbf5fb8fb39878a857f66ff5787830
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3144
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Diffstat (limited to 'ops/modules/www/deploys.tvl.fyi.nix')
-rw-r--r--ops/modules/www/deploys.tvl.fyi.nix20
1 files changed, 20 insertions, 0 deletions
diff --git a/ops/modules/www/deploys.tvl.fyi.nix b/ops/modules/www/deploys.tvl.fyi.nix
new file mode 100644
index 000000000000..9f59651d2b4f
--- /dev/null
+++ b/ops/modules/www/deploys.tvl.fyi.nix
@@ -0,0 +1,20 @@
+{ pkgs, ... }:
+
+{
+  imports = [
+    ./base.nix
+  ];
+
+  config = {
+    # Ensure the directory for deployment diffs exists.
+    systemd.tmpfiles.rules = [
+      "d /var/html/deploys.tvl.fyi 0755 nginx nginx -"
+    ];
+
+    services.nginx.virtualHosts."deploys.tvl.fyi" = {
+      enableACME = true;
+      forceSSL = true;
+      root = "/var/html/deploys.tvl.fyi";
+    };
+  };
+}