From 6df044a71dcb56cd0822dd0d4781ca14842f5b20 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 14 Nov 2026 01:59:41 +0800 Subject: [PATCH] Update zoraxydocker/zoraxy Docker tag to v3.3.5 (#8878) * Update zoraxydocker/zoraxy Docker tag to v3.3.5 * Update app version [skip ci] --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: github-action update-app-version --- apps/zoraxy/3.3.5/.env.sample | 7 ++ apps/zoraxy/3.3.5/data.yml | 103 ++++++++++++++++ apps/zoraxy/3.3.5/data/.gitkeep | 1 + apps/zoraxy/3.3.5/docker-compose.yml | 55 +++++++++ apps/zoraxy/3.3.5/scripts/entrypoint.sh | 155 ++++++++++++++++++++++++ apps/zoraxy/3.3.5/scripts/init.sh | 75 ++++++++++++ apps/zoraxy/3.3.5/scripts/uninstall.sh | 2 + apps/zoraxy/3.3.5/scripts/upgrade.sh | 4 + 8 files changed, 402 insertions(+) create mode 100644 apps/zoraxy/3.3.5/.env.sample create mode 100644 apps/zoraxy/3.3.5/data.yml create mode 100644 apps/zoraxy/3.3.5/data/.gitkeep create mode 100644 apps/zoraxy/3.3.5/docker-compose.yml create mode 100755 apps/zoraxy/3.3.5/scripts/entrypoint.sh create mode 100755 apps/zoraxy/3.3.5/scripts/init.sh create mode 100755 apps/zoraxy/3.3.5/scripts/uninstall.sh create mode 100755 apps/zoraxy/3.3.5/scripts/upgrade.sh diff --git a/apps/zoraxy/3.3.5/.env.sample b/apps/zoraxy/3.3.5/.env.sample new file mode 100644 index 000000000..36ce8cd31 --- /dev/null +++ b/apps/zoraxy/3.3.5/.env.sample @@ -0,0 +1,7 @@ +PANEL_APP_PORT_HTTP=8000 +PANEL_APP_PORT_PROXY_HTTP=8080 +PANEL_APP_PORT_PROXY_HTTPS=8443 +ADMIN_USERNAME=admin +ADMIN_PASSWORD= +APP_DATA_DIR=./data +CONTAINER_NAME= diff --git a/apps/zoraxy/3.3.5/data.yml b/apps/zoraxy/3.3.5/data.yml new file mode 100644 index 000000000..2f7836643 --- /dev/null +++ b/apps/zoraxy/3.3.5/data.yml @@ -0,0 +1,103 @@ +additionalProperties: + formFields: + - default: 8000 + edit: true + envKey: PANEL_APP_PORT_HTTP + labelEn: Management Port + labelZh: 管理端口 + label: + en: Management Port + zh: 管理端口 + zh-Hant: 管理連接埠 + ja: 管理ポート + ko: 관리 포트 + ru: Порт управления + ms: Port Pengurusan + pt-br: Porta de Gerenciamento + required: true + rule: paramPort + type: number + - default: 8080 + edit: true + envKey: PANEL_APP_PORT_PROXY_HTTP + labelEn: HTTP Proxy Port + labelZh: HTTP 代理端口 + label: + en: HTTP Proxy Port + zh: HTTP 代理端口 + zh-Hant: HTTP 代理連接埠 + ja: HTTP プロキシポート + ko: HTTP 프록시 포트 + ru: Порт HTTP-прокси + ms: Port Proksi HTTP + pt-br: Porta do Proxy HTTP + required: true + rule: paramPort + type: number + - default: 8443 + edit: true + envKey: PANEL_APP_PORT_PROXY_HTTPS + labelEn: HTTPS Proxy Port + labelZh: HTTPS 代理端口 + label: + en: HTTPS Proxy Port + zh: HTTPS 代理端口 + zh-Hant: HTTPS 代理連接埠 + ja: HTTPS プロキシポート + ko: HTTPS 프록시 포트 + ru: Порт HTTPS-прокси + ms: Port Proksi HTTPS + pt-br: Porta do Proxy HTTPS + required: true + rule: paramPort + type: number + - default: admin + edit: true + envKey: ADMIN_USERNAME + labelEn: Administrator Username + labelZh: 管理员用户名 + label: + en: Administrator Username + zh: 管理员用户名 + zh-Hant: 管理員使用者名稱 + ja: 管理者ユーザー名 + ko: 관리자 사용자 이름 + ru: Имя администратора + ms: Nama Pengguna Pentadbir + pt-br: Nome de Usuario Administrador + required: true + type: text + - default: "" + edit: true + envKey: ADMIN_PASSWORD + labelEn: Administrator Password + labelZh: 管理员密码 + label: + en: Administrator Password + zh: 管理员密码 + zh-Hant: 管理員密碼 + ja: 管理者パスワード + ko: 관리자 비밀번호 + ru: Пароль администратора + ms: Kata Laluan Pentadbir + pt-br: Senha do Administrador + random: true + required: true + rule: paramComplexity + type: password + - default: ./data + edit: true + envKey: APP_DATA_DIR + labelEn: Data Directory + labelZh: 数据目录 + label: + en: Data Directory + zh: 数据目录 + zh-Hant: 資料目錄 + ja: データディレクトリ + ko: 데이터 디렉터리 + ru: Каталог данных + ms: Direktori Data + pt-br: Diretorio de Dados + required: true + type: text diff --git a/apps/zoraxy/3.3.5/data/.gitkeep b/apps/zoraxy/3.3.5/data/.gitkeep new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/apps/zoraxy/3.3.5/data/.gitkeep @@ -0,0 +1 @@ + diff --git a/apps/zoraxy/3.3.5/docker-compose.yml b/apps/zoraxy/3.3.5/docker-compose.yml new file mode 100644 index 000000000..dd1c3a0c2 --- /dev/null +++ b/apps/zoraxy/3.3.5/docker-compose.yml @@ -0,0 +1,55 @@ +services: + zoraxy: + image: "zoraxydocker/zoraxy:v3.3.5@sha256:2dfc5acf4c84e3e477a8f1fcb7d05a600a8c3cd5fd1296a848372375910ae9dd" + container_name: ${CONTAINER_NAME} + restart: unless-stopped + user: "0:0" + working_dir: /opt/zoraxy/config + entrypoint: + - /bin/sh + - /opt/1panel/entrypoint.sh + networks: + - 1panel-network + ports: + - "${PANEL_APP_PORT_HTTP}:8000" + - "${PANEL_APP_PORT_PROXY_HTTP}:80" + - "${PANEL_APP_PORT_PROXY_HTTPS}:443" + cap_drop: + - ALL + cap_add: + - CHOWN + - DAC_OVERRIDE + - KILL + - SETUID + - SETGID + security_opt: + - no-new-privileges:true + read_only: true + tmpfs: + - /tmp:nodev,noexec,nosuid,size=64M + healthcheck: + test: + - CMD + - python3 + - -c + - >- + import urllib.request; + raise SystemExit(0 if urllib.request.urlopen( + 'http://127.0.0.1:8000/api/auth/userCount', timeout=5 + ).read().strip() == b'1' else 1) + interval: 30s + timeout: 10s + start_period: 30s + retries: 3 + extra_hosts: + - "host.docker.internal:host-gateway" + volumes: + - "${APP_DATA_DIR}:/data" + - "${APP_DATA_DIR}/config:/opt/zoraxy/config" + - "./scripts/entrypoint.sh:/opt/1panel/entrypoint.sh:ro" + labels: + createdBy: "Apps" + +networks: + 1panel-network: + external: true diff --git a/apps/zoraxy/3.3.5/scripts/entrypoint.sh b/apps/zoraxy/3.3.5/scripts/entrypoint.sh new file mode 100755 index 000000000..279b5c6e9 --- /dev/null +++ b/apps/zoraxy/3.3.5/scripts/entrypoint.sh @@ -0,0 +1,155 @@ +#!/bin/sh +set -eu +export LC_ALL=C + +CONFIG_DIR=/data/config +PLUGIN_DIR=/data/plugins +CREDENTIAL_FILE=/data/.bootstrap-credentials + +chown 65534:65534 "$CONFIG_DIR" "$PLUGIN_DIR" + +bootstrap_pid= +stop_bootstrap() { + if [ -n "$bootstrap_pid" ] && kill -0 "$bootstrap_pid" 2>/dev/null; then + kill -TERM -"$bootstrap_pid" 2>/dev/null || true + for _ in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do + kill -0 -"$bootstrap_pid" 2>/dev/null || break + sleep 0.1 + done + if kill -0 -"$bootstrap_pid" 2>/dev/null; then + kill -KILL -"$bootstrap_pid" 2>/dev/null || true + fi + wait "$bootstrap_pid" 2>/dev/null || true + fi +} +trap stop_bootstrap EXIT +trap 'stop_bootstrap; exit 143' HUP INT TERM + +setsid su -s /bin/sh nobody -c \ + 'exec /usr/local/bin/zoraxy \ + -autorenew=86400 \ + -cfgupgrade=true \ + -conf=/data/config/conf \ + -db=auto \ + -dbpath=/data/config/sys.db \ + -default_inbound_enabled=false \ + -docker=true \ + -earlyrenew=30 \ + -enablelog=true \ + -fastgeoip=false \ + -log=/data/config/log \ + -mdns=false \ + -noauth=false \ + -plugin=/data/plugins/ \ + -port=127.0.0.1:8000 \ + -sshlb=false \ + -tmp=/data/config/tmp \ + -uuid=/data/config/sys.uuid' & +bootstrap_pid=$! + +account_count="$(python3 -c ' +import sys +import time +import urllib.request + +url = "http://127.0.0.1:8000/api/auth/userCount" +for _ in range(60): + try: + value = urllib.request.urlopen(url, timeout=1).read().decode().strip() + if value.isdigit(): + print(value) + raise SystemExit(0) + except Exception: + pass + time.sleep(0.5) +raise SystemExit("Zoraxy bootstrap listener did not become ready") +')" + +case "$account_count" in + 0) + [ -f "$CREDENTIAL_FILE" ] || { + printf '%s\n' 'Bootstrap credentials are missing' >&2 + exit 1 + } + [ "$(stat -c '%a' "$CREDENTIAL_FILE")" = 400 ] || + [ "$(stat -c '%a' "$CREDENTIAL_FILE")" = 600 ] || { + printf '%s\n' 'Bootstrap credentials have unsafe permissions' >&2 + exit 1 + } + sed -n '1p' "$CREDENTIAL_FILE" | grep -Eq '^[A-Za-z0-9][A-Za-z0-9._-]{2,63}$' || { + printf '%s\n' 'Bootstrap username is invalid' >&2 + exit 1 + } + [ "$(wc -l <"$CREDENTIAL_FILE" | tr -d ' ')" = 2 ] || { + printf '%s\n' 'Bootstrap credential file must contain exactly two lines' >&2 + exit 1 + } + LC_ALL=C sed -n '2p' "$CREDENTIAL_FILE" | grep -Eq '^[[:graph:]]+$' || { + printf '%s\n' 'Bootstrap password must contain 16 to 256 printable ASCII characters without spaces' >&2 + exit 1 + } + password_length="$(sed -n '2p' "$CREDENTIAL_FILE" | wc -c | tr -d ' ')" + if [ "$password_length" -lt 17 ] || [ "$password_length" -gt 257 ]; then + printf '%s\n' 'Bootstrap password must contain 16 to 256 printable ASCII characters without spaces' >&2 + exit 1 + fi + python3 -c ' +import http.cookiejar +import re +import sys +import urllib.parse +import urllib.request + +username = sys.stdin.buffer.readline().rstrip(b"\n").decode() +password = sys.stdin.buffer.readline().rstrip(b"\n").decode() +jar = http.cookiejar.CookieJar() +opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(jar)) +page = opener.open("http://127.0.0.1:8000/login.html", timeout=5).read().decode() +match = re.search(r"name=\"zoraxy.csrf.Token\" content=\"([^\"]+)\"", page) +if match is None: + raise SystemExit("Unable to obtain the Zoraxy CSRF token") +request = urllib.request.Request( + "http://127.0.0.1:8000/api/auth/register", + data=urllib.parse.urlencode({"username": username, "password": password}).encode(), + headers={"X-CSRF-Token": match.group(1)}, +) +if opener.open(request, timeout=5).read().strip() != b"\"OK\"": + raise SystemExit("Zoraxy administrator registration failed") +' <"$CREDENTIAL_FILE" + ;; + 1) ;; + *) + printf 'Unexpected Zoraxy account count: %s\n' "$account_count" >&2 + exit 1 + ;; +esac + +[ "$(python3 -c 'import urllib.request; print(urllib.request.urlopen("http://127.0.0.1:8000/api/auth/userCount", timeout=5).read().decode().strip())')" = 1 ] || { + printf '%s\n' 'Zoraxy administrator bootstrap verification failed' >&2 + exit 1 +} + +stop_bootstrap +bootstrap_pid= +rm -f "$CREDENTIAL_FILE" +trap - EXIT HUP INT TERM + +exec su -s /bin/sh nobody -c \ + 'exec /usr/local/bin/zoraxy \ + -autorenew=86400 \ + -cfgupgrade=true \ + -conf=/data/config/conf \ + -db=auto \ + -dbpath=/data/config/sys.db \ + -docker=true \ + -earlyrenew=30 \ + -enablelog=true \ + -fastgeoip=false \ + -log=/data/config/log \ + -mdns=false \ + -noauth=false \ + -plugin=/data/plugins/ \ + -port=:8000 \ + -sshlb=false \ + -tmp=/data/config/tmp \ + -uuid=/data/config/sys.uuid' diff --git a/apps/zoraxy/3.3.5/scripts/init.sh b/apps/zoraxy/3.3.5/scripts/init.sh new file mode 100755 index 000000000..cd8edfd8b --- /dev/null +++ b/apps/zoraxy/3.3.5/scripts/init.sh @@ -0,0 +1,75 @@ +#!/usr/bin/env bash +set -euo pipefail +export LC_ALL=C + +ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)" +ENV_FILE="${ENV_FILE:-$ROOT_DIR/.env}" + +read_env_value() { + local key="$1" + [[ -f "$ENV_FILE" ]] || return 0 + local value + value="$(sed -n "s/^${key}=//p" "$ENV_FILE" | tail -n 1)" + case "$value" in + \"*\") value="${value#\"}"; value="${value%\"}" ;; + \'*\') value="${value#\'}"; value="${value%\'}" ;; + esac + printf '%s\n' "$value" +} + +configured_value() { + local key="$1" + local default_value="$2" + local value="${!key:-}" + if [[ -z "$value" ]]; then + value="$(read_env_value "$key")" + fi + printf '%s\n' "${value:-$default_value}" +} + +data_raw="$(configured_value APP_DATA_DIR ./data)" +admin_username="$(configured_value ADMIN_USERNAME admin)" +admin_password="$(configured_value ADMIN_PASSWORD '')" + +[[ -n "$data_raw" && "$data_raw" != /* ]] || { + printf '%s\n' 'APP_DATA_DIR must be a non-empty relative path' >&2 + exit 1 +} +data_dir="$(realpath -m -- "$ROOT_DIR/${data_raw#./}")" +case "$data_dir" in + "$ROOT_DIR"/*) ;; + *) + printf '%s\n' 'APP_DATA_DIR must remain inside the application version directory' >&2 + exit 1 + ;; +esac + +[[ "$admin_username" =~ ^[A-Za-z0-9][A-Za-z0-9._-]{2,63}$ ]] || { + printf '%s\n' 'ADMIN_USERNAME must contain 3 to 64 letters, digits, dots, underscores, or hyphens' >&2 + exit 1 +} +[[ "$admin_password" =~ ^[[:graph:]]{16,256}$ ]] || { + printf '%s\n' 'ADMIN_PASSWORD must contain 16 to 256 printable ASCII characters without spaces' >&2 + exit 1 +} + +install -d -m 0755 "$data_dir" +install -d -m 0750 "$data_dir/config" "$data_dir/plugins" +data_dir="$(realpath -e -- "$data_dir")" +case "$data_dir" in + "$ROOT_DIR"/*) ;; + *) + printf '%s\n' 'APP_DATA_DIR resolves outside the application version directory' >&2 + exit 1 + ;; +esac + +credential_file="$data_dir/.bootstrap-credentials" +credential_temporary="$(mktemp "$data_dir/.bootstrap-credentials.tmp.XXXXXX")" +umask 077 +{ + printf '%s\n' "$admin_username" + printf '%s\n' "$admin_password" +} >"$credential_temporary" +chmod 0600 "$credential_temporary" +mv -f -- "$credential_temporary" "$credential_file" diff --git a/apps/zoraxy/3.3.5/scripts/uninstall.sh b/apps/zoraxy/3.3.5/scripts/uninstall.sh new file mode 100755 index 000000000..6e877466e --- /dev/null +++ b/apps/zoraxy/3.3.5/scripts/uninstall.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +set -euo pipefail diff --git a/apps/zoraxy/3.3.5/scripts/upgrade.sh b/apps/zoraxy/3.3.5/scripts/upgrade.sh new file mode 100755 index 000000000..c7388c078 --- /dev/null +++ b/apps/zoraxy/3.3.5/scripts/upgrade.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -euo pipefail + +bash "$(dirname "$0")/init.sh"