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

dev/core#1926 - Try to autodetect mysql ssl settings from the CMS config #18264

Merged
merged 1 commit into from
Sep 3, 2020

Conversation

demeritcowboy
Copy link
Contributor

@demeritcowboy demeritcowboy commented Aug 26, 2020

Overview

This goes along with #18107 but isn't required by it. It just tries to autodetect if ssl is already used for mysql on the CMS side and prefill the parameters for use with civicrm-setup. This PR does require #18107 if you want to r-run the whole process, but you can sanity check this one on its own without running the whole process by:

  1. Configure mysql for ssl.
  2. Edit drupal settings.php to add a pdo section as per installation docs or as in dev/core#1926 - Allow SSL mysql connections for civicrm-setup #18107.
    • Note that even if you're not running the full install, there's a drupal bootstrap that will make it attempt to connect to the drupal database, so if the pdo params you're using aren't compatible with the real mysql ssl setup it will fail.
  3. Run this debugging command cv core:install --debug-model --cms-base-url=http://site/ and look at the output. In the simplest case with no client certificate and no server verification but wanting ssl it will look something like:
   "db": {
        "server": "localhost:3306",
        "username": "drupal",
        "password": "pass",
        "database": "civi",
        "ssl_params": {
            "ssl": 1
        }
    },
    "cmsDb": {
        "server": "localhost:3306",
        "username": "drupal",
        "password": "pass",
        "database": "drup",
        "ssl_params": {
            "ssl": 1
        }
    },

Before

  • Need to pass in the --db parameter for cv core:install to specify ssl settings.
  • Manually need to update CIVICRM_UF_DSN in civicrm.settings.php after install.

After

  • If the CMS config is using ssl for mysql then it should autodetect the ssl config for the --db parameter. You can still specify it manually if it guesses wrong.
  • CIVICRM_UF_DSN in civicrm.settings.php automatically updated after install.

Technical Details

Autodetect is only for drupalish sites at the moment (drupal 7/8, backdrop).

Comments

Has test

@civibot
Copy link

civibot bot commented Aug 26, 2020

(Standard links)

@eileenmcnaughton
Copy link
Contributor

Test looks good & we have just forked so there is lots of time for any issues to flush out. Merging

@eileenmcnaughton eileenmcnaughton merged commit b959a1a into civicrm:master Sep 3, 2020
@demeritcowboy demeritcowboy deleted the mysql-ssl-guess branch September 4, 2020 21:40
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.

2 participants