fix: 默认端口 7860(HF Space 约定,避免 HEALTH 检查不到)
Browse files- init_and_run.sh +2 -2
init_and_run.sh
CHANGED
|
@@ -27,8 +27,8 @@ if [ -f "$DATA_DIR/config.toml" ] && ! grep -q 'dir = "/data' "$DATA_DIR/config.
|
|
| 27 |
printf '\n[logging]\nenabled = true\ndir = "/data/logs"\nfilename = "gateway.log"\n' >> "$DATA_DIR/config.toml"
|
| 28 |
fi
|
| 29 |
|
| 30 |
-
# HF 强制端口 $PORT(如 7860),缺省回退
|
| 31 |
-
PORT="${PORT:-
|
| 32 |
export TWOAPI_CONFIG="$DATA_DIR/config.toml"
|
| 33 |
|
| 34 |
echo "[init] using config=$TWOAPI_CONFIG port=$PORT accounts=$(ls "$DATA_DIR/account"/*.json 2>/dev/null | wc -l)"
|
|
|
|
| 27 |
printf '\n[logging]\nenabled = true\ndir = "/data/logs"\nfilename = "gateway.log"\n' >> "$DATA_DIR/config.toml"
|
| 28 |
fi
|
| 29 |
|
| 30 |
+
# HF 强制端口 $PORT(如 7860),缺省回退 7860(HF Space 约定端口;本地未注入 $PORT 时也监听 7860)
|
| 31 |
+
PORT="${PORT:-7860}"
|
| 32 |
export TWOAPI_CONFIG="$DATA_DIR/config.toml"
|
| 33 |
|
| 34 |
echo "[init] using config=$TWOAPI_CONFIG port=$PORT accounts=$(ls "$DATA_DIR/account"/*.json 2>/dev/null | wc -l)"
|