Skip to content

Configure multisite network and fix local bootstrap tooling - #44

Open
markwong167 wants to merge 2 commits into
mainfrom
canopy-multisite-bootstrap-dev-tooling
Open

markwong167 wants to merge 2 commits into
mainfrom
canopy-multisite-bootstrap-dev-tooling

Conversation

@markwong167

Copy link
Copy Markdown
Contributor

Summary

  • Derives DOMAIN_CURRENT_SITE from WP_HOME instead of requiring both in .env.example, preserving the port when present (needed for local dev servers on non-standard ports)
  • Fixes the DISABLE_WP_CRON operator (?:??) so an explicit false isn't silently overwritten back to true by CONVERT_BOOL
  • Removes unused Redis object-cache placeholders from .env.example (no object-cache plugin is installed yet)
  • Rewrites bin/setup-local.sh to use wp core multisite-install instead of wp core multisite-convert — the latter requires WP-CLI to resolve an existing site before running, which fails once MULTISITE is already hardcoded true with no network row yet. multisite-install handles both an empty DB and an existing single-site DB in one step without that ordering requirement.
  • Fixes two more bugs found while verifying that change: wp site create has no --url option (it was being misread as the global bootstrap-target flag), and a domain with a port isn't a valid email address for the throwaway local admin account
  • Adds bin/bootstrap-secrets.sh, a local dev tool for pulling real secrets from GCP Secret Manager into .env.local

Split from #27

Part of splitting #27 into smaller, independently reviewable pieces. This PR covers multisite network config and local bootstrap tooling; #27 stays focused on containerization, and a separate PR covers the staging media offload config.

Test plan

  • vendor/bin/pint --test passes
  • vendor/bin/pest passes
  • bin/setup-local.sh verified end-to-end in a sandbox against both a portless and a port-having WP_HOME — installs the network, creates the seed subsite, activates network plugins, with no errors

🤖 Generated with Claude Code


Generated by Claude Code

Derives DOMAIN_CURRENT_SITE from WP_HOME instead of duplicating it in
.env.example, fixes the DISABLE_WP_CRON operator so an explicit false
survives CONVERT_BOOL, and adds the multisite/cron config. Rewrites
bin/setup-local.sh to use `wp core multisite-install` (which handles
both an empty DB and an existing single-site DB in one step) instead
of `wp core multisite-convert` (which requires WP-CLI to resolve an
existing site first — impossible once MULTISITE is already true with
no network row yet). Fixes two more bugs found while verifying that
change: `wp site create` has no --url option, and a domain with a port
isn't a valid email address for the throwaway local admin account.
Also adds bin/bootstrap-secrets.sh for pulling real secrets from GCP
Secret Manager into a local .env.local.

Verified end-to-end against both a portless and a port-having WP_HOME.
No k8s CronJob (or other real-cron replacement) exists yet in
gpo-platform-configs to hit wp-cron.php on a schedule. Disabling
WP's pseudo-cron by default here would have silently stopped
scheduled posts, plugin cron, etc. on staging/production the moment
this merged. Reverting to the current behavior (pseudo-cron stays on
unless DISABLE_WP_CRON is explicitly set) until that replacement
lands; the development.php override is now redundant and removed
with it. Multisite config itself is unchanged.
@markwong167
markwong167 marked this pull request as draft September 1, 2026 19:48
@markwong167
markwong167 marked this pull request as ready for review September 2, 2026 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants