Skip to content

Commit 24f0691

Browse files
committed
Update Hub setup wizard to Keycloak 25.x
1 parent 03334f6 commit 24f0691

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

assets/js/hubsetup.js

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ ${e}`;
113113
result += '# * KC_DB\n# * KC_HEALTH_ENABLED\n# * KC_HTTP_RELATIVE_PATH\n\n';
114114
}
115115

116-
result += '# Generated using script version 6\n\n';
116+
result += '# Generated using script version 7\n\n';
117117

118118
return result;
119119
}
@@ -431,7 +431,7 @@ EOF`;
431431
'init-config': {condition: 'service_completed_successfully'},
432432
'postgres': {condition: 'service_healthy'}
433433
},
434-
image: 'ghcr.io/cryptomator/keycloak:24.0.4',
434+
image: 'ghcr.io/cryptomator/keycloak:25.0.6',
435435
command: startCmd,
436436
volumes: ['kc-config:/opt/keycloak/data/import'],
437437
deploy: {
@@ -441,7 +441,7 @@ EOF`;
441441
},
442442
...(!this.cfg.compose.includeTraefik && {ports: [`${this.getPort(this.cfg.keycloak.publicUrl)}:8080`]}),
443443
healthcheck: {
444-
test: ['CMD', 'curl', '-f', `http://localhost:8080${this.getPathname(HubSetup.urlWithTrailingSlash(this.cfg.keycloak.publicUrl))}health/live`],
444+
test: ['CMD', 'curl', '-f', `http://localhost:9000${this.getPathname(HubSetup.urlWithTrailingSlash(this.cfg.keycloak.publicUrl))}health/live`],
445445
interval: '60s',
446446
timeout: '3s',
447447
},
@@ -454,10 +454,10 @@ EOF`;
454454
KC_DB_USERNAME: 'keycloak',
455455
KC_DB_PASSWORD: this.cfg.db.keycloakPw,
456456
KC_HEALTH_ENABLED: 'true',
457-
KC_HOSTNAME: devMode ? null : this.getHostname(this.cfg.keycloak.publicUrl),
457+
KC_HOSTNAME: devMode ? null : 'https://' + this.getHostname(this.cfg.keycloak.publicUrl),
458458
// KC_HOSTNAME_PORT: devMode ? null : this.getPort(this.cfg.keycloak.publicUrl), // FIXME as string!! FIXME does not work at all!!
459459
KC_HTTP_ENABLED: 'true',
460-
KC_PROXY: 'edge',
460+
KC_PROXY_HEADERS: 'xforwarded',
461461
KC_HTTP_RELATIVE_PATH: this.getPathname(this.cfg.keycloak.publicUrl),
462462
},
463463
...(this.cfg.compose.includeTraefik && this.getTraefikConfig(this.cfg.keycloak.publicUrl, 'kc'))
@@ -478,7 +478,7 @@ EOF`;
478478
},
479479
...(!this.cfg.compose.includeTraefik && {ports: [`${this.getPort(this.cfg.hub.publicUrl)}:8080`]}),
480480
healthcheck: {
481-
test: ['CMD-SHELL', '(curl -f http://localhost:8080/q/health/live && curl -f http://localhost:8080/api/config) || exit 1'],
481+
test: ['CMD-SHELL', '(curl -f http://localhost:9000/q/health/live && curl -f http://localhost:8080/api/config) || exit 1'],
482482
interval: '10s',
483483
timeout: '3s',
484484
},
@@ -657,7 +657,7 @@ class KubernetesConfigBuilder extends ConfigBuilder {
657657
args: [
658658
'/bin/sh',
659659
'-c',
660-
`set -x; while ! wget -q --spider "http://keycloak-svc:8080${this.getPathname(HubSetup.urlWithTrailingSlash(this.cfg.keycloak.publicUrl))}health/live" 2>>/dev/null; do sleep 10; done`
660+
`set -x; while ! wget -q --spider "http://keycloak-svc:9000${this.getPathname(HubSetup.urlWithTrailingSlash(this.cfg.keycloak.publicUrl))}health/live" 2>>/dev/null; do sleep 10; done`
661661
]
662662
}] : [])],
663663
containers: [{
@@ -775,11 +775,11 @@ class KubernetesConfigBuilder extends ConfigBuilder {
775775
{name: 'KC_DB_PASSWORD', valueFrom: {secretKeyRef: {name: 'hub-secrets', key: 'db_kc_pass'}}},
776776
{name: 'KC_HEALTH_ENABLED', value: 'true'},
777777
{name: 'KC_HTTP_ENABLED', value: 'true'},
778-
{name: 'KC_PROXY', value: 'edge'},
778+
{name: 'KC_PROXY_HEADERS', value: 'xforwarded'},
779779
{name: 'KC_HTTP_RELATIVE_PATH', value: this.getPathname(this.cfg.keycloak.publicUrl)}
780780
];
781781
if (!devMode) {
782-
env.push({name: 'KC_HOSTNAME', value: this.getHostname(this.cfg.keycloak.publicUrl)});
782+
env.push({name: 'KC_HOSTNAME', value: 'https://' + this.getHostname(this.cfg.keycloak.publicUrl)});
783783
// env.push({name: 'KC_HOSTNAME_PORT', value: '' + this.getPort(this.cfg.keycloak.publicUrl)}); // FIXME as string!! FIXME does not work at all!!
784784
}
785785
let deployment = {
@@ -803,20 +803,20 @@ class KubernetesConfigBuilder extends ConfigBuilder {
803803
}],
804804
containers: [{
805805
name: 'keycloak',
806-
image: 'ghcr.io/cryptomator/keycloak:24.0.4',
806+
image: 'ghcr.io/cryptomator/keycloak:25.0.6',
807807
command: startCmd,
808808
ports: [{containerPort: 8080}],
809809
resources: {
810810
requests: {cpu: '25m', memory: '512Mi'},
811811
limits: {cpu: '1000m', memory: '1024Mi'},
812812
},
813813
livenessProbe: {
814-
httpGet: {path: `${this.getPathname(HubSetup.urlWithTrailingSlash(this.cfg.keycloak.publicUrl))}health/live`, port: 8080},
814+
httpGet: {path: `${this.getPathname(HubSetup.urlWithTrailingSlash(this.cfg.keycloak.publicUrl))}health/live`, port: 9000},
815815
initialDelaySeconds: 120,
816816
periodSeconds: 60
817817
},
818818
readinessProbe: {
819-
httpGet: {path: `${this.getPathname(HubSetup.urlWithTrailingSlash(this.cfg.keycloak.publicUrl))}health/ready`, port: 8080},
819+
httpGet: {path: `${this.getPathname(HubSetup.urlWithTrailingSlash(this.cfg.keycloak.publicUrl))}health/ready`, port: 9000},
820820
initialDelaySeconds: 10,
821821
periodSeconds: 3
822822
},
@@ -878,7 +878,8 @@ class KubernetesConfigBuilder extends ConfigBuilder {
878878
spec: {
879879
selector: {app: 'keycloak'},
880880
ports: [
881-
{protocol: 'TCP', port: 8080}
881+
{protocol: 'TCP', port: 8080},
882+
{protocol: 'TCP', port: 9000}
882883
]
883884
}
884885
}

0 commit comments

Comments
 (0)