Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
1470 lines (1435 loc) · 89.5 KB
/
Copy pathdocker-compose.yml
File metadata and controls
1470 lines (1435 loc) · 89.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
name: ${PROJECT_NAME:-d2e}
networks:
alp:
data:
volumes:
caddy:
cdw-config-cachedb-data-1:
minio-data-1:
pg-minerva-data-1:
r-libs:
trex:
demodb-data:
hana-data:
supabase-storage-data:
hades-data:
audit-logs:
x-envs:
env_converter: &x-converter
URL__DATABASE_LIST__GET: http://${PROJECT_NAME:-d2e}-trex.${TLS__INTERNAL__DOMAIN:-d2e.local}:33001/gateway/api/db/database-creds/
DB_CREDENTIALS__PRIVATE_KEY: ${DB_CREDENTIALS__INTERNAL__DECRYPT_PRIVATE_KEY}
IDP__ALP_SVC__CLIENT_ID: ${LOGTO__D2E_SVC__CLIENT_ID:-${LOGTO__ALP_SVC__CLIENT_ID}}
IDP__ALP_SVC__CLIENT_SECRET: ${LOGTO__D2E_SVC__CLIENT_SECRET:-${LOGTO__ALP_SVC__CLIENT_SECRET}}
IDP__SCOPE: https://alp-default
IDP_SUBJECT_PROP: sub
pg: &x-pg
PG__DB_NAME: alp
## Flag to display executed Knex queries in log
PG__DEBUG: ${PG_DEBUG:-1}
PG__HOST: ${PG_HOST:-${PROJECT_NAME:-d2e}-minerva-postgres-1}
PG__MAX_POOL: ${PG__MAX_POOL:-1}
PG__MIN_POOL: ${PG__MIN_POOL:-1}
PG__PORT: ${PG_PORT:-5432}
PG__IDLE_TIMEOUT_IN_MS: ${PG__IDLE_TIMEOUT_IN_MS:-30000}
PG__DIALECT: postgresql
PG__SSL: ${PG__SSL:-false}
trex_sql: &x-trex-sql
TREX__SQL__HOST: ${PROJECT_NAME:-d2e}-trex
TREX__SQL__PORT: ${TREX__SQL__PORT:-5433}
TREX__SQL__USER: postgres
TREX__SQL__PASSWORD: ${TREX__SQL__PASSWORD:?TREX__SQL__PASSWORD must be set (run d2e init); refusing default pencil} # Password for the trex sql interface
TREX__SQL__DBNAME: postgres
# "https://${PROJECT_NAME:-d2e}-minerva-portal-server-1.${TLS__INTERNAL__DOMAIN:-d2e.local}:41105",
tls: &x-tls
TLS__INTERNAL__CA_CRT: ${TLS__INTERNAL__CA_CRT}
TLS__INTERNAL__CRT: ${TLS__INTERNAL__CRT}
TLS__INTERNAL__DOMAIN: ${TLS__INTERNAL__DOMAIN:-d2e.local}
TLS__INTERNAL__KEY: ${TLS__INTERNAL__KEY}
services:
# OHDSI WebAPI for Atlas3 (with trex dependencies)
trex:
image: ${DOCKER_IMAGE_PREFIX:-ghcr.io/ohdsi/}d2e-trex:${DOCKER_TAG_NAME:-develop}
container_name: ${PROJECT_NAME:-d2e}-trex
hostname: ${PROJECT_NAME:-d2e}-trex.${TLS__INTERNAL__DOMAIN:-d2e.local}
extra_hosts:
- "${CADDY__D2E__PUBLIC_FQDN:-${CADDY__ALP__PUBLIC_FQDN:-localhost}}:host-gateway"
depends_on:
# trex now provisions the database itself (runD2eBootstrap), so it only
# needs Postgres up. It deliberately does NOT wait for alp-logto-post-init
# any more: logto cannot migrate until trex has created logto_postgres and
# the logto schema, so trex must start FIRST. Keeping the old edge would
# deadlock (trex -> post-init -> logto -> trex's bootstrap).
alp-minerva-postgres:
condition: service_healthy
networks:
alp:
priority: 20
data:
priority: 10
volumes:
- trex:/usr/src/data
- cdw-config-cachedb-data-1:/usr/src/cdw_data/dynamically_generated
- hades-data:/data/hades
- audit-logs:/var/log/d2e/audit
# `notebook` schema (studies/notebooks) + its PostGraphile grants, applied
# as a trex migrations plugin. trex runs it against _config (the alp
# Postgres catalog) and tracks applied versions in
# notebook.refinery_schema_history. The image does not ship it, so this
# mount is its only source; the CLI stages the files next to its embedded
# copy of this compose file.
- ./services/trex/migrations/notebook:/usr/src/bundled-plugins/notebook-schema:ro
# d2e's DB provisioning plugin (d2e-bootstrap) is baked into the image and
# deliberately NOT mounted here: the CLI runs this file on its own, and a
# mount whose source it has not staged makes Docker create an empty
# directory that hides the image's copy, so trex aborts at boot. The
# live-edit mount lives in docker-compose-local.yml.
# WebAPI/Logto seeding SQL, applied by the d2e-compat atlas-db-init block
# once webapi.sec_role and logto.users exist. Replaces the webapi-init
# container, which ran the same files through psql.
- ./services/atlas-db-init:/usr/src/atlas-db-init:ro
ports:
- "8090:8080"
healthcheck:
# trex's main mounts built-in routes under BASE_PATH (=/trex), so the
# internal health endpoint is /trex/_internal/health. (D2E_COMPAT routes
# like /WebAPI and /portal are mounted at root, separately.)
test: ["CMD-SHELL", "curl -fk https://localhost:33000/trex/_internal/health || curl -f http://localhost:33001/trex/_internal/health || exit 1"]
interval: 10s
timeout: 10s
retries: 30
start_period: 120s
entrypoint: ["/bin/sh","-c"]
command:
- |
mkdir -p /usr/src/cert
printf '%s' "$$TLS__INTERNAL__CRT" > /usr/src/cert/cert.pem
(umask 077; printf '%s' "$$TLS__INTERNAL__KEY" > /usr/src/cert/key.pem)
printf '%s' "$$TLS__INTERNAL__CA_CRT" > /usr/src/cert/ca.pem
cp /usr/src/cert/ca.pem /usr/local/share/ca-certificates/d2e-internal-ca.crt
# Optional additional trust anchors, for upstreams that are not ours — the
# PS config server is typically external/HANA-side with its own CA. This is
# the supported way to reach such a server: the edge-function shim has no
# per-request TLS control and there is no verification bypass.
#
# Accepts one or more concatenated PEM blocks, split into one file each:
# update-ca-certificates appends a whole file to the bundle but only hashes
# its FIRST certificate into the CApath symlinks, so a multi-cert file would
# be trusted by bundle readers and silently ignored by CApath readers.
# The value needs real newlines; a .env-style string with literal \n will
# not parse, so the count is asserted below rather than failing later at
# the first TLS call.
if [ -n "$${TLS__EXTRA__CA_CRTS:-}" ]; then
printf '%s\n' "$$TLS__EXTRA__CA_CRTS" |
awk 'BEGIN{n=0} /^-----BEGIN CERTIFICATE-----$$/{n++} n>0{print > ("/usr/local/share/ca-certificates/d2e-extra-ca-" n ".crt")}'
got=0
for f in /usr/local/share/ca-certificates/d2e-extra-ca-*.crt; do
[ -e "$$f" ] || continue
if grep -qx -- '-----END CERTIFICATE-----' "$$f"; then
got=$$((got + 1))
else
echo "FATAL: $$f has no END line; TLS__EXTRA__CA_CRTS is truncated or malformed" >&2
exit 1
fi
done
if [ "$$got" -eq 0 ]; then
echo "FATAL: TLS__EXTRA__CA_CRTS is set but contains no PEM certificate. It needs real newlines -- a .env-style value with literal \\n will not parse." >&2
exit 1
fi
echo "installed $$got extra CA certificate(s)"
fi
update-ca-certificates
mkdir -p /usr/src/data/flow_staging && chmod 1777 /usr/src/data/flow_staging || exit 1
# This command replaces the image's own CMD, so the --enable-otel flag
# from Dockerfile.v2 never runs here; it must be re-added to this exec.
exec /usr/src/entrypoint.sh $${TREX_OTEL_ENABLED:+--enable-otel}
restart: ${DOCKER__RESTART_POLICY:-unless-stopped}
environment:
<<:
- *x-converter
- *x-tls
- *x-pg
- *x-trex-sql
# With the rebuilt trexas runtime (cert_provider fix), the worker HTTP client
# honors DENO_TLS_CA_STORE=system, so it trusts the internal CA installed into
# the OS store by the command above (via update-ca-certificates).
DENO_TLS_CA_STORE: system
# Extra trust anchors for non-internal upstreams (e.g. an external PS config
# server with its own CA). One or more concatenated PEM blocks; installed into
# the OS store by the command above, so DENO_TLS_CA_STORE=system picks them up.
TLS__EXTRA__CA_CRTS: ${TLS__EXTRA__CA_CRTS:-}
# Java analog of DENO_TLS_CA_STORE for the embedded native WebAPI. The GraalVM
# libwebapi-native.so bakes its truststore at build time and ignores the OS store
# (update-ca-certificates), so WebApiNativeLibrary.start() reads this PEM at startup
# and installs a composite SSLContext (JDK roots + this internal CA) before Spring
# boots — needed for OIDC discovery/JWKS over the internal self-signed TLS. The file
# is written by this service's command above (line ~115).
WEBAPI_TRUST_CERTS: /usr/src/cert/ca.pem
# Plugin paths for trex - must match volume mount at /usr/src/data
PLUGINS_PATH: /usr/src/data/plugins
DATASOURCE_DRIVERCLASSNAME: org.postgresql.Driver
DATASOURCE_URL: jdbc:postgresql://alp-minerva-postgres:5432/alp?currentSchema=webapi
DATASOURCE_USERNAME: postgres
DATASOURCE_PASSWORD: ${PG_SUPER_PASSWORD}
DATASOURCE_OHDSI_SCHEMA: webapi
JASYPT_ENCRYPTOR_ENABLED: ${JASYPT_ENCRYPTOR_ENABLED:-false}
JASYPT_ENCRYPTOR_PASSWORD: ${JASYPT_ENCRYPTOR_PASSWORD:-}
JASYPT_ENCRYPTOR_ALGORITHM: ${JASYPT_ENCRYPTOR_ALGORITHM:-PBEWITHSHA256AND256BITAES-CBC-BC}
SPRING_JPA_PROPERTIES_HIBERNATE_DEFAULT_SCHEMA: webapi
SPRING_BATCH_REPOSITORY_TABLEPREFIX: webapi.batch_
# Flyway migration settings
FLYWAY_DATASOURCE_USERNAME: postgres
FLYWAY_DATASOURCE_PASSWORD: ${PG_SUPER_PASSWORD}
SPRING_FLYWAY_URL: jdbc:postgresql://alp-minerva-postgres:5432/alp?currentSchema=webapi
SPRING_FLYWAY_USER: postgres
SPRING_FLYWAY_PASSWORD: ${PG_SUPER_PASSWORD}
SPRING_FLYWAY_SCHEMAS: webapi
SPRING_FLYWAY_TABLE: flyway_schema_history
SPRING_FLYWAY_PLACEHOLDERS_OHDSISCHEMA: webapi
# No SPRING_FLYWAY_BASELINE_VERSION: on an empty schema Flyway baselines at v1
# and applies all migrations, including the early ones that create cc_* tables.
# Existing installs already have history rows so this is a no-op for them.
# Security configuration
SECURITY_PROVIDER: AtlasRegularSecurity
SECURITY_ORIGIN: "*"
SECURITY_SSL_ENABLED: "false"
# Enable forwarded headers support for reverse proxy
SERVER_FORWARD_HEADERS_STRATEGY: NATIVE
# Auth providers - OpenID via Logto + Database auth
SECURITY_AUTH_JDBC_ENABLED: "true"
SECURITY_AUTH_WINDOWS_ENABLED: "false"
SECURITY_AUTH_KERBEROS_ENABLED: "false"
SECURITY_AUTH_OIDC_ENABLED: "true"
SECURITY_AUTH_FACEBOOK_ENABLED: "false"
SECURITY_AUTH_GITHUB_ENABLED: "false"
SECURITY_AUTH_GOOGLE_ENABLED: "false"
SECURITY_AUTH_LDAP_ENABLED: "false"
SECURITY_AUTH_AD_ENABLED: "false"
SECURITY_AUTH_CAS_ENABLED: "false"
# Database authentication configuration (uses webapi_security schema in alp-minerva-postgres)
SECURITY_DB_DATASOURCE_SCHEMA: webapi_security
SECURITY_DB_DATASOURCE_URL: "jdbc:postgresql://alp-minerva-postgres:5432/alp?currentSchema=webapi_security"
SECURITY_DB_DATASOURCE_DRIVERCLASSNAME: org.postgresql.Driver
SECURITY_DB_DATASOURCE_USERNAME: postgres
SECURITY_DB_DATASOURCE_PASSWORD: ${PG_SUPER_PASSWORD}
SECURITY_DB_DATASOURCE_AUTHENTICATIONQUERY: "SELECT password, email AS firstname, NULL AS middlename, email AS lastname FROM webapi_security.security WHERE email = ?"
# Native WebAPI reads its auth datasource under security.auth.db.datasource.*
# (not the legacy security.db.datasource.* above).
SECURITY_AUTH_DB_ENABLED: "true"
SECURITY_AUTH_DB_DATASOURCE_DRIVERCLASSNAME: org.postgresql.Driver
SECURITY_AUTH_DB_DATASOURCE_URL: "jdbc:postgresql://alp-minerva-postgres:5432/alp?currentSchema=webapi_security"
SECURITY_AUTH_DB_DATASOURCE_USERNAME: postgres
SECURITY_AUTH_DB_DATASOURCE_PASSWORD: ${PG_SUPER_PASSWORD}
SECURITY_AUTH_DB_DATASOURCE_SCHEMA: webapi_security
# OpenID Connect configuration — the identity provider trex serves at
# /trex/oidc. Discovery goes straight to trex rather than through Caddy:
# it is the same container that issues the tokens, so there is no TLS or
# forwarded-header question to work around.
SECURITY_AUTH_OIDC_CLIENTID: ${TREX__OIDC__WEBAPI_CLIENT_ID:-d2e-webapi}
SECURITY_AUTH_OIDC_APISECRET: ${TREX__OIDC__WEBAPI_CLIENT_SECRET:?TREX__OIDC__WEBAPI_CLIENT_SECRET must be set (run d2e init)}
# SECURITY_AUTH_OIDC_APISECRET above is WebAPI's, and WebAPI now
# authenticates against trex. d2e-compat still verifies the portal's
# Logto tokens and historically read that same variable as Logto's
# secret, so it has to be given Logto's under its own name -- otherwise
# the portal code exchange goes to Logto carrying trex's secret and is
# rejected with 401.
LOGTO__CLIENT_SECRET: ${LOGTO__D2E_APP__CLIENT_SECRET:-${LOGTO__ALP_APP__CLIENT_SECRET}}
# The issuer trex advertises, which is also what its tokens carry. WebAPI
# runs alongside trex rather than behind the gateway, so this address does
# not resolve for it -- SECURITY_AUTH_OIDC_INTERNALURL below is where the
# metadata and signing keys are actually read from. Both are needed: the
# issuer cannot be swapped for the internal address without invalidating
# every token, and the internal address cannot be reached from a browser.
SECURITY_AUTH_OIDC_URL: "https://${CADDY__D2E__PUBLIC_FQDN:-${CADDY__ALP__PUBLIC_FQDN:-localhost}}${D2E__PUBLIC_PORT_SUFFIX-${CADDY_PORT:+:${CADDY_PORT}}}/trex/oidc/.well-known/openid-configuration"
SECURITY_AUTH_OIDC_INTERNALURL: "http://${PROJECT_NAME:-d2e}-trex:33001/trex/oidc"
# External URL for browser redirects - used to rewrite internal OIDC URLs to external ones
SECURITY_AUTH_OIDC_EXTERNALURL: "https://${CADDY__D2E__PUBLIC_FQDN:-${CADDY__ALP__PUBLIC_FQDN:-localhost}}${D2E__PUBLIC_PORT_SUFFIX-${CADDY_PORT:+:${CADDY_PORT}}}/trex/oidc"
# @better-auth/oauth-provider serves RP-initiated logout at
# /oauth2/end-session and hard-codes that path; /session/end was the
# hand-written provider's and answers 404 now. The provider also refuses
# a client whose row does not carry enable_end_session, which the seeder
# sets for every client it registers.
SECURITY_AUTH_OIDC_LOGOUTURL: "https://${CADDY__D2E__PUBLIC_FQDN:-${CADDY__ALP__PUBLIC_FQDN:-localhost}}${D2E__PUBLIC_PORT_SUFFIX-${CADDY_PORT:+:${CADDY_PORT}}}/trex/oidc/oauth2/end-session"
# trex emits the application role array as `roles`; `trex_role` is a
# different claim entirely — trex's own admin/user system role, which
# must never be read as a WebAPI role.
SECURITY_AUTH_OIDC_ROLESCLAIM: "roles"
# NOTE: scopes `openid profile email` are added by default by the new WebAPI; extraScopes no longer required
# OAuth callback URLs - must use external URL for browser redirects
# NOTE: callback path now includes /openid segment (Spring oauth2Login convention).
# The Logto app's redirect URI must be updated to end with /user/oauth/callback/openid
SECURITY_AUTH_OAUTH_CALLBACK_API: "https://${CADDY__D2E__PUBLIC_FQDN:-${CADDY__ALP__PUBLIC_FQDN:-localhost}}:${CADDY_PORT:-${PORT:-443}}/WebAPI/user/oauth/callback"
SECURITY_AUTH_OAUTH_CALLBACK_UI: "https://${CADDY__D2E__PUBLIC_FQDN:-${CADDY__ALP__PUBLIC_FQDN:-localhost}}:${CADDY_PORT:-${PORT:-443}}/atlas/#/welcome"
# TrexSQL configuration
# PG__ vars needed by trex (npm start) for database connection
PG__DB_NAME: alp
PG__HOST: ${PG_HOST:-${PROJECT_NAME:-d2e}-minerva-postgres-1}
PG__PORT: ${PG_PORT:-5432}
# Schemas PostGraphile introspects for /trex/graphql - `notebook` exposes
# the studies/notebooks tables provisioned by the notebook-schema
# migrations plugin mounted above.
PG_SCHEMA: ${PG_SCHEMA:-trexdb,notebook}
# ── DB bootstrap (replaces the alp-minerva-pg-mgmt-init container) ──────
# trex's d2e-compat runD2eBootstrap() reads these before plugin init and
# provisions the login users, the anon/authenticated/service_role roles,
# the schemas and their grants. Same contract the retired container used,
# so the SQL is unchanged and re-runs idempotently on every boot.
POSTGRES_MANAGE_CONFIG: |-
{
"databases": {
"+${PG_DB_NAME:-alp}": {
"schemas": {
"+cdw_config": {},
"+jobplugins": {},
"+logto": {},
"+portal": {},
"+public": {},
"+qe_config": {},
"+terminology": {},
"+usermgmt": {},
"+files_manager": {},
"+perseus": {},
"+white_rabbit": {},
"+trex": {},
"+storage": {},
"+strategus": {},
"+notebook": {},
"+network": {},
"+analytics": {}
}
}
}
}
POSTGRES_MANAGE_USERS: |-
{
"${PG_DB_NAME:-alp}": {
"manager": "${PG_ADMIN_USER:-alp_pg_admin_user}",
"managerPassword": "${PG_ADMIN_PASSWORD}",
"reader": "${PG_WRITE_USER:-alp_pg_write_user}",
"readerPassword": "${PG_WRITE_PASSWORD}",
"writer": "${PG_WRITE_USER:-alp_pg_write_user}",
"writerPassword": "${PG_WRITE_PASSWORD}",
"logtoManager": "${PG_LOGTO_MANAGER:-${PG__LOGTO_MANAGER_USER:-logto_postgres}}",
"logtoManagerPassword": "${PG__LOGTO_MANAGER_PASSWORD}"
}
}
POSTGRES_MANAGE_ROLES_USERS: ${POSTGRES_MANAGE_ROLES_USERS:-{}}
# ── OIDC provider ───────────────────────────────────────────────────────
# trex is the identity provider for Atlas and WebAPI. The issuer is the
# externally reachable origin, not an internal one: it is baked into every
# token and re-checked by the relying party, so it has to be the URL a
# browser sees. BASE_PATH is appended, giving /trex/oidc/*.
# trex is the identity provider for the whole stack, not just WebAPI.
# d2e-compat verifies portal bearers against it and the portal login
# flow points at it. Installations that still hold their users in Logto
# run with D2E_IDP_MODE=logto-federated, which keeps Logto as an upstream
# sign-in option and migrates those users on boot (alp-idp-migration-init).
D2E_IDP: ${D2E_IDP:-trex}
# trex or logto-federated. Stamped into the env file by `d2e init` / `d2e start`;
# logto-federated is applied with docker-compose-logto-federation.yml.
D2E_IDP_MODE: ${D2E_IDP_MODE:-trex}
# D2E_IDP_AUDIENCES, D2E_IDP_RESOURCE and D2E_IDP_SCOPE are left unset on
# purpose. Under D2E_IDP=trex the engine derives all three from the issuer
# and the client id, and each one REPLACES that derivation rather than
# extending it. An audience list naming only the client id -- the value
# that was right before the provider moved onto @better-auth/oauth-provider
# -- rejects every access token the portal presents, and a rejection for a
# mismatched audience is indistinguishable from one for a forged token.
# A resource other than the issuer fails the same way: the issuer is the
# only resource the provider advertises, and a request that names none at
# all gets an opaque access token the portal cannot read `roles` from.
# trex authenticates users itself, so its native login surface has to be
# on. It is off by default in the engine for stacks fronted by an external
# IdP. Enabling it does not expose a default account: the seeded
# admin@trex.local has a user row but NO credential (trexdb.account is
# empty), so it cannot sign in until someone provisions one.
TREX_IDP_ENABLED: "true"
TREX_OIDC_PROVIDER_ENABLED: "true"
# One sign-in spends a password grant and a code exchange, and the limit
# is per address rather than per user, so everyone behind one gateway -
# or a whole test run - shares the count.
TREX_AUTH_RATE_LIMIT_MAX: ${TREX__AUTH_RATE_LIMIT_MAX:-2000}
# The public origin: `iss` must name where the discovery document is
# served. Server-side OIDC calls (d2e-compat's JWKS fetch and /oauth/token
# proxy, trex-token) must not go through it: where the FQDN is `localhost`
# -- any CLI install, local, CI -- it resolves to this container's own
# loopback, nothing answers on 443, and every portal code exchange ends in
# `fetch failed`. TREX_OIDC_INTERNAL_BASE routes those calls to trex
# directly on the compose network, which works for every FQDN, while `iss`
# stays the public issuer.
TREX_OIDC_INTERNAL_BASE: "http://${PROJECT_NAME:-d2e}-trex:33001"
TREX_OIDC_ISSUER: "https://${CADDY__D2E__PUBLIC_FQDN:-${CADDY__ALP__PUBLIC_FQDN:-localhost}}${D2E__PUBLIC_PORT_SUFFIX-${CADDY_PORT:+:${CADDY_PORT}}}"
# trex ships no login UI; an unauthenticated /authorize lands here.
TREX_OIDC_LOGIN_URL: "https://${CADDY__D2E__PUBLIC_FQDN:-${CADDY__ALP__PUBLIC_FQDN:-localhost}}:${CADDY_PORT:-${PORT:-443}}/d2e-login/"
# WebAPI is the only relying party: Atlas reaches the IdP through it. The
# registration is upserted on every boot, so these values are the source of
# truth and a changed URL needs no manual fix-up.
TREX_OIDC_CLIENT_ID: ${TREX__OIDC__WEBAPI_CLIENT_ID:-d2e-webapi}
TREX_OIDC_CLIENT_SECRET: ${TREX__OIDC__WEBAPI_CLIENT_SECRET:?TREX__OIDC__WEBAPI_CLIENT_SECRET must be set (run d2e init)}
TREX_OIDC_CLIENT_NAME: "D2E WebAPI"
# Spring's oauth2Login appends the registration id, hence the /openid tail.
# Two relying parties share this registration: WebAPI (Spring appends the
# /openid registration id) and the portal, whose callback d2e-compat builds
# from the same clientId. A redirect URI that is not listed here is refused
# at /authorize, so the portal cannot log in without its entry.
#
# WebAPI derives the redirect URI it asks for from the request it received,
# so reaching Atlas by any other name than the one below - another
# hostname, an address, a different port - produces a URI that is not on
# this list and the sign-in ends in "unregistered redirect_uri".
# TREX_OIDC__EXTRA_REDIRECT_URIS registers those additional origins; give
# it whole callback URLs, comma separated.
TREX_OIDC_CLIENT_REDIRECT_URIS: "https://${CADDY__D2E__PUBLIC_FQDN:-${CADDY__ALP__PUBLIC_FQDN:-localhost}}:${CADDY_PORT:-${PORT:-443}}/WebAPI/user/oauth/callback/openid,https://${CADDY__D2E__PUBLIC_FQDN:-${CADDY__ALP__PUBLIC_FQDN:-localhost}}:${CADDY_PORT:-${PORT:-443}}/d2e/portal/login-callback,https://${CADDY__D2E__PUBLIC_FQDN:-${CADDY__ALP__PUBLIC_FQDN:-localhost}}:${CADDY_PORT:-${PORT:-443}}/atlas-login/,https://${CADDY__D2E__PUBLIC_FQDN:-${CADDY__ALP__PUBLIC_FQDN:-localhost}}/WebAPI/user/oauth/callback/openid,https://${CADDY__D2E__PUBLIC_FQDN:-${CADDY__ALP__PUBLIC_FQDN:-localhost}}/d2e/portal/login-callback,https://${CADDY__D2E__PUBLIC_FQDN:-${CADDY__ALP__PUBLIC_FQDN:-localhost}}/atlas-login/${TREX_OIDC__EXTRA_REDIRECT_URIS:+,${TREX_OIDC__EXTRA_REDIRECT_URIS}}"
TREX_OIDC_CLIENT_POST_LOGOUT_URIS: "https://${CADDY__D2E__PUBLIC_FQDN:-${CADDY__ALP__PUBLIC_FQDN:-localhost}}:${CADDY_PORT:-${PORT:-443}}/atlas/,https://${CADDY__D2E__PUBLIC_FQDN:-${CADDY__ALP__PUBLIC_FQDN:-localhost}}:${CADDY_PORT:-${PORT:-443}}/d2e/portal,https://${CADDY__D2E__PUBLIC_FQDN:-${CADDY__ALP__PUBLIC_FQDN:-localhost}}/atlas/,https://${CADDY__D2E__PUBLIC_FQDN:-${CADDY__ALP__PUBLIC_FQDN:-localhost}}/d2e/portal"
# The ceiling /authorize narrows every request to, not a grant: it issues
# only what the request asks for. d2e-compat asks for offline_access on
# every sign-in because the provider issues a refresh token only when
# that scope was granted, so a row without it refuses every sign-in with
# an invalid_scope naming a scope nobody configured. The seeder writes
# this column only when this variable is set, leaving a row seeded by an
# older image on its old list until it is named here.
TREX_OIDC_CLIENT_SCOPES: "openid profile email idp_groups offline_access"
# client_credentials clients for trex's provider (LOGTO__CLIENT_APPS shape).
# alp-svc omitted: its only caller needs a psConfig route not set up here.
TREX_OIDC_SERVICE_CLIENTS: '[{"name":"alp-data","id":"${LOGTO__D2E_DATA__CLIENT_ID:-${LOGTO__ALP_DATA__CLIENT_ID}}","secret":"${LOGTO__D2E_DATA__CLIENT_SECRET:-${LOGTO__ALP_DATA__CLIENT_SECRET}}"}]'
TREX_SQL_PASSWORD: ${TREX__SQL__PASSWORD:?TREX__SQL__PASSWORD must be set (run d2e init); refusing default pencil}
TREX__SQL__PORT: ${TREX__SQL__PORT:-5433}
TREX__SQL__DBNAME: postgres
TREX__ENDPOINT_URL: "http://localhost:33001"
TREX_ROUTES: '{"d2e":"http://localhost:33001"}'
TREX_EXTENSIONS_PATH: /usr/src/node_modules/@trex
TREX_POOL_SIZE: ${TREX_POOL_SIZE:-1024}
TREXSQL_ENABLED: "true"
# hades-api Run backend: R env cache + per-run output, both under the
# hades-data volume; work schema for staged cohort/analysis data.
HADES_ENVS_BASE_DIR: /data/hades/envs
HADES_OUTPUT_BASE_DIR: /data/hades/runs
HADES_WORK_SCHEMA: _config.work
SWARM_NODE: d2e
SWARM_CONFIG: |-
{
"cluster_id": "d2e",
"nodes": {
"d2e": {
"gossip_addr": "0.0.0.0:4200",
"extensions": [
{
"name": "trexas",
"config": {
"host": "0.0.0.0",
"port": 33001,
"main_service_path": "/usr/src/core/server/index.eszip",
"event_worker_path": "/usr/src/core/event/index.eszip",
"tls_port": 33000,
"tls_cert_path": "/usr/src/cert/cert.pem",
"tls_key_path": "/usr/src/cert/key.pem"
}
},
{
"name": "pgwire",
"config": { "host": "0.0.0.0", "port": 5433, "password": "${TREX__SQL__PASSWORD:?TREX__SQL__PASSWORD must be set (run d2e init); refusing default pencil}" }
}
]
}
}
}
REP_PG: postgres://postgres:${DEMO__DB_PASSWORD:-mypass}@demodb:5432/postgres
TPM_USE_NODE_MODULES: "false"
SERVICE_ROUTES: |-
{
"analytics": "http://${PROJECT_NAME:-d2e}-trex.${TLS__INTERNAL__DOMAIN:-d2e.local}:33001",
"bookmark": "http://${PROJECT_NAME:-d2e}-trex.${TLS__INTERNAL__DOMAIN:-d2e.local}:33001/analytics-svc/api/services/bookmark",
"cdw": "http://${PROJECT_NAME:-d2e}-trex.${TLS__INTERNAL__DOMAIN:-d2e.local}:33001",
"d2e-webapi": "http://${PROJECT_NAME:-d2e}-trex.${TLS__INTERNAL__DOMAIN:-d2e.local}:33001/d2e-webapi",
"webapi": "http://${PROJECT_NAME:-d2e}-trex.${TLS__INTERNAL__DOMAIN:-d2e.local}:33001/WebAPI",
"paConfig": "http://${PROJECT_NAME:-d2e}-trex.${TLS__INTERNAL__DOMAIN:-d2e.local}:33001/pa-config-svc",
"trex": "http://${PROJECT_NAME:-d2e}-trex.${TLS__INTERNAL__DOMAIN:-d2e.local}:33001",
"queryGen": "http://${PROJECT_NAME:-d2e}-trex.${TLS__INTERNAL__DOMAIN:-d2e.local}:33001",
"jobplugins": "http://${PROJECT_NAME:-d2e}-trex.${TLS__INTERNAL__DOMAIN:-d2e.local}:33001",
"portalServer": "http://${PROJECT_NAME:-d2e}-trex.${TLS__INTERNAL__DOMAIN:-d2e.local}:33001/system-portal",
"dataset": "http://${PROJECT_NAME:-d2e}-trex.${TLS__INTERNAL__DOMAIN:-d2e.local}:33001/gateway/api/dataset",
"usermgmt": "http://${PROJECT_NAME:-d2e}-trex.${TLS__INTERNAL__DOMAIN:-d2e.local}:33001/usermgmt/api",
"strategus-analysis": "http://${PROJECT_NAME:-d2e}-trex.${TLS__INTERNAL__DOMAIN:-d2e.local}:33001",
"terminology": "http://${PROJECT_NAME:-d2e}-trex.${TLS__INTERNAL__DOMAIN:-d2e.local}:33001/terminology",
"prefect": "https://${PROJECT_NAME:-d2e}-dataflow-gen-1.${TLS__INTERNAL__DOMAIN:-d2e.local}:41120/d2e/api",
"idIssuerUrl": "https://${PROJECT_NAME:-d2e}-logto-1.${TLS__INTERNAL__DOMAIN:-d2e.local}:3001/oidc",
"minio": "",
"filesManager": "http://${PROJECT_NAME:-d2e}-trex.${TLS__INTERNAL__DOMAIN:-d2e.local}:33001/files-manager/api",
"whiteRabbit": "http://${PROJECT_NAME:-d2e}-trex.${TLS__INTERNAL__DOMAIN:-d2e.local}:33001/white-rabbit/api",
"alpdb": "http://${PROJECT_NAME:-d2e}-trex.${TLS__INTERNAL__DOMAIN:-d2e.local}:33001/gateway/api/db",
"logto": "https://${PROJECT_NAME:-d2e}-logto-1.${TLS__INTERNAL__DOMAIN:-d2e.local}:3001",
"supabaseStorage": "https://${PROJECT_NAME:-d2e}-supabase-storage-1.${TLS__INTERNAL__DOMAIN:-d2e.local}:9000",
"dataflowStorage": "http://${PROJECT_NAME:-d2e}-trex.${TLS__INTERNAL__DOMAIN:-d2e.local}:33001/system-portal/supabase-storage",
"mcp-server": "http://${PROJECT_NAME:-d2e}-trex.${TLS__INTERNAL__DOMAIN:-d2e.local}:33001/mcp/chat",
"materializeCohorts": "https://${PROJECT_NAME:-d2e}-materialize-cohorts:3333",
"fhirServer": "http://${PROJECT_NAME:-d2e}-trex.${TLS__INTERNAL__DOMAIN:-d2e.local}:8094",
"fhirGateway": "http://${PROJECT_NAME:-d2e}-trex.${TLS__INTERNAL__DOMAIN:-d2e.local}:33001/fhir-gateway"
}
PG_SUPER_PASSWORD: ${PG_SUPER_PASSWORD}
PG_SUPER_USER: ${PG_SUPER_USER:-postgres}
PG_MANAGE_PASSWORD: ${PG_ADMIN_PASSWORD}
PG_MANAGE_USER: ${PG_ADMIN_USER:-alp_pg_admin_user}
PG_PASSWORD: ${PG_WRITE_PASSWORD}
PG_USER: ${PG_WRITE_USER:-alp_pg_write_user}
PORTAL__LOG_DISCLAIMER: ${PORTAL__LOG_DISCLAIMER:-false}
PREFECT_API_URL: ${PREFECT_API_URL:-https://${PROJECT_NAME:-d2e}-dataflow-gen-1.${TLS__INTERNAL__DOMAIN:-d2e.local}:41120/d2e/api}
# Gates the alp-dataflow-gen-init function (waitforEnvVar: PREFECT_HEALTH_CHECK)
# so trex waits for the Prefect API to be reachable before seeding its
# variables/blocks/workpool. Without it the init runs at boot before Prefect
# is up, crashes with ECONNREFUSED, and DQD flow runs later fail with 500.
PREFECT_HEALTH_CHECK: ${PREFECT_HEALTH_CHECK:-https://${PROJECT_NAME:-d2e}-dataflow-gen-1.${TLS__INTERNAL__DOMAIN:-d2e.local}:41120/d2e/api/health}
# The trex core auto-deploys flow plugins to Prefect (core/server/plugin/flow.ts):
# it waits for a worker pool named PREFECT_POOL before registering deployments
# and sets work_pool_name to it. Must match the pool created by the
# dataflow-gen-worker. Default is the pixi process pool; rollback to the
# docker worker = PREFECT_POOL=docker-pool + WORKPOOL_TYPE=docker (see the
# alp-dataflow-gen-worker service comment).
PREFECT_POOL: ${PREFECT_POOL:-process-pool}
WORKPOOL_TYPE: ${WORKPOOL_TYPE:-process}
DEFAULT_FLOW_COMMAND: ${DEFAULT_FLOW_COMMAND:-/app/run-flow.sh d2e-flows}
# trex-embedded supabase storage (@trex/storage at /plugins/trex/storage-api):
# flow.ts publishes flow plugin tarballs here and stamps plugin_artifact
# into deployments; persistent backend path on the trex data volume.
STORAGE_FILE_BACKEND_PATH: ${STORAGE_FILE_BACKEND_PATH:-/usr/src/data/storage}
TREX_STORAGE_URL: ${TREX_STORAGE_URL_INTERNAL:-http://localhost:33001/plugins/trex/storage-api}
TREX_STORAGE_SERVICE_KEY: ${TREX_STORAGE_SERVICE_KEY:-}
DB_CREDENTIALS__PUBLIC_KEYS: |-
{
"DataPlatform": "",
"Internal": "${DB_CREDENTIALS__INTERNAL__PUBLIC_KEY}"
}
DB_CREDENTIALS__PRIVATE_KEY: ${DB_CREDENTIALS__INTERNAL__DECRYPT_PRIVATE_KEY}
GATEWAY__IDP_AUTH_TYPE: logto
GATEWAY__IDP_SUBJECT_PROP: sub
GATEWAY__WO_PROTOCOL_FQDN: ${CADDY__D2E__PUBLIC_FQDN:-${CADDY__ALP__PUBLIC_FQDN:-localhost}}${PORT:+:${PORT:-443}}
HANA__DRIVER_CLASS_PATH: ${HANA__DRIVER_CLASS_PATH:-/app/inst/drivers/ngdbc-latest.jar}
HANA_HINT: ${HANA_HINT:-USE_HEX_PLAN}
CADDY__D2E__PUBLIC_FQDN: ${CADDY__D2E__PUBLIC_FQDN:-${CADDY__ALP__PUBLIC_FQDN:-localhost}}${PORT:+:${PORT:-443}}
IDP__ALP_DATA_CLIENT_ID: ${LOGTO__D2E_DATA__CLIENT_ID:-${LOGTO__ALP_DATA__CLIENT_ID}}
IDP__ALP_SVC_CLIENT_ID: ${LOGTO__D2E_SVC__CLIENT_ID:-${LOGTO__ALP_SVC__CLIENT_ID}}
IDP__RELYING_PARTY: ${IDP__RELYING_PARTY}
IDP__REQUIRED_CLAIM: ${IDP__REQUIRED_CLAIM-thirdPartyToken}
LOGTO__AUDIENCES: https://alp-default
LOGTO__CLIENT_ID: ${LOGTO__D2E_APP__CLIENT_ID:-${LOGTO__ALP_APP__CLIENT_ID}}
LOGTO__D2E_SVC__CLIENT_ID: ${LOGTO__D2E_SVC__CLIENT_ID:-${LOGTO__ALP_SVC__CLIENT_ID}}
LOGTO__D2E_SVC__CLIENT_SECRET: ${LOGTO__D2E_SVC__CLIENT_SECRET:-${LOGTO__ALP_SVC__CLIENT_SECRET}}
LOGTO__D2E_DATA__CLIENT_ID: ${LOGTO__D2E_DATA__CLIENT_ID:-${LOGTO__ALP_DATA__CLIENT_ID}}
LOGTO__D2E_DATA__CLIENT_SECRET: ${LOGTO__D2E_DATA__CLIENT_SECRET:-${LOGTO__ALP_DATA__CLIENT_SECRET}}
# Must equal the iss claim Logto stamps into tokens (= Logto's ENDPOINT + /oidc).
# Used by trex-TS authn middleware (JWKS URL) and portal config (iss validation).
LOGTO__ISSUER: https://${PROJECT_NAME:-d2e}-logto-1.${TLS__INTERNAL__DOMAIN:-d2e.local}:3001/oidc
LOGTO__RESOURCE_API: https://alp-default
LOGTO__SCOPE: ${LOGTO__SCOPE:-openid offline_access profile email}
LOGTO__SVC_CLIENT_ID: ${LOGTO__D2E_SVC__CLIENT_ID:-${LOGTO__ALP_SVC__CLIENT_ID}}
LOGTO__SVC_CLIENT_SECRET: ${LOGTO__D2E_SVC__CLIENT_SECRET:-${LOGTO__ALP_SVC__CLIENT_SECRET}}
LOGTO__TOKEN_URL: https://${PROJECT_NAME:-d2e}-logto-1.${TLS__INTERNAL__DOMAIN:-d2e.local}:3001/oidc/token
LOGTO__ADMIN_SERVER__FQDN_URL: https://${PROJECT_NAME:-d2e}-logto-1.${TLS__INTERNAL__DOMAIN:-d2e.local}:3002
LOGTO__DEFAULT_TENANT__FQDN_URL: ${LOGTO__DEFAULT_TENANT__FQDN_URL:-https://default.logto.app/api}
LOGTO__CLIENTID_PASSWORD__BASIC_AUTH: ${LOGTO__CLIENTID_PASSWORD__BASIC_AUTH}
LOGTO_API_M2M_CLIENT_ID: ${LOGTO_API_M2M_CLIENT_ID}
LOGTO_API_M2M_CLIENT_SECRET: ${LOGTO_API_M2M_CLIENT_SECRET}
NODE_ENV: development
POSTGRES__DRIVER_CLASS_PATH: ${POSTGRES__DRIVER_CLASS_PATH:-/app/inst/drivers/postgresql-42.3.1.jar}
PREFECT_DOCKER_NETWORK: "${PROJECT_NAME:-d2e}_data"
PREFECT_DOCKER_VOLUMES: '${PREFECT_DOCKER_VOLUMES_CUSTOM:-["${PROJECT_NAME:-d2e}_trex:/app/duckdb_data"]}'
GH_TOKEN: ${GH_TOKEN}
PLUGINS_API_VERSION: ${PLUGINS_API_VERSION:-latest}
PLUGINS_REGISTRY: ${PLUGINS_REGISTRY:-https://pkgs.dev.azure.com/data2evidence/d2e/_packaging/d2e/npm/registry/}
TPM_REGISTRY_URL: ${PLUGINS_REGISTRY:-https://pkgs.dev.azure.com/data2evidence/d2e/_packaging/d2e/npm/registry/}
PLUGINS_IMAGE_TAG: ${PLUGINS_IMAGE_TAG:-develop}
PLUGINS_FLOW_CUSTOM_REPO_IMAGE_CONFIG: "${PLUGINS_FLOW_CUSTOM_REPO_IMAGE_CONFIG:-{}}" #{"current": "ghcr.io/ohdsi/d2e", "new": ""}
PLUGINS_INFORMATION_URL: ${PLUGINS_INFORMATION_URL:-https://feeds.dev.azure.com/data2evidence/d2e/_apis/packaging/Feeds/d2e/packages?api-version=7.1&includeDescription=true}
PROJECT_NAME: ${PROJECT_NAME:-d2e}
DATAFLOW_TEMPLATE_REPO_URL: ${DATAFLOW_TEMPLATE_REPO_URL:-https://github.com/data2evidence/templates.git}
DATAFLOW_TEMPLATE_BRANCH: ${DATAFLOW_TEMPLATE_BRANCH:-main}
NOTEBOOK_TEMPLATE_REPO_URL: ${NOTEBOOK_TEMPLATE_REPO_URL:-https://github.com/data2evidence/templates.git}
NOTEBOOK_TEMPLATE_REPO_BRANCH: ${NOTEBOOK_TEMPLATE_REPO_BRANCH:-main}
FHIR_STRUCTURE_MAP_TEMPLATE_REPO_URL: ${FHIR_STRUCTURE_MAP_TEMPLATE_REPO_URL:-https://github.com/data2evidence/templates.git}
FHIR_STRUCTURE_MAP_TEMPLATE_REPO_BRANCH: ${FHIR_STRUCTURE_MAP_TEMPLATE_REPO_BRANCH:-main}
GOOGLE_APPLICATION_CREDENTIALS: /usr/src/data/google-credentials.json
PG_ADMIN_PASSWORD: ${PG_ADMIN_PASSWORD}
PG_WRITE_PASSWORD: ${PG_WRITE_PASSWORD}
PG_STUDY_RESULTS_READ_PASSWORD: ${PG_STUDY_RESULTS_READ_PASSWORD}
PG_STUDY_RESULTS_ADMIN_PASSWORD: ${PG_STUDY_RESULTS_ADMIN_PASSWORD}
SUPABASE_STORAGE_JWT_TOKEN: ${SUPABASE_STORAGE_JWT_TOKEN}
SUPABASE_STORAGE_JWT_SECRET: ${SUPABASE_STORAGE_JWT_SECRET}
PERSEUS__FILES_MANAGER_HOST: trex
isHttpTestRun: ${isHttpTestRun:-false}
isTestEnv: ${isTestEnv:-false}
HTTPTEST_DB_DIALECT: ${HTTPTEST_DB_DIALECT:-duckdb}
local: ${local}
TESTSCHEMA: ${TESTSCHEMA}
REFRESH_TOKEN__ENDPOINT: ${REFRESH_TOKEN__ENDPOINT}
REFRESH_TOKEN__CLIENT_ID: ${REFRESH_TOKEN__CLIENT_ID}
REFRESH_TOKEN__CLIENT_SECRET: ${REFRESH_TOKEN__CLIENT_SECRET}
EXCLUDE_ANALYSIS_IDS: ${EXCLUDE_ANALYSIS_IDS}
DC_HANA_READ_ROLE: ${DC_HANA_READ_ROLE}
MINIO__SECRET_KEY: ${MINIO__SECRET_KEY}
DEMO__DB_PASSWORD: ${DEMO__DB_PASSWORD:-mypass}
USE_PUBLIC_WEBAPI_PROXY: ${USE_PUBLIC_WEBAPI_PROXY:-false}
PUBLIC_WEBAPI_PROXY_URL: ${PUBLIC_WEBAPI_PROXY_URL:-http://localhost:3001}
PUBLIC_WEBAPI_DATASOURCE: ${PUBLIC_WEBAPI_DATASOURCE:-SYNPUF1K}
AZURE_OPENAI_API_KEY: ${AZURE_OPENAI_API_KEY:-}
AZURE_OPENAI_API_ENDPOINT: ${AZURE_OPENAI_API_ENDPOINT:-}
AZURE_OPENAI_API_DEPLOYMENT_NAME: ${AZURE_OPENAI_API_DEPLOYMENT_NAME:-}
AZURE_OPENAI_API_VERSION: ${AZURE_OPENAI_API_VERSION:-}
AZURE_OPENAI_API_INSTANCE_NAME: ${AZURE_OPENAI_API_INSTANCE_NAME:-}
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY:-}
GOOGLE_API_KEY: ${GOOGLE_API_KEY:-}
OLLAMA_BASE_URL: ${OLLAMA_BASE_URL:-}
OLLAMA_API_KEY: ${OLLAMA_API_KEY:-}
AI_MODEL: ${AI_MODEL:-}
COHORT_HISTORY_MAX_TOKENS: ${COHORT_HISTORY_MAX_TOKENS:-4000}
# Pythia agent (Amazon Bedrock). AWS_BEARER_TOKEN_BEDROCK from the deploy env.
AWS_REGION: ${AWS_REGION:-us-east-1}
BAO_AGENT_MODEL: ${BAO_AGENT_MODEL:-us.anthropic.claude-sonnet-4-6}
# WebAPI trexsql.proxy probes localhost:8001 by default; the pythia mount lives on the Deno listener (33001).
BAO_AGENT_UPSTREAM_BASE: ${BAO_AGENT_UPSTREAM_BASE:-http://localhost:33001/plugins/ohdsi/pythia}
# Agent runtime reads TREX_AGENTS_DEFAULT_MODEL (provider/modelId), not BAO_AGENT_MODEL.
TREX_AGENTS_DEFAULT_MODEL: ${TREX_AGENTS_DEFAULT_MODEL:-bedrock/${BAO_AGENT_MODEL:-us.anthropic.claude-sonnet-4-6}}
AWS_BEARER_TOKEN_BEDROCK: ${AWS_BEARER_TOKEN_BEDROCK:-}
D2E_MEMORY_LIMIT: ${D2E_MEMORY_LIMIT:-}
D2E_SWAP_LIMIT: ${D2E_SWAP_LIMIT:-}
D2E_DUCKDB_MEMORY_LIMIT: ${D2E_DUCKDB_MEMORY_LIMIT:-15GB}
D2E_DUCKDB_THREADS: ${D2E_DUCKDB_THREADS:-}
INSTALL_SQLALCHEMY: ${INSTALL_SQLALCHEMY:-}
IS_SELF_MANAGED_ROLES: ${IS_SELF_MANAGED_ROLES:-false}
AUTO_GRANT_RESEARCHER_BY_DATASET_CODES: ${AUTO_GRANT_RESEARCHER_BY_DATASET_CODES:-${AZ_AUTO_GRANT_RESEARCHER_BY_DATASET_CODES:-}}
IDP__AUTO_PROVISION_USERS: ${IDP__AUTO_PROVISION_USERS:-false}
# Follows D2E_IDP above. Left on logto, group memberships are written to
# an identity provider the tokens no longer come from, so study roles
# never reach the claim the portal reads and datasets stay invisible.
USER_MGMT__ROLE_SOURCE: ${USER_MGMT__ROLE_SOURCE:-trex}
# Role assignments are written to trex, which is also the identity provider
# issuing the tokens they travel in.
IDP__ROLE_STORE: "trex"
TREX__ADMIN_URL: "http://${PROJECT_NAME:-d2e}-trex:33001/trex/admin/roles"
# Upstream provider registration and identity pre-linking (IdP migration).
TREX__FEDERATION_ADMIN_URL: "http://${PROJECT_NAME:-d2e}-trex:33001/trex/admin/federation"
# Account provisioning, as opposed to role assignment above. Used to
# create the initial user in the IdP so usermgmt can record its subject.
TREX__AUTH_URL: "http://${PROJECT_NAME:-d2e}-trex:33001/trex/auth/v1"
D2E__SEED_USER: ${D2E__SEED_USER:-}
D2E__SETUP_USER: ${D2E__SETUP_USER:-d2e-setup@d2e.local}
# Optional override only: usermgmt runs as a function worker inside the
# trex container, and trex already injects this same credential as
# SUPABASE_SERVICE_ROLE_KEY into every such worker's environment.
TREX__SERVICE_ROLE_KEY: ${TREX__SERVICE_ROLE_KEY:-}
USERMGMT__AUTO_PROVISION_ENABLED: ${USERMGMT__AUTO_PROVISION_ENABLED:-false}
USERMGMT__AUTO_PROVISION_CONNECTORS: ${USERMGMT__AUTO_PROVISION_CONNECTORS:-}
USERMGMT__AUTO_PROVISION_DEFAULT_TENANT_ID: ${USERMGMT__AUTO_PROVISION_DEFAULT_TENANT_ID:-}
USERMGMT__AUTO_PROVISION_ROLE_HOOK_URL: ${USERMGMT__AUTO_PROVISION_ROLE_HOOK_URL:-}
USERMGMT__AUTO_PROVISION_ROLE_HOOK_SECRET: ${USERMGMT__AUTO_PROVISION_ROLE_HOOK_SECRET:-}
USERMGMT__AUTO_PROVISION_ROLE_HOOK_TIMEOUT_MS: ${USERMGMT__AUTO_PROVISION_ROLE_HOOK_TIMEOUT_MS:-5000}
USERMGMT__ENTITLEMENTS_SYNC_ENABLED: ${USERMGMT__ENTITLEMENTS_SYNC_ENABLED:-false}
USERMGMT__ENTITLEMENTS_PHYSIONET_BASE_URL: ${USERMGMT__ENTITLEMENTS_PHYSIONET_BASE_URL:-}
USERMGMT__ENTITLEMENTS_TIMEOUT_MS: ${USERMGMT__ENTITLEMENTS_TIMEOUT_MS:-10000}
USERMGMT__ENTITLEMENTS_TOKEN_CLAIM: ${USERMGMT__ENTITLEMENTS_TOKEN_CLAIM:-physionet_access_token}
USERMGMT__ENTITLEMENTS_REFRESH_TOKEN_CLAIM: ${USERMGMT__ENTITLEMENTS_REFRESH_TOKEN_CLAIM:-physionet_refresh_token}
USERMGMT__ENTITLEMENTS_PHYSIONET_CLIENT_ID: ${USERMGMT__ENTITLEMENTS_PHYSIONET_CLIENT_ID:-}
USERMGMT__ENTITLEMENTS_PHYSIONET_CLIENT_SECRET: ${USERMGMT__ENTITLEMENTS_PHYSIONET_CLIENT_SECRET:-}
USERMGMT__ENTITLEMENTS_PHYSIONET_TOKEN_PATH: ${USERMGMT__ENTITLEMENTS_PHYSIONET_TOKEN_PATH:-/oauth/token/}
USERMGMT__ENTITLEMENTS_DATASET_MAPPING: ${USERMGMT__ENTITLEMENTS_DATASET_MAPPING:-}
# Upstream idp group id -> d2e scope, keyed by idp_provider (JSON). Read by
# the alp-usermgmt function; empty means no federated group maps to a role.
IDP__GROUP_ROLE_MAPPING: ${IDP__GROUP_ROLE_MAPPING:-}
# network-api function (plugins/functions/package.json) stays inactive
# until these are non-empty.
NETWORK_COGNITO_DOMAIN: ${NETWORK_COGNITO_DOMAIN:-}
NETWORK_CENTRAL_API_URL: ${NETWORK_CENTRAL_API_URL:-}
NETWORK_MACHINE_CLIENT_ID: ${NETWORK_MACHINE_CLIENT_ID:-}
NETWORK_CLIENT_SECRET: ${NETWORK_CLIENT_SECRET:-}
NETWORK_TOKEN_SCOPE: ${NETWORK_TOKEN_SCOPE:-}
NETWORK_ENC_KEY: ${NETWORK_ENC_KEY:-}
# Coordinator-scoped auth for study publish (POST /studies, POST
# /studies/{id}/publish). Scaffold only — central has no path today for
# a client_credentials token to receive role=coordinator, so network-api
# keeps GET /coordinator/state reporting configured:false regardless of
# these being set. See plugins/sibyl_functions/network-api/index.ts header.
NETWORK_COORDINATOR_CLIENT_ID: ${NETWORK_COORDINATOR_CLIENT_ID:-}
NETWORK_COORDINATOR_CLIENT_SECRET: ${NETWORK_COORDINATOR_CLIENT_SECRET:-}
NETWORK_COORDINATOR_TOKEN_SCOPE: ${NETWORK_COORDINATOR_TOKEN_SCOPE:-}
CACHE_FLOW_LEVEL_CONCURRENCY: ${CACHE_FLOW_LEVEL_CONCURRENCY:-1}
CACHE_TABLE_LEVEL_CONCURRENCY: ${CACHE_TABLE_LEVEL_CONCURRENCY:-1}
CACHE_TASK_TIMEOUT: ${CACHE_TASK_TIMEOUT:-10800}
CACHE_CHUNK_TIMEOUT: ${CACHE_CHUNK_TIMEOUT:-3600}
# alp-dataflow-gen-init seeds this as the `duckdb_data_folder` Prefect variable,
# which the cache flows resolve their .db path from. It was declared only in that
# function's trex env profile and in CI the variable came out null, so every cache
# build died in Path(None) -- seed.ts posts `value: undefined`, which Prefect
# stores as null rather than rejecting. Declaring it on the container the init
# runs in makes the seeded value the real one. trex mounts the same volume at
# /usr/src/data and attaches cache catalogs out of /usr/src/data/cache; a flow
# container sees that volume as /app/duckdb_data.
DUCKDB__DATA_FOLDER: ${DUCKDB__DATA_FOLDER:-/app/duckdb_data/cache}
ANALYTICS_STREAMING_CHUNK_SIZE_BY_DIALECT: '${ANALYTICS_STREAMING_CHUNK_SIZE_BY_DIALECT:-{"hana": 10000}}'
IS_AUDIT_LOG_ENABLED: ${IS_AUDIT_LOG_ENABLED:-false}
IS_CDM_SQL_AUDIT_LOG_ENABLED: ${IS_CDM_SQL_AUDIT_LOG_ENABLED:-false}
AUDIT_LOG_TO_CONSOLE: ${AUDIT_LOG_TO_CONSOLE:-false}
ANALYTICS_HANA_STREAMING_ENABLED: ${ANALYTICS_HANA_STREAMING_ENABLED:-false}
# TREX_DEBUG_GC: ${TREX_DEBUG_GC:-0}
# RUST_LOG: ${RUST_LOG:-info}
# --- trex main (FROM trexsql) requirements ---
# trexsql entrypoint refuses to start without TREX_ROOT_KEY (>=40 chars).
TREX_ROOT_KEY: ${TREX_ROOT_KEY:?TREX_ROOT_KEY must be set (run d2e init); trex refuses to boot without it}
# trex main connects to Postgres for trexdb schema, auth keys, event_log.
DATABASE_URL: postgres://postgres:${PG_SUPER_PASSWORD}@${PG_HOST:-${PROJECT_NAME:-d2e}-minerva-postgres-1}:${PG_PORT:-5432}/alp
BETTER_AUTH_SECRET: ${BETTER_AUTH_SECRET:-${TREX_ROOT_KEY}}
BETTER_AUTH_URL: "http://localhost:33001/trex"
BASE_PATH: /trex
SCHEMA_DIR: /usr/src/core/schema
PLUGINS_DEV_PATH: "/usr/src/plugins-dev:/usr/src/bundled-plugins"
D2E_COMPAT: "true"
# OpenTelemetry is off by default: deno_telemetry is only turned on when
# trex is started with --enable-otel (see the command above), not by
# these OTEL_EXPORTER_* vars alone.
TREX_OTEL_ENABLED: ${TREX_OTEL_ENABLED:-}
OTEL_EXPORTER_OTLP_ENDPOINT: ${OTEL_EXPORTER_OTLP_ENDPOINT:-}
OTEL_EXPORTER_OTLP_PROTOCOL: ${OTEL_EXPORTER_OTLP_PROTOCOL:-}
OTEL_EXPORTER_OTLP_HEADERS: ${OTEL_EXPORTER_OTLP_HEADERS:-}
OTEL_SERVICE_NAME: ${OTEL_SERVICE_NAME:-}
COHORT_CACHE_TTL_HOURS: ${COHORT_CACHE_TTL_HOURS:-24}
COHORT_CACHE_MAX_AGE_DAYS: ${COHORT_CACHE_MAX_AGE_DAYS:-30}
alp-caddy:
container_name: &c1 ${PROJECT_NAME:-d2e}-caddy
hostname: ${PROJECT_NAME:-d2e}-caddy.${TLS__INTERNAL__DOMAIN:-d2e.local}
platform: linux/amd64
image: caddy:2.8-alpine
logging:
options:
tag: *c1
networks:
alp:
priority: 20
command: >
sh -c "
mkdir -p /srv/caddy-config &&
printf '%s' \"$$TLS__INTERNAL__CA_CRT\" > /srv/caddy-config/ca.pem &&
cat <<EOT > /srv/caddy-config/Caddyfile
{
debug
servers {
protocols h1
}
pki {
ca local {
name \"D2E Local CA\"
root_cn \"D2E Local CA - 2024 ECC Root\"
intermediate_cn \"D2E Local CA - ECC Intermediate\"
}
}
}
(publicurlredirect) {
${CADDY__D2E__ALIAS_PUBLIC_FQDN:-${CADDY__ALP__ALIAS_PUBLIC_FQDN:-}} {
$TLS__CADDY_DIRECTIVE
redir https://${CADDY__D2E__PUBLIC_FQDN:-${CADDY__ALP__PUBLIC_FQDN:-localhost}}{uri} permanent
}
}
(proxy_headers_codespaces) {
header_up Host {upstream_hostport}
header_up X-Forwarded-Host ${CADDY__D2E__PUBLIC_FQDN:-${CADDY__ALP__PUBLIC_FQDN:-localhost}}
header_up X-Forwarded-Proto {scheme}
# {remote_host}, not {remote}: Caddy's {remote} is the peer's
# host:PORT, and nothing downstream can parse an X-Forwarded-For
# spelled that way. Better Auth's isValidIP refuses it outright, so
# trex resolved no client IP at all and its rate limiter keyed every
# caller into ONE bucket per path — which is how 594 anonymous
# requests closed /oauth2/userinfo for the whole installation in 2.4
# seconds. Logto reads the same header (TRUST_PROXY_HEADER=true).
# trex normalises this defensively, so the two repositories can ship
# in either order.
header_up X-Forwarded-For {remote_host}
}
(proxy_headers_default) {
header_up Host ${CADDY__D2E__PUBLIC_FQDN:-${CADDY__ALP__PUBLIC_FQDN:-localhost}}:${CADDY_PORT:-${PORT:-443}}
header_up X-Forwarded-Host ${CADDY__D2E__PUBLIC_FQDN:-${CADDY__ALP__PUBLIC_FQDN:-localhost}}:${CADDY_PORT:-${PORT:-443}}
header_up X-Forwarded-Port ${CADDY_PORT:-${PORT:-443}}
header_up X-Forwarded-Proto https
# {remote_host}, not {remote}: Caddy's {remote} is the peer's
# host:PORT, and nothing downstream can parse an X-Forwarded-For
# spelled that way. Better Auth's isValidIP refuses it outright, so
# trex resolved no client IP at all and its rate limiter keyed every
# caller into ONE bucket per path — which is how 594 anonymous
# requests closed /oauth2/userinfo for the whole installation in 2.4
# seconds. Logto reads the same header (TRUST_PROXY_HEADER=true).
# trex normalises this defensively, so the two repositories can ship
# in either order.
header_up X-Forwarded-For {remote_host}
}
(portal) {
log {
format console {
level_format color
}
}
# Logto api server
@logto {
path /api/*
path /oidc/*
path /sign-in
path /consent
path /callback/* # For azure connector
path /d2e/logto/index.*
path /d2e/logto/assets/* # logto assets are moved to this path
}
handle @logto {
uri strip_prefix /d2e/logto
reverse_proxy https://${PROJECT_NAME:-d2e}-logto-1.${TLS__INTERNAL__DOMAIN:-d2e.local}:3001 {
import ${PROXY_HEADERS_MODE:-proxy_headers_default}
# Host + X-Forwarded-* make Logto (TRUST_PROXY_HEADER=true) emit external URLs
# for browser-facing endpoints (authorize/sign-in). The issuer claim itself is
# sourced from Logto's ENDPOINT env var (internal http://alp-caddy:8080), which
# lets WebAPI's Spring OAuth2 client validate iss without TLS/DNS gymnastics.
header_up Host ${CADDY__D2E__PUBLIC_FQDN:-${CADDY__ALP__PUBLIC_FQDN:-localhost}}${PORT:+:${PORT:-443}}
transport http {
tls
tls_trust_pool file /srv/caddy-config/ca.pem
read_buffer 8192
}
}
}
# Redirect uppercase /Atlas to lowercase /atlas
@atlas_uppercase {
path_regexp atlas_case ^/Atlas(.*)$$
}
redir @atlas_uppercase /atlas{re.atlas_case.1} 301
# Bare root lands on Atlas. Matched exactly so only "/" moves: every
# other path still falls through to the trex gateway below.
@root path /
redir @root /atlas/ 302
@studio path /plugins/trex/studio /plugins/trex/studio/*
handle @studio {
reverse_proxy http://${PROJECT_NAME:-d2e}-trex:33001 {
import ${PROXY_HEADERS_MODE:-proxy_headers_default}
transport http {
read_buffer 8192
}
header_down -X-Frame-Options
header_down -Content-Security-Policy
}
}
# Default handler - all other routes go to trex gateway
handle {
reverse_proxy http://${PROJECT_NAME:-d2e}-trex:33001 {
import ${PROXY_HEADERS_MODE:-proxy_headers_default}
transport http {
read_buffer 8192
}
}
}
}
$INSTANCE_SPECIFIC_CONFIG
# Enable if need to access admin console
# http://localhost:3002 {
# uri strip_prefix /d2e/logto
# reverse_proxy http://${PROJECT_NAME:-d2e}-logto-1:3002 {
# header_up Host {host}
# header_up X-Forwarded-Proto http
# header_up X-Forwarded-Port 3002
# transport http {
# read_buffer 8192
# }
# }
# }
# Internal HTTP listener for service-to-service communication (avoids TLS issues)
# Does NOT set X-Forwarded headers - metadata will have internal URLs for token exchange
:8080 {
@oidc {
path /oidc/*
}
handle @oidc {
reverse_proxy https://${PROJECT_NAME:-d2e}-logto-1.${TLS__INTERNAL__DOMAIN:-d2e.local}:3001 {
transport http {
tls
tls_trust_pool file /srv/caddy-config/ca.pem
}
}
}
# Enable if need to access admin console
# @admin_api path /api/*
# handle @admin_api {
# reverse_proxy http://${PROJECT_NAME:-d2e}-logto-1:3002
# }
# @admin_auth path /sign-in* /sign-up* /consent* /forgot-password* /callback/* /social/*
# handle @admin_auth {
# reverse_proxy http://${PROJECT_NAME:-d2e}-logto-1:3001
# }
respond 404
}
https://${CADDY__D2E__PUBLIC_FQDN:-${CADDY__ALP__PUBLIC_FQDN:-localhost}}${CADDY__ADDITIONAL_HOSTS:+, ${CADDY__ADDITIONAL_HOSTS}} {
$TLS__CADDY_DIRECTIVE
@aliasbasepaths {
path_regexp portal_basepath ^/(d2e|portal)(/)?$
}
redir @aliasbasepaths /d2e/portal
import portal
}
# Plain-HTTP listener (no TLS) so service workers register without a
# trusted cert. Reuses the same handles via the (portal) snippet.
# localhost over http is a secure context, so the results-viewer
# shinylive service worker registers without the self-signed-cert error.
# Access the app at http://localhost:41180.
http://${CADDY__D2E__PUBLIC_FQDN:-${CADDY__ALP__PUBLIC_FQDN:-localhost}}:41180 {
@aliasbasepaths2 {
path_regexp portal_basepath ^/(d2e|portal)(/)?$
}
redir @aliasbasepaths2 /d2e/portal
import portal
}
EOT
caddy run --environ --config /srv/caddy-config/Caddyfile --adapter caddyfile
"
ports:
- ${CADDY_PORT:-${PORT:-443}}:443
- 41180:41180 # plain-http route (no TLS) so service workers work locally
# - 3002:3002 # Enable if need to access admin console
# - 8080:8080 # Enable if need to access admin console
restart: ${DOCKER__RESTART_POLICY:-unless-stopped}
volumes:
- caddy:/data
environment:
CADDY__D2E__PUBLIC_FQDN: ${CADDY__D2E__PUBLIC_FQDN:-${CADDY__ALP__PUBLIC_FQDN:-localhost}}
TLS__CADDY_DIRECTIVE: ${TLS__CADDY_DIRECTIVE:-tls internal}
INSTANCE_SPECIFIC_CONFIG: ${INSTANCE_SPECIFIC_CONFIG:-}
CADDY__D2E__ALIAS_PUBLIC_FQDN: ${CADDY__D2E__ALIAS_PUBLIC_FQDN:-${CADDY__ALP__ALIAS_PUBLIC_FQDN:-}}
PROJECT_NAME: ${PROJECT_NAME:-d2e}
# Read by the entrypoint above to write /srv/caddy-config/ca.pem, which the
# tls_trust_pool directives use. Only the CA is passed — not the *x-tls
# anchor — so the internal private key stays out of this container.
TLS__INTERNAL__CA_CRT: ${TLS__INTERNAL__CA_CRT}
alp-dataflow-gen:
container_name: &c2 ${PROJECT_NAME:-d2e}-dataflow-gen-1
depends_on:
# No edge to alp-logto-post-init: it sits behind the logto profile and
# compose cannot express a dependency that applies only when a profile is
# active, so waiting on it would break every default start.
# Needs the alp_pg_* users, which trex's bootstrap creates.
trex:
condition: service_healthy
healthcheck:
interval: 30s
retries: 30
start_period: 30s
test:
[
"CMD-SHELL",
"curl -fk https://localhost:41120/d2e/api/health || exit 1",
]
timeout: 30s
hostname: &dataflow-gen-hostname ${PROJECT_NAME:-d2e}-dataflow-gen-1.${TLS__INTERNAL__DOMAIN:-d2e.local}
image: ${DOCKER_IMAGE_PREFIX:-ghcr.io/ohdsi/}d2e-dataflow-gen:${DOCKER_TAG_NAME:-develop}
platform: linux/amd64
logging:
options:
tag: *c2
networks:
alp:
priority: 20
data:
priority: 10
restart: ${DOCKER__RESTART_POLICY:-unless-stopped}
environment:
<<:
- *x-converter
- *x-pg
- *x-tls
LOCAL_DEBUG: "false"
DATAFLOW_GEN_HOSTNAME: *dataflow-gen-hostname
PREFECT_API_DATABASE_CONNECTION_URL: postgresql+asyncpg://${PG_SUPER_USER:-postgres}:${PG_SUPER_PASSWORD}@${PG_HOST:-${PROJECT_NAME:-d2e}-minerva-postgres-1}:${PG_PORT:-5432}/${PG_DB_NAME:-alp}
PREFECT_API_DEFAULT_LIMIT: 5000
PREFECT_SERVER_API_BASE_PATH: /d2e/api
PREFECT_UI_SERVE_BASE: /d2e
# Relative API URL: the UI calls whatever origin it was loaded from
# (localhost, 127.0.0.1, or the Caddy public FQDN), so API calls stay
# same-origin and avoid the cross-origin CORS preflight that the
# in-container nginx answers with 503. Must line up with
# PREFECT_SERVER_API_BASE_PATH (/d2e/api) above.
PREFECT_UI_API_URL: /d2e/api
PREFECT_UI_URL: https://127.0.0.1:41120/d2e
PREFECT_LOGGING_LEVEL: DEBUG
PREFECT_LOGGING_SERVER_LEVEL: WARNING
PREFECT_SERVER_ANALYTICS_ENABLED: "false"
# Prefect itself stays on loopback, HTTP only; nginx (started by the
# image's entrypoint.sh) is the only thing listening on 41120/the
# docker network, terminating TLS with the shared TLS__INTERNAL__* cert.
PREFECT_SERVER_API_HOST: 127.0.0.1
PREFECT_UI_STATIC_DIRECTORY: /app/ui-files
PREFECT_SERVER_API_PORT: 41121
PREFECT_API_ENABLE_HTTP2: False
# Pixi process worker: flow runs execute as subprocesses in per-plugin pixi
# environments (run-flow.sh); plugin code+envs arrive as deployment-attached
# artifacts from trex storage or the image's baked cache. Rollback to the
# docker worker: PREFECT_POOL=docker-pool WORKPOOL_TYPE=docker (+ revert the
# package.json command commit and use Dockerfile.docker-pool image).
alp-dataflow-gen-worker:
command:
- pixi
- run
- --manifest-path
- /opt/worker/pyproject.toml
- sh
- -c
- >-
rm -rf /root/.prefect/storage/run_cache.db /root/.prefect/storage/events.db;
printf '%s\n' "$$TLS__INTERNAL__CA_CRT" > /usr/local/share/ca-certificates/d2e-internal-ca.crt;
update-ca-certificates;