processone / docker-ejabberd

Set of ejabberd Docker images
94 stars 77 forks source link

New captcha.sh does not work in docker container #66

Closed podkilla closed 3 years ago

podkilla commented 3 years ago

Dockerfile

FROM ejabberd/ecs:21.01

USER root

RUN apk add --no-cache \
    ghostscript-fonts \
    bash \
    imagemagick

docker-compose

version: '3.8'
services:
    ejabberd:
      build: 
        context: .
        dockerfile: Dockerfile
      container_name: ${CONTAINER_NAME:-ejabberd}
      restart: unless-stopped
      network_mode: "host"
      image: ejabberd:ecs
      volumes:
        - /var/docker/ejabberd/conf:/home/ejabberd/conf:ro
        - /var/docker/ejabberd/upload:/home/ejabberd/upload
        - /var/docker/ejabberd/logs:/home/ejabberd/logs
        - /etc/localtime:/etc/localtime:ro`

Registering new accounts on host via new captcha.sh https://github.com/processone/ejabberd/pull/3533 gives error:

2021-04-03 00:10:54.793125+02:00 [error] <0.711.0>@ejabberd_captcha:do_create_image/1:407 Failed to process output from "/home/ejabberd/conf/captcha.sh 139043". Maybe ImageMagick's Convert program is not installed.

The "old" example captcha.sh script worked but resulted in a LOT of bot accounts, so i gave the new one a shot.

badlop commented 3 years ago

Hi! captcha-ng.sh works for me following the instructions from ecs/README

In your case, if captcha.sh works, obviously you already have convert installed. That ejabberd error message is pretty generic. If you can check what's the output of the captcha script, it may provide some pointer to the real problem.

podkilla commented 3 years ago

Thanks. I added the line captcha_url: https://localhost:5443/captcha to my ejabberd.yml as stated in ecs/README. Captchas work as intended now. With the old script this line was not necessary.