diff --git a/Makefile b/Makefile index db6e423..7808522 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,16 @@ # Root Makefile for CMMC-Platform local dev +############################################################ +# Load .env into Make's environment (must be first!) +############################################################ +ifneq (,$(wildcard .env)) +include .env +export $(shell sed -E 's/#.*//' .env | cut -d= -f1) +endif + +# ───────────── rest of your Makefile below ───────────── compose = podman-compose -f dev-compose.yaml +# # ---------------------------------------------------------- # Helpers @@ -11,9 +21,12 @@ create-proxy-net: # probe external Keycloak once and cache the flag check-idp: @echo "🔍 Probing $(KEYCLOAK_URL) for existing Keycloak..." - @if curl -sf "${KEYCLOAK_URL:-http://keycloak.local:8080}/realms/master" >/dev/null ; \ - then echo "🥳 External Keycloak detected!"; echo 1 >.idp_flag ; \ - else echo "🛠 No external Keycloak found."; echo 0 >.idp_flag ; fi + @if curl -skL --max-time 5 "$${KEYCLOAK_URL:-http://keycloak.local:8080}/realms/master" >/dev/null ; then \ + echo "🥳 External Keycloak detected!"; echo 1 >.idp_flag ; \ + else \ + echo "🛠 No external Keycloak found."; echo 0 >.idp_flag ; \ + fi + # ---------------------------------------------------------- # Lifecycle targets