summaryrefslogtreecommitdiffstats
path: root/lass/2configs/radio/container-host.nix
blob: e32095ffa3edc35cdffa983d00f8332bac566c3a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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'
    '';
  };
}