configuration - ejabberd mod_register allow registration only from a specified IP -
i'm trying ejabberd allow in-channel registration specific ip, using mod_register's ip_access clause.
to this, added line mod_register block in ejabberd.cfg:
{ip_access, [{allow, "the.allowed.ip.address"}]} ... , restarted ejabberd via ejabberdctl restart. server came online no warnings or errors logged in /var/log/ejabberd/ejabberd.log.
unfortunately, line of code, still perform in-channel registration non-whitelisted ip using adium client. decided amend line above adding:
{ip_access, [{allow, "the.allowed.ip.address"}, {deny, all}]} ... running risk of causing registrations throw 403 "unauthorized" status. strangely, now, when try register any ip, including whitelisted one, 503 "service unavailable" status message.
how can ejabberd allow in-channel registration specific ip, , ip alone?
that's not how restriction supposed used. can find example (in .yaml) in ejabberd documentation mod_register:
that's not how works in ejabberd 15.x. need 3 things able limit registration ip: - acl definition ip. - access rule defining acl want allow or deny access. - mod_register configuration linking ip_access access rule.
for (very old) 2.1.11, different, not use keyword deny.
ejabberd 2.1.11 documentation show example as:
{acl, shortname, {user_glob, "??"}}. %% same using regexp: %%{acl, shortname, {user_regexp, "^..?$"}}. {access, register, [{deny, shortname}, {allow, all}]}. {modules, [ ... {mod_register, [{access, register}, {ip_access, [{allow, "127.0.0.0/8"}, {deny, "0.0.0.0/0"}]} ]}, ... ]}. as see deny should match ip address blocks deny.
Comments
Post a Comment