[#33] Move config from php fpm script to wp-config
Description
Move and add dynamic configuration improvements to our WordPress container setup:
-
Dynamic Database & Site Settings:
- Database credentials and table prefix are loaded from environment variables from
wp-config.php
. - Site URL constants (e.g.
WP_HOME
,WP_SITEURL
) are defined based on theAPPLICATION_NAME
environment variable and loaded fromwp-config.php
. - Filters override site options like
blogname
andadmin_email
to reflect environment values without unnecessary database writes.
- Database credentials and table prefix are loaded from environment variables from
-
Dynamic OpenID Connect Settings:
- A must-use plugin (
openid-settings.php
) has been added to automatically update theopenid_connect_generic_settings
option during theinit
hook. - The plugin merges existing settings with new values derived from environment variables, ensuring that the OpenID Connect plugin always uses current configuration data without manual intervention.
- A must-use plugin (
-
Dynamic Authentication Keys & Salts:
- Instead of hardcoding security keys, the configuration now fetches random salted keys from the WordPress.org secret-key API and defines them dynamically.
Testing
Edited by Georgios Tsoulos
Merge request reports
Activity
- Resolved by Carina Antunes
Needs a rebase, there were some changes in the meantime
added 9 commits
-
7e928d03...c890f46f - 8 commits from branch
mvp
- fe9d31d5 - Move config from php fpm script to wp-config
-
7e928d03...c890f46f - 8 commits from branch
- Resolved by Carina Antunes
- Resolved by Carina Antunes
- Resolved by Carina Antunes
Please include this as the last bit before
... wp-setting.php
// Local configuration file should be in project root. if (file_exists(dirname(__FILE__, 2) . '/wp-config-local.php')) { include(dirname(__FILE__, 2) . '/wp-config-local.php'); }
We can then on the operator codebase mount a configmap as file under the
wp-config-local.php
in case we need custom configs in a project- Resolved by Carina Antunes
changed title from [#33 (closed)] [WIP] Move config from php fpm script to wp-config to [#33 (closed)] Move config from php fpm script to wp-config
added 8 commits
-
777a2f73...9351f094 - 6 commits from branch
mvp
- d68bc2a2 - Move config from php fpm script to wp-config
- 267fde90 - Use salt and move the openid settings
-
777a2f73...9351f094 - 6 commits from branch
Hi again, to complement on the logic loading the optional file
wp-config-local.php
, I propose:- We add an optional field to the CRD, something like "extra-config: string" which will contain the name of the configmap.
- On the operator, if the field exists we try to mount the configmap. This way the resource is manual, and we don't ever reconcile it.
Wdyt?
asking @rpareek to review the suggestion as well
mentioned in merge request !62 (merged)
Please register or sign in to reply