fix(entrypoint.sh): Passwords starting with hyphen break `occ mainten…#2586
Open
flxjoeken wants to merge 1 commit into
Open
fix(entrypoint.sh): Passwords starting with hyphen break `occ mainten…#2586flxjoeken wants to merge 1 commit into
flxjoeken wants to merge 1 commit into
Conversation
…ance:install` Signed-off-by: Felix Joeken <felix@joeken.eu>
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.
Issue
If you provide a password starting with a hyphen, the automated installation fails because the
occcommand parses the password value as a new CLI option.docker run --rm \ -e NEXTCLOUD_ADMIN_USER=admin \ -e NEXTCLOUD_ADMIN_PASSWORD="-starts-with-hyphen" \ -e SQLITE_DATABASE="sqlite.db" \ nextcloud:latest [...] Starting nextcloud installation The "--admin-pass" option requires a value. [fails ten more times]Fix
option=valuesyntax inentrypoint.shfor passwords to ensure passwords starting with hyphens aren't parsed as a new option.Testing
docker run --rm \ -e NEXTCLOUD_ADMIN_USER=admin \ -e NEXTCLOUD_ADMIN_PASSWORD="-starts-with-hyphen" \ -e SQLITE_DATABASE="sqlite.db" \ local/nextcloud:latest [...] Starting nextcloud installation Nextcloud was successfully installed [...]I verified the same behavior and fix applies to database passwords (MYSQL_PASSWORD, POSTGRES_PASSWORD)
Note: The same
option=valuepattern could also be applied to the other params for additional robustness. I'm happy to extend this PR if desired.