Repository navigation
fix: reset passwords and remap URLs only in local environments - #44
Merged
Merged
Conversation
Signed-off-by: YvesCesar <[email protected]>
vitormattos
approved these changes
Nov 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
reset_local_user_passwordsandsync_site_urlsran on every start whenever their variables were set, with no check of the environment. IfWORDPRESS_LOCAL_USERS_PASSWORDorPROD_SITE_URLreached a production container (copied override, shared.env), every account got the shared password, or the database URLs were rewritten.Changes
WP_ENVIRONMENT_TYPEislocalordevelopment. The variable is the one WordPress itself reads; when it is missing the environment is treated as production. Otherwise the entrypoint logs an error and skips the step.common-services.ymlpassesWP_ENVIRONMENT_TYPEto the container, and the development example in the README declaresWP_ENVIRONMENT_TYPE: local.Local setups that use these variables need to add
WP_ENVIRONMENT_TYPE: localto their override.Tests
tests/security/local-only-setup.batsruns the real entrypoint with a stubbedwpand checks which commands it issues: no password change and no search-replace without the variable or withproduction/staging, both still happen withlocal/development. The skip cases fail onmainand pass here.bats tests/security: 23/23; ShellCheck clean.On a fresh stack started from this branch, with the reset and URL variables set: without
WP_ENVIRONMENT_TYPEthe admin password andsiteurlstay unchanged; withlocalboth are applied as before.