This commit is contained in:
41666 2024-06-05 23:17:36 -04:00
parent 2d4c3a539e
commit ee7191f1c6
3 changed files with 89 additions and 5 deletions

View file

@ -36,7 +36,7 @@ in rec {
se.servers."${tsHost "sapphic-engineer" 4000}" = {}; se.servers."${tsHost "sapphic-engineer" 4000}" = {};
git.servers."${tsHost "git" 3000}" = {}; git.servers."${tsHost "git" 3000}" = {};
staticsites.servers."${tsHost "static-sites" 80}" = {}; staticsites.servers."${tsHost "static-sites" 80}" = {};
owncast.servers."${tsHost "owncast" 8080}" = {}; ldr.servers."${tsHost "live-doll-repair" 80}" = {};
}; };
proxyCachePath."pdr" = { proxyCachePath."pdr" = {
@ -101,7 +101,7 @@ in rec {
"live.doll.repair" = { "live.doll.repair" = {
locations."/" = { locations."/" = {
recommendedProxySettings = true; recommendedProxySettings = true;
proxyPass = "http://owncast"; proxyPass = "http://ldr";
proxyWebsockets = true; proxyWebsockets = true;
}; };
} // defaultConfig; } // defaultConfig;

View file

@ -7,4 +7,82 @@
networking.hostName = "live-doll-repair"; networking.hostName = "live-doll-repair";
system.stateVersion = "24.05"; system.stateVersion = "24.05";
nixpkgs.hostPlatform = "x86_64-linux"; nixpkgs.hostPlatform = "x86_64-linux";
services.nginx = {
enable = true;
additionalModules = [
pkgs.nginxModules.rtmp
];
virtualHosts."live.doll.repair" = {
locations."/" = {
root = pkgs.writeTextDir "index.html" ''
<!doctype html>
<link href="https://vjs.zencdn.net/8.10.0/video-js.css" rel="stylesheet" />
<style>:root {margin: 0; padding: 0;} video { width: 100vw; height: 100vh; }</style>
<!-- Or if you want the latest version from the main branch -->
<!-- <script src="https://cdn.jsdelivr.net/npm/hls.js@canary"></script> -->
<video id="video" class="video-js" preload="auto" controls autoplay muted data-setup='{"liveui": true, "autoplay": "play", "fluid": true, "liveTracker": { "liveTolerance": 5 }}'>
<source src="https://live.doll.repair/stream/meow.m3u8">
<source src="https://live.doll.repair/stream-dash/meow.mpd">
</video>
<script src="https://vjs.zencdn.net/8.10.0/video.min.js"></script>
<script>
window.HELP_IMPROVE_VIDEOJS = false;
</script>
'';
};
locations."/stream" = {
root = "/tmp";
extraConfig = ''
autoindex on;
add_header Cache-Control no-cache;
types {
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
application/dash+xml mpd;
}
'';
};
locations."/stream-dash" = {
root = "/tmp";
extraConfig = ''
autoindex on;
add_header Cache-Control no-cache;
types {
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
application/dash+xml mpd;
}
'';
};
};
appendConfig = ''
rtmp {
server {
listen 1935;
chunk_size 4096;
application live {
live on;
allow publish 100.64.0.0/10;
deny publish all;
deny play all;
hls on;
hls_path /tmp/stream;
hls_playlist_length 2s;
hls_fragment 1s;
hls_continuous on;
dash on;
dash_path /tmp/stream-dash;
}
}
}
'';
};
} }

View file

@ -52,13 +52,19 @@
}; };
in with ports; [ in with ports; [
(static "aerial" [ node ]) (static "aerial" [ node ])
(static "ps2live" [ node ])
(static "keylime" [ node ])
(static "cider" [ node ]) (static "cider" [ node ])
(static "monitoring" [ node ]) (static "git" [ node ])
(static "ingress-proxy" [ node nginx ]) (static "ingress-proxy" [ node nginx ])
(static "keylime" [ node ])
(static "live-doll-repair" [ node ])
(static "monitoring" [ node ])
(static "nas0" [ node ])
(static "pihole" [ node ])
(static "porcelain-doll-repair" [ node ]) (static "porcelain-doll-repair" [ node ])
(static "ps2live" [ node ])
(static "sapphic-engineer" [ node ]) (static "sapphic-engineer" [ node ])
(static "static-sites" [ node nginx ])
(static "ts3" [ node ])
{ {
job_name = "pve_node"; job_name = "pve_node";
static_configs = [ static_configs = [