summaryrefslogtreecommitdiffstats
path: root/lass
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2023-01-07 23:35:39 +0100
committerlassulus <lassulus@lassul.us>2023-01-07 23:35:39 +0100
commit917889f8fcd9a6f4659dc46047d063333c2bb2a9 (patch)
treec4898025b0815edaf8b90bc0cef5ab271c86e8f4 /lass
parentb0b89a392b8ed402c73801e2488da34397786b6b (diff)
l neoprism.r: host radio.r container
Diffstat (limited to 'lass')
-rw-r--r--lass/1systems/neoprism/config.nix5
-rw-r--r--lass/2configs/radio/container-host.nix23
2 files changed, 28 insertions, 0 deletions
diff --git a/lass/1systems/neoprism/config.nix b/lass/1systems/neoprism/config.nix
index f203abc07..8e5a60c36 100644
--- a/lass/1systems/neoprism/config.nix
+++ b/lass/1systems/neoprism/config.nix
@@ -4,8 +4,13 @@
imports = [
<stockholm/lass>
<stockholm/lass/2configs/retiolum.nix>
+
+ # sync-containers
<stockholm/lass/2configs/consul.nix>
<stockholm/lass/2configs/yellow-host.nix>
+ <stockholm/lass/2configs/radio/container-host.nix>
+
+ # other containers
<stockholm/lass/2configs/riot.nix>
];
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 <secrets>}/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'
+ '';
+ };
+}