From cb0627e6b2b62e2e430cff0b4ba008d69a9b96bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Chmielowski?= Date: Wed, 22 Mar 2017 14:30:04 +0100 Subject: [PATCH] Expand ejabberd.yml.example by enabling mod_http_api with couple commands --- ejabberd.yml.example | 59 +++++++++++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 22 deletions(-) diff --git a/ejabberd.yml.example b/ejabberd.yml.example index fe9b5083d..782c00e4f 100644 --- a/ejabberd.yml.example +++ b/ejabberd.yml.example @@ -182,6 +182,7 @@ listen: module: ejabberd_http request_handlers: "/websocket": ejabberd_http_ws + "/api": mod_http_api ## "/pub/archive": mod_http_fileserver web_admin: true http_bind: true @@ -534,30 +535,43 @@ access_rules: ## ## By default "console commands" section allow executing all commands ## issued using ejabberdctl command, and "admin access" section allows -## users in admin acl to execute all commands except start and stop -## with any available access method (ejabberdctl, http-api, xmlrpc -## depending what is enabled on server). +## users in admin acl that connect from 127.0.0.1 to execute all +## commands except start and stop with any available access method +## (ejabberdctl, http-api, xmlrpc depending what is enabled on server). ## -## Remember to not remove "console commands" section when doing modifications -## or ejabberdctl will not be able to execute commands! +## If you remove "console commands" there will be one added by +## default allowing executing all commands, but if you just change +## permissions in it, version from config file will be used instead +## of default one. ## -## -## api_permissions: -## "console commands": -## from: -## - ejabberd_ctl -## who: all -## what: "*" -## "admin access": -## who: -## - admin -## - oauth: -## - scope: "ejabberd:admin" -## - admin -## what: -## - "*" -## - "!stop" -## - "!start" +api_permissions: + "console commands": + from: + - ejabberd_ctl + who: all + what: "*" + "admin access": + who: + - access: + - allow: + - ip: "127.0.0.1/8" + - acl: admin + - oauth: + - scope: "ejabberd:admin" + - access: + - allow: + - ip: "127.0.0.1/8" + - acl: admin + what: + - "*" + - "!stop" + - "!start" + "public commands": + who: + - ip: "127.0.0.1/8" + what: + - "status" + - "connected_users_number" ## By default the frequency of account registrations from the same IP ## is limited to 1 account every 10 minutes. To disable, specify: infinity @@ -714,6 +728,7 @@ modules: ## PKIX authentication. Make sure you have proper certificates installed ## and check your accessibility at https://xmpp.net/ mod_s2s_dialback: {} + mod_http_api: {} ## ## Enable modules with custom options in a specific virtual host