Update generate_config.sh

This commit is contained in:
Arvin
2026-03-21 17:17:13 +08:00
parent 4532a64b47
commit ad0e7f8bc3

View File

@ -131,17 +131,22 @@ apply_secret_to_config() {
apply_controller_to_config() { apply_controller_to_config() {
local file="$1" local file="$1"
local ui_dir="$PROJECT_DIR/ui/dist" local ui_src="$PROJECT_DIR/ui/dist"
local ui_dir="$RUNTIME_DIR/ui"
if [ "$EXTERNAL_CONTROLLER_ENABLED" = "true" ]; then if [ "$EXTERNAL_CONTROLLER_ENABLED" = "true" ]; then
upsert_yaml_kv_local "$file" "external-controller" "$EXTERNAL_CONTROLLER" upsert_yaml_kv_local "$file" "external-controller" "$EXTERNAL_CONTROLLER"
if [ -f "$ui_dir/index.html" ]; then if [ ! -f "$ui_src/index.html" ]; then
upsert_yaml_kv_local "$file" "external-ui" "$ui_dir" echo "[ERROR] UI not found: $ui_src/index.html" >&2
else
echo "[ERROR] UI not found: $ui_dir/index.html" >&2
exit 1 exit 1
fi fi
rm -rf "$ui_dir"
mkdir -p "$ui_dir"
cp -a "$ui_src/." "$ui_dir/"
upsert_yaml_kv_local "$file" "external-ui" "$ui_dir"
else else
remove_yaml_key_local "$file" "external-controller" remove_yaml_key_local "$file" "external-controller"
remove_yaml_key_local "$file" "external-ui" remove_yaml_key_local "$file" "external-ui"