Skip to content
Snippets Groups Projects

[#33] Move config from php fpm script to wp-config

Merged Georgios Tsoulos requested to merge feature/GL-33 into mvp

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 the APPLICATION_NAME environment variable and loaded from wp-config.php.
    • Filters override site options like blogname and admin_email to reflect environment values without unnecessary database writes.
  • Dynamic OpenID Connect Settings:
    • A must-use plugin (openid-settings.php) has been added to automatically update the openid_connect_generic_settings option during the init 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.
  • 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

  1. Run make build & make up.

  2. Checked if openid_connect_generic_settings existed:

    Screenshot 2025-03-18 at 11.36.22.png

  3. Blog Options are correctly populated:

    Screenshot 2025-03-18 at 11.37.26.png

  4. Security keys are salted and correctly populated

    Screenshot 2025-03-18 at 11.39.17.png

  5. Site correctly loads !

Edited by Georgios Tsoulos

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading