Setting a password on smp-server with an '@' character breaks the Docker entrypoint script
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
Research direction
Start with scripts/docker/entrypoint-smp-server around line 62 and reproduce the failure using the documented docker run command with PASS=passw@rd. Inspect the invocation and its error output, then verify that initializing the container with an @ character no longer exits silently or enters a reboot loop.
Written by the indexing model from the issue text.
Description
Issue
I went down a bit of rabbit hole before realizing my Docker setup was not the issue here, but rather it was the PASS environment variable I had set that was causing smp-server to exit with code 1 and go into a container reboot loop.
Steps to reproduce:
- Set up the the latest Docker container using simplexchat/smp-server:latest
- Configure the PASS environment variable such that it contains an '@' character.
PASS=passw@ordworks just as well. - Deploy the container and observe a totally silent failure (exit code 1) with no container logs. If the container strategy is set to reboot always, it will go into a reboot loop.
Recommend solutions:
- Update documentation to indicate that certain special characters are not allowed.
- Escape the input string properly when passing the argument to smp-server init.
I tried naively to apply the second recommendation and fix the command line parameter invocation, but after reading the first sentence of the set built-in documentation, I admit I didn't really pursue it further.
Debugging further
Starting an instance of the image and overriding the entrypoint to a shell gives us the opportunity to add some debug logs to the entrypoint script and invoke it manually for testing:
docker run --interactive --tty --entrypoint /bin/bash simplexchat/smp-server:latest
cd /usr/local/bin
export ADDR=simplex.exampledomain.local
export PASS=passw@rd
./entrypoint
In the entrypoint script, changing this line:
smp-server init --yes \
--store-log \
--daily-stats \
--source-code \
"$@" > /dev/null 2>&1
To this:
smp-server init --yes \
--store-log \
--daily-stats \
--source-code \
"$@"
reveals the underlying error. Now the entrypoint script fails with the following invocation error and usage example:
option --password: endOfInput
Usage: smp-server init [--disable-store-log | (-l|--store-log)]
[-d|--database DB_CONN] [--schema DB_SCHEMA]
[--pool-size POOL_SIZE] [-s|--daily-stats]
[-a|--sign-algorithm ALG] [--ip IP] [-n|--fqdn FQDN]
[--no-password | --password PASSWORD]
[--control-port | --control-port PORT]
[--socks-proxy | --socks-proxy PROXY]
[--own-domains DOMAINS]
[--source-code | --source-code URI]
[--operator OPERATOR_NAME]
[--operator-country OPERATOR_COUNTRY]
[--hosting HOSTING_NAME]
[--hosting-country HOSTING_COUNTRY]
[--hosting-type HOSTING_TYPE]
[--server-country SERVER_COUNTRY]
[--operator-website WEBSITE] [--web-path PATH]
[--disable-web] [-y|--yes]
Initialize server - creates /etc/opt/simplex and /var/opt/simplex directories
and configuration files
Thank you,
-DM
- Dominant language
- Haskell
- Stars
- 847
- Forks
- 111
- Avg merge
- 3d 11h
- Merged PRs (30d)
- 9
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from simplex-chat/simplexmq
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
simplex-chat/simplexmq#1853 ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
simplex-chat/simplexmq#1864 ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
simplex-chat/simplexmq#1857 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
simplex-chat/simplexmq#1855 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
simplex-chat/simplexmq#1834 ·
All issues in simplex-chat/simplexmq
Similar issues
-
chore
Difficulty 1/5 Under an hour Newbie friendliness 91/100
alunduil/alunduil-chezmoi#792 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
koalaman/shellcheck#3539 ·
-
time-manager-0.4.0 Openfailure: bounds
Difficulty 1/5 Under an hour Newbie friendliness 72/100
commercialhaskell/stackage#8122 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
objectionary/phino#1350 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100