Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions blt/01dev.blt.yml

This file was deleted.

10 changes: 0 additions & 10 deletions blt/01live.blt.yml

This file was deleted.

10 changes: 0 additions & 10 deletions blt/01test.blt.yml

This file was deleted.

27 changes: 13 additions & 14 deletions blt/blt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,53 +126,53 @@ modules:
akamai
]
## We have no prod in ACE.
01dev:
meodev:
enable:
[
dblog,
cgov_syslog,
acquia_connector,
acsf,
shield,
cgov_https_config,
cgov_caching_cdn,
akamai,
]
uninstall:
[
cgov_caching_nocdn
acsf,
cgov_caching_nocdn,
]
01test:
meostage:
enable:
[
dblog,
cgov_syslog,
acquia_connector,
acsf,
shield,
cgov_https_config,
cgov_caching_cdn,
akamai,
]
uninstall:
[
cgov_caching_nocdn
acsf,
cgov_caching_nocdn,
]
01live:
meoprod:
enable:
[
cgov_syslog,
acquia_connector,
acsf,
shield,
cgov_https_config,
cgov_caching_cdn,
akamai,
]
uninstall:
[
acsf,
dblog,
cgov_caching_nocdn
cgov_caching_nocdn,
]
## If this is not set, blt drupal:install will iterate through the sites in the sites folder.
## For now we set it to default, so it does not try installing simpletest, or god forbid "g".
Expand Down Expand Up @@ -224,11 +224,10 @@ command-hooks:
command: null

cgov:
## Defaulting users to the repo file was a bad idea, and we will just
## set this to the path ACE environments use so that we do not need
## as many blt overrides. This will avoid any misconfigured environments
## loading the defaults from the repo.
drupal_users_file: '/home/ncigovcd/cgov-drupal-users.yml'
## All Acquia environment will use the drupal_users_file path below.
## Only local will use its own path; CI does not load users at this
## time.
drupal_users_file: '/mnt/files/${env.AH_SITE_GROUP}.${env.AH_SITE_ENVIRONMENT}/cgdp/cgov-drupal-users.yml'
front_end_globals_file: '${repo.root}/FrontendGlobals.json'
pdq_load_glossifier_file: '${repo.root}/glossifier_refresh.json'

Expand Down
1 change: 0 additions & 1 deletion blt/dev.blt.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
use Acquia\Blt\Robo\BltTasks;

/**
* Commands for use in the ACSF Environments.
* Commands for use in the MEO Environments.
*
* Some of the Factory Hooks are a pain to run multiple commands. (I am
* Some of the MEO deployment tasks require specific handling. (I am
* looking at you post-install) So for consistency, we will define all
* cgov factory hook methods here.
* cgov MEO hook methods here.
*/
class CgovAcsfCommands extends BltTasks {
class CgovMeoCommands extends BltTasks {

/**
* Post Install Support for ACSF.
* Post Install Support for MEO.
*
* @command cgov:acsf:post-install
* @command cgov:meo:post-install
*
* @validateDrushConfig
* @executeInVm
Expand All @@ -31,9 +31,9 @@ public function postInstall() {
}

/**
* DB Update Support for ACSF.
* DB Update Support for MEO.
*
* @command cgov:acsf:db-update
* @command cgov:meo:db-update
*
* @validateDrushConfig
* @executeInVm
Expand All @@ -47,9 +47,9 @@ public function dbUpdate() {
}

/**
* Post staging deploy support for ACSF.
* Post staging deploy support for MEO.
*
* @command cgov:acsf:post-staging-deploy
* @command cgov:meo:post-staging-deploy
*
* @validateDrushConfig
* @executeInVm
Expand All @@ -63,7 +63,7 @@ public function postStagingDeploy() {
/**
* Blocks the admin user from being able to login.
*
* @command cgov:acsf:block-admin
* @command cgov:meo:block-admin
*/
public function blockAdminUser() {
$task = $this->taskDrush()
Expand Down
2 changes: 1 addition & 1 deletion blt/src/Blt/Plugin/Commands/UsersCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function loadUsers() {

$commands = [];
$blocked_admin = [
'cgov:acsf:block-admin' => [],
'cgov:meo:block-admin' => [],
];
if (array_key_exists('admin', $userConfig)) {
if ($this->isAdminBlockValid($userConfig['admin'])) {
Expand Down
48 changes: 48 additions & 0 deletions blt/src/Blt/Plugin/Config/CustomConfigInitializer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php

namespace Cgov\Blt\Plugin\Config;

use Acquia\Blt\Robo\Config\ConfigInitializer;

/**
* Custom configuration initializer.
*
* This class extends BLT's ConfigInitializer to provide custom environment
* detection logic that handles MEO environments
* by prefixing environment names with 'meo' when appropriate.
*/
class CustomConfigInitializer extends ConfigInitializer {

/**
* {@inheritdoc}
*
* Override environment determination to handle MEO environments.
* When AH_ENVIRONMENT_TYPE=meo, prefix the environment with 'meo'.
*/
public function determineEnvironment() {
// First check for explicit environment parameters.
$environment = parent::determineEnvironment();

// If we got a specific environment from parent, use it.
if ($environment !== 'local' || !getenv('AH_SITE_ENVIRONMENT')) {
return $environment;
}

// We're in an Acquia environment, check if it's MEO.
$ah_environment_type = getenv('AH_ENVIRONMENT_TYPE');
$ah_site_environment = getenv('AH_SITE_ENVIRONMENT');

if ($ah_environment_type === 'meo' && $ah_site_environment) {
// For MEO environments, prefix with 'meo'.
return 'meo' . $ah_site_environment;
}
elseif ($ah_site_environment) {
// For ACE environments, use the environment as-is.
return $ah_site_environment;
}

// Fallback to parent logic.
return $environment;
}

}
2 changes: 0 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"require": {
"acquia/acsf-tools": "^11.2",
"acquia/blt": "14.0.0-beta2",
"acquia/blt-acsf": "^1.1",
"acquia/blt-phpcs": "^1.0",
"acquia/memcache-settings": "^1.2",
"brianium/paratest": "^6.3",
Expand Down Expand Up @@ -177,7 +176,6 @@
"patch -p1 < ./patches/drupal-scaffold/gitattributes.patch",
"cd docroot && patch -p1 <../patches/drupal-scaffold/htaccess.https.patch",
"cd docroot && patch -p1 <../patches/drupal-scaffold/htaccess.hsts.patch",
"cd docroot && patch -p1 <../patches/drupal-scaffold/htaccess.acsf.patch",
"cd docroot && patch -p1 <../patches/drupal-scaffold/default.settings.php.translations.patch"
]
},
Expand Down
47 changes: 1 addition & 46 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions docroot/.htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,12 @@ AddEncoding gzip svgz
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# Return Status 403 (Forbidden) on non-ODE server access in the
# Return Status 403 (Forbidden) on non-ODE/MEO server access in the
# Acquia cloud.
RewriteCond %{ENV:AH_SITE_ENVIRONMENT} ^(.)+$
RewriteCond %{HTTP_HOST} ^(.)+\.acquia-sites\.com$ [NC]
RewriteCond %{ENV:AH_SITE_ENVIRONMENT} !^ode[0-9]+$ [NC]
RewriteCond %{ENV:AH_ENVIRONMENT_TYPE} !^meo$ [NC]
RewriteRule .* - [R=403]

# Redirect common PHP files to their new locations.
Expand Down Expand Up @@ -153,8 +154,6 @@ AddEncoding gzip svgz
# Copy and adapt this rule to directly execute PHP files in contributed or
# custom modules or to run another PHP application in the same directory.
RewriteCond %{REQUEST_URI} !/core/modules/statistics/statistics\.php$
# ACSF requirement: allow access to apc_rebuild.php.
RewriteCond %{REQUEST_URI} !/sites/g/apc_rebuild.php$
# Deny access to any other PHP files that do not match the rules above.
# Specifically, disallow autoload.php from being served directly.
RewriteRule "^(.+/.*|autoload)\.php($|/)" - [F]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,11 @@ class CgovCoreTools {
];

const PROD_AH_SITE_ENVS = [
'01live',
'prod',
];

const TEST_AH_SITE_ENVS = [
'01test',
'stage',
'test',
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const legacyFilterSet = (_, el) => {
/^https?\:\/\/([a-zA-Z0-9\-]+\.)+/i.test(el.href) &&
!/^https?\:\/\/([a-zA-Z0-9\-]+\.)+gov/i.test(el.href) &&
!/^https?\:\/\/([a-zA-Z0-9\-]+\.)+acquia-sites\.com/i.test(el.href) &&
!/^https?\:\/\/([a-zA-Z0-9\-]+\.)+acsitefactory\.com/i.test(el.href) &&
el.href !== "" &&
el.href.indexOf(location.protocol + "//" + location.hostname) !== 0 &&
!$(el).hasClass("add_this_btn") &&
Expand Down
Loading
Loading