From 08abb69df56f7f5fa25a48a088b680c336a1d602 Mon Sep 17 00:00:00 2001 From: partoftheworlD Date: Fri, 30 Oct 2026 18:20:46 +0300 Subject: [PATCH] Add --no-secure support for Docker (#1493) --- Dockerfile | 5 +++-- docs/EN/README.docker.md | 15 ++++++++------- docs/RU/README.docker.md | 15 ++++++++------- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index 55597ce..79d51e7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,7 +26,8 @@ ENV PYTHONDONTWRITEBYTECODE=1 \ TG_WS_PROXY_PORT=1443 \ TG_WS_PROXY_SECRET="" \ TG_WS_PROXY_DC_IPS="2:149.154.167.220 4:149.154.167.220" \ - TG_WS_PROXY_CF_WORKER="" + TG_WS_PROXY_CF_WORKER="" \ + TG_WS_PROXY_NO_SECURE=False RUN apt-get update \ && apt-get install -y --no-install-recommends tini ca-certificates \ @@ -44,5 +45,5 @@ USER app EXPOSE 1443/tcp -ENTRYPOINT ["/usr/bin/tini", "--", "/bin/sh", "-lc", "set -eu; args=\"--host ${TG_WS_PROXY_HOST} --port ${TG_WS_PROXY_PORT}\"; for dc in ${TG_WS_PROXY_DC_IPS}; do args=\"$args --dc-ip $dc\"; done; if [ -n \"${TG_WS_PROXY_SECRET}\" ]; then args=\"$args --secret ${TG_WS_PROXY_SECRET}\"; fi; if [ -n \"${TG_WS_PROXY_CF_WORKER}\" ]; then args=\"$args --cfproxy-worker-domain ${TG_WS_PROXY_CF_WORKER}\"; fi; exec /opt/venv/bin/python -u proxy/tg_ws_proxy.py $args \"$@\"", "--"] +ENTRYPOINT ["/usr/bin/tini", "--", "/bin/sh", "-lc", "set -eu; args=\"--host ${TG_WS_PROXY_HOST} --port ${TG_WS_PROXY_PORT}\"; for dc in ${TG_WS_PROXY_DC_IPS}; do args=\"$args --dc-ip $dc\"; done; if [ -n \"${TG_WS_PROXY_SECRET}\" ]; then args=\"$args --secret ${TG_WS_PROXY_SECRET}\"; fi; if [ -n \"${TG_WS_PROXY_CF_WORKER}\" ]; then args=\"$args --cfproxy-worker-domain ${TG_WS_PROXY_CF_WORKER}\"; fi; if [ \"${TG_WS_PROXY_NO_SECURE}\" = \"True\" ]; then args=\"$args --no-secure \"; fi; exec /opt/venv/bin/python -u proxy/tg_ws_proxy.py $args \"$@\"", "--"] CMD [] \ No newline at end of file diff --git a/docs/EN/README.docker.md b/docs/EN/README.docker.md index 7cb1a43..8687630 100644 --- a/docs/EN/README.docker.md +++ b/docs/EN/README.docker.md @@ -35,13 +35,14 @@ tg://proxy?server=172.17.0.2&port=1443&secret=dd68f127db1d... All settings are configured using environment variables when running the container: -| Variable | Description | Default | -| ----------------------- | -------------------------------- | --------------------------------- | -| `TG_WS_PROXY_HOST` | Address for incoming connections | `0.0.0.0` | -| `TG_WS_PROXY_PORT` | Port inside the container | `1443` | -| `TG_WS_PROXY_SECRET` | Secret key | `random` | -| `TG_WS_PROXY_DC_IPS` | DC number:IP pairs separated by space | `2:149.154.167.220 4:149.154.167.220` | -| `TG_WS_PROXY_CF_WORKER` | Cloudflare Worker domain | `None` | +| Variable | Description | Default | +| ----------------------- | -------------------------------------------------- | ------------------------------------- | +| `TG_WS_PROXY_HOST` | Address for incoming connections | `0.0.0.0` | +| `TG_WS_PROXY_PORT` | Port inside the container | `1443` | +| `TG_WS_PROXY_SECRET` | Secret key | `random` | +| `TG_WS_PROXY_DC_IPS` | DC number:IP pairs separated by space | `2:149.154.167.220 4:149.154.167.220` | +| `TG_WS_PROXY_CF_WORKER` | Cloudflare Worker domain | `None` | +| `TG_WS_PROXY_NO_SECURE` | Use 80 port for CF-proxy and CF-worker connections | `False` | Example with manually specified secret: diff --git a/docs/RU/README.docker.md b/docs/RU/README.docker.md index 61bf3e2..b6c4660 100644 --- a/docs/RU/README.docker.md +++ b/docs/RU/README.docker.md @@ -35,13 +35,14 @@ tg://proxy?server=172.17.0.2&port=1443&secret=dd68f127db1d... Все настройки задаются переменными окружения при запуске контейнера: -| Переменная | Описание | По умолчанию | -| ----------------------- | --------------------------------- | ------------------------------------- | -| `TG_WS_PROXY_HOST` | `Адрес для приёма подключений` | `0.0.0.0` | -| `TG_WS_PROXY_PORT` | `Порт внутри контейнера` | `1443` | -| `TG_WS_PROXY_SECRET` | `Секретный ключ` | `random` | -| `TG_WS_PROXY_DC_IPS` | `Пары «номер DC:IP» через пробел` | `2:149.154.167.220 4:149.154.167.220` | -| `TG_WS_PROXY_CF_WORKER` | `Домен Cloudflare Worker` | `None` | +| Переменная | Описание | По умолчанию | +| ----------------------- | ------------------------------------------------------------- | ------------------------------------- | +| `TG_WS_PROXY_HOST` | `Адрес для приёма подключений` | `0.0.0.0` | +| `TG_WS_PROXY_PORT` | `Порт внутри контейнера` | `1443` | +| `TG_WS_PROXY_SECRET` | `Секретный ключ` | `random` | +| `TG_WS_PROXY_DC_IPS` | `Пары «номер DC:IP» через пробел` | `2:149.154.167.220 4:149.154.167.220` | +| `TG_WS_PROXY_CF_WORKER` | `Домен Cloudflare Worker` | `None` | +| `TG_WS_PROXY_NO_SECURE` | `Использовать 80 порт для подключения к CF-proxy и CF-Worker` | `False` | Пример с ручным указанием секрета: