feat(setup): auto-detect host server IP in setup banner, support HEAD in /health, clean compose warning
This commit is contained in:
+3
-3
@@ -48,7 +48,7 @@ app.include_router(api_v1_router)
|
||||
app.include_router(legacy_router)
|
||||
|
||||
|
||||
@app.get("/api/v1/health", tags=["System"], summary="System health check probe")
|
||||
@app.api_route("/api/v1/health", methods=["GET", "HEAD"], tags=["System"], summary="System health check probe")
|
||||
def health_check():
|
||||
"""Health check probe endpoint."""
|
||||
return {
|
||||
@@ -58,8 +58,8 @@ def health_check():
|
||||
}
|
||||
|
||||
# Backward compatibility health check probes (hidden from OpenAPI schema)
|
||||
@app.get("/health", include_in_schema=False)
|
||||
@app.get("/api/health", include_in_schema=False)
|
||||
@app.api_route("/health", methods=["GET", "HEAD"], include_in_schema=False)
|
||||
@app.api_route("/api/health", methods=["GET", "HEAD"], include_in_schema=False)
|
||||
def legacy_health_check():
|
||||
return health_check()
|
||||
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
# - Pre-seeded Starter Pipelines mounted to guarantee DAGs list appears instantly
|
||||
# ==============================================================================
|
||||
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
merica:
|
||||
build: .
|
||||
|
||||
@@ -55,7 +55,14 @@ MERICA_PORT=$(grep -E "^MERICA_PORT=" .env | cut -d '=' -f2 | tr -d ' ' || echo
|
||||
MERICA_PORT=${MERICA_PORT:-14000}
|
||||
AIRFLOW_URL=$(grep -E "^AIRFLOW_WEB_URL=" .env | cut -d '=' -f2 | tr -d ' ' || echo "http://host.docker.internal:14080")
|
||||
|
||||
# 3. Verifikasi Starter Seed Pipelines (Anti-Blank Canvas)
|
||||
# Deteksi IP Server Host untuk kenyamanan copy-paste
|
||||
SERVER_IP=$(hostname -I 2>/dev/null | awk '{print $1}')
|
||||
if [ -z "$SERVER_IP" ]; then
|
||||
SERVER_IP=$(ip -4 route get 1.1.1.1 2>/dev/null | awk '{print $7}')
|
||||
fi
|
||||
SERVER_IP=${SERVER_IP:-localhost}
|
||||
|
||||
# 3. Verifikasi Starter Seed Pipelines
|
||||
echo -e "📁 [3/5] Memverifikasi template starter pipelines..."
|
||||
if [ -d "./pipelines/configs" ] && [ "$(ls -A ./pipelines/configs 2>/dev/null)" ]; then
|
||||
TOTAL_DAGS=$(ls -1 ./pipelines/configs/*.yaml 2>/dev/null | wc -l)
|
||||
@@ -90,12 +97,15 @@ if [ $SUCCESS -eq 1 ]; then
|
||||
echo -e "\n${GREEN}==============================================================================${NC}"
|
||||
echo -e "${GREEN}🎉 MERICA STANDALONE APPLIANCE BERHASIL AKTIF & SEHAT!${NC}"
|
||||
echo -e "${GREEN}==============================================================================${NC}"
|
||||
echo -e "🌐 Antarmuka Web MERICA : ${BLUE}http://localhost:${MERICA_PORT}${NC}"
|
||||
echo -e "🌐 Antarmuka Web MERICA : ${GREEN}http://${SERVER_IP}:${MERICA_PORT}${NC}"
|
||||
if [ "$SERVER_IP" != "localhost" ] && [ "$SERVER_IP" != "127.0.0.1" ]; then
|
||||
echo -e " (Akses Lokal) : ${BLUE}http://localhost:${MERICA_PORT}${NC}"
|
||||
fi
|
||||
echo -e "🔗 Airflow Target : ${YELLOW}${AIRFLOW_URL}${NC}"
|
||||
echo -e "🔑 Kredensial Default : Username: ${GREEN}admin${NC} | Password: ${GREEN}admin${NC}"
|
||||
echo -e "📁 Direktori Pipeline : ./pipelines (Configs, Metadata, & dbt)"
|
||||
echo -e "=============================================================================="
|
||||
echo -e "💡 Tips: Buka browser Anda di ${BLUE}http://localhost:${MERICA_PORT}${NC} untuk mulai merancang DAG!"
|
||||
echo -e "💡 Tips: Buka browser Anda di ${GREEN}http://${SERVER_IP}:${MERICA_PORT}${NC} untuk mulai merancang DAG!"
|
||||
echo -e " Untuk menghentikan: ${YELLOW}$COMPOSE_CMD down${NC}"
|
||||
echo -e "==============================================================================\n"
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user