From 917889f8fcd9a6f4659dc46047d063333c2bb2a9 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 7 Jan 2023 23:35:39 +0100 Subject: l neoprism.r: host radio.r container --- lass/2configs/radio/container-host.nix | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 lass/2configs/radio/container-host.nix (limited to 'lass/2configs') diff --git a/lass/2configs/radio/container-host.nix b/lass/2configs/radio/container-host.nix new file mode 100644 index 000000000..e32095ffa --- /dev/null +++ b/lass/2configs/radio/container-host.nix @@ -0,0 +1,23 @@ +{ config, pkgs, ... }: +{ + lass.sync-containers3.containers.radio = { + sshKey = "${toString }/radio.sync.key"; + }; + containers.radio = { + bindMounts."/var/music" = { + hostPath = "/var/music"; + isReadOnly = false; + }; + }; + krebs.iptables.tables.filter.INPUT.rules = [ + { predicate = "-p tcp --dport 8000"; target = "ACCEPT"; } + ]; + krebs.htgen.radio-redirect = { + port = 8000; + scriptFile = pkgs.writers.writeDash "redir" '' + printf 'HTTP/1.1 301 Moved Permanently\r\n' + printf "Location: http://radio.lassul.us''${Request_URI}\r\n" + printf '\r\n' + ''; + }; +} -- cgit v1.2.3