summaryrefslogtreecommitdiffstats
path: root/lass/2configs/radio.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2021-08-05 21:20:17 +0200
committermakefu <github@syntax-fehler.de>2021-08-05 21:20:17 +0200
commitc177a49ca38b8c1022638deaff2dc4eefda655f3 (patch)
tree201c4245203da92228c99f0940871a996e2efee7 /lass/2configs/radio.nix
parenta072b9a49b6ee50bfdd57f62a3f60087e98c7c02 (diff)
parentba6a5456e8d76b9c1eae7cd81dca3f2b16359ba2 (diff)
Merge remote-tracking branch 'lass/master'
Diffstat (limited to 'lass/2configs/radio.nix')
-rw-r--r--lass/2configs/radio.nix15
1 files changed, 14 insertions, 1 deletions
diff --git a/lass/2configs/radio.nix b/lass/2configs/radio.nix
index a474b0ebc..b1e1ed4d9 100644
--- a/lass/2configs/radio.nix
+++ b/lass/2configs/radio.nix
@@ -225,7 +225,7 @@ in {
${pkgs.mpc_cli}/bin/mpc idle player > /dev/null
${pkgs.mpc_cli}/bin/mpc current -f %file%
done | while read track; do
- listeners=$(${pkgs.iproute}/bin/ss -Hno state established 'sport = :8000' | grep '^mptcp' | wc -l)
+ listeners=$(${pkgs.iproute}/bin/ss -Hno state established 'sport = :8000' | grep '^tcp' | wc -l)
echo "$(date -Is)" "$track" | tee -a "$HISTORY_FILE"
echo "$(tail -$LIMIT "$HISTORY_FILE")" > "$HISTORY_FILE"
${set_irc_topic} "playing: $track listeners: $listeners"
@@ -347,6 +347,19 @@ in {
locations."= /recent".extraConfig = ''
alias /tmp/played;
'';
+ locations."= /current".extraConfig = ''
+ proxy_pass http://localhost:8001;
+ '';
+ locations."= /skip".extraConfig = ''
+ proxy_pass http://localhost:8001;
+ '';
+ locations."= /good".extraConfig = ''
+ proxy_pass http://localhost:8001;
+ '';
+ extraConfig = ''
+ add_header 'Access-Control-Allow-Origin' '*';
+ add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
+ '';
};
virtualHosts."lassul.us".locations."= /the_playlist".extraConfig = let
html = pkgs.writeText "index.html" ''