Include the captcha examples in the container and how to use them (#65)

pull/68/head
Badlop 3 years ago
parent 9adadc6999
commit 3d78a70132

@ -24,8 +24,11 @@ RUN mkdir runtime \
&& cp releases/*/start.boot bin \
&& echo 'beam_lib:strip_files(filelib:wildcard("lib/*/ebin/*beam")), init:stop().' | erts*/bin/erl -boot start_clean >/dev/null \
&& mv erts*/bin/* bin \
&& EJABBERD_VERSION=`(cd releases; ls -1 -d *.*.*)` \
&& rm -rf releases erts* bin/*src bin/dialyzer bin/typer \
&& rm bin/ejabberd bin/ejabberd.bat \
&& mkdir lib/ejabberd-$EJABBERD_VERSION/priv/bin \
&& cp /ejabberd/tools/captcha*sh lib/ejabberd-$EJABBERD_VERSION/priv/bin \
&& cp -r /ejabberd/sql lib/ejabberd-*/priv
# Runtime container

@ -130,6 +130,31 @@ You can open a live debug Erlang console attached to a running container:
docker exec -it ejabberd bin/ejabberdctl debug
```
### CAPTCHA
ejabberd includes two example CAPTCHA scripts.
If you want to use any of them, first install some additional required libraries:
```bash
docker exec --user root ejabberd apk add imagemagick ghostscript-fonts bash
```
Now update your ejabberd configuration file, for example:
```bash
docker exec -it ejabberd vi conf/ejabberd.yml
```
and add the required options:
```
captcha_cmd: /home/ejabberd/lib/ejabberd-21.1.0/priv/bin/captcha.sh
captcha_url: https://localhost:5443/captcha
```
Finally, reload the configuration file or restart the container:
```bash
docker exec ejabberd bin/ejabberdctl reload_config
```
## Docker image advanced configuration
### Ports

Loading…
Cancel
Save