From 9412c16dfcb7394f4cec07fd78903f4616578d7c Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Sun, 26 Jun 2022 15:57:52 +0200 Subject: 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 :) --- machines/profpatsch/legosi.nix | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'machines') 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; }; }; -- cgit 1.4.1