1
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
2026-04-30 00:51:44 +08:00
parent 3bfaa303cb
commit 805d6f8cae
5 changed files with 24 additions and 5 deletions

View File

@@ -270,6 +270,11 @@ if [[ ! "${BUILD_NAME}" =~ ^[0-9A-Za-z._-]+$ ]]; then
exit 1
fi
if [[ ! "${DATABASE}" =~ ^[0-9A-Za-z.-]+$ ]]; then
echo "[deploy:rust] --database 只能包含数字、字母、点和短横线,不能包含下划线: ${DATABASE}" >&2
exit 1
fi
if [[ "${SKIP_SPACETIME_BUILD}" -eq 1 && "${MIGRATION_BOOTSTRAP_SECRET_MODE}" != "disabled" ]]; then
echo "[deploy:rust] --skip-spacetime-build 无法把迁移引导密钥注入 wasm。" >&2
echo "[deploy:rust] 请移除 --skip-spacetime-build或同时传 --no-migration-bootstrap-secret。" >&2
@@ -654,6 +659,15 @@ sanitize_path_segment() {
printf "%s" "$1" | tr -c 'A-Za-z0-9._-' '_'
}
validate_spacetime_database_name() {
local database="$1"
if [[ ! "${database}" =~ ^[0-9A-Za-z.-]+$ ]]; then
echo "[start] GENARRATIVE_SPACETIME_DATABASE 只能包含数字、字母、点和短横线,不能包含下划线: ${database}" >&2
exit 1
fi
}
is_publish_conflict_output() {
local output="$1"
local normalized
@@ -973,6 +987,7 @@ start_process() {
require_command node
require_command spacetime
validate_spacetime_database_name "${SPACETIME_DATABASE}"
mkdir -p "${PID_DIR}" "${LOG_DIR}" "${SPACETIME_ROOT_DIR}"
sync_ubuntu_spacetime_install "${SPACETIME_ROOT_DIR}"