After configuring ejabberd on windows 10 through docker and following the documentation I am trying to create an admin user, but whenever I try the command
PS C:\Users\user_name> docker exec -it ejabberd bin/ejabberdapi register --endpoint=http://127.0.0.1:5280/ --jid=admin@localhost --password=passw0rd
it shows the following error
ejabberdapi: error: user registration error for admin@localhost: Error 99: invalid character '<' looking for beginning of value
Yes, got the correct command docker exec -it ejabberd bin/ejabberdctl register admin localhost passw0rd to register a user (ejabberd through docker).
But when I tried the user-created http://localhost:5280/user-name to open the web admin console in the browser it didn't work and showing error This site can't be reached, localhost refused to connect. Kindly guide if I am missing something. Thank you
But when I tried the user-created http://localhost:5280/user-name to open the web admin console in the browser
Looking at the file https://github.com/processone/docker-ejabberd/blob/master/ecs/conf/ejabberd.yml#L66
I think the WebAdmin will be listenting in http://localhost:5280/admin/
See also https://docs.ejabberd.im/admin/guide/managing/#web-admin
Ejabberd running inside docker on 5222 but Localhost can't be reached http://localhost:5280/admin/
If you want to access the container port 5280 using your local port 5280 (like in the URL http://localhost:5280/admin/ ), then you must start docker with something like this:
docker run -it -p 5222:5222 -p 5280:5280 ejabberd/ecs live
Similarly, if you want to access other ports, for example the encrypted port 5443 (like in https://localhost:5443/admin/ ), then you must add that one too:
docker run -it -p 5222:5222 -p 5280:5280 -p 5443:5443 ejabberd/ecs live
@badlop, thanks for the support
Definitely something happening here
~ $ bin/ejabberdapi register --endpoint=http://127.0.0.1:5280 --jid=admin@localhost --password=passw0rd --json
ejabberdapi: error: user registration error for admin@localhost: Error 99: invalid character '<' looking for beginning of value
~ $ bin/ejabberdapi register --endpoint=http://127.0.0.1:5280/admin --jid=admin@localhost --password=passw0rd --json
ejabberdapi: error: user registration error for admin@localhost: Error 99: unexpected end of JSON input
@HugoPoi ejabberd version? Config?
Docker Ejabberd version 20.01 default configuration provided.
But I think i narrow down the issue
bin/ejabberdapi need to have access to mod_http_api for working correctlybin/ejabberdapi can handle TLS ?bin/ejabberdapi deprecated ?bin/ejabberdapi return weird error message and you need to guessI add the module and an api_permission and it works now, but I think something could be down regarding the docker readme.
Right, something was going on there, as the docker documentation said to point ejabberdapi to http:...5280 but in the ejabberd.yml
So... I've rewritten that Docker documentation to use ejabberdctl first, and then offer ejabberdapi
PD: This was previously asked also in https://github.com/processone/ejabberd/issues/2635
Most helpful comment
Right, something was going on there, as the docker documentation said to point ejabberdapi to http:...5280 but in the ejabberd.yml
So... I've rewritten that Docker documentation to use ejabberdctl first, and then offer ejabberdapi
PD: This was previously asked also in https://github.com/processone/ejabberd/issues/2635