rroemhild / docker-ejabberd

Dockerfile for Ejabberd server
MIT License
267 stars 161 forks source link

Support for http auth method #203

Open Goutam192002 opened 3 years ago

Goutam192002 commented 3 years ago

ejabberd_auth_http method enables http authentication for ejabberd. I have added this module to my variable as follows:

EJABBERD_CONTRIB_MODULES=ejabberd_auth_http

This works fine..but to be able to actually use http auth I had to change the configuration template to the following:

auth_method: {{ env.get('EJABBERD_AUTH_METHOD', 'http') }}
auth_opts:
  host: {{ env.get('EJABBERD_AUTH_HOST', 'http://localhost:8000') }}
  basic_auth: {{ env.get('EJABBERD_AUTH_TOKEN', '') }}
  path_prefix: {{ env.get('EJABBERD_AUTH_PATH_PREFIX', '/internal_auth/') }}

When I run docker-compose up I get the following error:

==> /usr/local/var/log/ejabberd/error.log <==
ejabberd_1  | 2021-02-04 13:26:37.339 [error] <0.63.0>@ejabberd_config:validate_opts:1087 Invalid value for option 'auth_method': - http
ejabberd_1  | 2021-02-04 13:26:37.339 [error] <0.63.0>@ejabberd_config:start:88 Failed to load configuration file /usr/local/etc/ejabberd/ejabberd.yml
ejabberd_1  | 2021-02-04 13:26:37.339 [critical] <0.63.0>@ejabberd_app:start:70 Failed to start ejabberd application: invalid_option
Goutam192002 commented 3 years ago

I think it's because install_modules script is run after ejabberd server has been started for the first time. Is there a workaround for this?