summaryrefslogtreecommitdiff
path: root/chaski/services/tracktrain.nix
diff options
context:
space:
mode:
authorstuebinm2023-01-27 20:36:12 +0100
committerstuebinm2023-01-27 20:36:12 +0100
commite3a7cbc9bf986d0f27b4808b12899548a4a552c3 (patch)
tree821ae16352599d0f12ddc900d40343a4f5350100 /chaski/services/tracktrain.nix
parent729ea2f3f2b2835fd8262f17225014a326f237b8 (diff)
chaski: tracktrain deployment is no longer live
just keep it as a test deployment at my own domain, so I'm less likely to break it accidentally.
Diffstat (limited to '')
-rw-r--r--chaski/services/tracktrain.nix29
1 files changed, 17 insertions, 12 deletions
diff --git a/chaski/services/tracktrain.nix b/chaski/services/tracktrain.nix
index 34391b0..f1a7d13 100644
--- a/chaski/services/tracktrain.nix
+++ b/chaski/services/tracktrain.nix
@@ -11,6 +11,20 @@ let
'';
phases = [ "buildPhase" ];
};
+
+ tracktrain-config = ''
+ dbstring: "dbname=tracktrain user=tracktrain"
+ gtfs: ./gtfs.zip
+
+ warp:
+ port: 4000
+
+ login:
+ enable: false
+ url: "http://dings"
+ clientname: not
+ clientsecret: used
+ '';
in
{
services.nginx.recommendedProxySettings = true;
@@ -19,16 +33,6 @@ in
proxyPass = "http://192.168.42.41:4000";
proxyWebsockets = true;
};
- # don't expose prometheus endpoint
- locations."/metrics".return = "404";
-
- enableACME = true;
- forceSSL = true;
- extraConfig = ''
- add_header 'Access-Control-Allow-Origin' '*' always;
- '';
- };
- services.nginx.virtualHosts."tracktrain.ilztalbahn.eu" = {
locations."/api" = {
proxyPass = "http://192.168.42.41:4000";
proxyWebsockets = true;
@@ -100,7 +104,8 @@ in
path = [ pkgs.wget ];
script = ''
cd /tmp
- # wget "https://ilztalbahn.eu/wp-content/uploads/2020/07/gtfs.zip"
+ ln -sf ${pkgs.writeText "config.yaml" tracktrain-config} "config.yaml"
+ wget "https://ilztalbahn.eu/wp-content/uploads/2020/07/gtfs.zip"
${stripLib (((import inputs.tracktrain {nixpkgs = pkgs;}))
# have to remove version constraints because some aren't in 22.05
.overrideAttrs (old: { patchPhase = ''
@@ -108,7 +113,7 @@ in
sed -i "s/^>=.*//g" *.cabal
sed -i "s/>=.*//g" *.cabal
''; }))
- }/bin/tracktrain --dbString="dbname=tracktrain user=tracktrain" --warp.port=4000 +RTS -T
+ }/bin/tracktrain +RTS -T
'';
startAt = "daily";
};