about summary refs log tree commit diff
path: root/machines/profpatsch
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2022-06-26 15:57:52 +0200
committerProfpatsch <mail@profpatsch.de>2022-06-26 16:00:52 +0200
commit9412c16dfcb7394f4cec07fd78903f4616578d7c (patch)
treebf856a019aecd380a514c2a2b752c78361d09eb7 /machines/profpatsch
parentc42c6185d05a62d03592349f72fd07024f2bcc02 (diff)
machines/legosi: Add notes and projects server to website
This is not pretty, some of the code lives in vuizvui, some lives in
tvl depot. But at least it seems to work for now :)
Diffstat (limited to 'machines/profpatsch')
-rw-r--r--machines/profpatsch/legosi.nix30
1 files changed, 30 insertions, 0 deletions
diff --git a/machines/profpatsch/legosi.nix b/machines/profpatsch/legosi.nix
index fa19f4b5..8f27d324 100644
--- a/machines/profpatsch/legosi.nix
+++ b/machines/profpatsch/legosi.nix
@@ -19,6 +19,7 @@ let
   xandikosPort = 2345;
   tailscaleInterface = "tailscale0";
   tailscaleAddress = "100.89.52.54";
+  siteServerPort = 2346;
 
 in {
   imports = [
@@ -165,10 +166,39 @@ in {
       virtualHosts.${"profpatsch.de"} = {
         forceSSL = true;
         enableACME = true;
+        # pass exactly / to the static index
         locations."/" = {
           index = "index.html";
           root = pkgs.vuizvui.profpatsch.websiteStatic;
         };
+        # pass the rest to the site server (TODO: make static!)
+        locations."/notes" = {
+          proxyPass = "http://localhost:${toString siteServerPort}";
+        };
+        locations."/projects" = {
+          proxyPass = "http://localhost:${toString siteServerPort}";
+        };
+        locations."/posts" = {
+          proxyPass = "http://localhost:${toString siteServerPort}";
+        };
+
+      };
+    };
+
+    systemd.services.notes-server = {
+      description   = "notes for my website";
+      wantedBy      = [ "multi-user.target" ];
+      after         = [ "network.target" ];
+      serviceConfig = {
+        ExecStart = pkgs.vuizvui.profpatsch.tvl.users.Profpatsch.blog.site-server {
+          port = toString siteServerPort;
+          # TODO: css has to be adjusted for articles
+          # cssFile = pkgs.vuizvui.profpatsch.concatenatedCss;
+          cssFile = null;
+        };
+        Restart = "always";
+        RestartSec = "1s";
+        DynamicUser = true;
       };
     };