fix: align drainage frontend configuration
This commit is contained in:
+17
-3
@@ -6,7 +6,6 @@ runtime_config=$(jq -cn \
|
||||
--arg mapUrl "${DRAINAGE_MAP_URL:-https://geoserver.waternetwork.cn/geoserver}" \
|
||||
--arg geoserverWorkspace "${DRAINAGE_GEOSERVER_WORKSPACE:-wenzhou}" \
|
||||
--arg agentApiBaseUrl "${DRAINAGE_AGENT_API_BASE_URL:-http://127.0.0.1:8787}" \
|
||||
--arg ttsApiUrl "${DRAINAGE_TTS_API_URL:-/api/tts/edge}" \
|
||||
--arg enableDevPanel "${DRAINAGE_ENABLE_DEV_PANEL:-false}" \
|
||||
--arg enableMsw "${DRAINAGE_ENABLE_MSW:-false}" \
|
||||
'{
|
||||
@@ -14,11 +13,26 @@ runtime_config=$(jq -cn \
|
||||
DRAINAGE_MAP_URL: $mapUrl,
|
||||
DRAINAGE_GEOSERVER_WORKSPACE: $geoserverWorkspace,
|
||||
DRAINAGE_AGENT_API_BASE_URL: $agentApiBaseUrl,
|
||||
DRAINAGE_TTS_API_URL: $ttsApiUrl,
|
||||
DRAINAGE_ENABLE_DEV_PANEL: $enableDevPanel,
|
||||
DRAINAGE_ENABLE_MSW: $enableMsw
|
||||
}')
|
||||
|
||||
printf 'globalThis.__DRAINAGE_CONFIG__ = %s;\n' "$runtime_config" > /srv/runtime-config.js
|
||||
|
||||
exec "$@"
|
||||
node /usr/local/lib/drainage-frontend/edge-tts-server.cjs &
|
||||
tts_pid=$!
|
||||
|
||||
"$@" &
|
||||
app_pid=$!
|
||||
|
||||
terminate() {
|
||||
kill "$app_pid" "$tts_pid" 2>/dev/null || true
|
||||
}
|
||||
trap terminate INT TERM
|
||||
|
||||
status=0
|
||||
wait -n "$app_pid" "$tts_pid" || status=$?
|
||||
terminate
|
||||
wait "$app_pid" 2>/dev/null || true
|
||||
wait "$tts_pid" 2>/dev/null || true
|
||||
exit "$status"
|
||||
|
||||
Reference in New Issue
Block a user