<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div>Peter,<br><br>Thank you for the suggestion. <br><br>I've commented the mod_rest part in the modules section of the main config file.<br>In example1.cfg I have:<br><br>{host_config, "example1.com",<br> [<br> {acl, admin1, {user, "admin1", "example1.com"}},<br> {access, rest1, [{allow, admin1}]},<br> {{add, modules},<br> [<br> {mod_rest, [ {access_commands,[{rest1, all, [{host, "example1.com"}]}]} ]}<br> ]<br> }<br>]}.<br><br>Now any user can execute any command as if the mod_rest config has no effect.<br>Being able to define access_commands for example for a specific host in a separate config file is very helpful.<br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br><div
style="font-family: arial,helvetica,sans-serif; font-size: 13px;"><font size="2" face="Tahoma"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Peter Viskup <skupko.sk@gmail.com><br><b><span style="font-weight: bold;">To:</span></b> ejabberd@jabber.ru<br><b><span style="font-weight: bold;">Sent:</span></b> Monday, June 1, 2009 1:47:52 AM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [ejabberd] access_commands in ejabberd.cfg and vhosts (ejabberd2.1)<br></font><br> Hi Pablo,<br><span>this looks similar to my post "Cannot register to our server" -> <a target="_blank" href="http://www.ejabberd.im/node/3350">http://www.ejabberd.im/node/3350</a></span><br>Try to remove mod_rest configuration record from your main ejabberd.cfg - this should help you to solve this issue. Configuration of mod_rest in example1.cfg file should apply after this removal (and only for vhost <a target="_blank"
href="http://example1.com">example1.com</a> as you require).<br>Module from 'main' configuration section cannot be reconfigured in vhosts sections - you have to remove it from 'main' and add to 'vhost' with appropriate configuration options.<br>It is probably related to Erlang language and it's syntax.<br><br>Best regards,<br>Peter "skupko" Viskup<br>jabber: <a ymailto="mailto:skupko@jabber.sk" href="mailto:skupko@jabber.sk">skupko@jabber.sk</a><br>mail: <a ymailto="mailto:skupko.sk@gmail.com" href="mailto:skupko.sk@gmail.com">skupko.sk@gmail.com</a><br><br><br>Pablo Platt wrote:<br>> Hi,<br>> <br>> I'm using the trunk version ejabberd2.1<br>> <br>> I have two vhosts example1.com and <a target="_blank" href="http://example2.com">example2.com</a><br>> I want to configure mod_rest to allow admin1 from example1.com to execute commands only related to host example1.com<br>> and the same for admin2 from example2.com to be able to execute
commands only related to host example2.com<br>> The following config works for me. admin1 can execute commands only on example1.com and admin2 can only on example2.com:<br>> {acl, admin1, {user, "admin1", "example1.com"}}.<br>> {access, rest1, [{allow, admin1}]}.<br>> {acl, admin2, {user, "admin2", "example2.com"}}.<br>> {access, rest2, [{allow, admin2}]}.<br>> {modules,<br>> [<br>> {mod_rest, [<br>> {access_commands, [<br>> {configure, all, []},<br>> {rest1, all, [{host, "example1.com"}]},<br>> {rest2, all, [{host, "example2.com"}]}<br>> ]}<br>> ]},<br>> <br>> Now I'm trying to put vhost related configurations in a separate config file example1.cfg and example2.cfg<br>> I'm including them at the end of
my ejabberd.cfg using:<br>> {include_config_file, "/etc/ejabberd/example1.cfg"}.<br>> I removed acl, access and mod_rest configuration related to vhosts and added to example1.cfg, example2.cfg.<br>> Now admin (access rule configure) can execute commands on any vhost but<br>> admin1 from example1.com and admin2 from example2.com can't execute any commands.<br>> <br>> ejabberd.cfg:<br>> {modules,<br>> [<br>> {mod_rest, [<br>> {access_commands, [<br>> {configure, all, []}<br>> ]}<br>> ]},<br>> <br>> example1.cfg:<br>> {host_config, "example1.com",<br>> [<br>> {acl, admin1, {user, "admin1", "example1.com"}},<br>> {access, rest1, [{allow, admin1}]},<br>> {{add, modules},<br>> [<br>> {mod_rest, [ {access_commands,[{rest1,
all, [{host, "example1.com"}]}]} ]}<br>> ]<br>> }<br>> ]}.<br>> <br>> Is it possible to configure access_commands in several places or do I have to set all of them in the main config file?<br>> <br>> Thanks<br>> <br>> <br>> <br>> <br>> <br>> ------------------------------------------------------------------------<br>> <br>> _______________________________________________<br>> ejabberd mailing list<br>> <a ymailto="mailto:ejabberd@jabber.ru" href="mailto:ejabberd@jabber.ru">ejabberd@jabber.ru</a><br><span>> <a target="_blank" href="http://lists.jabber.ru/mailman/listinfo/ejabberd">http://lists.jabber.ru/mailman/listinfo/ejabberd</a></span><br>> <br><br>_______________________________________________<br>ejabberd mailing list<br><a ymailto="mailto:ejabberd@jabber.ru" href="mailto:ejabberd@jabber.ru">ejabberd@jabber.ru</a><br><a
href="http://lists.jabber.ru/mailman/listinfo/ejabberd" target="_blank">http://lists.jabber.ru/mailman/listinfo/ejabberd</a><br></div></div></div><br>
</body></html>