diff --git a/hosts/nixserver/configuration.nix b/hosts/nixserver/configuration.nix index cc1bed2..1330ff9 100755 --- a/hosts/nixserver/configuration.nix +++ b/hosts/nixserver/configuration.nix @@ -109,7 +109,7 @@ dnsProvider = "cloudflare"; email = "cameron@cam123.dev"; environmentFile = "/var/acme/secrets/.env"; - extraDomainNames = [ "jelly.cam123.dev" ]; + extraDomainNames = [ "jelly.cam123.dev" "todo.cam123.dev" ]; }; @@ -134,6 +134,15 @@ recommendedProxySettings = true; }; }; + + "todo.cam123.dev" = { + forceSSL = true; + useACMEHost = "owl.cam123.dev"; + locations."/" = { + proxyPass = "http://127.0.0.1:8090"; + recommendedProxySettings = true; + }; + }; }; }; @@ -148,6 +157,22 @@ }; }; + systemd.services = { + todo-web = { + description = "Todo app"; + after = [ "network.target" ]; + + serviceConfig = { + ExecStart = "/opt/todo/todo-web -a 127.0.0.1 -p 8090 --db /opt/todo/prod.db --static /opt/todo/static"; + Type = "simple"; + Restart = "always"; + }; + + wantedBy = [ "default.target" ]; + requiredBy = [ "network.target" ]; + }; + }; + # Open ports in the firewall. # networking.firewall.allowedTCPPorts = [ ... ]; # networking.firewall.allowedUDPPorts = [ ... ];