Skip to content

fix(entrypoint.sh): Passwords starting with hyphen break `occ mainten…#2586

Open
flxjoeken wants to merge 1 commit into
nextcloud:masterfrom
flxjoeken:master
Open

fix(entrypoint.sh): Passwords starting with hyphen break `occ mainten…#2586
flxjoeken wants to merge 1 commit into
nextcloud:masterfrom
flxjoeken:master

Conversation

@flxjoeken

Copy link
Copy Markdown

Issue

If you provide a password starting with a hyphen, the automated installation fails because the occ command 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

  1. Use option=value syntax in entrypoint.sh for 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=value pattern could also be applied to the other params for additional robustness. I'm happy to extend this PR if desired.

…ance:install`

Signed-off-by: Felix Joeken <felix@joeken.eu>
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.

1 participant