Compare commits
No commits in common. "updates" and "master" have entirely different histories.
25
Dockerfile
25
Dockerfile
@ -1,15 +1,15 @@
|
|||||||
ARG RESTY_IMAGE_BASE="alpine"
|
ARG RESTY_IMAGE_BASE="alpine"
|
||||||
ARG RESTY_IMAGE_TAG="3.22.1"
|
ARG RESTY_IMAGE_TAG="3.15"
|
||||||
ARG FFMPEG_VERSION=4.4.6
|
ARG FFMPEG_VERSION=4.4
|
||||||
|
|
||||||
##############################
|
##############################
|
||||||
# Build the OpenResty-build image.
|
# Build the OpenResty-build image.
|
||||||
# mostly from https://github.com/openresty/docker-openresty/blob/master/alpine/Dockerfile
|
# mostly from https://github.com/openresty/docker-openresty/blob/master/alpine/Dockerfile
|
||||||
FROM ${RESTY_IMAGE_BASE}:${RESTY_IMAGE_TAG} AS build-openresty
|
FROM ${RESTY_IMAGE_BASE}:${RESTY_IMAGE_TAG} as build-openresty
|
||||||
|
|
||||||
ARG RESTY_IMAGE_BASE
|
ARG RESTY_IMAGE_BASE
|
||||||
ARG RESTY_IMAGE_TAG
|
ARG RESTY_IMAGE_TAG
|
||||||
ARG RESTY_VERSION="1.27.1.2"
|
ARG RESTY_VERSION="1.19.9.1"
|
||||||
ARG RESTY_OPENSSL_VERSION="1.1.1l"
|
ARG RESTY_OPENSSL_VERSION="1.1.1l"
|
||||||
ARG RESTY_OPENSSL_PATCH_VERSION="1.1.1f"
|
ARG RESTY_OPENSSL_PATCH_VERSION="1.1.1f"
|
||||||
ARG RESTY_OPENSSL_URL_BASE="https://www.openssl.org/source"
|
ARG RESTY_OPENSSL_URL_BASE="https://www.openssl.org/source"
|
||||||
@ -162,7 +162,7 @@ RUN cd /tmp \
|
|||||||
|
|
||||||
###############################
|
###############################
|
||||||
# Build the FFmpeg-build image.
|
# Build the FFmpeg-build image.
|
||||||
FROM ${RESTY_IMAGE_BASE}:${RESTY_IMAGE_TAG} AS build-ffmpeg
|
FROM ${RESTY_IMAGE_BASE}:${RESTY_IMAGE_TAG} as build-ffmpeg
|
||||||
ARG FFMPEG_VERSION
|
ARG FFMPEG_VERSION
|
||||||
ARG PREFIX=/usr/local
|
ARG PREFIX=/usr/local
|
||||||
ARG MAKEFLAGS="-j4"
|
ARG MAKEFLAGS="-j4"
|
||||||
@ -232,9 +232,9 @@ RUN rm -rf /var/cache/* /tmp/*
|
|||||||
|
|
||||||
######################################
|
######################################
|
||||||
# Create FAT version of openresty-rtmp
|
# Create FAT version of openresty-rtmp
|
||||||
FROM build-openresty AS build-openresty-fat
|
FROM build-openresty as build-openresty-fat
|
||||||
|
|
||||||
ARG RESTY_LUAROCKS_VERSION="3.12.2"
|
ARG RESTY_LUAROCKS_VERSION="3.7.0"
|
||||||
|
|
||||||
RUN apk add --no-cache --virtual .build-deps \
|
RUN apk add --no-cache --virtual .build-deps \
|
||||||
perl-dev \
|
perl-dev \
|
||||||
@ -249,7 +249,6 @@ RUN apk add --no-cache --virtual .build-deps \
|
|||||||
outils-md5 \
|
outils-md5 \
|
||||||
perl \
|
perl \
|
||||||
unzip \
|
unzip \
|
||||||
wget \
|
|
||||||
&& cd /tmp \
|
&& cd /tmp \
|
||||||
&& curl -fSL https://luarocks.github.io/luarocks/releases/luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz -o luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz \
|
&& curl -fSL https://luarocks.github.io/luarocks/releases/luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz -o luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz \
|
||||||
&& tar xzf luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz \
|
&& tar xzf luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz \
|
||||||
@ -277,9 +276,9 @@ ENV LUA_CPATH="/usr/local/openresty/site/lualib/?.so;/usr/local/openresty/lualib
|
|||||||
|
|
||||||
ENV PATH="/usr/local/openresty/bin:/usr/local/openresty/luajit/bin:$PATH"
|
ENV PATH="/usr/local/openresty/bin:/usr/local/openresty/luajit/bin:$PATH"
|
||||||
|
|
||||||
ENV LAPIS_VERSION=1.16.0
|
ENV LAPIS_VERSION=1.9.0
|
||||||
|
|
||||||
RUN apk add openssl-dev curl git
|
RUN apk add openssl-dev
|
||||||
RUN opm get spacewander/luafilesystem
|
RUN opm get spacewander/luafilesystem
|
||||||
RUN luarocks install luasec
|
RUN luarocks install luasec
|
||||||
RUN luarocks install busted
|
RUN luarocks install busted
|
||||||
@ -290,7 +289,7 @@ RUN luarocks install moonscript
|
|||||||
|
|
||||||
##########################
|
##########################
|
||||||
# Build the release image.
|
# Build the release image.
|
||||||
FROM ${RESTY_IMAGE_BASE}:${RESTY_IMAGE_TAG} AS openresty-rtmp
|
FROM ${RESTY_IMAGE_BASE}:${RESTY_IMAGE_TAG} as openresty-rtmp
|
||||||
LABEL MAINTAINER dreamer <dreamer@puikheid.nl>
|
LABEL MAINTAINER dreamer <dreamer@puikheid.nl>
|
||||||
|
|
||||||
# Set default ports.
|
# Set default ports.
|
||||||
@ -312,13 +311,11 @@ RUN apk add --update \
|
|||||||
libvpx \
|
libvpx \
|
||||||
libvorbis \
|
libvorbis \
|
||||||
libwebp \
|
libwebp \
|
||||||
libwebpmux \
|
|
||||||
libtheora \
|
libtheora \
|
||||||
opus \
|
opus \
|
||||||
rtmpdump \
|
rtmpdump \
|
||||||
x264-dev \
|
x264-dev \
|
||||||
x265-dev \
|
x265-dev
|
||||||
lame-dev
|
|
||||||
|
|
||||||
|
|
||||||
COPY --from=build-openresty-fat /usr/local/openresty /usr/local/openresty
|
COPY --from=build-openresty-fat /usr/local/openresty /usr/local/openresty
|
||||||
|
|||||||
@ -5,32 +5,24 @@ local function Authhandler(self)
|
|||||||
local name = self.params.name
|
local name = self.params.name
|
||||||
local password = self.params.password
|
local password = self.params.password
|
||||||
local yt_streamkey = self.params.youtube or nil
|
local yt_streamkey = self.params.youtube or nil
|
||||||
local yt_url = self.params.yt_url or nil
|
|
||||||
|
|
||||||
print("connected with: " .. name)
|
|
||||||
|
|
||||||
local endpoints = {
|
local endpoints = {
|
||||||
puik='somethingsecret',
|
puik='something',
|
||||||
wstd='somethingsecret',
|
wstd='something',
|
||||||
buzz='somethingsecret'
|
buzz='something'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if endpoints[name] == password then
|
if endpoints[name] == password then
|
||||||
local urls = {}
|
local urls = {}
|
||||||
|
|
||||||
print("connected with: " .. name)
|
|
||||||
|
|
||||||
local hls_url = "rtmp://127.0.0.1/streamhls/" .. name
|
local hls_url = "rtmp://127.0.0.1/streamhls/" .. name
|
||||||
table.insert(urls, hls_url)
|
table.insert(urls, hls_url)
|
||||||
|
|
||||||
local yt_url = "rtmp://127.0.0.1/youtube/" .. name
|
if yt_streamkey then
|
||||||
--table.insert(urls, yt_url)
|
local yt_url = "rtmp://127.0.0.1/youtube/" .. yt_streamkey
|
||||||
|
table.insert(urls, yt_url)
|
||||||
-- if yt_streamkey then
|
end
|
||||||
-- local yt_url = "rtmp://126.0.0.1/youtube/" .. yt_streamkey .. "&url=" .. yt_url
|
|
||||||
-- --local yt_url = "rtmp://" .. yt_streamkey
|
|
||||||
-- table.insert(urls, yt_url)
|
|
||||||
-- end
|
|
||||||
|
|
||||||
local redirect_urls = table.concat(urls, ",")
|
local redirect_urls = table.concat(urls, ",")
|
||||||
|
|
||||||
|
|||||||
@ -11,41 +11,27 @@ rtmp {
|
|||||||
server {
|
server {
|
||||||
listen 1935;
|
listen 1935;
|
||||||
chunk_size 4000;
|
chunk_size 4000;
|
||||||
|
|
||||||
# recommended directives: https://github.com/savonet/liquidsoap/issues/1389#issuecomment-1095096246
|
|
||||||
idle_streams off;
|
|
||||||
wait_key on;
|
|
||||||
wait_video on;
|
|
||||||
|
|
||||||
application stream {
|
application stream {
|
||||||
live on;
|
live on;
|
||||||
|
|
||||||
on_publish http://127.0.0.1:${{PORT}}/auth;
|
on_publish http://localhost:${{PORT}}/auth;
|
||||||
}
|
}
|
||||||
|
|
||||||
application youtube {
|
application youtube {
|
||||||
live on;
|
live on;
|
||||||
allow publish 127.0.0.1;
|
|
||||||
|
|
||||||
#exec ffmpeg -i rtmp://127.0.0.1:1935/youtube/$name -c:a copy -c:v copy -f flv rtmp://a.rtmp.youtube.com/live2/$name;
|
exec ffmpeg -i rtmp://localhost:1935/youtube/$name -c:a copy -c:v copy -f flv rtmp://a.rtmp.youtube.com/live2/$name;
|
||||||
#exec ffmpeg -i rtmp://127.0.0.1:1935/youtube/$name -c:a copy -c:v copy -f flv rtmp://${arg_url}.rtmp.youtube.com/live1/$name;
|
|
||||||
|
|
||||||
exec ffmpeg -i rtmp://127.0.0.1:1935/youtube/$name -c:a copy -c:v copy -f flv rtmp://x.rtmp.youtube.com/live2/hj5m-x8ff-pqyv-rtu0-26fk;
|
|
||||||
#exec ffmpeg -i rtmp://127.0.0.1:1935/youtube/$name -c:a copy -c:v copy -f flv rtmp://a.rtmp.youtube.com/live2/m5wk-h9xr-70g1-uzr7-dwgf;
|
|
||||||
exec ffmpeg -i rtmp://127.0.0.1:1935/youtube/$name -c:a copy -c:v copy -f flv rtmp://a.rtmp.youtube.com/live2/m0a5-r1rq-9qjf-pjk9-9kke;
|
|
||||||
|
|
||||||
#exec ffmpeg -i rtmp://127.0.0.1:1935/youtube/$name -c:a copy -c:v copy -f flv rtmp://$name;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
application streamhls {
|
application streamhls {
|
||||||
live on;
|
live on;
|
||||||
allow publish 127.0.0.1;
|
|
||||||
|
|
||||||
#relays the incoming video to low quality streams on this server, audio-only version and to a different server
|
#relays the incoming video to low quality streams on this server, audio-only version and to a different server
|
||||||
exec ffmpeg -i rtmp://127.0.0.1:1935/streamhls/$name
|
exec ffmpeg -i rtmp://localhost:1935/streamhls/$name
|
||||||
-c:a copy -c:v copy -f flv rtmp://127.0.0.1/hls/$name_hi;
|
-c:a copy -c:v copy -f flv rtmp://localhost/hls/$name_hi;
|
||||||
exec ffmpeg -i rtmp://127.0.0.1:1935/streamhls/$name -max_muxing_queue_size 1024
|
exec ffmpeg -i rtmp://localhost:1935/streamhls/$name -max_muxing_queue_size 1024
|
||||||
-c:a copy -c:v libx264 -b:v 128K -preset superfast -profile:v baseline -f flv rtmp://127.0.0.1/hls/$name_low;
|
-c:a copy -c:v libx264 -b:v 128K -preset superfast -profile:v baseline -f flv rtmp://localhost/hls/$name_low;
|
||||||
# 2>/mnt/radio/logs/ffmpeg-$name_low.log;
|
# 2>/mnt/radio/logs/ffmpeg-$name_low.log;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,11 +54,11 @@ rtmp {
|
|||||||
http {
|
http {
|
||||||
include mime.types;
|
include mime.types;
|
||||||
|
|
||||||
# init_by_lua_block {
|
init_by_lua_block {
|
||||||
# require("socket")
|
require("socket")
|
||||||
# require("lpeg")
|
require("lpeg")
|
||||||
# math.randomseed(os.time()+ngx.worker.id())
|
math.randomseed(os.time()+ngx.worker.id())
|
||||||
# }
|
}
|
||||||
|
|
||||||
|
|
||||||
server {
|
server {
|
||||||
@ -122,9 +108,9 @@ http {
|
|||||||
|
|
||||||
location / {
|
location / {
|
||||||
default_type text/html;
|
default_type text/html;
|
||||||
content_by_lua '
|
content_by_lua_block {
|
||||||
require("lapis").serve("app")
|
require("lapis").serve("app")
|
||||||
';
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
location /favicon.ico {
|
location /favicon.ico {
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
version: "3.3"
|
||||||
services:
|
services:
|
||||||
puikheid:
|
puikheid:
|
||||||
environment:
|
environment:
|
||||||
@ -20,19 +21,9 @@ services:
|
|||||||
- traefik.http.routers.puikheid_ssl.rule=Host(`puikheid.nl`)
|
- traefik.http.routers.puikheid_ssl.rule=Host(`puikheid.nl`)
|
||||||
- traefik.http.routers.puikheid_ssl.entrypoints=websecure
|
- traefik.http.routers.puikheid_ssl.entrypoints=websecure
|
||||||
- traefik.http.routers.puikheid_ssl.tls.certresolver=myresolver
|
- traefik.http.routers.puikheid_ssl.tls.certresolver=myresolver
|
||||||
# - traefik.http.routers.puikheid_ssl.tls.middlewares=corsheader
|
|
||||||
# - "traefik.http.middlewares.corsheader.headers.accesscontrolalloworigin=origin-list-or-null"
|
|
||||||
|
|
||||||
- traefik.http.services.puikheid.loadbalancer.server.port=8080
|
- traefik.http.services.puikheid.loadbalancer.server.port=8080
|
||||||
|
|
||||||
- traefik.tcp.routers.puikheid.rule=HostSNI(`puikheid.nl`)
|
|
||||||
- traefik.tcp.routers.puikhuid.entrypoints=rtmp
|
|
||||||
#- traefik.tcp.routers.puikhuid.entrypoints=rtmps
|
|
||||||
# - traefik.tcp.routers.puikheid.service=puikheid
|
|
||||||
- traefik.tcp.routers.puikheid.tls=true
|
|
||||||
- traefik.tcp.routers.puikheid.tls.certresolver=myresolver
|
|
||||||
# - traefik.tcp.services.puikheid.loadbalancer.server.port=1935
|
|
||||||
|
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
web:
|
web:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user