parent
03086c7a06
commit
e20e00a3c2
@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
export PATH=/opt/keycloak/bin:$PATH
|
||||
|
||||
# perform an authentication as admin so that all other scripts can
|
||||
# use the cached credentials
|
||||
|
||||
kcadm.sh \
|
||||
config credentials \
|
||||
--server http://keycloak:8080/ \
|
||||
--user admin \
|
||||
--password "$KEYCLOAK_ADMIN_PASSWORD" \
|
||||
--realm master \
|
||||
|| exit 1
|
||||
|
||||
for file in /keycloak-setup/* ; do
|
||||
echo >&2 "$file: running setup"
|
||||
$file || exit 1
|
||||
done
|
@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -z "$SMTP_SERVER" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo >&2 "*** configuring email to use $SMTP_SERVER"
|
||||
/opt/keycloak/bin/kcadm.sh update \
|
||||
"realms/$REALM" \
|
||||
-f - <<EOF || exit 1
|
||||
{
|
||||
"resetPasswordAllowed": "true",
|
||||
"smtpServer" : {
|
||||
"auth" : "true",
|
||||
"starttls" : "true",
|
||||
"user" : "$SMTP_USER",
|
||||
"password" : "$SMTP_PASSWORD",
|
||||
"port" : "$SMTP_PORT",
|
||||
"host" : "$SMTP_SERVER",
|
||||
"from" : "keycloak@$DOMAIN_NAME",
|
||||
"fromDisplayName" : "Keycloak @ $DOMAIN_NAME",
|
||||
"ssl" : "false"
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
exit 0
|
Loading…
Reference in new issue