Skip to content

Commit 582b621

Browse files
committed
Updated Acquia settings.
1 parent f6f41d8 commit 582b621

8 files changed

Lines changed: 104 additions & 35 deletions

File tree

.vortex/docs/content/hosting/acquia.mdx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,27 @@ settings from [`web/sites/default/includes/providers/settings.acquia.php`](https
4747
This includes Acquia-specific configurations for caching, file paths, and
4848
environment variables.
4949

50+
#### Acquia settings file
51+
52+
By default, Vortex includes the Acquia-provided settings file from
53+
`/var/www/site-php/{group}/{group}-settings.inc`. You can override this path
54+
by setting the `DRUPAL_ACQUIA_SETTINGS_FILE` environment variable.
55+
56+
#### Temporary file path
57+
58+
Vortex configures the temporary file path (`file_temp_path`) with a three-tier
59+
priority:
60+
61+
1. **Default**: `/tmp`
62+
2. **Shared GFS mount**: If `DRUPAL_TMP_PATH_IS_SHARED` is set, uses
63+
`/mnt/gfs/{group}.{env}/tmp` — a per-head mounted directory on Acquia's
64+
shared filesystem. This is useful for operations like bulk uploads that
65+
require a shared temporary directory across web heads. See
66+
[Acquia temporary files documentation](https://docs.acquia.com/acquia-cloud-platform/manage-apps/files/temporary#section-important-considerations)
67+
for details.
68+
3. **Explicit override**: If `DRUPAL_TMP_PATH` is set, its value is used
69+
regardless of other settings.
70+
5071
## Onboarding
5172

5273
Before you begin, ensure you have:
@@ -63,6 +84,9 @@ file:
6384
| Variable | Description |
6485
|----------|-------------|
6586
| `VORTEX_ACQUIA_APP_NAME` | Your Acquia application name (machine name) |
87+
| `DRUPAL_ACQUIA_SETTINGS_FILE` | Override the path to Acquia's settings `.inc` file (optional) |
88+
| `DRUPAL_TMP_PATH` | Override the temporary file path (optional) |
89+
| `DRUPAL_TMP_PATH_IS_SHARED` | Use Acquia's shared GFS mount for temporary files (optional) |
6690

6791
For CI environments, configure these secrets in your CI provider ([GitHub Actions](/docs/continuous-integration/github-actions) or [CircleCI](/docs/continuous-integration/circleci)):
6892

.vortex/installer/tests/Fixtures/handler_process/_baseline/web/sites/default/includes/providers/settings.container.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
$vortex_localdev_url = getenv('VORTEX_LOCALDEV_URL');
1616
if (!empty($vortex_localdev_url)) {
1717
// Local development URL.
18-
$patterns = str_replace(['.', 'https://', 'http://', ','], [
18+
$container_patterns = str_replace(['.', 'https://', 'http://', ','], [
1919
'\.', '', '', '|',
2020
], $vortex_localdev_url);
21-
$settings['trusted_host_patterns'][] = '^' . $patterns . '$';
21+
$settings['trusted_host_patterns'][] = '^' . $container_patterns . '$';
2222

2323
// URL for internal container access (e.g., via drush, in tests etc.).
2424
$settings['trusted_host_patterns'][] = '^nginx$';

.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/docroot/sites/default/includes/providers/settings.acquia.php

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,23 @@
1515
declare(strict_types=1);
1616

1717
if (!empty(getenv('AH_SITE_ENVIRONMENT'))) {
18+
$ah_site_group = getenv('AH_SITE_GROUP');
19+
$ah_site_env = getenv('AH_SITE_ENVIRONMENT');
20+
1821
// Delay the initial database connection.
1922
$config['acquia_hosting_settings_autoconnect'] = FALSE;
2023

2124
// Include Acquia environment settings.
22-
// The path is built dynamically from the AH_SITE_GROUP environment variable
23-
// provided by Acquia Cloud.
24-
$ah_site_group = getenv('AH_SITE_GROUP');
25-
// @codeCoverageIgnoreStart
2625
if (!empty($ah_site_group)) {
27-
$ah_settings_file = sprintf('/var/www/site-php/%s/%s-settings.inc', $ah_site_group, $ah_site_group);
26+
$ah_settings_file = getenv('DRUPAL_ACQUIA_SETTINGS_FILE') ?: sprintf('/var/www/site-php/%s/%s-settings.inc', $ah_site_group, $ah_site_group);
27+
// @codeCoverageIgnoreStart
2828
if (!file_exists($ah_settings_file)) {
2929
throw new \RuntimeException(sprintf('Acquia settings file "%s" not found. Check Acquia Cloud environment configuration.', $ah_settings_file));
3030
}
3131
require $ah_settings_file;
32+
// @codeCoverageIgnoreEnd
3233
}
33-
// @codeCoverageIgnoreEnd
34+
3435
// Default all environments to 'dev', including ODE environments.
3536
$settings['environment'] = ENVIRONMENT_DEV;
3637

@@ -51,14 +52,28 @@
5152
// Override the config sync directory with the DRUPAL_CONFIG_PATH environment
5253
// variable if provided, or fall back to the config_vcs_directory setting
5354
// provided by Acquia.
54-
$drupal_config_path = getenv('DRUPAL_CONFIG_PATH');
55-
if (!empty($drupal_config_path)) {
56-
$settings['config_sync_directory'] = $drupal_config_path;
55+
$config_path = getenv('DRUPAL_CONFIG_PATH');
56+
if (!empty($config_path)) {
57+
$settings['config_sync_directory'] = $config_path;
5758
}
5859
elseif (!empty($settings['config_vcs_directory'])) {
5960
$settings['config_sync_directory'] = $settings['config_vcs_directory'];
6061
}
6162

6263
// Automatically create an Apache HTTP .htaccess file in writable directories.
6364
$settings['auto_create_htaccess'] = TRUE;
65+
66+
// Allow to override temporary path using per-head mounted directory or
67+
// DRUPAL_TMP_PATH variable.
68+
// @see https://docs.acquia.com/acquia-cloud-platform/manage-apps/files/temporary#section-important-considerations
69+
$settings['file_temp_path'] = '/tmp';
70+
71+
if (!empty($ah_site_group) && getenv('DRUPAL_TMP_PATH_IS_SHARED')) {
72+
// @see https://acquia.my.site.com/s/article/360054835954-Bulk-Upload-Not-Working-Correctly
73+
$settings['file_temp_path'] = sprintf('/mnt/gfs/%s.%s/tmp', $ah_site_group, $ah_site_env);
74+
}
75+
76+
if (getenv('DRUPAL_TMP_PATH')) {
77+
$settings['file_temp_path'] = getenv('DRUPAL_TMP_PATH');
78+
}
6479
}

.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/docroot/sites/default/includes/providers/settings.container.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
$vortex_localdev_url = getenv('VORTEX_LOCALDEV_URL');
1616
if (!empty($vortex_localdev_url)) {
1717
// Local development URL.
18-
$patterns = str_replace(['.', 'https://', 'http://', ','], [
18+
$container_patterns = str_replace(['.', 'https://', 'http://', ','], [
1919
'\.', '', '', '|',
2020
], $vortex_localdev_url);
21-
$settings['trusted_host_patterns'][] = '^' . $patterns . '$';
21+
$settings['trusted_host_patterns'][] = '^' . $container_patterns . '$';
2222

2323
// URL for internal container access (e.g., via drush, in tests etc.).
2424
$settings['trusted_host_patterns'][] = '^nginx$';

.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/sites/default/includes/providers/settings.acquia.php

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,23 @@
1515
declare(strict_types=1);
1616

1717
if (!empty(getenv('AH_SITE_ENVIRONMENT'))) {
18+
$ah_site_group = getenv('AH_SITE_GROUP');
19+
$ah_site_env = getenv('AH_SITE_ENVIRONMENT');
20+
1821
// Delay the initial database connection.
1922
$config['acquia_hosting_settings_autoconnect'] = FALSE;
2023

2124
// Include Acquia environment settings.
22-
// The path is built dynamically from the AH_SITE_GROUP environment variable
23-
// provided by Acquia Cloud.
24-
$ah_site_group = getenv('AH_SITE_GROUP');
25-
// @codeCoverageIgnoreStart
2625
if (!empty($ah_site_group)) {
27-
$ah_settings_file = sprintf('/var/www/site-php/%s/%s-settings.inc', $ah_site_group, $ah_site_group);
26+
$ah_settings_file = getenv('DRUPAL_ACQUIA_SETTINGS_FILE') ?: sprintf('/var/www/site-php/%s/%s-settings.inc', $ah_site_group, $ah_site_group);
27+
// @codeCoverageIgnoreStart
2828
if (!file_exists($ah_settings_file)) {
2929
throw new \RuntimeException(sprintf('Acquia settings file "%s" not found. Check Acquia Cloud environment configuration.', $ah_settings_file));
3030
}
3131
require $ah_settings_file;
32+
// @codeCoverageIgnoreEnd
3233
}
33-
// @codeCoverageIgnoreEnd
34+
3435
// Default all environments to 'dev', including ODE environments.
3536
$settings['environment'] = ENVIRONMENT_DEV;
3637

@@ -51,14 +52,28 @@
5152
// Override the config sync directory with the DRUPAL_CONFIG_PATH environment
5253
// variable if provided, or fall back to the config_vcs_directory setting
5354
// provided by Acquia.
54-
$drupal_config_path = getenv('DRUPAL_CONFIG_PATH');
55-
if (!empty($drupal_config_path)) {
56-
$settings['config_sync_directory'] = $drupal_config_path;
55+
$config_path = getenv('DRUPAL_CONFIG_PATH');
56+
if (!empty($config_path)) {
57+
$settings['config_sync_directory'] = $config_path;
5758
}
5859
elseif (!empty($settings['config_vcs_directory'])) {
5960
$settings['config_sync_directory'] = $settings['config_vcs_directory'];
6061
}
6162

6263
// Automatically create an Apache HTTP .htaccess file in writable directories.
6364
$settings['auto_create_htaccess'] = TRUE;
65+
66+
// Allow to override temporary path using per-head mounted directory or
67+
// DRUPAL_TMP_PATH variable.
68+
// @see https://docs.acquia.com/acquia-cloud-platform/manage-apps/files/temporary#section-important-considerations
69+
$settings['file_temp_path'] = '/tmp';
70+
71+
if (!empty($ah_site_group) && getenv('DRUPAL_TMP_PATH_IS_SHARED')) {
72+
// @see https://acquia.my.site.com/s/article/360054835954-Bulk-Upload-Not-Working-Correctly
73+
$settings['file_temp_path'] = sprintf('/mnt/gfs/%s.%s/tmp', $ah_site_group, $ah_site_env);
74+
}
75+
76+
if (getenv('DRUPAL_TMP_PATH')) {
77+
$settings['file_temp_path'] = getenv('DRUPAL_TMP_PATH');
78+
}
6479
}

.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/sites/default/includes/providers/settings.container.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
$vortex_localdev_url = getenv('VORTEX_LOCALDEV_URL');
1616
if (!empty($vortex_localdev_url)) {
1717
// Local development URL.
18-
$patterns = str_replace(['.', 'https://', 'http://', ','], [
18+
$container_patterns = str_replace(['.', 'https://', 'http://', ','], [
1919
'\.', '', '', '|',
2020
], $vortex_localdev_url);
21-
$settings['trusted_host_patterns'][] = '^' . $patterns . '$';
21+
$settings['trusted_host_patterns'][] = '^' . $container_patterns . '$';
2222

2323
// URL for internal container access (e.g., via drush, in tests etc.).
2424
$settings['trusted_host_patterns'][] = '^nginx$';

web/sites/default/includes/providers/settings.acquia.php

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,23 @@
1515
declare(strict_types=1);
1616

1717
if (!empty(getenv('AH_SITE_ENVIRONMENT'))) {
18+
$ah_site_group = getenv('AH_SITE_GROUP');
19+
$ah_site_env = getenv('AH_SITE_ENVIRONMENT');
20+
1821
// Delay the initial database connection.
1922
$config['acquia_hosting_settings_autoconnect'] = FALSE;
2023

2124
// Include Acquia environment settings.
22-
// The path is built dynamically from the AH_SITE_GROUP environment variable
23-
// provided by Acquia Cloud.
24-
$ah_site_group = getenv('AH_SITE_GROUP');
25-
// @codeCoverageIgnoreStart
2625
if (!empty($ah_site_group)) {
27-
$ah_settings_file = sprintf('/var/www/site-php/%s/%s-settings.inc', $ah_site_group, $ah_site_group);
26+
$ah_settings_file = getenv('DRUPAL_ACQUIA_SETTINGS_FILE') ?: sprintf('/var/www/site-php/%s/%s-settings.inc', $ah_site_group, $ah_site_group);
27+
// @codeCoverageIgnoreStart
2828
if (!file_exists($ah_settings_file)) {
2929
throw new \RuntimeException(sprintf('Acquia settings file "%s" not found. Check Acquia Cloud environment configuration.', $ah_settings_file));
3030
}
3131
require $ah_settings_file;
32+
// @codeCoverageIgnoreEnd
3233
}
33-
// @codeCoverageIgnoreEnd
34+
3435
// Default all environments to 'dev', including ODE environments.
3536
$settings['environment'] = ENVIRONMENT_DEV;
3637

@@ -51,14 +52,28 @@
5152
// Override the config sync directory with the DRUPAL_CONFIG_PATH environment
5253
// variable if provided, or fall back to the config_vcs_directory setting
5354
// provided by Acquia.
54-
$drupal_config_path = getenv('DRUPAL_CONFIG_PATH');
55-
if (!empty($drupal_config_path)) {
56-
$settings['config_sync_directory'] = $drupal_config_path;
55+
$config_path = getenv('DRUPAL_CONFIG_PATH');
56+
if (!empty($config_path)) {
57+
$settings['config_sync_directory'] = $config_path;
5758
}
5859
elseif (!empty($settings['config_vcs_directory'])) {
5960
$settings['config_sync_directory'] = $settings['config_vcs_directory'];
6061
}
6162

6263
// Automatically create an Apache HTTP .htaccess file in writable directories.
6364
$settings['auto_create_htaccess'] = TRUE;
65+
66+
// Allow to override temporary path using per-head mounted directory or
67+
// DRUPAL_TMP_PATH variable.
68+
// @see https://docs.acquia.com/acquia-cloud-platform/manage-apps/files/temporary#section-important-considerations
69+
$settings['file_temp_path'] = '/tmp';
70+
71+
if (!empty($ah_site_group) && getenv('DRUPAL_TMP_PATH_IS_SHARED')) {
72+
// @see https://acquia.my.site.com/s/article/360054835954-Bulk-Upload-Not-Working-Correctly
73+
$settings['file_temp_path'] = sprintf('/mnt/gfs/%s.%s/tmp', $ah_site_group, $ah_site_env);
74+
}
75+
76+
if (getenv('DRUPAL_TMP_PATH')) {
77+
$settings['file_temp_path'] = getenv('DRUPAL_TMP_PATH');
78+
}
6479
}

web/sites/default/includes/providers/settings.container.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
$vortex_localdev_url = getenv('VORTEX_LOCALDEV_URL');
1616
if (!empty($vortex_localdev_url)) {
1717
// Local development URL.
18-
$patterns = str_replace(['.', 'https://', 'http://', ','], [
18+
$container_patterns = str_replace(['.', 'https://', 'http://', ','], [
1919
'\.', '', '', '|',
2020
], $vortex_localdev_url);
21-
$settings['trusted_host_patterns'][] = '^' . $patterns . '$';
21+
$settings['trusted_host_patterns'][] = '^' . $container_patterns . '$';
2222

2323
// URL for internal container access (e.g., via drush, in tests etc.).
2424
$settings['trusted_host_patterns'][] = '^nginx$';

0 commit comments

Comments
 (0)