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

@@ -29,8 +29,9 @@ RUN apk add --no-cache ca-certificates tzdata && \
addgroup -S olcrtc && \
mkdir -p /usr/share/olcrtc /var/lib/olcrtc && \
adduser -S -D -h /var/lib/olcrtc -s /sbin/nologin -G olcrtc olcrtc && \
chown -R olcrtc:olcrtc /var/lib/olcrtc
chown -R olcrtc:olcrtc /usr/share/olcrtc /var/lib/olcrtc
COPY --chown=olcrtc:olcrtc data /usr/share/olcrtc
COPY --from=build /out/olcrtc /usr/local/bin/olcrtc
COPY script/docker/olcrtc-entrypoint.sh /usr/local/bin/olcrtc-entrypoint
COPY script/docker/olcrtc-healthcheck.sh /usr/local/bin/olcrtc-healthcheck
@@ -41,7 +42,7 @@ USER olcrtc:olcrtc
WORKDIR /var/lib/olcrtc
ENV OLCRTC_MODE=srv \
OLCRTC_PROVIDER=telemost \
OLCRTC_PROVIDER= \
OLCRTC_DATA_DIR=/usr/share/olcrtc \
OLCRTC_DNS=1.1.1.1:53 \
OLCRTC_KEY_FILE=/var/lib/olcrtc/key.hex

View File

@@ -6,10 +6,12 @@ services:
container_name: olcrtc-server
restart: unless-stopped
environment:
OLCRTC_PROVIDER: "${OLCRTC_PROVIDER:?set OLCRTC_PROVIDER (telemost, jazz, wb_stream)}"
OLCRTC_ROOM_ID: "${OLCRTC_ROOM_ID:?set OLCRTC_ROOM_ID}"
OLCRTC_KEY: "${OLCRTC_KEY:-}"
OLCRTC_DNS: "${OLCRTC_DNS:-1.1.1.1:53}"
OLCRTC_DUO: "${OLCRTC_DUO:-false}"
OLCRTC_SOCKS_PROXY: "${OLCRTC_SOCKS_PROXY:-}"
OLCRTC_SOCKS_PROXY_PORT: "${OLCRTC_SOCKS_PROXY_PORT:-1080}"
OLCRTC_DEBUG: "${OLCRTC_DEBUG:-false}"
volumes:
- olcrtc-state:/var/lib/olcrtc

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