Skip to content

Commit 77d84c8

Browse files
committed
UHF-10311: update settings.php
1 parent 7837732 commit 77d84c8

1 file changed

Lines changed: 17 additions & 12 deletions

File tree

public/sites/default/settings.php

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -229,24 +229,30 @@ function drupal_get_env(string|array $variables) : mixed {
229229
}
230230
}
231231
}
232+
$stage_file_proxy_origin = getenv('STAGE_FILE_PROXY_ORIGIN');
233+
$stage_file_proxy_dir = getenv('STAGE_FILE_PROXY_ORIGIN_DIR');
232234

233-
if ($stage_file_proxy_origin = getenv('STAGE_FILE_PROXY_ORIGIN')) {
234-
$config['stage_file_proxy.settings']['origin'] = $stage_file_proxy_origin;
235-
$config['stage_file_proxy.settings']['origin_dir'] = getenv('STAGE_FILE_PROXY_ORIGIN_DIR') ?: 'test';
235+
if ($stage_file_proxy_origin || $stage_file_proxy_dir) {
236+
$config['stage_file_proxy.settings']['origin'] = $stage_file_proxy_origin ?: 'https://stplattaprod.blob.core.windows.net';
237+
$config['stage_file_proxy.settings']['origin_dir'] = $stage_file_proxy_dir;
236238
$config['stage_file_proxy.settings']['hotlink'] = FALSE;
237239
$config['stage_file_proxy.settings']['use_imagecache_root'] = FALSE;
238240
}
239241

240-
// Map API accounts. The value should be a base64 encoded JSON string.
241-
// @see https://github.com/City-of-Helsinki/drupal-module-helfi-api-base/blob/main/documentation/api-accounts.md.
242-
if ($api_accounts = getenv('DRUPAL_API_ACCOUNTS')) {
243-
$config['helfi_api_base.api_accounts']['accounts'] = json_decode(base64_decode($api_accounts), TRUE);
242+
if ($drupal_pubsub_vault = getenv('DRUPAL_PUBSUB_VAULT')) {
243+
$config['helfi_api_base.api_accounts']['vault'][] = [
244+
'id' => 'pubsub',
245+
'plugin' => 'json',
246+
'data' => trim($drupal_pubsub_vault),
247+
];
244248
}
245249

246-
// Map vault accounts. The value should be a base64 encoded JSON string.
247-
// @see https://github.com/City-of-Helsinki/drupal-module-helfi-api-base/blob/main/documentation/api-accounts.md.
248-
if ($vault_accounts = getenv('DRUPAL_VAULT_ACCOUNTS')) {
249-
$config['helfi_api_base.api_accounts']['vault'] = json_decode(base64_decode($vault_accounts), TRUE);
250+
if ($drupal_navigation_vault = getenv('DRUPAL_NAVIGATION_VAULT')) {
251+
$config['helfi_api_base.api_accounts']['vault'][] = [
252+
'id' => 'helfi_navigation',
253+
'plugin' => 'authorization_token',
254+
'data' => trim($drupal_navigation_vault),
255+
];
250256
}
251257

252258
// Override session suffix when present.
@@ -382,4 +388,3 @@ function drupal_get_env(string|array $variables) : mixed {
382388
if (empty($settings['deployment_identifier'])) {
383389
$settings['deployment_identifier'] = filemtime(__DIR__ . '/../../../composer.lock');
384390
}
385-

0 commit comments

Comments
 (0)