summaryrefslogtreecommitdiffstats
path: root/lass/2configs/radio.nix
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2020-04-18 09:32:52 +0200
committerlassulus <lassulus@lassul.us>2020-04-18 09:32:52 +0200
commitfae3c95c6c32c67c7d0c67bf466890a1ffee803d (patch)
treed8ed1b42adfd220ad64053639c28b82d10e7cbb4 /lass/2configs/radio.nix
parent8772a311a82040c187a04df3f5393c3083780db8 (diff)
l radio: add REST api
Diffstat (limited to 'lass/2configs/radio.nix')
-rw-r--r--lass/2configs/radio.nix24
1 files changed, 24 insertions, 0 deletions
diff --git a/lass/2configs/radio.nix b/lass/2configs/radio.nix
index 60659d043..9da0a499c 100644
--- a/lass/2configs/radio.nix
+++ b/lass/2configs/radio.nix
@@ -146,6 +146,7 @@ in {
tables = {
filter.INPUT.rules = [
{ predicate = "-p tcp --dport 8000"; target = "ACCEPT"; }
+ { predicate = "-i retiolum -p tcp --dport 8001"; target = "ACCEPT"; }
];
};
};
@@ -259,6 +260,29 @@ in {
];
};
+ krebs.htgen.radio = {
+ port = 8001;
+ user = {
+ name = "radio";
+ };
+ script = ''
+ case "$Method $Request_URI" in
+ "POST /skip")
+ ${skip_track}/bin/skip_track
+ exit
+ ;;
+ "POST /good")
+ ${good_track}/bin/good_track
+ exit
+ ;;
+ "POST /current")
+ ${print_current}/bin/print_current
+ exit
+ ;;
+ esac
+ '';
+ };
+
services.nginx = {
enable = true;
virtualHosts."radio.lassul.us" = {