@@ -48,7 +48,7 @@ services:
48
48
volumes :
49
49
- diracx-iam-key-store:/etc/indigo-iam/keystore
50
50
depends_on :
51
- - iam-init-jwks
51
+ - iam-init-keystore
52
52
healthcheck :
53
53
test : ["CMD", "curl", "-f", "http://localhost:8080/.well-known/openid-configuration"]
54
54
interval : 5s
@@ -57,9 +57,9 @@ services:
57
57
start_period : 60s
58
58
pull_policy : always
59
59
60
- iam-init-jwks :
60
+ iam-init-keystore :
61
61
image : alpine:latest
62
- container_name : init-jwks
62
+ container_name : iam- init-keystore
63
63
volumes :
64
64
- diracx-iam-key-store:/jwks
65
65
command : >
@@ -130,7 +130,7 @@ services:
130
130
condition : service_healthy
131
131
dirac-init-certificates :
132
132
condition : service_completed_successfully # Let the init container create the certificates
133
- diracx-init-key :
133
+ diracx-init-keystore :
134
134
condition : service_completed_successfully # Let the init container create the signing key
135
135
diracx-init-cs :
136
136
condition : service_completed_successfully # Let the init container create the cs
@@ -139,10 +139,10 @@ services:
139
139
volumes :
140
140
- certs_data:/ca/certs
141
141
- diracx-cs-store:/cs_store
142
- - diracx-key-store:/signing-key
142
+ - diracx-key-store:/keystore
143
143
environment :
144
144
- DIRACX_CONFIG_BACKEND_URL=git+file:///cs_store/initialRepo
145
- - DIRACX_SERVICE_AUTH_TOKEN_KEY =file:///signing-key/rs256.key
145
+ - DIRACX_SERVICE_AUTH_TOKEN_KEYSTORE =file:///keystore/jwks.json
146
146
command : ["sleep", "infinity"] # This is necessary because of the issue described in https://github.com/moby/moby/issues/42275. What is added here is a hack/workaround.
147
147
pull_policy : always
148
148
@@ -185,33 +185,49 @@ services:
185
185
start_period : 60s
186
186
command : ["sleep", "infinity"] # This is necessary because of the issue described in https://github.com/moby/moby/issues/42275. What is added here is a hack/workaround.
187
187
188
- diracx-init-key :
188
+
189
+ diracx-chmod :
189
190
image : ghcr.io/diracgrid/diracx/secret-generation:latest
190
- container_name : diracx-init-key
191
- environment :
192
- - DIRACX_SERVICE_AUTH_TOKEN_KEY="file:///signing-key/rs256.key"
191
+ container_name : diracx-chmod
193
192
volumes :
194
- - diracx-key-store:/signing-key/
195
- # As the diracx images don't run as root we need to change the permissions of the /cs_store/ directory as well
193
+ # As the diracx images don't run as root we need to change the permissions of the directories as well
194
+ - diracx-key-store:/keystore/
196
195
- diracx-cs-store:/cs_store/
197
196
# We need to allow everybody to read the private keys
198
197
# Because the users are different between the DIRAC and DiracX containers
199
198
entrypoint : |
200
- bash -xc "ssh-keygen -P '' -trsa -b4096 -mPEM -f/signing-key/rs256.key && chmod o+r /signing-key/rs256.* && chmod -R o=u /cs_store"
199
+ bash -xc 'chmod -R o=u /keystore && chmod -R o=u /cs_store'
200
+ pull_policy : always
201
+
202
+
203
+ diracx-init-keystore :
204
+ image : ghcr.io/diracgrid/diracx/services:dev
205
+ container_name : diracx-init-keystore
206
+ depends_on :
207
+ diracx-chmod :
208
+ condition : service_completed_successfully # Let the init container set the permission on /keystore/
209
+ environment :
210
+ - DIRACX_SERVICE_AUTH_TOKEN_KEYSTORE="file:///keystore/jwks.json"
211
+ volumes :
212
+ - diracx-key-store:/keystore/
213
+ entrypoint : |
214
+ /entrypoint.sh bash -xc 'python -m diracx.logic rotate-jwk --jwks-path /keystore/jwks.json'
201
215
pull_policy : always
202
216
203
217
diracx-init-cs :
204
218
image : ghcr.io/diracgrid/diracx/client:dev
205
219
container_name : diracx-init-cs
206
220
depends_on :
207
- diracx-init-key :
221
+ diracx-chmod :
208
222
condition : service_completed_successfully # Let the init container set the permission on /cs_store/
223
+ diracx-init-keystore :
224
+ condition : service_completed_successfully # Let the init container create the signing key
209
225
environment :
210
226
- DIRACX_CONFIG_BACKEND_URL=git+file:///cs_store/initialRepo
211
- - DIRACX_SERVICE_AUTH_TOKEN_KEY =file:///signing-key/rs256.key
227
+ - DIRACX_SERVICE_AUTH_TOKEN_KEYSTORE =file:///keystore/jwks.json
212
228
volumes :
213
229
- diracx-cs-store:/cs_store/
214
- - diracx-key-store:/signing-key /
230
+ - diracx-key-store:/keystore /
215
231
entrypoint : |
216
232
/entrypoint.sh bash -xc 'dirac internal generate-cs /cs_store/initialRepo'
217
233
pull_policy : always
@@ -239,7 +255,7 @@ services:
239
255
- DIRACX_DB_URL_SANDBOXMETADATADB=mysql+aiomysql://Dirac:Dirac@mysql/SandboxMetadataDB
240
256
- DIRACX_DB_URL_PILOTAGENTSDB=mysql+aiomysql://Dirac:Dirac@mysql/PilotAgentsDB
241
257
- ' DIRACX_OS_DB_PILOTLOGSDB={"sqlalchemy_dsn": "mysql+aiomysql://Dirac:Dirac@mysql/PilotLogsDB"}'
242
- - DIRACX_SERVICE_AUTH_TOKEN_KEY =file:///signing-key/rs256.key
258
+ - DIRACX_SERVICE_AUTH_TOKEN_KEYSTORE =file:///keystore/jwks.json
243
259
- DIRACX_SERVICE_AUTH_TOKEN_ISSUER=http://diracx:8000
244
260
- DIRACX_SERVICE_AUTH_ALLOWED_REDIRECTS=["http://diracx:8000/docs/oauth2-redirect"]
245
261
# Obtained with head -c 32 /dev/urandom | base64
@@ -256,7 +272,7 @@ services:
256
272
condition : service_completed_successfully
257
273
volumes :
258
274
- diracx-cs-store:/cs_store/
259
- - diracx-key-store:/signing-key /
275
+ - diracx-key-store:/keystore /
260
276
entrypoint : |
261
277
/entrypoint.sh bash -xc 'uvicorn --factory diracx.routers:create_app --host=0.0.0.0'
262
278
0 commit comments