forked from wangbo/easyai
fix(deploy): 加固 Redis 持久化与旧环境启动配置
This commit is contained in:
@@ -19,8 +19,10 @@ cp \
|
||||
mkdir -p "$TMP_DIR/scripts"
|
||||
cp \
|
||||
"$REPO_ROOT/scripts/init-security-env.sh" \
|
||||
"$REPO_ROOT/scripts/init-security-origin.sh" \
|
||||
"$REPO_ROOT/scripts/init-public-api-base-url.sh" \
|
||||
"$REPO_ROOT/scripts/init-server-http-bind-ip.sh" \
|
||||
"$REPO_ROOT/scripts/check-redis-persistence.sh" \
|
||||
"$TMP_DIR/scripts/"
|
||||
|
||||
cd "$TMP_DIR"
|
||||
@@ -112,6 +114,17 @@ assert "ws_ticket" in methods, f"ws-gateway does not advertise ws_ticket: {sorte
|
||||
'
|
||||
}
|
||||
|
||||
assert_redis_startup_contract() {
|
||||
docker compose config --format json | python3 -c '
|
||||
import json, sys
|
||||
services = json.load(sys.stdin)["services"]
|
||||
redis = services["redis"]
|
||||
assert any(volume.get("target") == "/data" for volume in redis.get("volumes") or []), redis.get("volumes")
|
||||
assert redis["healthcheck"]["test"] == ["CMD", "redis-cli", "ping"]
|
||||
assert services["easyai-server"]["depends_on"]["redis"]["condition"] == "service_healthy"
|
||||
'
|
||||
}
|
||||
|
||||
assert_compose_security() {
|
||||
docker compose config --format json | python3 -c '
|
||||
import json, sys
|
||||
@@ -188,6 +201,7 @@ if command -v docker >/dev/null 2>&1 && docker compose version >/dev/null 2>&1;
|
||||
assert_compose_exposure 127.0.0.1 127.0.0.1
|
||||
assert_canvas_ws_auth_config
|
||||
assert_compose_security
|
||||
assert_redis_startup_contract
|
||||
fi
|
||||
|
||||
reset_case
|
||||
|
||||
Reference in New Issue
Block a user