add owncast server and change mpd stream urls to mpd.owo.monster/{quality}

This commit is contained in:
chaos 2023-10-27 16:44:17 +01:00
parent 15d9bd5483
commit 1fa594fab9
No known key found for this signature in database
8 changed files with 86 additions and 16 deletions

View file

@ -27,5 +27,5 @@ in {
}; };
programs.zsh.shellAliases.mpv-ontop = "mpv --profile=ontop"; programs.zsh.shellAliases.mpv-ontop = "mpv --profile=ontop";
programs.zsh.shellAliases.listen = '' programs.zsh.shellAliases.listen = ''
mpv "https://music:$(cat ${listen-password-file})@stream.owo.monster/mpd/flac" --cache=yes --cache-pause-initial=yes --cache-pause-wait=5''; mpv "https://music:$(cat ${listen-password-file})@mpd.owo.monster/flac" --cache=yes --cache-pause-initial=yes --cache-pause-wait=5'';
} }

View file

@ -79,7 +79,7 @@ in {
}; };
}; };
services.nginx.virtualHosts."stream.owo.monster" = let services.nginx.virtualHosts."mpd.owo.monster" = let
extraConfig = '' extraConfig = ''
auth_basic "Music Password"; auth_basic "Music Password";
auth_basic_user_file ${pathInContainer containerSecrets.music_stream_passwd.path}; auth_basic_user_file ${pathInContainer containerSecrets.music_stream_passwd.path};
@ -89,13 +89,13 @@ in {
enableACME = true; enableACME = true;
locations = mkMerge [ locations = mkMerge [
{ {
"/mpd/flac" = { "/flac" = {
proxyPass = "http://${containerIP}:${toString ports.mpd-flac}"; proxyPass = "http://${containerIP}:${toString ports.mpd-flac}";
inherit extraConfig; inherit extraConfig;
}; };
} }
(mkMerge (forEach ["low" "medium" "high"] (quality: { (mkMerge (forEach ["low" "medium" "high"] (quality: {
"/mpd/opus-${quality}" = { "/opus-${quality}" = {
proxyPass = "http://${containerIP}:${toString ports."mpd-opus-${quality}"}"; proxyPass = "http://${containerIP}:${toString ports."mpd-opus-${quality}"}";
inherit extraConfig; inherit extraConfig;
}; };

View file

@ -82,16 +82,6 @@ hard_delete = true
type = alias type = alias
remote = B2-Chaos-Public-Source:Chaos-Public remote = B2-Chaos-Public-Source:Chaos-Public
[B2-Chaos-Media-Source]
type = b2
account = B2_CHAOS_MEDIA_ACCOUNT
key = B2_CHAOS_MEDIA_KEY
hard_delete = true
[B2-Chaos-Media]
type = alias
remote = B2-Chaos-Media-Source:Chaos-Media
[B2-Phoenix-Cryptidz-Storage-Source] [B2-Phoenix-Cryptidz-Storage-Source]
type = b2 type = b2
account = B2_PHOENIX_CRYPTIDZ_STORAGE_ACCOUNT account = B2_PHOENIX_CRYPTIDZ_STORAGE_ACCOUNT

View file

@ -21,7 +21,6 @@
"api-keys/data/backblaze/Chaos-Music" "api-keys/data/backblaze/Chaos-Music"
"api-keys/data/backblaze/Chaos-Personal" "api-keys/data/backblaze/Chaos-Personal"
"api-keys/data/backblaze/Chaos-Public" "api-keys/data/backblaze/Chaos-Public"
"api-keys/data/backblaze/Chaos-Media"
"api-keys/data/backblaze/Phoenix-Cryptidz-Storage" "api-keys/data/backblaze/Phoenix-Cryptidz-Storage"
"api-keys/data/storage/restic/Music" "api-keys/data/storage/restic/Music"
@ -208,7 +207,6 @@
simple_get_replace_b2 "/api-keys/backblaze/Chaos-Music" "B2_CHAOS_MUSIC" ./template simple_get_replace_b2 "/api-keys/backblaze/Chaos-Music" "B2_CHAOS_MUSIC" ./template
simple_get_replace_b2 "/api-keys/backblaze/Chaos-Personal" "B2_CHAOS_PERSONAL" ./template simple_get_replace_b2 "/api-keys/backblaze/Chaos-Personal" "B2_CHAOS_PERSONAL" ./template
simple_get_replace_b2 "/api-keys/backblaze/Chaos-Public" "B2_CHAOS_PUBLIC" ./template simple_get_replace_b2 "/api-keys/backblaze/Chaos-Public" "B2_CHAOS_PUBLIC" ./template
simple_get_replace_b2 "/api-keys/backblaze/Chaos-Media" "B2_CHAOS_MEDIA" ./template
simple_get_replace_b2 "/api-keys/backblaze/Phoenix-Cryptidz-Storage" "B2_PHOENIX_CRYPTIDZ_STORAGE" ./template simple_get_replace_b2 "/api-keys/backblaze/Phoenix-Cryptidz-Storage" "B2_PHOENIX_CRYPTIDZ_STORAGE" ./template
PUTIO_PASSWORD="token/$(simple_get /api-keys/putio .oauth_token)" PUTIO_PASSWORD="token/$(simple_get /api-keys/putio .oauth_token)"

View file

@ -0,0 +1,72 @@
{
self,
hostPath,
tree,
inputs,
pkgs,
config,
...
}: let
containerName = "stream";
containerAddresses = import "${hostPath}/data/containerAddresses.nix";
hostIP = containerAddresses.host;
containerIP = containerAddresses.containers.${containerName};
in {
containers.stream = {
autoStart = true;
privateNetwork = true;
hostAddress = hostIP;
localAddress = containerIP;
specialArgs = {
inherit inputs;
inherit tree;
inherit self;
inherit hostPath;
};
config = {...}: {
nixpkgs.pkgs = pkgs;
imports = with tree;
[
presets.nixos.containerBase
]
++ (with hosts.hetzner-arm.containers.stream.profiles; [
owncast
]);
networking.firewall.allowedTCPPorts = [
1935
8080
];
home-manager.users.root.home.stateVersion = "23.05";
system.stateVersion = "23.05";
};
};
services.nginx.virtualHosts."stream.owo.monster" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://${containerIP}:8080";
proxyWebsockets = true;
};
};
networking = {
nat.forwardPorts = [
{
sourcePort = 1935;
destination = "${containerIP}\:1935";
}
];
firewall.allowedTCPPorts = [
1935
];
};
}

View file

@ -0,0 +1,8 @@
{...}: {
services.owncast = {
enable = true;
listen = "0.0.0.0";
port = 8080;
rtmp-port = 1935;
};
}

View file

@ -9,5 +9,6 @@
postgresql = "10.0.1.7"; postgresql = "10.0.1.7";
piped-fi = "10.0.1.8"; piped-fi = "10.0.1.8";
caldav = "10.0.1.9"; caldav = "10.0.1.9";
stream = "10.0.1.10";
}; };
} }

View file

@ -29,6 +29,7 @@ in {
"mail" "mail"
"forgejo" "forgejo"
"caldav" "caldav"
"stream"
] (name: ./containers + "/${name}")) ] (name: ./containers + "/${name}"))
++ (with hosts.hetzner-arm.profiles; [ ++ (with hosts.hetzner-arm.profiles; [
staticSites staticSites