From 0bf903e3de4e15d172b05e7020744da1176f82f8 Mon Sep 17 00:00:00 2001 From: James Wragg Date: Fri, 6 Sep 2024 17:18:04 +0100 Subject: [PATCH 1/2] fix: selfserve asset_path config.global update --- app/selfserve/config/autoload/config.global.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/selfserve/config/autoload/config.global.php b/app/selfserve/config/autoload/config.global.php index 4f6a2baf2d..c7a06fe352 100644 --- a/app/selfserve/config/autoload/config.global.php +++ b/app/selfserve/config/autoload/config.global.php @@ -54,7 +54,18 @@ ], // Asset path, URI to olcs-static (CSS, JS, etc] *Environment specific* - 'asset_path' => (\Aws\Credentials\CredentialProvider::shouldUseEcs() ? 'https://cdn.%domain%' : '/static/public'), + 'asset_path' => function () { + global $environment; + if (\Aws\Credentials\CredentialProvider::shouldUseEcs()) { + return match ($environment) { + 'DEV' => 'https://dev-cdn.dev-dvsacloud.uk', + 'QA' => 'https://int-cdn.dev-dvsacloud.uk', + default => throw new \InvalidArgumentException('Asset Path: Should use ECS but environment not recognised'), + }; + } + return '/static/public'; + }, + 'cookie-manager' => [ 'delete-undefined-cookies' => true, 'user-preference-cookie-name' => 'cookie_policy', From 3ac26d73e941936fa8fe94369bb68b541021f748 Mon Sep 17 00:00:00 2001 From: James Wragg Date: Tue, 10 Sep 2024 15:35:22 +0100 Subject: [PATCH 2/2] fix: ECS environments defers to assets_url parameter for asset path --- app/internal/config/autoload/config.global.php | 2 +- app/selfserve/config/autoload/config.global.php | 14 ++------------ 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/app/internal/config/autoload/config.global.php b/app/internal/config/autoload/config.global.php index 11640f3eaf..f7d462fd39 100644 --- a/app/internal/config/autoload/config.global.php +++ b/app/internal/config/autoload/config.global.php @@ -79,7 +79,7 @@ ], // Asset path, URI to olcs-static (CSS, JS, etc] *Environment specific* - 'asset_path' => (\Aws\Credentials\CredentialProvider::shouldUseEcs() ? 'https://cdn.%domain%' : '/static/public'), + 'asset_path' => (\Aws\Credentials\CredentialProvider::shouldUseEcs() ? '%assets_url%' : '/static/public'), /** * Configure the location of the application log diff --git a/app/selfserve/config/autoload/config.global.php b/app/selfserve/config/autoload/config.global.php index c7a06fe352..50664228ee 100644 --- a/app/selfserve/config/autoload/config.global.php +++ b/app/selfserve/config/autoload/config.global.php @@ -54,18 +54,8 @@ ], // Asset path, URI to olcs-static (CSS, JS, etc] *Environment specific* - 'asset_path' => function () { - global $environment; - if (\Aws\Credentials\CredentialProvider::shouldUseEcs()) { - return match ($environment) { - 'DEV' => 'https://dev-cdn.dev-dvsacloud.uk', - 'QA' => 'https://int-cdn.dev-dvsacloud.uk', - default => throw new \InvalidArgumentException('Asset Path: Should use ECS but environment not recognised'), - }; - } - return '/static/public'; - }, - + 'asset_path' => (\Aws\Credentials\CredentialProvider::shouldUseEcs() ? '%assets_url%' : '/static/public'), + 'cookie-manager' => [ 'delete-undefined-cookies' => true, 'user-preference-cookie-name' => 'cookie_policy',