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

Fix unreplaced template vars in civicrm.settings.php when using legacy installer #21692

Merged
merged 1 commit into from
Oct 23, 2021

Conversation

demeritcowboy
Copy link
Contributor

Overview

When using the legacy installer (e.g. sites/all/modules/civicrm/install/index.php) it leaves behind some unreplaced ssl-related template variables.

Before

DSN in civicrm.settings.php looks like mysql://foo:bar@localhost/cividb?new_link=true%%dbSSL%% after install.

After

mysql://foo:bar@localhost/cividb?new_link=true

Technical Details

The ssl vars are only replaced when using the newer civicrm-setup.

Comments

See also civicrm/civicrm-joomla#63

@civibot
Copy link

civibot bot commented Oct 1, 2021

(Standard links)

@civibot civibot bot added the master label Oct 1, 2021
@demeritcowboy
Copy link
Contributor Author

Jenkins retest this please.

PhantomJS 2.1.1 (Linux x86_64) ERROR
Disconnected , because no message in 30000 ms.

@totten
Copy link
Member

totten commented Oct 1, 2021

This looks safe and reasonable on its own.

Not a blocker, but possibly related - I don't see dbSSL in civicrm.drush.inc for BD/D7/D8?

@demeritcowboy
Copy link
Contributor Author

Oh that probably has the same problem then. And wp-cli if it does installs too.

@demeritcowboy
Copy link
Contributor Author

Have added #21710 as alternate but for readability I think I'd prefer this one and just try to find all the spots where it's used, but the upgrade message might be useful either way.

@totten
Copy link
Member

totten commented Oct 4, 2021

Yeah, I think they're complementary. #21692 looks like a fix for new installations, and #21710 looks like cleanup for existing installations.

@demeritcowboy
Copy link
Contributor Author

I meant I would move the upgrade message here and close that one if this is the more desirable route.

@eileenmcnaughton
Copy link
Contributor

@totten @demeritcowboy this looks almost there but to have lost momentum ...

@demeritcowboy
Copy link
Contributor Author

If the upgrade message is a holdup I can remove it. The actual change is just the blanks. There's similar PRs for drush at civicrm/civicrm-drupal-8#67, civicrm/civicrm-drupal#650, civicrm/civicrm-backdrop#151, and the wp-cli and joomla ones are merged.

@eileenmcnaughton
Copy link
Contributor

@demeritcowboy so I'm confused what this is blocked on - my take is that when we weren't swapping out the ssl variables in our civicrm.settings.php we couldn't load the site - but if you think this is a misconfiguration that might be in operation then I think the message is OK for the edge case

@demeritcowboy
Copy link
Contributor Author

It's cosmetic at the moment because the %% stuff gets ignored anyway so civi still works fine. But strictly speaking it shouldn't leave the %% variables in there. There's a couple approaches:

  • Just blanking them - the simplest
  • Supporting db ssl connections for the legacy installer. I don't think it's worth doing.
  • Something fancier which was the alternate PR, but I felt it was too unreadable and all it gained was avoiding having to make those other drush etc PRs which aren't that hard to do.

The upgrade message isn't an edge case. It's anyone who used the legacy installer or drush since FiveTwentySomething would likely have the %% vars still in their civicrm.settings.php.

@eileenmcnaughton
Copy link
Contributor

@demeritcowboy ok - but those hitting the upgrade message - it's an optional thing for them to fix?

@demeritcowboy
Copy link
Contributor Author

At the moment yes. Theoretically it could cause problems in the future if there was some change to DSN parsing or usage. I can tone down the message?

@eileenmcnaughton
Copy link
Contributor

@demeritcowboy it feels like it should be a status check IMHO. I'm inclined to say pull it out of this PR & we'll merge this one & then the other PR can deal with informing people

@demeritcowboy
Copy link
Contributor Author

Ok I'll pull it out. I don't know if it should be a status check because the person who would deal with it is often not the person who sees the status check message. Maybe it could be communicated some other way TBD.

@eileenmcnaughton
Copy link
Contributor

unrelated fail

@eileenmcnaughton eileenmcnaughton merged commit cc15915 into civicrm:master Oct 23, 2021
@demeritcowboy demeritcowboy deleted the dbssl branch October 25, 2021 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants