Start with HA s6 config

This commit is contained in:
Fredrik Baberg 2023-03-15 11:37:35 +01:00
parent 04d7fd3520
commit 6cdff6ea0b
9 changed files with 52 additions and 24 deletions

View File

@ -56,6 +56,9 @@ RUN mv janus/libjanus_ustreamer.so /opt/janus/lib/janus/plugins/libjanus_ustream
FROM ${BUILD_FROM} AS final
ENV LANG C.UTF-8
COPY --from=builder /opt/janus /opt/janus
COPY --from=builder /usr/local/bin/ustreamer /usr/local/bin/ustreamer
RUN apk add -U \
alsa-lib \
curl \
@ -80,9 +83,6 @@ RUN apk add -U \
zlib \
caddy
COPY --from=builder /opt/janus /opt/janus
COPY --from=builder /usr/local/bin/ustreamer /usr/local/bin/ustreamer
COPY rootfs/ /
WORKDIR /

View File

@ -1,4 +1,12 @@
localhost
# Ingress
:8099 {
@blocked not remote_ip 172.30.32.2
respond @blocked "This is only for access through Ingress" 403
reverse_proxy 127.0.0.1:8080
}
root * /server
# External access
:8080 {
root * /opt/janus/share/janus/demos
file_server
}

View File

@ -0,0 +1,22 @@
#!/usr/bin/with-contenv bashio
# ==============================================================================
# Add-on: aiortc
# Configures NGINX for use with aiortc
# ==============================================================================
# Generate Ingress configuration
bashio::var.json \
interface "$(bashio::addon.ip_address)" \
port "^$(bashio::addon.ingress_port)" \
| tempio \
-template /etc/nginx/templates/ingress.gtpl \
-out /etc/nginx/servers/ingress.conf
# Generate direct access configuration, if enabled.
if bashio::var.has_value "$(bashio::addon.port 80)"; then
bashio::var.json \
port "^$(bashio::addon.port 80)" \
| tempio \
-template /etc/nginx/templates/direct.gtpl \
-out /etc/nginx/servers/direct.conf
fi

View File

@ -0,0 +1,9 @@
#!/usr/bin/with-contenv bashio
# ==============================================================================
# Add-on: camera-ustreamer
# Runs janus
# ==============================================================================
bashio::log.info "Starting janus.."
exec /opt/janus/bin/janus

View File

@ -1,9 +0,0 @@
#!/usr/bin/execlineb -S0
# ==============================================================================
# Add-on: mjpg-streamer
# Take down the S6 supervision tree when Nginx fails
# ==============================================================================
if -n { s6-test $# -ne 0 }
if -n { s6-test ${1} -eq 256 }
s6-svscanctl -t /var/run/s6/services

View File

@ -1,11 +1,8 @@
#!/usr/bin/with-contenv bashio
# ==============================================================================
# Add-on: mjpg-streamer
# Runs the Nginx daemon
# Add-on: camera-ustreamer
# Runs the proxy daemon
# ==============================================================================
# Wait for aiortc web server to be available
bashio::net.wait_for 80
bashio::log.info "Starting proxy..."
# exec caddy run -config /etc/caddy/Caddyfile
exec caddy run -config /etc/caddy/Caddyfile

View File

@ -1,7 +1,7 @@
#!/usr/bin/execlineb -S0
# ==============================================================================
# Add-on: mjpg-streamer
# Take down the S6 supervision tree when mjpg-streamer fails
# Add-on: camera-ustreamer
# Take down the S6 supervision tree when ustreamer fails
# ==============================================================================
if -n { s6-test $# -ne 0 }
if -n { s6-test ${1} -eq 256 }

View File

@ -6,4 +6,5 @@
bashio::log.info "Starting mjpg-streamer.."
mjpg_streamer -i "$(bashio::config 'mjpg_input')" -o "output_http.so -w /www_mjpg -p 80"
# mjpg_streamer -i "$(bashio::config 'mjpg_input')" -o "output_http.so -w /www_mjpg -p 80"
exec ustreamer --host=127.0.0.1 --port=80