From f6f41d8e570f215b54392be199dbb3f785a8654d Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Thu, 2 Apr 2026 16:37:18 +1100 Subject: [PATCH 1/3] Fixed DB download in Acquia. --- scripts/vortex/download-db-acquia.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/vortex/download-db-acquia.sh b/scripts/vortex/download-db-acquia.sh index 5d5404e1e..750fe5491 100755 --- a/scripts/vortex/download-db-acquia.sh +++ b/scripts/vortex/download-db-acquia.sh @@ -262,7 +262,7 @@ else [ -z "${backup_url}" ] && fail "Unable to discover backup URL for backup ID '${backup_id}'. API response: ${backup_json}" && exit 1 task "Downloading DB dump into file ${file_name_compressed}." - curl --progress-bar -L -H 'Accept: application/json, version=2' -H "Authorization: Bearer ${token}" "${backup_url}" -o "${file_name_compressed}" + curl --progress-bar -L "${backup_url}" -o "${file_name_compressed}" download_result=$? # shellcheck disable=SC2181 From 582b621c310295f964ae9878f79478153fccce64 Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Thu, 2 Apr 2026 16:23:42 +1100 Subject: [PATCH 2/3] Updated Acquia settings. --- .vortex/docs/content/hosting/acquia.mdx | 24 ++++++++++++++ .../includes/providers/settings.container.php | 4 +-- .../includes/providers/settings.acquia.php | 33 ++++++++++++++----- .../includes/providers/settings.container.php | 4 +-- .../includes/providers/settings.acquia.php | 33 ++++++++++++++----- .../includes/providers/settings.container.php | 4 +-- .../includes/providers/settings.acquia.php | 33 ++++++++++++++----- .../includes/providers/settings.container.php | 4 +-- 8 files changed, 104 insertions(+), 35 deletions(-) diff --git a/.vortex/docs/content/hosting/acquia.mdx b/.vortex/docs/content/hosting/acquia.mdx index 81997e188..3f01fe77e 100644 --- a/.vortex/docs/content/hosting/acquia.mdx +++ b/.vortex/docs/content/hosting/acquia.mdx @@ -47,6 +47,27 @@ settings from [`web/sites/default/includes/providers/settings.acquia.php`](https This includes Acquia-specific configurations for caching, file paths, and environment variables. +#### Acquia settings file + +By default, Vortex includes the Acquia-provided settings file from +`/var/www/site-php/{group}/{group}-settings.inc`. You can override this path +by setting the `DRUPAL_ACQUIA_SETTINGS_FILE` environment variable. + +#### Temporary file path + +Vortex configures the temporary file path (`file_temp_path`) with a three-tier +priority: + +1. **Default**: `/tmp` +2. **Shared GFS mount**: If `DRUPAL_TMP_PATH_IS_SHARED` is set, uses + `/mnt/gfs/{group}.{env}/tmp` — a per-head mounted directory on Acquia's + shared filesystem. This is useful for operations like bulk uploads that + require a shared temporary directory across web heads. See + [Acquia temporary files documentation](https://docs.acquia.com/acquia-cloud-platform/manage-apps/files/temporary#section-important-considerations) + for details. +3. **Explicit override**: If `DRUPAL_TMP_PATH` is set, its value is used + regardless of other settings. + ## Onboarding Before you begin, ensure you have: @@ -63,6 +84,9 @@ file: | Variable | Description | |----------|-------------| | `VORTEX_ACQUIA_APP_NAME` | Your Acquia application name (machine name) | +| `DRUPAL_ACQUIA_SETTINGS_FILE` | Override the path to Acquia's settings `.inc` file (optional) | +| `DRUPAL_TMP_PATH` | Override the temporary file path (optional) | +| `DRUPAL_TMP_PATH_IS_SHARED` | Use Acquia's shared GFS mount for temporary files (optional) | For CI environments, configure these secrets in your CI provider ([GitHub Actions](/docs/continuous-integration/github-actions) or [CircleCI](/docs/continuous-integration/circleci)): diff --git a/.vortex/installer/tests/Fixtures/handler_process/_baseline/web/sites/default/includes/providers/settings.container.php b/.vortex/installer/tests/Fixtures/handler_process/_baseline/web/sites/default/includes/providers/settings.container.php index 4c85649c5..4df167ff8 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/_baseline/web/sites/default/includes/providers/settings.container.php +++ b/.vortex/installer/tests/Fixtures/handler_process/_baseline/web/sites/default/includes/providers/settings.container.php @@ -15,10 +15,10 @@ $vortex_localdev_url = getenv('VORTEX_LOCALDEV_URL'); if (!empty($vortex_localdev_url)) { // Local development URL. - $patterns = str_replace(['.', 'https://', 'http://', ','], [ + $container_patterns = str_replace(['.', 'https://', 'http://', ','], [ '\.', '', '', '|', ], $vortex_localdev_url); - $settings['trusted_host_patterns'][] = '^' . $patterns . '$'; + $settings['trusted_host_patterns'][] = '^' . $container_patterns . '$'; // URL for internal container access (e.g., via drush, in tests etc.). $settings['trusted_host_patterns'][] = '^nginx$'; diff --git a/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/docroot/sites/default/includes/providers/settings.acquia.php b/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/docroot/sites/default/includes/providers/settings.acquia.php index 1be66a892..1b48402c6 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/docroot/sites/default/includes/providers/settings.acquia.php +++ b/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/docroot/sites/default/includes/providers/settings.acquia.php @@ -15,22 +15,23 @@ declare(strict_types=1); if (!empty(getenv('AH_SITE_ENVIRONMENT'))) { + $ah_site_group = getenv('AH_SITE_GROUP'); + $ah_site_env = getenv('AH_SITE_ENVIRONMENT'); + // Delay the initial database connection. $config['acquia_hosting_settings_autoconnect'] = FALSE; // Include Acquia environment settings. - // The path is built dynamically from the AH_SITE_GROUP environment variable - // provided by Acquia Cloud. - $ah_site_group = getenv('AH_SITE_GROUP'); - // @codeCoverageIgnoreStart if (!empty($ah_site_group)) { - $ah_settings_file = sprintf('/var/www/site-php/%s/%s-settings.inc', $ah_site_group, $ah_site_group); + $ah_settings_file = getenv('DRUPAL_ACQUIA_SETTINGS_FILE') ?: sprintf('/var/www/site-php/%s/%s-settings.inc', $ah_site_group, $ah_site_group); + // @codeCoverageIgnoreStart if (!file_exists($ah_settings_file)) { throw new \RuntimeException(sprintf('Acquia settings file "%s" not found. Check Acquia Cloud environment configuration.', $ah_settings_file)); } require $ah_settings_file; + // @codeCoverageIgnoreEnd } - // @codeCoverageIgnoreEnd + // Default all environments to 'dev', including ODE environments. $settings['environment'] = ENVIRONMENT_DEV; @@ -51,9 +52,9 @@ // Override the config sync directory with the DRUPAL_CONFIG_PATH environment // variable if provided, or fall back to the config_vcs_directory setting // provided by Acquia. - $drupal_config_path = getenv('DRUPAL_CONFIG_PATH'); - if (!empty($drupal_config_path)) { - $settings['config_sync_directory'] = $drupal_config_path; + $config_path = getenv('DRUPAL_CONFIG_PATH'); + if (!empty($config_path)) { + $settings['config_sync_directory'] = $config_path; } elseif (!empty($settings['config_vcs_directory'])) { $settings['config_sync_directory'] = $settings['config_vcs_directory']; @@ -61,4 +62,18 @@ // Automatically create an Apache HTTP .htaccess file in writable directories. $settings['auto_create_htaccess'] = TRUE; + + // Allow to override temporary path using per-head mounted directory or + // DRUPAL_TMP_PATH variable. + // @see https://docs.acquia.com/acquia-cloud-platform/manage-apps/files/temporary#section-important-considerations + $settings['file_temp_path'] = '/tmp'; + + if (!empty($ah_site_group) && getenv('DRUPAL_TMP_PATH_IS_SHARED')) { + // @see https://acquia.my.site.com/s/article/360054835954-Bulk-Upload-Not-Working-Correctly + $settings['file_temp_path'] = sprintf('/mnt/gfs/%s.%s/tmp', $ah_site_group, $ah_site_env); + } + + if (getenv('DRUPAL_TMP_PATH')) { + $settings['file_temp_path'] = getenv('DRUPAL_TMP_PATH'); + } } diff --git a/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/docroot/sites/default/includes/providers/settings.container.php b/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/docroot/sites/default/includes/providers/settings.container.php index 4c85649c5..4df167ff8 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/docroot/sites/default/includes/providers/settings.container.php +++ b/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/docroot/sites/default/includes/providers/settings.container.php @@ -15,10 +15,10 @@ $vortex_localdev_url = getenv('VORTEX_LOCALDEV_URL'); if (!empty($vortex_localdev_url)) { // Local development URL. - $patterns = str_replace(['.', 'https://', 'http://', ','], [ + $container_patterns = str_replace(['.', 'https://', 'http://', ','], [ '\.', '', '', '|', ], $vortex_localdev_url); - $settings['trusted_host_patterns'][] = '^' . $patterns . '$'; + $settings['trusted_host_patterns'][] = '^' . $container_patterns . '$'; // URL for internal container access (e.g., via drush, in tests etc.). $settings['trusted_host_patterns'][] = '^nginx$'; diff --git a/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/sites/default/includes/providers/settings.acquia.php b/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/sites/default/includes/providers/settings.acquia.php index 1be66a892..1b48402c6 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/sites/default/includes/providers/settings.acquia.php +++ b/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/sites/default/includes/providers/settings.acquia.php @@ -15,22 +15,23 @@ declare(strict_types=1); if (!empty(getenv('AH_SITE_ENVIRONMENT'))) { + $ah_site_group = getenv('AH_SITE_GROUP'); + $ah_site_env = getenv('AH_SITE_ENVIRONMENT'); + // Delay the initial database connection. $config['acquia_hosting_settings_autoconnect'] = FALSE; // Include Acquia environment settings. - // The path is built dynamically from the AH_SITE_GROUP environment variable - // provided by Acquia Cloud. - $ah_site_group = getenv('AH_SITE_GROUP'); - // @codeCoverageIgnoreStart if (!empty($ah_site_group)) { - $ah_settings_file = sprintf('/var/www/site-php/%s/%s-settings.inc', $ah_site_group, $ah_site_group); + $ah_settings_file = getenv('DRUPAL_ACQUIA_SETTINGS_FILE') ?: sprintf('/var/www/site-php/%s/%s-settings.inc', $ah_site_group, $ah_site_group); + // @codeCoverageIgnoreStart if (!file_exists($ah_settings_file)) { throw new \RuntimeException(sprintf('Acquia settings file "%s" not found. Check Acquia Cloud environment configuration.', $ah_settings_file)); } require $ah_settings_file; + // @codeCoverageIgnoreEnd } - // @codeCoverageIgnoreEnd + // Default all environments to 'dev', including ODE environments. $settings['environment'] = ENVIRONMENT_DEV; @@ -51,9 +52,9 @@ // Override the config sync directory with the DRUPAL_CONFIG_PATH environment // variable if provided, or fall back to the config_vcs_directory setting // provided by Acquia. - $drupal_config_path = getenv('DRUPAL_CONFIG_PATH'); - if (!empty($drupal_config_path)) { - $settings['config_sync_directory'] = $drupal_config_path; + $config_path = getenv('DRUPAL_CONFIG_PATH'); + if (!empty($config_path)) { + $settings['config_sync_directory'] = $config_path; } elseif (!empty($settings['config_vcs_directory'])) { $settings['config_sync_directory'] = $settings['config_vcs_directory']; @@ -61,4 +62,18 @@ // Automatically create an Apache HTTP .htaccess file in writable directories. $settings['auto_create_htaccess'] = TRUE; + + // Allow to override temporary path using per-head mounted directory or + // DRUPAL_TMP_PATH variable. + // @see https://docs.acquia.com/acquia-cloud-platform/manage-apps/files/temporary#section-important-considerations + $settings['file_temp_path'] = '/tmp'; + + if (!empty($ah_site_group) && getenv('DRUPAL_TMP_PATH_IS_SHARED')) { + // @see https://acquia.my.site.com/s/article/360054835954-Bulk-Upload-Not-Working-Correctly + $settings['file_temp_path'] = sprintf('/mnt/gfs/%s.%s/tmp', $ah_site_group, $ah_site_env); + } + + if (getenv('DRUPAL_TMP_PATH')) { + $settings['file_temp_path'] = getenv('DRUPAL_TMP_PATH'); + } } diff --git a/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/sites/default/includes/providers/settings.container.php b/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/sites/default/includes/providers/settings.container.php index 4c85649c5..4df167ff8 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/sites/default/includes/providers/settings.container.php +++ b/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/sites/default/includes/providers/settings.container.php @@ -15,10 +15,10 @@ $vortex_localdev_url = getenv('VORTEX_LOCALDEV_URL'); if (!empty($vortex_localdev_url)) { // Local development URL. - $patterns = str_replace(['.', 'https://', 'http://', ','], [ + $container_patterns = str_replace(['.', 'https://', 'http://', ','], [ '\.', '', '', '|', ], $vortex_localdev_url); - $settings['trusted_host_patterns'][] = '^' . $patterns . '$'; + $settings['trusted_host_patterns'][] = '^' . $container_patterns . '$'; // URL for internal container access (e.g., via drush, in tests etc.). $settings['trusted_host_patterns'][] = '^nginx$'; diff --git a/web/sites/default/includes/providers/settings.acquia.php b/web/sites/default/includes/providers/settings.acquia.php index 1be66a892..1b48402c6 100644 --- a/web/sites/default/includes/providers/settings.acquia.php +++ b/web/sites/default/includes/providers/settings.acquia.php @@ -15,22 +15,23 @@ declare(strict_types=1); if (!empty(getenv('AH_SITE_ENVIRONMENT'))) { + $ah_site_group = getenv('AH_SITE_GROUP'); + $ah_site_env = getenv('AH_SITE_ENVIRONMENT'); + // Delay the initial database connection. $config['acquia_hosting_settings_autoconnect'] = FALSE; // Include Acquia environment settings. - // The path is built dynamically from the AH_SITE_GROUP environment variable - // provided by Acquia Cloud. - $ah_site_group = getenv('AH_SITE_GROUP'); - // @codeCoverageIgnoreStart if (!empty($ah_site_group)) { - $ah_settings_file = sprintf('/var/www/site-php/%s/%s-settings.inc', $ah_site_group, $ah_site_group); + $ah_settings_file = getenv('DRUPAL_ACQUIA_SETTINGS_FILE') ?: sprintf('/var/www/site-php/%s/%s-settings.inc', $ah_site_group, $ah_site_group); + // @codeCoverageIgnoreStart if (!file_exists($ah_settings_file)) { throw new \RuntimeException(sprintf('Acquia settings file "%s" not found. Check Acquia Cloud environment configuration.', $ah_settings_file)); } require $ah_settings_file; + // @codeCoverageIgnoreEnd } - // @codeCoverageIgnoreEnd + // Default all environments to 'dev', including ODE environments. $settings['environment'] = ENVIRONMENT_DEV; @@ -51,9 +52,9 @@ // Override the config sync directory with the DRUPAL_CONFIG_PATH environment // variable if provided, or fall back to the config_vcs_directory setting // provided by Acquia. - $drupal_config_path = getenv('DRUPAL_CONFIG_PATH'); - if (!empty($drupal_config_path)) { - $settings['config_sync_directory'] = $drupal_config_path; + $config_path = getenv('DRUPAL_CONFIG_PATH'); + if (!empty($config_path)) { + $settings['config_sync_directory'] = $config_path; } elseif (!empty($settings['config_vcs_directory'])) { $settings['config_sync_directory'] = $settings['config_vcs_directory']; @@ -61,4 +62,18 @@ // Automatically create an Apache HTTP .htaccess file in writable directories. $settings['auto_create_htaccess'] = TRUE; + + // Allow to override temporary path using per-head mounted directory or + // DRUPAL_TMP_PATH variable. + // @see https://docs.acquia.com/acquia-cloud-platform/manage-apps/files/temporary#section-important-considerations + $settings['file_temp_path'] = '/tmp'; + + if (!empty($ah_site_group) && getenv('DRUPAL_TMP_PATH_IS_SHARED')) { + // @see https://acquia.my.site.com/s/article/360054835954-Bulk-Upload-Not-Working-Correctly + $settings['file_temp_path'] = sprintf('/mnt/gfs/%s.%s/tmp', $ah_site_group, $ah_site_env); + } + + if (getenv('DRUPAL_TMP_PATH')) { + $settings['file_temp_path'] = getenv('DRUPAL_TMP_PATH'); + } } diff --git a/web/sites/default/includes/providers/settings.container.php b/web/sites/default/includes/providers/settings.container.php index 4c85649c5..4df167ff8 100644 --- a/web/sites/default/includes/providers/settings.container.php +++ b/web/sites/default/includes/providers/settings.container.php @@ -15,10 +15,10 @@ $vortex_localdev_url = getenv('VORTEX_LOCALDEV_URL'); if (!empty($vortex_localdev_url)) { // Local development URL. - $patterns = str_replace(['.', 'https://', 'http://', ','], [ + $container_patterns = str_replace(['.', 'https://', 'http://', ','], [ '\.', '', '', '|', ], $vortex_localdev_url); - $settings['trusted_host_patterns'][] = '^' . $patterns . '$'; + $settings['trusted_host_patterns'][] = '^' . $container_patterns . '$'; // URL for internal container access (e.g., via drush, in tests etc.). $settings['trusted_host_patterns'][] = '^nginx$'; From 6183cf79a344bc820d8ab9574a5a99588e685be3 Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Thu, 2 Apr 2026 17:49:43 +1100 Subject: [PATCH 3/3] Updated download-db-acquia BATS tests to match removed auth headers from download curl. --- .vortex/tests/bats/unit/download-db-acquia.bats | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.vortex/tests/bats/unit/download-db-acquia.bats b/.vortex/tests/bats/unit/download-db-acquia.bats index fd707355e..28224d9ea 100644 --- a/.vortex/tests/bats/unit/download-db-acquia.bats +++ b/.vortex/tests/bats/unit/download-db-acquia.bats @@ -39,7 +39,7 @@ load ../_helper.bash # Mock file download curl call with its message and side effect to create zipped archive "Downloading DB dump into file .data/testdb_backup_backup-id-789.sql.gz." - '@curl --progress-bar -L -H Accept: application/json, version=2 -H Authorization: Bearer test-token https://backup.example.com/db.sql.gz -o .data/testdb_backup_backup-id-789.sql.gz # 0 # # echo "CREATE TABLE test (id INT);" | gzip > .data/testdb_backup_backup-id-789.sql.gz' + '@curl --progress-bar -L https://backup.example.com/db.sql.gz -o .data/testdb_backup_backup-id-789.sql.gz # 0 # # echo "CREATE TABLE test (id INT);" | gzip > .data/testdb_backup_backup-id-789.sql.gz' # Mock gunzip operations with their message "Expanding DB file .data/testdb_backup_backup-id-789.sql.gz into .data/testdb_backup_backup-id-789.sql." @@ -228,7 +228,7 @@ load ../_helper.bash # Mock file download curl call with its message and side effect to create zipped archive "Downloading DB dump into file ./.data/testdb_backup_backup-id-789.sql.gz." - '@curl --progress-bar -L -H Accept: application/json, version=2 -H Authorization: Bearer test-token https://backup.example.com/db.sql.gz -o ./.data/testdb_backup_backup-id-789.sql.gz # 0 # # mkdir -p ./.data && echo "database content" | gzip > ./.data/testdb_backup_backup-id-789.sql.gz' + '@curl --progress-bar -L https://backup.example.com/db.sql.gz -o ./.data/testdb_backup_backup-id-789.sql.gz # 0 # # mkdir -p ./.data && echo "database content" | gzip > ./.data/testdb_backup_backup-id-789.sql.gz' # Mock gunzip operations with their message "Expanding DB file ./.data/testdb_backup_backup-id-789.sql.gz into ./.data/testdb_backup_backup-id-789.sql." @@ -494,7 +494,7 @@ load ../_helper.bash '@curl --progress-bar -L -H Accept: application/json, version=2 -H Authorization: Bearer test-token https://cloud.acquia.com/api/environments/env-id-456/databases/testdb/backups/backup-id-new-123/actions/download # {"url":"https://backup.example.com/db-fresh.sql.gz"}' "[TASK] Downloading DB dump into file .data/testdb_backup_backup-id-new-123.sql.gz." - '@curl --progress-bar -L -H Accept: application/json, version=2 -H Authorization: Bearer test-token https://backup.example.com/db-fresh.sql.gz -o .data/testdb_backup_backup-id-new-123.sql.gz # 0 # # echo "CREATE TABLE fresh (id INT);" | gzip > .data/testdb_backup_backup-id-new-123.sql.gz' + '@curl --progress-bar -L https://backup.example.com/db-fresh.sql.gz -o .data/testdb_backup_backup-id-new-123.sql.gz # 0 # # echo "CREATE TABLE fresh (id INT);" | gzip > .data/testdb_backup_backup-id-new-123.sql.gz' "[TASK] Expanding DB file .data/testdb_backup_backup-id-new-123.sql.gz into .data/testdb_backup_backup-id-new-123.sql." "@gunzip -t .data/testdb_backup_backup-id-new-123.sql.gz # 0"