Skip to content

Commit 0fbbcb6

Browse files
committed
Changed monitoring script
1 parent 87a108d commit 0fbbcb6

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

infrastructure/scripts/setup/monitoring.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,20 @@ trap cleanup EXIT
3232

3333
# -- Generate secure username and password for webhook
3434
WEBHOOK_USER="grafana-alerts"
35-
WEBHOOK_PASSWORD=$(openssl rand -base64 16 | tr -d '\n')
35+
36+
# Try to source IDE_PASSWORD from workshop configuration
37+
if [[ -f /etc/profile.d/workshop.sh ]]; then
38+
source /etc/profile.d/workshop.sh
39+
fi
40+
41+
# Use IDE_PASSWORD if available and not empty, otherwise generate random password
42+
if [[ -n "${IDE_PASSWORD:-}" ]]; then
43+
WEBHOOK_PASSWORD="$IDE_PASSWORD"
44+
log "Using IDE_PASSWORD from workshop configuration"
45+
else
46+
WEBHOOK_PASSWORD=$(openssl rand -base64 16 | tr -d '\n')
47+
log "Generated random webhook password (IDE_PASSWORD not available)"
48+
fi
3649

3750
# -- Create the secret for webhook
3851
aws secretsmanager create-secret \

0 commit comments

Comments
 (0)