-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make Keycloak Admin configurable #9490
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,9 +44,9 @@ objects: | |
- name: POSTGRES_PASSWORD | ||
value: keycloak | ||
- name: KEYCLOAK_USER | ||
value: admin | ||
value: "${KEYCLOAK_USER}" | ||
- name: KEYCLOAK_PASSWORD | ||
value: admin | ||
value: "${KEYCLOAK_PASSWORD}" | ||
- name: PROTOCOL | ||
value: "${PROTOCOL}" | ||
- name: ROUTING_SUFFIX | ||
|
@@ -140,10 +140,20 @@ objects: | |
storage: 1Gi | ||
|
||
parameters: | ||
|
||
- name: PROTOCOL | ||
displayName: htpps or http protocol | ||
description: Protocol to be used in Che communications | ||
value: http | ||
- name: KEYCLOAK_USER | ||
displayName: Keycloak admin user | ||
description: Default Keycloak admin user | ||
value: "admin" | ||
- name: KEYCLOAK_PASSWORD | ||
displayName: Keycloak admin password | ||
description: Default Keycloak admin password. Can be changed after login | ||
value: "admin" | ||
value: http | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like this line is a typo There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. Thanks |
||
- name: ROUTING_SUFFIX | ||
displayName: Routing suffix of your OpenShift cluster | ||
description: This is the suffix appended to routes in your OpenShift cluster <route>.<project>.<routing_suffix> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,9 +13,6 @@ cat /scripts/che-users-0.json.erb | \ | |
sed -e "/<% end -%>/d" | \ | ||
sed -e "/\"requiredActions\" : \[ \],/d" > /scripts/che-users-0.json | ||
|
||
cp /scripts/master-users-0.json.erb /scripts/master-users-0.json | ||
cp /scripts/master-realm.json.erb /scripts/master-realm.json | ||
|
||
if [ "${CHE_KEYCLOAK_ADMIN_REQUIRE_UPDATE_PASSWORD}" == "false" ]; then | ||
sed -i -e "s#\"UPDATE_PASSWORD\"##" /scripts/che-users-0.json | ||
fi | ||
|
@@ -24,6 +21,12 @@ cat /scripts/che-realm.json.erb | \ | |
sed -e "s@<%= scope\.lookupvar('che::che_server_url') %>@${PROTOCOL}://che-${NAMESPACE}.${ROUTING_SUFFIX}@" \ | ||
> /scripts/che-realm.json | ||
|
||
echo "Creating Admin user..." | ||
|
||
if [ $KEYCLOAK_USER ] && [ $KEYCLOAK_PASSWORD ]; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Basically reused this https://github.com/jboss-dockerfiles/keycloak/blob/3.3.0.CR2-3/server/docker-entrypoint.sh In fact, even a check isn't really required since ENVS are set in deploymentConfig. |
||
/opt/jboss/keycloak/bin/add-user-keycloak.sh --user $KEYCLOAK_USER --password $KEYCLOAK_PASSWORD | ||
fi | ||
|
||
echo "Starting Keycloak server..." | ||
|
||
/opt/jboss/keycloak/bin/standalone.sh -Dkeycloak.migration.action=import \ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this empty line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Thanks