-
Notifications
You must be signed in to change notification settings - Fork 129
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·2639 lines (2424 loc) · 116 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·2639 lines (2424 loc) · 116 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env bash
# ─────────────────────────────────────────────────────────────
# E.D.D.I — One-Command Install & Onboarding Wizard
#
# Usage:
# curl -fsSL https://raw.githubusercontent.com/labsai/EDDI/main/install.sh | bash
#
# Options (non-interactive):
# bash install.sh --defaults # all defaults, no prompts
# bash install.sh --db=postgres --with-auth # specific choices
# ─────────────────────────────────────────────────────────────
set -euo pipefail
# ── Configuration ──────────────────────────────────────────
# EDDI_BRANCH selects which git ref the compose/support files are fetched from.
# When it is not set explicitly, it is DERIVED from EDDI_VERSION after argument
# parsing (see resolve_eddi_branch): pinning a release with --eddi-version=6.5.0
# must fetch that release's compose files from its tag, not whatever is on `main`,
# which can be a compose file newer than the pinned image.
EDDI_BRANCH_EXPLICIT="${EDDI_BRANCH:-}"
EDDI_BRANCH="${EDDI_BRANCH:-main}"
EDDI_VERSION="${EDDI_VERSION:-latest}"
EDDI_PORT="${EDDI_PORT:-7070}"
EDDI_HTTPS_PORT="${EDDI_HTTPS_PORT:-7443}"
# Host ports for the containers the compose files publish. The *_REQUESTED
# values are what the caller pinned (empty = "resolve it for me"); the plain ones
# carry the default until wizard_ports resolves them, so the summary and the
# closing banner always have something to print. MONGO_PORT is the exception:
# it stays empty for PostgreSQL installs, which publish no database port.
MONGO_PORT_REQUESTED="${MONGO_PORT:-}"
MONGO_PORT=""
KEYCLOAK_PORT_REQUESTED="${KEYCLOAK_PORT:-}"
KEYCLOAK_PORT="${KEYCLOAK_PORT:-8180}"
GRAFANA_PORT_REQUESTED="${GRAFANA_PORT:-}"
GRAFANA_PORT="${GRAFANA_PORT:-3000}"
PROMETHEUS_PORT_REQUESTED="${PROMETHEUS_PORT:-}"
PROMETHEUS_PORT="${PROMETHEUS_PORT:-9090}"
JAEGER_PORT_REQUESTED="${JAEGER_PORT:-}"
JAEGER_PORT="${JAEGER_PORT:-16686}"
OTLP_GRPC_PORT_REQUESTED="${OTLP_GRPC_PORT:-}"
OTLP_GRPC_PORT="${OTLP_GRPC_PORT:-4317}"
OTLP_HTTP_PORT_REQUESTED="${OTLP_HTTP_PORT:-}"
OTLP_HTTP_PORT="${OTLP_HTTP_PORT:-4318}"
# Ports handed out during this run. Two components with adjacent defaults (Jaeger
# OTLP 4317/4318) would otherwise both be offered the same free port -- nothing
# is listening on it yet, so "free" is true for both until docker tries to bind.
RESERVED_PORTS=()
EDDI_DIR="${EDDI_DIR:-$HOME/.eddi}"
# Strip trailing slash to avoid double-slash paths in output/config
EDDI_DIR="${EDDI_DIR%/}"
# Validate branch name (prevent path traversal in download URLs)
if [[ ! "$EDDI_BRANCH" =~ ^[a-zA-Z0-9._/-]+$ ]]; then
echo "Invalid EDDI_BRANCH: $EDDI_BRANCH" >&2; exit 1
fi
COMPOSE_BASE_URL="https://raw.githubusercontent.com/labsai/EDDI/${EDDI_BRANCH}"
EDDI_ALREADY_RUNNING=false
# Admin credentials of the auth/monitoring overlays, under the names the compose
# files read. Compose falls back to admin/admin, which is acceptable only while
# the port stays on 127.0.0.1; the installer never leaves it at that. An exported
# value wins (the GCP provisioner generates the Keycloak password on the VM and
# exports it); otherwise resolve_stack_passwords keeps the one already in .env
# or generates one, and .env carries it to every later compose run.
KC_BOOTSTRAP_ADMIN_USERNAME="${KC_BOOTSTRAP_ADMIN_USERNAME:-}"
KC_BOOTSTRAP_ADMIN_PASSWORD="${KC_BOOTSTRAP_ADMIN_PASSWORD:-}"
GRAFANA_ADMIN_USER="${GRAFANA_ADMIN_USER:-}"
GRAFANA_ADMIN_PASSWORD="${GRAFANA_ADMIN_PASSWORD:-}"
# Set by keycloak_admin_login; read by the steps that call the Admin API.
KC_ADMIN_TOKEN=""
# "user=password" for every realm account this run gave a first password, and
# "user=" for one that already had a password and was left alone.
FIRST_LOGIN_PASSWORDS=()
# Unprivileged fixtures (viewer, user) that already HAVE a credential although
# --demo-users was not given — on a realm imported before the fixtures stopped
# shipping passwords, that is viewer/viewer and user/user.
LEGACY_FIXTURE_LOGINS=()
# Set by set_first_login_passwords once it holds an admin token and has read the
# eddi realm's accounts. Until then print_success cannot say what they look like.
REALM_ACCOUNTS_CHECKED=false
# Set by keycloak_admin_login when it moved a legacy admin/admin login to
# KC_BOOTSTRAP_ADMIN_PASSWORD, so a caller knows the new value is now the true one.
KC_ADMIN_ROTATED=false
# True when this run generated KC_BOOTSTRAP_ADMIN_PASSWORD rather than finding one.
KC_ADMIN_PASSWORD_GENERATED=false
# True when this run generated GRAFANA_ADMIN_PASSWORD rather than finding one.
GRAFANA_PASSWORD_GENERATED=false
# ── State flags ────────────────────────────────────────────
CONTAINERS_STARTED=false
HEALTHY=false
COMPOSE_FILES=()
# ── Colors ─────────────────────────────────────────────────
if [[ -t 1 ]]; then
BOLD='\033[1m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
RED='\033[0;31m'
CYAN='\033[0;36m'
DIM='\033[2m'
RESET='\033[0m'
else
BOLD='' GREEN='' YELLOW='' RED='' CYAN='' DIM='' RESET=''
fi
# ── Cleanup trap ───────────────────────────────────────────
cleanup() {
if [[ "$CONTAINERS_STARTED" == "true" && "$HEALTHY" != "true" ]]; then
echo ""
echo -e "${YELLOW}⚠️ Setup interrupted. Cleaning up containers...${RESET}"
if [[ ${#COMPOSE_FILES[@]} -gt 0 ]]; then
local env_file="$EDDI_DIR/.env"
local flags=()
if [[ -f "$env_file" ]]; then
flags+=(--env-file "$env_file")
fi
for f in "${COMPOSE_FILES[@]}"; do
flags+=(-f "$f")
done
docker compose "${flags[@]}" down 2>/dev/null || true
fi
fi
}
trap cleanup EXIT INT TERM
# ── Helpers ────────────────────────────────────────────────
info() { echo -e " ${GREEN}✅${RESET} $1"; }
warn() { echo -e " ${YELLOW}⚠️ $1${RESET}"; }
fail() { echo -e " ${RED}❌ $1${RESET}"; exit 1; }
step() { echo -e "\n${BOLD}─── Step $1 of $TOTAL_STEPS: $2 ${RESET}───────────────────────"; echo ""; }
section() { echo -e "\n${BOLD}─── $1 ${RESET}───────────────────────────────"; echo ""; }
# ask DEFAULT VALID_VALUES...
# Prompts user, validates input, returns choice on stdout
ask() {
local default="$1"
shift
local valid=("$@")
if [[ "$NON_INTERACTIVE" == "true" ]]; then
echo "$default"
return
fi
while true; do
echo -ne " Choose [${default}]: " >&2
local reply
read -r reply </dev/tty 2>/dev/null || reply=""
reply="${reply:-$default}"
# Validate if valid values were provided
if [[ ${#valid[@]} -gt 0 ]]; then
for v in "${valid[@]}"; do
if [[ "$reply" == "$v" ]]; then
echo "$reply"
return
fi
done
echo -e " ${YELLOW}Please enter one of: ${valid[*]}${RESET}" >&2
else
echo "$reply"
return
fi
done
}
# Check if a TCP port is in use (probe order: ss → lsof → nc → /dev/tcp)
#
# Only ss short-circuits: when it is present, no match really does mean the port
# is free. A negative lsof result proves nothing, because busybox's lsof (Alpine
# and friends) ignores -i/-s entirely, lists every open file and exits 0 --
# neither its exit code nor the absence of a "(LISTEN)" marker says anything
# about the port. Judging by exit code alone made every port read as taken and
# the resolver abort with "no free port found"; trusting a missing marker would
# make every port read as free and hand the raw bind error back to Docker. So a
# positive lsof match is trusted, and a negative one falls through to a connect
# probe, which behaves the same on every implementation.
port_in_use() {
local port="$1"
if command -v ss &>/dev/null; then
# Captured rather than piped into grep, for the same reason as the lsof
# branch below: `grep -q` exits on its first match, which can SIGPIPE ss
# while it is still writing. Under `set -o pipefail` that makes the whole
# pipeline non-zero even though the port WAS found -- so a busy port would
# read as free, and this branch does not fall through to another probe.
# The window is real on a host with enough listening sockets to overflow
# the 64 KiB pipe buffer, and the match can come long before the last row.
local ss_out=""
ss_out=$(ss -tln 2>/dev/null) || true
# Space/end-of-line anchor avoids matching port 70 when checking 7070
grep -qE ":${port}( |$)" <<<"$ss_out" && return 0
return 1
fi
if command -v lsof &>/dev/null; then
# Captured rather than piped into grep: `grep -q` exits on the first match
# and can SIGPIPE lsof, which `set -o pipefail` would then report as a
# failed pipeline even though the port was found.
local lsof_out=""
lsof_out=$(lsof -iTCP:"${port}" -sTCP:LISTEN 2>/dev/null) || true
[[ "$lsof_out" == *LISTEN* ]] && return 0
fi
if command -v nc &>/dev/null; then
nc -z 127.0.0.1 "${port}" 2>/dev/null && return 0
return 1
fi
# Last resort: /dev/tcp (bash built-in)
(echo >/dev/tcp/127.0.0.1/"${port}") 2>/dev/null && return 0
return 1
}
# A port already handed out during this run counts as taken: nothing is
# listening on it yet, so port_in_use alone would offer it twice.
reserve_port() { RESERVED_PORTS+=("$1"); }
port_reserved() {
# ${#arr[@]} is safe under `set -u` on an empty array; "${arr[@]}" is not on
# bash 3.2, which is what macOS still ships.
(( ${#RESERVED_PORTS[@]} == 0 )) && return 1
local p
for p in "${RESERVED_PORTS[@]}"; do
[[ "$p" == "$1" ]] && return 0
done
return 1
}
port_taken() { port_reserved "$1" || port_in_use "$1"; }
find_next_free_port() {
local start="$1"
for ((p=start; p<=start+100; p++)); do
if ! port_taken "$p"; then
echo "$p"
return
fi
done
echo "0"
}
# The project name `docker compose` will actually use, derived the same way it
# derives it: COMPOSE_PROJECT_NAME wins outright; otherwise it is the basename
# of the project directory, lowercased with everything outside [a-z0-9_-]
# stripped. The project directory is the directory of the FIRST -f file, which
# under --local is the repo checkout rather than EDDI_DIR -- getting that wrong
# makes our own containers look like foreign listeners, and the resolver then
# remaps a port it should have reused (or fails an explicit one outright).
compose_project_name() {
if [[ -n "${COMPOSE_PROJECT_NAME:-}" ]]; then
echo "$COMPOSE_PROJECT_NAME"
return
fi
local project_dir="$EDDI_DIR"
if [[ "${LOCAL_IMAGE:-false}" == "true" ]]; then
# Mirrors resolve_compose_files, which puts the repo's
# docker-compose.local.yml first and so makes the repo the project dir.
project_dir="${EDDI_REPO_ROOT:-${SCRIPT_DIR:-$(pwd)}}"
fi
local name
name=$(basename "$project_dir" | tr '[:upper:]' '[:lower:]' | tr -cd 'a-z0-9_-')
echo "${name:-eddi}"
}
# Is the listener on $1 a container of *our* Compose project? Then it is not a
# conflict -- `docker compose up` reuses that container instead of binding the
# port a second time.
port_owned_by_project() {
local port="$1" names project
project=$(compose_project_name)
names=$(docker ps --filter "publish=${port}" --filter "label=com.docker.compose.project=${project}" --format '{{.Names}}' 2>/dev/null) || return 1
[[ -n "$names" ]]
}
# Resolve one host port that the selected compose files publish. The wizard used
# to look at EDDI's own 7070/7443 and nothing else, so every other published
# port -- MongoDB 27017, Keycloak 8180, Grafana 3000, Prometheus 9090, Jaeger --
# reached `docker compose up` unchecked and failed there with a raw
# "ports are not available" bind error the installer could not explain.
# Containers reach each other on the compose network using the service name and
# the *internal* port, so moving a host port is invisible to the stack.
#
# Prints the resolved port on stdout; everything else goes to stderr.
# Usage: resolve_published_port LABEL DEFAULT REQUESTED ENV_KEY
resolve_published_port() {
local label="$1" default_port="$2" requested="$3" env_key="$4"
local preferred="$default_port" explicit=false
if [[ -n "$requested" ]]; then
explicit=true
if [[ ! "$requested" =~ ^[0-9]+$ ]] || (( requested < 1 || requested > 65535 )); then
fail "Invalid ${env_key} '${requested}'. Must be a port number (1-65535)." >&2
fi
preferred="$requested"
elif [[ -f "$EDDI_DIR/.env" ]]; then
# Reuse the port a previous install settled on, so re-runs stay stable
local previous
previous=$(grep -m1 -E "^${env_key}=[0-9]+$" "$EDDI_DIR/.env" 2>/dev/null | cut -d= -f2 || true)
[[ -n "$previous" ]] && preferred="$previous"
fi
if ! port_reserved "$preferred"; then
if ! port_in_use "$preferred"; then
info "${label} port: ${preferred}" >&2
echo "$preferred"
return
fi
# Our own container from a previous install already holds it -- compose
# reuses that container rather than binding the port a second time
if port_owned_by_project "$preferred"; then
info "${label} port: ${preferred} (held by the existing EDDI container)" >&2
echo "$preferred"
return
fi
fi
if [[ "$explicit" == "true" ]]; then
fail "Port ${preferred} is already in use.\n Stop the process using it, or set ${env_key} to a free port." >&2
fi
warn "Port ${preferred} is in use — moving ${label} to another port." >&2
local free
free=$(find_next_free_port $((preferred + 1)))
if [[ "$free" == "0" ]]; then
fail "No free port found near ${preferred} for ${label}.\n Stop the process using port ${preferred}, or set ${env_key} to a free port." >&2
fi
info "${label} port: ${free} (default ${preferred} was taken)" >&2
echo "$free"
}
# Resolve a port into the named global and reserve it. The reservation has to
# happen here: resolve_published_port runs in a command substitution, and a
# subshell cannot add to RESERVED_PORTS.
# Usage: resolve_port_into VAR_NAME LABEL DEFAULT REQUESTED ENV_KEY
resolve_port_into() {
local var_name="$1"
shift
local value
# Checked explicitly rather than left to `set -e`: the resolver runs in a
# command substitution, and set -e is suppressed for anything called from a
# condition context -- there the failed assignment would fall through and pin
# the port to an empty string.
if ! value=$(resolve_published_port "$@") || [[ -z "$value" ]]; then
exit 1
fi
printf -v "$var_name" '%s' "$value"
reserve_port "$value"
}
# Prompt the user for a port. Shows conflict info and suggests alternatives.
# Returns the chosen port on stdout.
# Usage: EDDI_PORT=$(read_port "HTTP" "$EDDI_PORT")
read_port() {
local port_name="$1"
local default_port="$2"
local suggested="$default_port"
if port_taken "$default_port"; then
warn "Port ${default_port} is already in use!" >&2
local next_free
next_free=$(find_next_free_port $((default_port + 1)))
if [[ "$next_free" != "0" ]]; then
echo -e " Suggested alternative: ${CYAN}${next_free}${RESET}" >&2
suggested="$next_free"
fi
else
echo -e " ${DIM}Port ${default_port} is available.${RESET}" >&2
fi
echo "" >&2
if [[ "$NON_INTERACTIVE" == "true" ]]; then
info "${port_name} port: ${suggested}" >&2
echo "$suggested"
return
fi
while true; do
echo -ne " ${port_name} port [${suggested}]: " >&2
local reply
read -r reply </dev/tty 2>/dev/null || reply=""
reply="${reply:-$suggested}"
if [[ "$reply" =~ ^[0-9]+$ ]] && (( reply >= 1024 && reply <= 65535 )); then
if port_taken "$reply"; then
warn "Port ${reply} is in use. Try another." >&2
else
info "${port_name} port: ${reply}" >&2
echo "$reply"
return
fi
else
echo -e " ${YELLOW}Please enter a valid port (1024-65535)${RESET}" >&2
fi
done
}
banner() {
echo ""
echo -e "${BOLD} ______ ____ ____ ____ ${RESET}"
echo -e "${BOLD} / ____/ / __ \\ / __ \\ / _/ ${RESET}"
echo -e "${BOLD} / __/ / / / / / / / / / / ${RESET}"
echo -e "${BOLD} / /___ / /_/ / / /_/ / _/ / ${RESET}"
echo -e "${BOLD} /_____/ /_____/ /_____/ /___/ ${RESET}"
echo ""
echo -e " ${BOLD}Multi-Agent Orchestration Middleware${RESET}"
echo -e " ${DIM}https://eddi.labs.ai${RESET}"
echo ""
}
# ── Parse arguments ────────────────────────────────────────
NON_INTERACTIVE=false
DB_CHOICE=""
WITH_AUTH=false
WITH_MONITORING=false
DEMO_USERS=false
LOCAL_IMAGE=false
VAULT_KEY_ARG=""
# Detect piped stdin (curl | bash) — disable interactive prompts
if [[ ! -t 0 ]]; then
NON_INTERACTIVE=true
fi
for arg in "$@"; do
case "$arg" in
--defaults) NON_INTERACTIVE=true; DB_CHOICE="${DB_CHOICE:-1}" ;;
--db=mongo*) DB_CHOICE="1" ;;
--db=postgres*) DB_CHOICE="2" ;;
--with-auth) WITH_AUTH=true ;;
--with-monitoring) WITH_MONITORING=true ;;
--demo-users) DEMO_USERS=true ;;
--vault-key=*) VAULT_KEY_ARG="${arg#*=}" ;;
--eddi-version=*) EDDI_VERSION="${arg#*=}" ;;
--mongo-port=*) MONGO_PORT_REQUESTED="${arg#*=}" ;;
--full) DB_CHOICE="2"; WITH_AUTH=true; WITH_MONITORING=true ;;
--local) LOCAL_IMAGE=true ;;
--help|-h)
echo "EDDI Install Script"
echo ""
echo "Usage: curl -fsSL .../install.sh | bash"
echo " bash install.sh [OPTIONS]"
echo ""
echo "Options:"
echo " --defaults Accept all defaults (non-interactive)"
echo " --db=mongodb Use MongoDB (default)"
echo " --db=postgres Use PostgreSQL"
echo " --vault-key=<key> Set vault master key (min 16 chars)"
echo " --with-auth Include Keycloak authentication"
echo " --with-monitoring Include Grafana + Prometheus"
echo " --demo-users With --with-auth: also give the realm's unprivileged"
echo " viewer and user accounts a one-time password"
echo " --eddi-version=<tag> Pin EDDI image tag (default: latest)"
echo " --mongo-port=<port> Host port for MongoDB (default: 27017)"
echo " --full All options enabled"
echo " --local Use locally built Docker image (skip pull)"
echo ""
echo "Environment variables:"
echo " EDDI_PORT HTTP port (default: 7070)"
echo " EDDI_HTTPS_PORT HTTPS port (default: 7443)"
echo " MONGO_PORT Host port for MongoDB (default: 27017)"
echo " KEYCLOAK_PORT Host port for Keycloak (default: 8180)"
echo " KC_BOOTSTRAP_ADMIN_PASSWORD Keycloak bootstrap admin password (default: generated,"
echo " kept in .env across re-runs)"
echo " GRAFANA_ADMIN_USER Grafana admin user (default: admin)"
echo " GRAFANA_ADMIN_PASSWORD Grafana admin password (default: generated, kept in .env)"
echo " GRAFANA_PORT Host port for Grafana (default: 3000)"
echo " PROMETHEUS_PORT Host port for Prometheus (default: 9090)"
echo " JAEGER_PORT Host port for the Jaeger UI (default: 16686)"
echo " OTLP_GRPC_PORT Host port for Jaeger OTLP gRPC (default: 4317)"
echo " OTLP_HTTP_PORT Host port for Jaeger OTLP HTTP (default: 4318)"
echo " EDDI_DIR Install directory (default: ~/.eddi)"
echo " EDDI_VERSION Image tag to pull (default: latest)"
echo ""
echo " Every port is resolved before the containers start. A port left"
echo " at its default is kept when free and moved to the next free port"
echo " when something holds it. A port you pin here -- or with"
echo " --mongo-port= -- is never moved: if it is busy the install stops"
echo " and says so, rather than starting somewhere you did not ask for."
exit 0
;;
esac
done
# Resolve EDDI_BRANCH now that --eddi-version has been parsed. An explicit
# EDDI_BRANCH always wins; otherwise a pinned version fetches its matching tag and
# only the floating "latest" falls back to main.
resolve_eddi_branch() {
if [[ -n "$EDDI_BRANCH_EXPLICIT" ]]; then
EDDI_BRANCH="$EDDI_BRANCH_EXPLICIT"
elif [[ -n "${EDDI_VERSION:-}" && "$EDDI_VERSION" != "latest" ]]; then
# Release tags are not v-prefixed (see AGENTS.md CI notes), so the tag IS the
# version string, e.g. EDDI_VERSION=6.5.0 -> ref 6.5.0.
EDDI_BRANCH="$EDDI_VERSION"
else
EDDI_BRANCH="main"
fi
if [[ ! "$EDDI_BRANCH" =~ ^[a-zA-Z0-9._/-]+$ ]]; then
echo "Invalid EDDI_BRANCH: $EDDI_BRANCH" >&2; exit 1
fi
COMPOSE_BASE_URL="https://raw.githubusercontent.com/labsai/EDDI/${EDDI_BRANCH}"
}
resolve_eddi_branch
# ── Pre-flight checks ─────────────────────────────────────
detect_platform() {
PLATFORM="unknown"
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
if grep -qi microsoft /proc/version 2>/dev/null; then
PLATFORM="wsl"
else
PLATFORM="linux"
fi
elif [[ "$OSTYPE" == "darwin"* ]]; then
PLATFORM="macos"
fi
}
install_docker_linux() {
# Pinned Docker convenience install script (OpenSSF: pin downloads by hash)
# Source: https://github.com/docker/docker-install
# To update: pick a new commit, download, compute sha256sum, update both values.
local DOCKER_INSTALL_COMMIT="f2b0ef96e1f2a34340caf3c72a0a727aa0c48ec7"
local DOCKER_INSTALL_SHA256="93f04ab7de485fb08498d8d0257f11a1ffee145ebcc2074dc21937eacc706a2b"
local DOCKER_INSTALL_URL="https://raw.githubusercontent.com/docker/docker-install/${DOCKER_INSTALL_COMMIT}/install.sh"
echo ""
echo -e " ${BOLD}Docker is required but not installed.${RESET}"
echo ""
if [[ "$NON_INTERACTIVE" == "true" ]]; then
echo " Install Docker first: https://docs.docker.com/get-docker/"
exit 1
fi
echo -ne " Install Docker now? [Y/n]: " >&2
local reply
read -r reply </dev/tty 2>/dev/null || reply="y"
reply="${reply:-y}"
if [[ "$reply" =~ ^[Yy]$ ]]; then
echo -e " Installing Docker via ${CYAN}docker/docker-install${RESET}..."
local docker_install_script
docker_install_script=$(mktemp "${TMPDIR:-/tmp}/get-docker.XXXXXX")
if curl -fsSL "$DOCKER_INSTALL_URL" -o "$docker_install_script"; then
# Verify integrity before execution (OpenSSF pinned-dependencies requirement)
local actual_hash
actual_hash=$(sha256sum "$docker_install_script" | cut -d' ' -f1)
if [[ "$actual_hash" != "$DOCKER_INSTALL_SHA256" ]]; then
rm -f "$docker_install_script"
fail "Docker install script hash mismatch!\n Expected: ${DOCKER_INSTALL_SHA256}\n Got: ${actual_hash}\n The pinned script may need updating. Install Docker manually: https://docs.docker.com/get-docker/"
fi
if sh "$docker_install_script"; then
rm -f "$docker_install_script"
info "Docker installed!"
# Add current user to docker group (takes effect on next login)
if ! groups | grep -q docker; then
sudo usermod -aG docker "$USER" 2>/dev/null || true
echo -e " ${YELLOW}Note: You may need to log out/in for Docker group to take effect.${RESET}"
echo -e " ${YELLOW} If docker commands fail, run: newgrp docker${RESET}"
fi
else
rm -f "$docker_install_script"
fail "Docker installation failed. Try manually: https://docs.docker.com/get-docker/"
fi
else
rm -f "$docker_install_script"
fail "Failed to download Docker install script.\n Try manually: https://docs.docker.com/get-docker/"
fi
else
echo " Install Docker first, then re-run this script."
exit 1
fi
}
check_prerequisites() {
echo ""
detect_platform
# curl
if ! command -v curl &>/dev/null; then
fail "curl is required but not found.\n Install: apt install curl / brew install curl"
fi
# Docker
if ! command -v docker &>/dev/null; then
case "$PLATFORM" in
linux|wsl)
install_docker_linux
;;
macos)
echo -e " ${RED}❌ Docker is not installed.${RESET}"
echo ""
echo " Install Docker Desktop for macOS:"
echo " brew install --cask docker"
echo " — or —"
echo " https://docs.docker.com/desktop/install/mac-install/"
echo ""
echo " After installing, open Docker Desktop and wait for it to start."
exit 1
;;
*)
echo -e " ${RED}❌ Docker is not installed.${RESET}"
echo ""
echo " Install Docker: https://docs.docker.com/get-docker/"
exit 1
;;
esac
fi
info "Docker found ($(docker --version | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1))"
# Docker daemon running
if ! docker info &>/dev/null 2>&1; then
case "$PLATFORM" in
macos)
fail "Docker is installed but not running.\n Open Docker Desktop from Applications." ;;
linux|wsl)
fail "Docker is installed but not running.\n Run: sudo systemctl start docker" ;;
*)
fail "Docker is installed but not running.\n Start Docker Desktop or the Docker daemon." ;;
esac
fi
# Docker Compose
if docker compose version &>/dev/null 2>&1; then
info "Docker Compose found ($(docker compose version --short 2>/dev/null))"
else
fail "Docker Compose not found.\n Docker Compose is included with Docker Desktop.\n Linux: sudo apt install docker-compose-plugin"
fi
# Disk space check (need ~2GB for images)
local available_gb
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS df doesn't support -BG, use -g for GB blocks
available_gb=$(df -g "$HOME" 2>/dev/null | awk 'NR==2{print $4}') || available_gb=999
else
available_gb=$(df -BG "$HOME" 2>/dev/null | awk 'NR==2{print $4}' | tr -d 'G') || available_gb=999
fi
if [[ "$available_gb" =~ ^[0-9]+$ ]] && [[ "$available_gb" -lt 3 ]]; then
warn "Low disk space (${available_gb}GB free). EDDI images need ~2GB."
warn "Free space: docker system prune"
fi
# Port check — is EDDI already running?
if curl -sf "http://localhost:${EDDI_PORT}/q/health/ready" &>/dev/null 2>&1; then
EDDI_ALREADY_RUNNING=true
info "EDDI already running on port ${EDDI_PORT}"
else
EDDI_ALREADY_RUNNING=false
fi
}
# ── Wizard steps ───────────────────────────────────────────
TOTAL_STEPS=5
EDDI_VAULT_MASTER_KEY=""
wizard_database() {
if [[ -n "$DB_CHOICE" ]]; then return; fi
step 1 "Database"
echo " EDDI needs a database to store agent configs & conversations."
echo ""
echo -e " ${BOLD}1)${RESET} MongoDB ${DIM}document store, simple setup (default)${RESET}"
echo -e " ${BOLD}2)${RESET} PostgreSQL ${DIM}relational, SQL-queryable, familiar${RESET}"
echo ""
DB_CHOICE=$(ask "1" "1" "2")
}
# Generate a cryptographically random vault key (32 base64 chars)
generate_vault_key() {
if command -v openssl &>/dev/null; then
openssl rand -base64 24
else
# Fallback: read from /dev/urandom
head -c 24 /dev/urandom | base64
fi
}
# A random password of 32 characters from [A-Za-z0-9] (~190 bits). Alphanumeric
# on purpose: it survives .env quoting, a form-encoded token request and a JSON
# body without escaping. Each `|| true` keeps a SIGPIPE from `head` from ending
# the installer under `set -o pipefail`.
generate_password() {
local out=""
if command -v openssl &>/dev/null; then
out=$(openssl rand -base64 64 | tr -dc 'A-Za-z0-9' | head -c 32 || true)
fi
if [[ ${#out} -lt 32 ]]; then
out=$(LC_ALL=C tr -dc 'A-Za-z0-9' </dev/urandom | head -c 32 || true)
fi
printf '%s' "$out"
}
# The value of KEY in an existing .env, surrounding quotes stripped; empty when
# the file or the key is absent.
env_file_value() {
local key="$1" value=""
[[ -f "$EDDI_DIR/.env" ]] || return 0
value=$(grep -m1 "^${key}=" "$EDDI_DIR/.env" 2>/dev/null | cut -d= -f2- || true)
value="${value%$'\r'}"
value="${value#[\"\']}"
value="${value%[\"\']}"
printf '%s' "$value"
}
# Resolves the admin credentials of the selected compose overlays, BEFORE .env is
# written: an exported value, else the one a previous run stored in .env, else a
# new one. Keeping the stored value matters — Keycloak and Grafana read theirs
# only when their volume is first initialised, so a new value on every re-run
# would silently stop matching the running service.
resolve_stack_passwords() {
# Stored values are read back WHATEVER this run's flags are, and the .env
# write in resolve_compose_files (which runs after this) carries them forward. A re-run without --with-auth used to rewrite .env
# without them while the keycloak-data volume survived — deleting the only
# copy of the password that volume answers to, so a later --with-auth run
# generated a new one and was locked out of the master realm. A stale
# password in .env is harmless; a lost one is not.
[[ -n "$KC_BOOTSTRAP_ADMIN_USERNAME" ]] || KC_BOOTSTRAP_ADMIN_USERNAME=$(env_file_value KC_BOOTSTRAP_ADMIN_USERNAME)
[[ -n "$KC_BOOTSTRAP_ADMIN_PASSWORD" ]] || KC_BOOTSTRAP_ADMIN_PASSWORD=$(env_file_value KC_BOOTSTRAP_ADMIN_PASSWORD)
[[ -n "$GRAFANA_ADMIN_USER" ]] || GRAFANA_ADMIN_USER=$(env_file_value GRAFANA_ADMIN_USER)
[[ -n "$GRAFANA_ADMIN_PASSWORD" ]] || GRAFANA_ADMIN_PASSWORD=$(env_file_value GRAFANA_ADMIN_PASSWORD)
if [[ "$WITH_AUTH" == "true" ]]; then
[[ -n "$KC_BOOTSTRAP_ADMIN_USERNAME" ]] || KC_BOOTSTRAP_ADMIN_USERNAME="admin"
if [[ -z "$KC_BOOTSTRAP_ADMIN_PASSWORD" ]]; then
KC_BOOTSTRAP_ADMIN_PASSWORD=$(generate_password)
KC_ADMIN_PASSWORD_GENERATED=true
fi
fi
if [[ "$WITH_MONITORING" == "true" && -z "$GRAFANA_ADMIN_PASSWORD" ]]; then
GRAFANA_ADMIN_PASSWORD=$(generate_password)
GRAFANA_PASSWORD_GENERATED=true
fi
# Written single-quoted into .env, where compose reads the value literally;
# a single quote is the one character that cannot be carried that way.
local value
for value in "$KC_BOOTSTRAP_ADMIN_USERNAME" "$KC_BOOTSTRAP_ADMIN_PASSWORD" "$GRAFANA_ADMIN_USER" "$GRAFANA_ADMIN_PASSWORD"; do
if [[ "$value" == *"'"* ]]; then
fail "KC_BOOTSTRAP_ADMIN_USERNAME, KC_BOOTSTRAP_ADMIN_PASSWORD, GRAFANA_ADMIN_USER and GRAFANA_ADMIN_PASSWORD must not contain a single quote (')."
fi
done
if [[ ( "$WITH_AUTH" == "true" && -z "$KC_BOOTSTRAP_ADMIN_PASSWORD" ) \
|| ( "$WITH_MONITORING" == "true" && -z "$GRAFANA_ADMIN_PASSWORD" ) ]]; then
fail "Could not generate an admin password (neither openssl nor /dev/urandom produced one)."
fi
}
wizard_security() {
# If a key was provided via CLI arg, use it
if [[ -n "$VAULT_KEY_ARG" ]]; then
if [[ ${#VAULT_KEY_ARG} -lt 16 ]]; then
fail "Vault key must be at least 16 characters (got ${#VAULT_KEY_ARG})"
fi
EDDI_VAULT_MASTER_KEY="$VAULT_KEY_ARG"
return
fi
# If a key already exists from a previous install, preserve it
local env_file="$EDDI_DIR/.env"
if [[ -f "$env_file" ]]; then
local existing_key
existing_key=$(sed -n 's/^EDDI_VAULT_MASTER_KEY=//p' "$env_file" 2>/dev/null || true)
# Strip surrounding double quotes to prevent quote accumulation on re-runs
existing_key="${existing_key#\"}"
existing_key="${existing_key%\"}"
if [[ -n "$existing_key" ]]; then
EDDI_VAULT_MASTER_KEY="$existing_key"
info "Vault key preserved from previous install" >&2
return
fi
fi
step 2 "Security"
echo " EDDI encrypts API keys and secrets using a vault master key."
echo " This key is unique to your installation — keep it safe!"
echo ""
if [[ "$NON_INTERACTIVE" == "true" ]]; then
# Auto-generate for non-interactive installs
EDDI_VAULT_MASTER_KEY=$(generate_vault_key)
info "Vault master key auto-generated"
return
fi
echo -e " ${BOLD}1)${RESET} Auto-generate ${DIM}strong random key (recommended)${RESET}"
echo -e " ${BOLD}2)${RESET} Custom ${DIM}enter your own passphrase (min 16 chars)${RESET}"
echo ""
local sec_choice
sec_choice=$(ask "1" "1" "2")
if [[ "$sec_choice" == "1" ]]; then
EDDI_VAULT_MASTER_KEY=$(generate_vault_key)
info "Vault master key generated"
else
while true; do
echo -ne " Enter passphrase: " >&2
local passphrase
read -rs passphrase </dev/tty 2>/dev/null || passphrase=""
echo "" >&2
if [[ ${#passphrase} -lt 16 ]]; then
echo -e " ${YELLOW}Passphrase must be at least 16 characters${RESET}" >&2
else
EDDI_VAULT_MASTER_KEY="$passphrase"
info "Custom passphrase set"
break
fi
done
fi
}
wizard_auth() {
if [[ "$NON_INTERACTIVE" == "true" ]]; then return; fi
if [[ "$WITH_AUTH" == "true" ]]; then return; fi
step 3 "Authentication"
echo " How should EDDI handle user access?"
echo ""
echo -e " ${BOLD}1)${RESET} Open access ${DIM}no login needed — bound to 127.0.0.1 only (dev / personal)${RESET}"
echo -e " ${BOLD}2)${RESET} Keycloak ${DIM}multi-user OIDC — required before exposing off-box (production)${RESET}"
echo ""
echo -e " ${DIM}Open access stays safe because EDDI listens on localhost only. Do not set${RESET}"
echo -e " ${DIM}EDDI_BIND to a public interface without choosing Keycloak here.${RESET}"
echo ""
local auth_choice
auth_choice=$(ask "1" "1" "2")
if [[ "$auth_choice" == "2" ]]; then WITH_AUTH=true; fi
}
wizard_monitoring() {
if [[ "$NON_INTERACTIVE" == "true" ]]; then return; fi
if [[ "$WITH_MONITORING" == "true" ]]; then return; fi
step 4 "Monitoring"
echo -e " ${BOLD}1)${RESET} Skip for now ${DIM}add later with: eddi update --with-monitoring${RESET}"
echo -e " ${BOLD}2)${RESET} Grafana ${DIM}dashboards + Prometheus metrics${RESET}"
echo ""
local mon_choice
mon_choice=$(ask "1" "1" "2")
if [[ "$mon_choice" == "2" ]]; then WITH_MONITORING=true; fi
}
wizard_ports() {
step 5 "Ports"
echo " EDDI uses two ports: HTTP for the dashboard/API, HTTPS for secure access."
echo ""
EDDI_PORT=$(read_port "HTTP" "$EDDI_PORT")
reserve_port "$EDDI_PORT"
EDDI_HTTPS_PORT=$(read_port "HTTPS" "$EDDI_HTTPS_PORT")
reserve_port "$EDDI_HTTPS_PORT"
# Every other host port the selected compose files publish, resolved before
# docker refuses the bind
if [[ "${DB_CHOICE:-1}" == "2" ]]; then
# postgres-only.yml publishes no database port
MONGO_PORT=""
else
resolve_port_into MONGO_PORT "MongoDB" 27017 "$MONGO_PORT_REQUESTED" MONGO_PORT
fi
if [[ "$WITH_AUTH" == "true" ]]; then
resolve_port_into KEYCLOAK_PORT "Keycloak" 8180 "$KEYCLOAK_PORT_REQUESTED" KEYCLOAK_PORT
fi
if [[ "$WITH_MONITORING" == "true" ]]; then
resolve_port_into GRAFANA_PORT "Grafana" 3000 "$GRAFANA_PORT_REQUESTED" GRAFANA_PORT
resolve_port_into PROMETHEUS_PORT "Prometheus" 9090 "$PROMETHEUS_PORT_REQUESTED" PROMETHEUS_PORT
resolve_port_into JAEGER_PORT "Jaeger UI" 16686 "$JAEGER_PORT_REQUESTED" JAEGER_PORT
resolve_port_into OTLP_GRPC_PORT "Jaeger OTLP gRPC" 4317 "$OTLP_GRPC_PORT_REQUESTED" OTLP_GRPC_PORT
resolve_port_into OTLP_HTTP_PORT "Jaeger OTLP HTTP" 4318 "$OTLP_HTTP_PORT_REQUESTED" OTLP_HTTP_PORT
fi
}
# ── Compose file management ───────────────────────────────
# Detect script directory (empty when piped via curl | bash)
# Guard: when piped, BASH_SOURCE is empty and dirname resolves to CWD,
# which could contain unrelated files (e.g. ~/docker-compose.yml).
if [[ -n "${BASH_SOURCE[0]:-}" && -f "${BASH_SOURCE[0]}" ]]; then
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)" || SCRIPT_DIR=""
else
SCRIPT_DIR=""
fi
resolve_compose_files() {
mkdir -p "$EDDI_DIR"
local needed_files=()
COMPOSE_FILES=()
# Base compose file depends on database choice
if [[ "${DB_CHOICE:-1}" == "2" ]]; then
needed_files+=("docker-compose.postgres-only.yml")
else
needed_files+=("docker-compose.yml")
fi
# Local build overlay (overrides image with local build context)
if [[ "$LOCAL_IMAGE" == "true" ]]; then
# --local requires running from the EDDI repo checkout
EDDI_REPO_ROOT="${SCRIPT_DIR:-$(pwd)}"
if [[ ! -f "$EDDI_REPO_ROOT/docker-compose.local.yml" ]]; then
fail "--local requires running from the EDDI repo root.\n Run: cd /path/to/EDDI && bash install.sh --local"
fi
if [[ ! -f "$EDDI_REPO_ROOT/src/main/docker/Dockerfile" ]]; then
fail "Dockerfile not found. Run: ./mvnw package -DskipTests first."
fi
# Use the file directly from the repo (build context must be repo root)
COMPOSE_FILES+=("$EDDI_REPO_ROOT/docker-compose.local.yml")
fi
# Auth overlay
if [[ "$WITH_AUTH" == "true" ]]; then
needed_files+=("docker-compose.auth.yml")
fi
# Monitoring overlay
if [[ "$WITH_MONITORING" == "true" ]]; then
needed_files+=("docker-compose.monitoring.yml")
fi
# Resolve each file: prefer local copy, fall back to download
for f in "${needed_files[@]}"; do
local class="pl-s">"$EDDI_DIR/$f"
if [[ -n "$SCRIPT_DIR" && -f "$SCRIPT_DIR/$f" ]]; then
# File exists next to the script — copy to install dir
cp "$SCRIPT_DIR/$f" "$target"
echo -e " Using local ${f} ${GREEN}✅${RESET}"
else
# Not available locally — download from GitHub
local download_url="${COMPOSE_BASE_URL}/${f}"
echo -ne " Downloading ${f}... "
if curl -fsSL "${download_url}" -o "$target"; then
echo -e "${GREEN}✅${RESET}"
else
fail "Failed to download ${f}.\n URL: ${download_url}\n Check your internet connection and that the branch '${EDDI_BRANCH}' exists."
fi
fi
COMPOSE_FILES+=("$target")
done
# Download monitoring support files if needed
if [[ "$WITH_MONITORING" == "true" ]]; then
echo ""
echo -e " ${DIM}Downloading monitoring configuration...${RESET}"
local monitoring_files=(
"docs/monitoring/prometheus.yml"
"docs/monitoring/grafana-provisioning/dashboards/dashboards.yml"
"docs/monitoring/grafana-provisioning/datasources/datasources.yml"
"docs/monitoring/eddi-grafana-dashboard.json"
"docs/monitoring/eddi-operations-dashboard.json"
"docs/monitoring/eddi-full-metrics-dashboard.json"
)
for mf in "${monitoring_files[@]}"; do
local mf_target="$EDDI_DIR/$mf"
local mf_dir
mf_dir=$(dirname "$mf_target")
mkdir -p "$mf_dir"
if [[ -n "$SCRIPT_DIR" && -f "$SCRIPT_DIR/$mf" ]]; then
cp "$SCRIPT_DIR/$mf" "$mf_target"
else
local mf_url="${COMPOSE_BASE_URL}/${mf}"
echo -ne " Downloading ${mf}... "
if curl -fsSL "${mf_url}" -o "$mf_target"; then
echo -e "${GREEN}✅${RESET}"
else
# Every one of these is bind-mounted as a FILE by
# docker-compose.monitoring.yml, so a missing one is worse than it
# sounds: Docker creates a *directory* at the mount path. What happens
# next depends on the grafana-data volume, and neither outcome is
# acceptable — on a fresh volume the container starts and the dashboard
# is silently absent with nothing logged, and on a volume that already
# holds a file there runc fails the mount ("Are you trying to mount a
# directory onto a file") and the container never leaves state Created.
# The first case also poisons the volume: it creates a directory inside
# it, after which restoring the host file fails the mount in the
# opposite direction until that stale directory is deleted. Same
# reasoning as the Keycloak realm below; a half-built monitoring stack
# is not better than a refusal to build one.
#
# This list must therefore stay in step with every file-type bind
# mount in docker-compose.monitoring.yml. Adding a dashboard there
# without adding it here breaks --with-monitoring outright.
# -rf, not -f: the thing in the way is most likely a DIRECTORY that a
# previous run's failed mount left behind, and `rm -f` cannot remove
# one. Under `set -e` that turns this cleanup into the script's exit
# point, so the user sees "rm: cannot remove ...: Is a directory"
# instead of the message below, and the stale path survives to break
# the next run too.
rm -rf "$mf_target"
fail "Failed to download ${mf} (required for --with-monitoring).\n URL: ${mf_url}"
fi
fi
done
fi
# Download Keycloak realm if auth enabled