Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Containers/talk/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ FROM alpine:3.24 AS janus
RUN set -ex; \
apk upgrade --no-cache -a; \
apk add --no-cache janus-gateway; \
mv /etc/janus/janus.jcfg.sample /etc/janus/janus.jcfg; \
mv /etc/janus/janus.transport.websockets.jcfg.sample /etc/janus/janus.transport.websockets.jcfg; \
# Only the signaling server in this container needs the Janus API, so do not expose it to other containers
sed -i 's|^[[:space:]]*#ws_ip = .*|\tws_ip = "127.0.0.1"|' /etc/janus/janus.transport.websockets.jcfg; \
Expand All @@ -21,7 +22,7 @@ ENV SKIP_CERT_VERIFY=false \
COPY --from=janus --chmod=777 --chown=1000:1000 /usr/bin/janus /usr/bin/janus
COPY --from=janus --chmod=777 --chown=1000:1000 /usr/lib/janus/plugins/libjanus_videoroom.so* /usr/lib/janus/plugins/
COPY --from=janus --chmod=777 --chown=1000:1000 /usr/lib/janus/transports/libjanus_websockets.so* /usr/lib/janus/transports/
COPY --from=janus --chmod=777 --chown=1000:1000 /etc/janus/janus.jcfg.sample /etc/janus/janus.plugin.videoroom.jcfg /etc/janus/janus.transport.websockets.jcfg /etc/janus/
COPY --from=janus --chmod=777 --chown=1000:1000 /etc/janus/janus.jcfg /etc/janus/janus.plugin.videoroom.jcfg /etc/janus/janus.transport.websockets.jcfg /etc/janus/

COPY --from=eturnal --chmod=777 --chown=1000:1000 /opt/eturnal /opt/eturnal
COPY --from=nats --chmod=777 --chown=1000:1000 /nats-server /usr/local/bin/nats-server
Expand Down
2 changes: 1 addition & 1 deletion Containers/talk/dinit.d/janus
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
type = process
command = janus --config=/conf/janus.jcfg --disable-colors --log-stdout --full-trickle --debug-level $JANUS_LOG_LEVEL
command = janus --config=/etc/janus/janus.jcfg --disable-colors --log-stdout --full-trickle --debug-level $JANUS_LOG_LEVEL
term-signal = TERM
restart = yes
options = shares-console
30 changes: 0 additions & 30 deletions Containers/talk/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -164,34 +164,4 @@ maxstreambitrate = ${TALK_MAX_STREAM_BITRATE}
maxscreenbitrate = ${TALK_MAX_SCREEN_BITRATE}
SIGNALING_CONF

# Configure Janus to use the local TURN server for its own relay candidates.
# Ephemeral TURN credentials (TURN REST API pattern):
# username = "<expiry_unix_timestamp>:<random_hex>" (valid for 3 months)
# password = base64(HMAC-SHA1(TURN_SECRET, username))
# eturnal validates both the HMAC and the embedded expiry on every Allocate,
# so a captured credential stops working after at most 3 months.
JANUS_TURN_USER="$(( $(date +%s) + 7776000 )):$(openssl rand -hex 16)"
JANUS_TURN_PWD="$(printf '%s' "$JANUS_TURN_USER" | openssl dgst -sha1 -hmac "$TURN_SECRET" -binary | openssl base64)"

if [ -z "$TURN_DOMAIN" ]; then
TURN_DOMAIN="$NC_DOMAIN"
fi

# Build janus.jcfg: strip the entire nat block from the original and append a
# clean minimal one that points at the TURN server.
{
sed '/^nat:/,/^}/d' /etc/janus/janus.jcfg.sample
cat << NAT_CONF
nat: {
turn_server = "$TURN_DOMAIN"
turn_port = $TALK_PORT
turn_type = "udp"
turn_user = "$JANUS_TURN_USER"
turn_pwd = "$JANUS_TURN_PWD"
# The ice ignore list is set by janus by default, so also do this here
ice_ignore_list = "vmnet"
}
NAT_CONF
} > /conf/janus.jcfg

exec "$@"