@@ -33,8 +33,7 @@ class HubSetup {
33
33
publicUrl : 'https://domain.tld' ,
34
34
adminUser : 'admin' ,
35
35
adminPw : 'admin' ,
36
- syncerUser : 'syncer' , // TODO: randomize?
37
- syncerPw : HubSetup . uuid ( ) ,
36
+ systemClientSecret : HubSetup . uuid ( ) ,
38
37
}
39
38
}
40
39
}
@@ -231,16 +230,6 @@ GRANT ALL PRIVILEGES ON DATABASE hub TO hub;`);
231
230
'realm-management' : [ 'realm-admin' ]
232
231
}
233
232
}
234
- } ,
235
- {
236
- name : 'syncer' ,
237
- description : 'syncer' ,
238
- composite : true ,
239
- composites : {
240
- client : {
241
- 'realm-management' : [ 'view-users' ]
242
- }
243
- }
244
233
}
245
234
] ,
246
235
} ,
@@ -253,13 +242,11 @@ GRANT ALL PRIVILEGES ON DATABASE hub TO hub;`);
253
242
realmRoles : [ 'admin' ]
254
243
} ,
255
244
{
256
- username : this . cfg . hub . syncerUser ,
257
- firstName : "syncer" ,
258
- lastName : "syncer" ,
259
- email : "syncer@localhost" ,
245
+ username : 'system' ,
246
+ email : "system@localhost" ,
260
247
enabled : true ,
261
- credentials : [ { type : 'password' , value : this . cfg . hub . syncerPw , temporary : false } ] ,
262
- realmRoles : [ 'syncer' ]
248
+ serviceAccountClientId : "cryptomatorhub-system" ,
249
+ clientRoles : { 'realm-management' : [ 'realm-admin' ] }
263
250
}
264
251
] ,
265
252
scopeMappings : [
@@ -325,6 +312,16 @@ GRANT ALL PRIVILEGES ON DATABASE hub TO hub;`);
325
312
frontchannelLogout : false ,
326
313
protocol : 'openid-connect' ,
327
314
attributes : { 'pkce.code.challenge.method' : 'S256' } ,
315
+ } ,
316
+ {
317
+ clientId : 'cryptomatorhub-system' ,
318
+ serviceAccountsEnabled : true ,
319
+ publicClient : false ,
320
+ name : 'Cryptomator Hub System' ,
321
+ enabled : true ,
322
+ clientAuthenticatorType : 'client-secret' ,
323
+ secret : this . cfg . hub . systemClientSecret ,
324
+ standardFlowEnabled : false ,
328
325
} ] ,
329
326
browserSecurityHeaders : {
330
327
contentSecurityPolicy : `frame-src 'self'; frame-ancestors 'self' ${ HubSetup . urlWithTrailingSlash ( this . cfg . hub . publicUrl ) } ; object-src 'none';`
@@ -488,9 +485,8 @@ EOF`;
488
485
HUB_KEYCLOAK_PUBLIC_URL : this . cfg . keycloak . publicUrl ,
489
486
HUB_KEYCLOAK_LOCAL_URL : ! this . cfg . keycloak . useExternal ? `http://keycloak:8080${ this . getPathname ( this . cfg . keycloak . publicUrl ) } ` : this . cfg . keycloak . publicUrl ,
490
487
HUB_KEYCLOAK_REALM : this . cfg . keycloak . realmId ,
491
- HUB_KEYCLOAK_SYNCER_USERNAME : this . cfg . hub . syncerUser ,
492
- HUB_KEYCLOAK_SYNCER_PASSWORD : this . cfg . hub . syncerPw ,
493
- HUB_KEYCLOAK_SYNCER_CLIENT_ID : 'admin-cli' ,
488
+ HUB_KEYCLOAK_SYSTEM_CLIENT_ID : 'cryptomatorhub-system' ,
489
+ HUB_KEYCLOAK_SYSTEM_CLIENT_SECRET : this . cfg . hub . systemClientSecret ,
494
490
HUB_KEYCLOAK_SYNCER_PERIOD : '5m' , // TODO make configurable?
495
491
HUB_KEYCLOAK_OIDC_CRYPTOMATOR_CLIENT_ID : 'cryptomator' ,
496
492
QUARKUS_OIDC_AUTH_SERVER_URL : new URL ( `realms/${ this . cfg . keycloak . realmId } ` , HubSetup . urlWithTrailingSlash ( ! this . cfg . keycloak . useExternal ? `http://keycloak:8080${ this . getPathname ( this . cfg . keycloak . publicUrl ) } ` : this . cfg . keycloak . publicUrl ) ) . href , // network-internal URL
@@ -608,8 +604,7 @@ class KubernetesConfigBuilder extends ConfigBuilder {
608
604
'db_admin_pass' : this . cfg . db . adminPw ,
609
605
'db_hub_pass' : this . cfg . db . hubPw ,
610
606
...( ! this . cfg . keycloak . useExternal ) && { 'db_kc_pass' : this . cfg . db . keycloakPw } ,
611
- 'hub_syncer_user' : this . cfg . hub . syncerUser ,
612
- 'hub_syncer_pass' : this . cfg . hub . syncerPw ,
607
+ 'hub_system_client_secret' : this . cfg . hub . systemClientSecret ,
613
608
'initdb.sql' : this . getInitDbSQL ( ) ,
614
609
...( ! this . cfg . keycloak . useExternal ) && { 'realm.json' : JSON . stringify ( realmCfg , null , 2 ) }
615
610
}
@@ -683,9 +678,8 @@ class KubernetesConfigBuilder extends ConfigBuilder {
683
678
{ name : 'HUB_KEYCLOAK_PUBLIC_URL' , value : this . cfg . keycloak . publicUrl } ,
684
679
{ name : 'HUB_KEYCLOAK_LOCAL_URL' , value : ! this . cfg . keycloak . useExternal ? `http://keycloak-svc:8080${ this . getPathname ( this . cfg . keycloak . publicUrl ) } ` : this . cfg . keycloak . publicUrl } ,
685
680
{ name : 'HUB_KEYCLOAK_REALM' , value : this . cfg . keycloak . realmId } ,
686
- { name : 'HUB_KEYCLOAK_SYNCER_USERNAME' , valueFrom : { secretKeyRef : { name : 'hub-secrets' , key : 'hub_syncer_user' } } } ,
687
- { name : 'HUB_KEYCLOAK_SYNCER_PASSWORD' , valueFrom : { secretKeyRef : { name : 'hub-secrets' , key : 'hub_syncer_pass' } } } ,
688
- { name : 'HUB_KEYCLOAK_SYNCER_CLIENT_ID' , value : 'admin-cli' } ,
681
+ { name : 'HUB_KEYCLOAK_SYSTEM_CLIENT_ID' , value : 'cryptomatorhub-system' } ,
682
+ { name : 'HUB_KEYCLOAK_SYSTEM_CLIENT_SECRET' , valueFrom : { secretKeyRef : { name : 'hub-secrets' , key : 'hub_system_client_secret' } } } ,
689
683
{ name : 'HUB_KEYCLOAK_SYNCER_PERIOD' , value : '5m' } , // TODO make configurable?
690
684
{ name : 'HUB_KEYCLOAK_OIDC_CRYPTOMATOR_CLIENT_ID' , value : 'cryptomator' } ,
691
685
{ name : 'QUARKUS_OIDC_AUTH_SERVER_URL' , value : new URL ( `realms/${ this . cfg . keycloak . realmId } ` , HubSetup . urlWithTrailingSlash ( ! this . cfg . keycloak . useExternal ? `http://keycloak-svc:8080${ this . getPathname ( this . cfg . keycloak . publicUrl ) } ` : this . cfg . keycloak . publicUrl ) ) . href } ,
0 commit comments