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
|
||||
|
||||
@@ -48,11 +48,19 @@ _PG="$(dotenv_get POSTGRES_PORT)"
|
||||
_RD="$(dotenv_get REDIS_PORT)"
|
||||
_NATS_MON="$(dotenv_get NATS_MONITOR_PORT)"
|
||||
_MINIO_C="$(dotenv_get MINIO_CONSOLE_PORT)"
|
||||
echo "API: http://localhost:${_API}/health"
|
||||
_PANEL="$(dotenv_get PANEL_UI_PORT)"
|
||||
_PROM="$(dotenv_get PROMETHEUS_PORT)"
|
||||
_GRAF="$(dotenv_get GRAFANA_PORT)"
|
||||
|
||||
echo "Web control panel: http://localhost:${_PANEL}/ (login: admin / admin — change after first sign-in)"
|
||||
echo "API (scaffold): http://localhost:${_API}/health"
|
||||
echo "Panel API (proxied): http://localhost:${_PANEL}/api/health"
|
||||
echo "PostgreSQL: localhost:${_PG}"
|
||||
echo "Redis: localhost:${_RD}"
|
||||
echo "NATS monitor: http://localhost:${_NATS_MON}"
|
||||
echo "MinIO console: http://localhost:${_MINIO_C}"
|
||||
echo "Prometheus: http://localhost:${_PROM}"
|
||||
echo "Grafana: http://localhost:${_GRAF} (admin user from .env)"
|
||||
echo "(Ports come from .env; defaults avoid system PostgreSQL/Redis on 5432/6379.)"
|
||||
echo
|
||||
echo "Docker group is configured; if a future terminal still cannot run docker, log out and back in once."
|
||||
|
||||
Reference in New Issue
Block a user