commit b803989bd0a480d9dd3a9b573402c41c0b6e8e15 Author: Dmitry Date: Wed Apr 8 12:48:37 2026 +0300 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8b5f0f2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +rtmp.conf +.env + diff --git a/angie_rtmp/Dockerfile b/angie_rtmp/Dockerfile new file mode 100644 index 0000000..37e87f5 --- /dev/null +++ b/angie_rtmp/Dockerfile @@ -0,0 +1,6 @@ +FROM docker.angie.software/angie:1.11.4-alpine + +RUN apk add --no-cache ffmpeg curl ca-certificates + +COPY angie.conf /etc/angie/angie.conf + diff --git a/angie_rtmp/angie.conf b/angie_rtmp/angie.conf new file mode 100644 index 0000000..fc8f92b --- /dev/null +++ b/angie_rtmp/angie.conf @@ -0,0 +1,47 @@ +# package: angie-module-rtmp +load_module modules/ngx_rtmp_module.so; + +user angie; +worker_processes auto; +worker_rlimit_nofile 65536; + +error_log /var/log/angie/error.log notice; +pid /run/angie/angie.pid; + +events { + worker_connections 2048; + +} + + +http { + include /etc/angie/mime.types; + default_type application/octet-stream; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + log_format extended '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" rt="$request_time" ' + '"$http_user_agent" "$http_x_forwarded_for" ' + 'h="$host" sn="$server_name" ru="$request_uri" u="$uri" ' + 'ucs="$upstream_cache_status" ua="$upstream_addr" us="$upstream_status" ' + 'uct="$upstream_connect_time" urt="$upstream_response_time"'; + + access_log /var/log/angie/access.log main; + + sendfile on; + #tcp_nopush on; + + keepalive_timeout 65; + + #gzip on; + + include /etc/angie/http.d/*.conf; +} + +rtmp { + include /etc/angie/rtmp.d/*.conf; +} + diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..adc3c0e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,26 @@ +services: + restream: + #image: docker.angie.software/angie:1.11.4-alpine + build: angie_rtmp + restart: unless-stopped + container_name: restream + volumes: + - ./web:/usr/share/angie/html:ro + - ./rtmp.conf:/etc/angie/rtmp.d/rtmp.conf:ro + - ./http.conf:/etc/angie/http.d/default.conf:ro + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro + environment: + TZ: Europe/Moscow + security_opt: + - no-new-privileges:true + ports: + - 1935:1935/tcp + - 1935:1935/udp + - 59080:80/tcp + logging: + driver: json-file + options: + max-size: "10m" + max-file: "5" + diff --git a/http.conf b/http.conf new file mode 100644 index 0000000..3b1bf74 --- /dev/null +++ b/http.conf @@ -0,0 +1,23 @@ +server { + listen 80; + server_name localhost; + + location / { + root /usr/share/angie/html; + index index.html index.htm; + } + + # rtmp stat + location /stat { + rtmp_stat all; + rtmp_stat_stylesheet stat.xsl; + } + location /stat.xsl { + root /usr/share/angie/html/rtmp; + } + + # rtmp control + location /control { + rtmp_control all; + } +} diff --git a/web/index.html b/web/index.html new file mode 100644 index 0000000..de05145 --- /dev/null +++ b/web/index.html @@ -0,0 +1,63 @@ + + + + + + Статус сервера + + + +
+
+

Сервер рестрима работает

+
+ + + diff --git a/web/rtmp/stat.xsl b/web/rtmp/stat.xsl new file mode 100644 index 0000000..355453b --- /dev/null +++ b/web/rtmp/stat.xsl @@ -0,0 +1,355 @@ + + + + + + + + + + + + + RTMP statistics + + + +
+ Generated by + nginx-rtmp-module , + nginx , + pid , + built   + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
RTMP#clientsVideoAudioIn bytesOut bytesIn bits/sOut bits/sStateTime
Accepted: codecbits/ssizefpscodecbits/sfreqchan + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + live streams + + + + + + + + + + + + vod streams + + + + + + + + + + + + + #cccccc + #dddddd + + + + + + var d=document.getElementById('-'); + d.style.display=d.style.display=='none'?'':'none'; + return false + + + + [EMPTY] + + + + + +    + + + + + + + + + + + + + + + +   + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + +
IdStateAddressFlash versionPage URLSWF URLDroppedTimestampA-VTime
+ + +
+ + + + + + + + + + + d + + + + h + + + + m + + + s + + + + + + + + + + + + + T + + + G + + + M + + K + + + + b + B + + /s + + + + + + active + idle + + + + + + + publishing + playing + + + + + + + + + #cccccc + #eeeeee + + + + + + + + http://apps.db.ripe.net/search/query.html?searchtext= + + whois + + + + + + + + + + + + + + + + + + + + + + + + + + publishing + + + + active + + + + x + + +
diff --git a/web/stat.xsl b/web/stat.xsl new file mode 100644 index 0000000..355453b --- /dev/null +++ b/web/stat.xsl @@ -0,0 +1,355 @@ + + + + + + + + + + + + + RTMP statistics + + + +
+ Generated by + nginx-rtmp-module , + nginx , + pid , + built   + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
RTMP#clientsVideoAudioIn bytesOut bytesIn bits/sOut bits/sStateTime
Accepted: codecbits/ssizefpscodecbits/sfreqchan + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + live streams + + + + + + + + + + + + vod streams + + + + + + + + + + + + + #cccccc + #dddddd + + + + + + var d=document.getElementById('-'); + d.style.display=d.style.display=='none'?'':'none'; + return false + + + + [EMPTY] + + + + + +    + + + + + + + + + + + + + + + +   + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + +
IdStateAddressFlash versionPage URLSWF URLDroppedTimestampA-VTime
+ + +
+ + + + + + + + + + + d + + + + h + + + + m + + + s + + + + + + + + + + + + + T + + + G + + + M + + K + + + + b + B + + /s + + + + + + active + idle + + + + + + + publishing + playing + + + + + + + + + #cccccc + #eeeeee + + + + + + + + http://apps.db.ripe.net/search/query.html?searchtext= + + whois + + + + + + + + + + + + + + + + + + + + + + + + + + publishing + + + + active + + + + x + + +