76 lines
1.8 KiB
Nix
Raw Permalink Normal View History

2025-01-21 10:04:14 +01:00
{config, ...}: {
virtualisation.oci-containers.containers."restreamer" = {
image = "docker.io/datarhei/restreamer:latest";
environmentFiles = [config.age.secrets.restreamer-env.path];
2025-03-14 17:32:08 +01:00
# Modified ports to include RTMPS
ports = [
2025-03-15 14:23:47 +01:00
"127.0.0.1:3006:8080" # Web UI
"127.0.0.1:1936:1935" # RTMP
];
volumes = [
"restreamer_data:/core/data"
"restreamer_config:/core/config"
2025-03-14 17:32:08 +01:00
];
2025-01-21 10:04:14 +01:00
extraOptions = ["--add-host=postgres:10.89.0.1" "--ip=10.89.0.13" "--network=web"];
};
2025-03-14 17:32:08 +01:00
# Traefik configuration
services.traefik = {
dynamicConfigOptions = {
http = {
services.restreamer.loadBalancer.servers = [
{
url = "http://localhost:3006/";
}
];
routers.restreamer = {
rule = "Host(`stream.m3tam3re.com`)";
tls = {
certResolver = "godaddy";
};
service = "restreamer";
entrypoints = ["websecure"];
};
};
tcp = {
services = {
rtmp-service.loadBalancer.servers = [
{
2025-03-15 14:23:47 +01:00
address = "localhost:1936";
2025-03-14 17:32:08 +01:00
}
];
rtmps-service.loadBalancer.servers = [
{
2025-03-15 14:23:47 +01:00
address = "localhost:1936";
2025-03-14 17:32:08 +01:00
}
];
};
routers = {
rtmp = {
rule = "HostSNI(`*`)"; # Changed to accept all SNI
service = "rtmp-service";
entryPoints = ["rtmp"];
};
rtmps = {
rule = "HostSNI(`stream.m3tam3re.com`)";
service = "rtmps-service";
entryPoints = ["rtmps"];
tls = {
certResolver = "godaddy";
passthrough = false;
};
};
};
};
};
};
# Firewall configuration
networking.firewall = {
allowedTCPPorts = [80 443 1935 1945];
2025-01-21 10:04:14 +01:00
};
}