SaraSmiseth / prosody

Prosody XMPP server docker image
https://hub.docker.com/r/sarasmiseth/prosody
20 stars 7 forks source link

stringy.split problem #47

Closed Rooby69 closed 1 year ago

Rooby69 commented 1 year ago

Hello

I have a problem when not defining PROSODY_ADMINS then in line4 of the prosody.cfg.lua the _stringy.split(os.getenv("PROSODYADMINS"), ", "); has a problem since it gets an empty string from PROSODY_ADMINS.

when running prosodyctl it will scan the config an raise an error: Error: /usr/local/etc/prosody/prosody.cfg.lua:6: bad argument #1 to 'split' (string expected, got nil)

The same happens in other cfg.lua files where an empty string may defined e.g. SERVER_CONTACT_INFO_ABUSE, SERVER_CONTACT_INFO_ADMIN etc.

CodeWithMa commented 1 year ago

Hello,

you have to use the /entrypoint.bash script. It will initialize the environment variables and call prosodyctl if the first argument is not prosody.

https://github.com/SaraSmiseth/prosody/blob/ab2afd42497955a58a564226c3353a2e1df62ba7/docker-entrypoint.bash#L26-L29

Example:

# This one does not work
docker compose exec prosody_postgres prosodyctl register TestUserName localhost 12345678
# This one works
docker compose exec prosody_postgres /bin/bash -c "/entrypoint.bash register TestUserName localhost 12345678"
SaraSmiseth commented 1 year ago

Thanks @CodeWithMa for answering. I'll close this. If you still have questions please reopen.