Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Ability to Inject Drupal 8 Config Values into Settings.php #2

Closed
populist opened this issue Sep 10, 2013 · 11 comments
Closed

Ability to Inject Drupal 8 Config Values into Settings.php #2

populist opened this issue Sep 10, 2013 · 11 comments

Comments

@populist
Copy link

Unlike the installation process for Drupal 7, Drupal 8 requires (on behalf of CMI) that the values for the configuration directories be available to settings.php. This is typically written during installation and look like this:

$config_directories['active']['path'] = 'config_1-lRVHZQPcBvES1GZkcB4OMzcH9qHNiqTxhEj706e3U/active';
$config_directories['staging']['path'] = 'config_1-lRVHZQPcBvES1GZkcB4OMzcH9qHNiqTxhEj706e3U/staging';

Since we want to skip this step all together, we will need to figure out how to modify this write/read behavior so that Pantheon can define the $config_directories values in the same way we currently do for the $databases.

@populist
Copy link
Author

We can switch this around to support better pathing. Possible examples could include:

/sites/default/files/config/[ENVIRONMENT]-active
/sites/default/config/staging

The reason to move these directories is to allow this configuration to be managed by git and magiced through our workflow tools.

@populist
Copy link
Author

We will need to make sure that these do not get squashed if someone pushed up custom items in settings.php (i.e. local developers).

@populist
Copy link
Author

Here is the logic we are using for now. Will need to be updated with correct paths which ideally would be pushed in through PRESSFLOW_SETTINGS:

// Load CMI directory config, if present.
  if (isset($_SERVER['PRESSFLOW_SETTINGS'])) {
    $config_directories = array(
      CONFIG_ACTIVE_DIRECTORY => array(
        'path' => 'config_active',
      ),
      CONFIG_STAGING_DIRECTORY => array(
        'path' => 'config_staging',
      ),
    );
  }

populist added a commit that referenced this issue Mar 24, 2014
…drupal_settings_initialize() instead of _drupal_request_initialize()
populist added a commit that referenced this issue Mar 24, 2014
…gic to settings.php while Drupal 8 is still in active development.
@populist
Copy link
Author

This logic has been moved to settings.php for the time being

@grayside
Copy link

grayside commented Jun 4, 2014

Found this issue while googling for https://drupal.org/node/1830816.

@populist
Copy link
Author

Since the CMI active configuration is now in the database, we can simplify this a bit.

populist added a commit that referenced this issue Sep 23, 2014
@populist
Copy link
Author

I also added a quick workaround so this directory is actually sites/default/files during installation so the write-ability check passes. You will still need to make the configuration writeable to use CMI, but it wont bust install.

@populist
Copy link
Author

As a quick note, it probably is best to have the configuration settings happen in settings.php WITHOUT a wrapper for running on Pantheon so folks who move elsewhere or have a local development setup still are able to find where their configuration lives.

@populist
Copy link
Author

We should also add a message that describes the privacy settings of these values and consider moving it to /private so it is private + versionable on Pantheon.

@greg-1-anderson
Copy link
Member

I would propose the following note about privacy and config paths:

IMPORTANT SECURITY NOTE:  The configuration paths set up
below are secure when running your site on Pantheon.  If you
migrate your site to another environment on the public internet, 
you should relocate these locations. See "After Installation"
at https://www.drupal.org/node/2431247

@greg-1-anderson
Copy link
Member

Everything mentioned here has been committed.

kporras07 pushed a commit that referenced this issue Nov 1, 2022
Changes to improve ease of use & maintenance found during user testing
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants