new changes
This commit is contained in:
@@ -7,10 +7,25 @@ ENV_FILE="${ROOT}/.env"
|
||||
|
||||
[[ -f "$ENV_FILE" ]] || exit 0
|
||||
|
||||
# Do not rewrite .env while the dev stack is already running: published ports would
|
||||
# appear "in use" but belong to our own containers.
|
||||
# Add new keys when .env was created before panel-ui/observability existed.
|
||||
add_key_if_missing() {
|
||||
local key="$1" value="$2"
|
||||
if ! grep -qE "^${key}=" "$ENV_FILE"; then
|
||||
echo "${key}=${value}" >> "$ENV_FILE"
|
||||
fi
|
||||
}
|
||||
|
||||
add_key_if_missing PANEL_UI_PORT 3080
|
||||
add_key_if_missing PANEL_CORS_EXTRA_ORIGINS ""
|
||||
add_key_if_missing PROMETHEUS_PORT 19090
|
||||
add_key_if_missing GRAFANA_PORT 13000
|
||||
add_key_if_missing GRAFANA_ADMIN_USER admin
|
||||
add_key_if_missing GRAFANA_ADMIN_PASSWORD yakpanel_grafana_admin
|
||||
add_key_if_missing CADVISOR_PORT 18081
|
||||
|
||||
# Do not rewrite .env while our stack is already running.
|
||||
if command -v docker >/dev/null 2>&1 && docker info >/dev/null 2>&1; then
|
||||
if docker ps --format '{{.Names}}' 2>/dev/null | grep -qE '^yakpanel-(redis|postgres|api|nats|minio|agent-gateway)$'; then
|
||||
if docker ps --format '{{.Names}}' 2>/dev/null | grep -qE '^yakpanel-(redis|postgres|api|nats|minio|agent-gateway|panel-api|panel-worker|panel-scheduler|panel-frontend|prometheus|grafana|cadvisor)$'; then
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
@@ -76,3 +91,7 @@ remap_key NATS_PORT 14222
|
||||
remap_key NATS_MONITOR_PORT 18222
|
||||
remap_key MINIO_PORT 19000
|
||||
remap_key MINIO_CONSOLE_PORT 19001
|
||||
remap_key PANEL_UI_PORT 13080
|
||||
remap_key PROMETHEUS_PORT 19090
|
||||
remap_key GRAFANA_PORT 13000
|
||||
remap_key CADVISOR_PORT 18081
|
||||
|
||||
Reference in New Issue
Block a user