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

ddev start always creates a new hash_salt in settings.ddev.php (Drupal); should be static. #5255

Closed
TonyTheFerg opened this issue Aug 12, 2023 · 1 comment
Milestone

Comments

@TonyTheFerg
Copy link

TonyTheFerg commented Aug 12, 2023

Expected Behavior

Consistent hash_salt or none at all, not sure.

Actual Behavior

Whenever ddev builds the containers, they create a new hash_salt every time.

This creates issues with the token values on Drupal contextual links, as the hash_salt value is checked here. which leads to this issue.

You can reproduce this by opening the settings.ddev.php file, doing ddev poweroff, and then ddev start to view it change in real-time.

So a temporary fix is to place your hash_salt value AFTER the $ddev_settings section that gets added by DDEV in settings.php. This will allow that value to persist despite the new hash salt value that's created everytime DDEV starts up.

// Automatically generated include for settings managed by ddev.
$ddev_settings = dirname(__FILE__) . '/settings.ddev.php';
if (getenv('IS_DDEV_PROJECT') == 'true' && is_readable($ddev_settings)) {
  require $ddev_settings;
}

$settings['hash_salt'] = file_get_contents('/home/example/salt.txt');

You could also just move your local settings below the ddev settings, and put the hash_salt value in settings.local.php instead.

@rfay rfay added this to the v1.23 milestone Aug 12, 2023
@rfay rfay changed the title DDEV creates a new hash_salt when creating containers ddev start always creates a new hash_salt in settings.ddev.php (Drupal) Aug 12, 2023
@rfay rfay changed the title ddev start always creates a new hash_salt in settings.ddev.php (Drupal) ddev start always creates a new hash_salt in settings.ddev.php (Drupal); should be static. Aug 12, 2023
@rfay rfay modified the milestones: v1.23, v1.22.2 Aug 15, 2023
@rfay
Copy link
Member

rfay commented Aug 15, 2023

@TonyTheFerg could you please test the artifacts in

with your use case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants