feat: add SOCKS proxy support and require explicit OLCRTC_PROVIDER configuration

This commit is contained in:
zarazaex69
2026-04-20 05:12:09 +03:00
parent 94063a240f
commit 0f6a079374
3 changed files with 13 additions and 7 deletions

View File

@@ -31,14 +31,17 @@ fi
mode="${OLCRTC_MODE:-srv}"
room_id="${OLCRTC_ROOM_ID:-${ROOM_ID:-}}"
provider="${OLCRTC_PROVIDER:-telemost}"
provider="${OLCRTC_PROVIDER:-}"
data_dir="${OLCRTC_DATA_DIR:-/usr/share/olcrtc}"
dns_server="${OLCRTC_DNS:-1.1.1.1:53}"
key="${OLCRTC_KEY:-${KEY:-}}"
key_file="${OLCRTC_KEY_FILE:-/var/lib/olcrtc/key.hex}"
socks_proxy="${OLCRTC_SOCKS_PROXY:-}"
socks_proxy_port="${OLCRTC_SOCKS_PROXY_PORT:-1080}"
[ "$mode" = "srv" ] || die "server image defaults to OLCRTC_MODE=srv; got '$mode'"
[ -n "$room_id" ] || die "set OLCRTC_ROOM_ID to the Telemost room id"
[ -n "$provider" ] || die "set OLCRTC_PROVIDER (e.g. telemost, jazz, wb_stream)"
[ -n "$room_id" ] || die "set OLCRTC_ROOM_ID to the room identifier"
if [ -z "$key" ]; then
if [ -s "$key_file" ]; then
@@ -68,8 +71,8 @@ set -- /usr/local/bin/olcrtc \
-data "$data_dir" \
-dns "$dns_server"
if bool_flag "${OLCRTC_DUO:-}"; then
set -- "$@" -duo
if [ -n "$socks_proxy" ]; then
set -- "$@" -socks-proxy "$socks_proxy" -socks-proxy-port "$socks_proxy_port"
fi
if bool_flag "${OLCRTC_DEBUG:-}"; then