From 5ec45431709318ec1c479c71b40b8143e1f626f6 Mon Sep 17 00:00:00 2001 From: Adam Franco Date: Mon, 25 Nov 2024 16:09:46 -0500 Subject: [PATCH] #47: Let SYNC_ALLOWED_BLOCK_CODES to be configured in .env. This uses an encoded JSON array to pass from shell, to YAML. --- .env | 2 ++ config/services.yaml | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.env b/.env index 2d3207f5..5c600a11 100644 --- a/.env +++ b/.env @@ -32,6 +32,8 @@ SCHEDULES_IMAGE_FONT_FILE=/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf # Sync SYNC_ERROR_MAIL_TO="admin@example.edu" SYNC_ERROR_MAIL_FROM="noreply@example.edu" +# A JSON encoded array of Block Codes that should be exposed to users. +SYNC_ALLOWED_BLOCK_CODES='["CC"]' # Sync destination (this application's database) SYNC_DESTINATION_DSN="mysql:host=database;port=3306;dbname=symfony;charset=utf8mb4" SYNC_DESTINATION_USERNAME=symfony diff --git a/config/services.yaml b/config/services.yaml index 6736bc9e..8eadd326 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -73,8 +73,7 @@ services: $errorMailFrom: '%env(SYNC_ERROR_MAIL_FROM)%' App\Service\CatalogSync\Syncer\OciSyncer: arguments: - $allowedBlckCodes: - - "CC" + $allowedBlckCodes: '%env(json:SYNC_ALLOWED_BLOCK_CODES)%' App\Service\CatalogSync\Database\Destination\PdoDestinationDatabase: arguments: $dsn: '%env(SYNC_DESTINATION_DSN)%'