2009-08-29 77 views
3

我有兩個ejabberd服務器,一個在foobar.com上在本地很遠的一個在線服務器。Xmpp ejabberd和添加用戶命令

使用XMPP洋涇浜控制檯我可以給IQ節的測試:

本地服務器主機名是EEPC

<iq to='eeepc' from='[email protected]' id='get-registred-users-num-1' type='set'> 
    <command xmlns='http://jabber.org/protocol/commands' action='execute' node='http://jabber.org/protocol/admin#get-registered-users-num'/> 

</iq> 

<iq from='eeepc' to='[email protected]/3493331071251540036345753' id='get-registred-users-num-1' type='result'> 
    <command xmlns='http://jabber.org/protocol/commands' sessionid='2009-08-29T14:01:55.714639Z' node='http://jabber.org/protocol/admin#get-registered-users-num' status='completed'> 
     <x xmlns='jabber:x:data'> 
      <field type='hidden' var='FORM_TYPE'> 
       <value>http://jabber.org/protocol/admin</value> 
      </field> 
      <field type='text-single' label='Number of registered users' var='registeredusersnum'> 
       <value>7</value> 
      </field> 
     </x> 
    </command> 
</iq> 

遠程服務器

<iq to='foobar.com' from='[email protected]' id='get-registred-users-num-1' type='set'> 
    <command xmlns='http://jabber.org/protocol/commands' action='execute' node='http://jabber.org/protocol/admin#get-registered-users-num'/> 
</iq> 

<iq from='foobar.com' to='[email protected]/36523779951251567671615394' id='get-registred-users-num-1' type='error'> 
    <command xmlns='http://jabber.org/protocol/commands' action='execute' node='http://jabber.org/protocol/admin#get-registered-users-num'/> 
    <error code='404' type='cancel'> 
     <item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> 
    </error> 
</iq> 

我不明白爲什麼我得到一個,我看不到任何特定的選項告訴服務器接受來自遠程的命令?

回答

1

也許mod_configure只是不加載遠程服務器。 您可以在ejabberd管理員shell中通過lists:member(mod_configure, gen_mod:loaded_modules("foobar.com")).進行檢查。 我無法想象這是關於成爲遠程用戶,因爲在foobar.com和[email protected]之間不需要s2s連接。

0

查看the mod_configure.erl source code似乎有一個ACL檢查,以確保配置adhoc命令只有當請求者在用戶帳戶上時才允許在該虛擬主機上配置priv。默認情況下,我認爲他們沒有。

acl:match_rule(LServer, configure, From) 

您可能需要添加類似...

{access, configure, [{allow, [email protected]}]}. 

...您ejabberd.cfg文件。