Skip to content

Commit 5230e48

Browse files
committed
chore: Make hostname configureable in realm
1 parent fb844cd commit 5230e48

File tree

4 files changed

+28
-26
lines changed

4 files changed

+28
-26
lines changed

compas/docker-compose-postgresql.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ services:
3737
- KC_HTTP_RELATIVE_PATH=auth
3838
- KC_HTTP_ENABLED=true
3939
- KC_PROXY_HEADERS=xforwarded
40-
volumes:
41-
- ./keycloak/realms:/opt/keycloak/data/import
4240
healthcheck:
4341
test: ["CMD", "curl", "-f", "http://localhost:8080/auth/"]
4442
interval: 30s

compas/keycloak/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ FROM quay.io/keycloak/keycloak:latest
66

77
ARG COMPAS_HOSTNAME
88

9+
# Copy the demo realm configuration to /opt/keycloak/data/import inside the container, this is the default import path
10+
COPY --chown=keycloak:keycloak keycloak_compas_realm.json /opt/keycloak/data/import/keycloak_compas_realm.json
11+
RUN sed -i "s/##COMPAS_HOSTNAME##/${COMPAS_HOSTNAME}/g" /opt/keycloak/data/import/keycloak_compas_realm.json
12+
913
# Creating an Admin account
1014
ENV KC_DB_USERNAME admin
1115
ENV KC_DB_PASSWORD admin

compas/keycloak/realms/keycloak_compas_realm.json renamed to compas/keycloak/keycloak_compas_realm.json

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,17 +1248,17 @@
12481248
"clientId": "cim-mapping",
12491249
"name": "CIM Mapping",
12501250
"description": "CIM Mapping Service to convert CIM Data to SCL Data",
1251-
"rootUrl": "http://127.0.0.1/",
1252-
"adminUrl": "http://127.0.0.1/",
1251+
"rootUrl": "http://##COMPAS_HOSTNAME##/",
1252+
"adminUrl": "http://##COMPAS_HOSTNAME##/",
12531253
"surrogateAuthRequired": false,
12541254
"enabled": true,
12551255
"alwaysDisplayInConsole": false,
12561256
"clientAuthenticatorType": "client-secret",
12571257
"redirectUris": [
1258-
"http://127.0.0.1/*"
1258+
"http://##COMPAS_HOSTNAME##/*"
12591259
],
12601260
"webOrigins": [
1261-
"http://127.0.0.1"
1261+
"http://##COMPAS_HOSTNAME##"
12621262
],
12631263
"notBefore": 0,
12641264
"bearerOnly": false,
@@ -1328,17 +1328,17 @@
13281328
{
13291329
"id": "ace17366-e696-4821-9f24-89b797acb736",
13301330
"clientId": "openscd",
1331-
"rootUrl": "http://127.0.0.1/",
1332-
"adminUrl": "http://127.0.0.1/",
1331+
"rootUrl": "http://##COMPAS_HOSTNAME##/",
1332+
"adminUrl": "http://##COMPAS_HOSTNAME##/",
13331333
"surrogateAuthRequired": false,
13341334
"enabled": true,
13351335
"alwaysDisplayInConsole": false,
13361336
"clientAuthenticatorType": "client-secret",
13371337
"redirectUris": [
1338-
"http://127.0.0.1/*"
1338+
"http://##COMPAS_HOSTNAME##/*"
13391339
],
13401340
"webOrigins": [
1341-
"http://127.0.0.1"
1341+
"http://##COMPAS_HOSTNAME##"
13421342
],
13431343
"notBefore": 0,
13441344
"bearerOnly": false,
@@ -1447,17 +1447,17 @@
14471447
"clientId": "scl-auto-alignment",
14481448
"name": "SCL Auto Alignment Service",
14491449
"description": "The SCL Auto Alignment Service for calculating XY Coordinates",
1450-
"rootUrl": "http://127.0.0.1/",
1451-
"adminUrl": "http://127.0.0.1/",
1450+
"rootUrl": "http://##COMPAS_HOSTNAME##/",
1451+
"adminUrl": "http://##COMPAS_HOSTNAME##/",
14521452
"surrogateAuthRequired": false,
14531453
"enabled": true,
14541454
"alwaysDisplayInConsole": false,
14551455
"clientAuthenticatorType": "client-secret",
14561456
"redirectUris": [
1457-
"http://127.0.0.1/*"
1457+
"http://##COMPAS_HOSTNAME##/*"
14581458
],
14591459
"webOrigins": [
1460-
"http://127.0.0.1"
1460+
"http://##COMPAS_HOSTNAME##"
14611461
],
14621462
"notBefore": 0,
14631463
"bearerOnly": false,
@@ -1529,17 +1529,17 @@
15291529
"clientId": "scl-data-service",
15301530
"name": "SCL Data Service",
15311531
"description": "The SCL Data Service for storing / retrieving SCLs",
1532-
"rootUrl": "http://127.0.0.1/",
1533-
"adminUrl": "http://127.0.0.1/",
1532+
"rootUrl": "http://##COMPAS_HOSTNAME##/",
1533+
"adminUrl": "http://##COMPAS_HOSTNAME##/",
15341534
"surrogateAuthRequired": false,
15351535
"enabled": true,
15361536
"alwaysDisplayInConsole": false,
15371537
"clientAuthenticatorType": "client-secret",
15381538
"redirectUris": [
1539-
"http://127.0.0.1/*"
1539+
"http://##COMPAS_HOSTNAME##/*"
15401540
],
15411541
"webOrigins": [
1542-
"http://127.0.0.1"
1542+
"http://##COMPAS_HOSTNAME##"
15431543
],
15441544
"notBefore": 0,
15451545
"bearerOnly": false,
@@ -1611,17 +1611,17 @@
16111611
"clientId": "scl-validator",
16121612
"name": "SCL Validator Service",
16131613
"description": "The SCL Validator Service to validate SCL Files",
1614-
"rootUrl": "http://127.0.0.1/",
1615-
"adminUrl": "http://127.0.0.1/",
1614+
"rootUrl": "http://##COMPAS_HOSTNAME##/",
1615+
"adminUrl": "http://##COMPAS_HOSTNAME##/",
16161616
"surrogateAuthRequired": false,
16171617
"enabled": true,
16181618
"alwaysDisplayInConsole": false,
16191619
"clientAuthenticatorType": "client-secret",
16201620
"redirectUris": [
1621-
"http://127.0.0.1/*"
1621+
"http://##COMPAS_HOSTNAME##/*"
16221622
],
16231623
"webOrigins": [
1624-
"http://127.0.0.1"
1624+
"http://##COMPAS_HOSTNAME##"
16251625
],
16261626
"notBefore": 0,
16271627
"bearerOnly": false,
@@ -1693,17 +1693,17 @@
16931693
"clientId": "sitipe-service",
16941694
"name": "Sitipe Service",
16951695
"description": "The Sitipe Service to retrieve Sitipe related data",
1696-
"rootUrl": "http://127.0.0.1/",
1697-
"adminUrl": "http://127.0.0.1/",
1696+
"rootUrl": "http://##COMPAS_HOSTNAME##/",
1697+
"adminUrl": "http://##COMPAS_HOSTNAME##/",
16981698
"surrogateAuthRequired": false,
16991699
"enabled": true,
17001700
"alwaysDisplayInConsole": false,
17011701
"clientAuthenticatorType": "client-secret",
17021702
"redirectUris": [
1703-
"http://127.0.0.1/*"
1703+
"http://##COMPAS_HOSTNAME##/*"
17041704
],
17051705
"webOrigins": [
1706-
"http://127.0.0.1"
1706+
"http://##COMPAS_HOSTNAME##"
17071707
],
17081708
"notBefore": 0,
17091709
"bearerOnly": false,

0 commit comments

Comments
 (0)