From 3d78a70132510df0c8747b118f909ec922121d69 Mon Sep 17 00:00:00 2001 From: Badlop Date: Wed, 31 Mar 2021 15:54:19 +0200 Subject: [PATCH] Include the captcha examples in the container and how to use them (#65) --- ecs/Dockerfile | 3 +++ ecs/README.md | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/ecs/Dockerfile b/ecs/Dockerfile index e469da6..f832848 100644 --- a/ecs/Dockerfile +++ b/ecs/Dockerfile @@ -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 diff --git a/ecs/README.md b/ecs/README.md index f974c7d..aaa8561 100644 --- a/ecs/README.md +++ b/ecs/README.md @@ -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