new: [add] new charm keycloak
This commit is contained in:
12
keycloak-elabore/hooks/init
Executable file
12
keycloak-elabore/hooks/init
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
admin_password=$(options-get admin-password) || exit 1
|
||||
|
||||
init-config-add "\
|
||||
$MASTER_BASE_SERVICE_NAME:
|
||||
environment:
|
||||
KEYCLOAK_ADMIN: \"admin\"
|
||||
KEYCLOAK_ADMIN_PASSWORD: \"$admin_password\"
|
||||
"
|
17
keycloak-elabore/hooks/postgres_database-relation-joined
Executable file
17
keycloak-elabore/hooks/postgres_database-relation-joined
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
PASSWORD="$(relation-get password)"
|
||||
USER="$(relation-get user)"
|
||||
DBNAME="$(relation-get dbname)"
|
||||
|
||||
config-add "\
|
||||
services:
|
||||
$MASTER_BASE_SERVICE_NAME:
|
||||
environment:
|
||||
KC_DB_URL: \"jdbc:postgresql://$MASTER_TARGET_SERVICE_NAME:5432/$DBNAME\"
|
||||
KC_DB_USERNAME: \"$USER\"
|
||||
KC_DB_PASSWORD: \"$PASSWORD\"
|
||||
KC_DB: \"postgres\"
|
||||
"
|
21
keycloak-elabore/hooks/web_proxy-relation-joined
Executable file
21
keycloak-elabore/hooks/web_proxy-relation-joined
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
. lib/common
|
||||
|
||||
DOMAIN=$(relation-get domain) || exit 1
|
||||
#IP_HOST=$(hostname -I | awk '{print $1}')
|
||||
|
||||
set -e
|
||||
keycloak:generate-key-if-not-exist "$DOMAIN"
|
||||
|
||||
|
||||
config-add "\
|
||||
services:
|
||||
$MASTER_BASE_SERVICE_NAME:
|
||||
environment:
|
||||
KC_HOSTNAME: \"$DOMAIN\"
|
||||
KC_PROXY: edge
|
||||
KC_HTTP_ENABLED: \"true\"
|
||||
KC_HOSTNAME_STRICT: \"false\"
|
||||
"
|
||||
|
Reference in New Issue
Block a user