Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #3255: On Acquia Cloud, acquia_config.php should better handle multisite #3492

Merged
merged 1 commit into from
Mar 28, 2019
Merged
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
17 changes: 8 additions & 9 deletions scripts/simplesamlphp/acquia_config.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,6 @@
$protocol = 'https://';
$port = ':' . $_SERVER['SERVER_PORT'];*/

/**
* Support multi-site and single site installations at different base URLs.
*
* Overide $config['baseurlpath'] = "https://{yourdomain}/simplesaml/"
* to customize the default Acquia configuration.
*/
$config['baseurlpath'] = $protocol . $_SERVER['HTTP_HOST'] . $port . '/simplesaml/';

/**
* Cookies No Cache.
*
Expand Down Expand Up @@ -84,7 +76,14 @@

}
elseif (getenv('AH_SITE_ENVIRONMENT')) {
// Set ACE ad ACSF sites based on hosting database and site name.
/**
* Support multi-site and single site installations at different base URLs.
*
* Overide $config['baseurlpath'] = "https://{yourdomain}/simplesaml/"
* to customize the default Acquia configuration.
*/
$config['baseurlpath'] = $protocol . $_SERVER['HTTP_HOST'] . $port . '/simplesaml/';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noting here that $protocol and $port are not defined unless the code block above is uncommented. This was also true of the code prior to this PR.

// Set ACE and ACSF sites based on hosting database and site name.
$config['certdir'] = "/mnt/www/html/{$_ENV['AH_SITE_GROUP']}.{$_ENV['AH_SITE_ENVIRONMENT']}/simplesamlphp/cert/";
$config['metadatadir'] = "/mnt/www/html/{$_ENV['AH_SITE_GROUP']}.{$_ENV['AH_SITE_ENVIRONMENT']}/simplesamlphp/metadata";
$config['baseurlpath'] = 'simplesaml/';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be removed or it will clobber what you've defined above, right?

Copy link
Contributor Author

@anavarre anavarre Mar 22, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand what you mean. I've just moved around the $config['baseurlpath'] = $protocol . $_SERVER['HTTP_HOST'] . $port . '/simplesaml/'; line which fixed the missing port 443 in the URL for a multisite we have.

I'm not saying this is best practice or the right fix for BLT, but it's what worked for us. It was really not obvious to understand it had to be within the elseif (getenv('AH_SITE_ENVIRONMENT')) block thus why putting it here - assuming it's where it should belong by default - looked best to prevent others from running into the issue in the future.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm talking about this line, three lines below the code that you inserted: $config['baseurlpath'] = 'simplesaml/';

That will clobber the value of baseurlpath that you just assigned.

Expand Down