Agnello George | 1 Jun 2009 10:48
Picon

user authentication fails againts Windows ADS .

hi 
i have a ejabberd server in set up on Cent OS 5.2 . i need to connect to an exertnal Ads server for some users . My ejabberd.cfg file looks something like this . 
{hosts, ["excads.netstat.com"]}.
{host_config, "excads.netstat.com", [{auth_method,ldap},
{ldap_servers,["excads.netstat.com"]},
{ldap_uids, [{"sAMAccountName","%u"}]},
{ldap_base,"dc=excads,dc=netstat,dc=com"},
{ldap_rootdn,"cn=Administrator,cn=Users,dc=excads,dc=netstat,dc=com"},
{ldap_password,"qwerasdf"}]}.
whnei trto login i get  the following error ( i apologies for  posting  a huge log file )
=INFO REPORT==== 2009-06-01 13:52:20 ===
I(<0.244.0>:ejabberd_listener:112) : (#Port<0.437>) Accepted connection {{192,168,10,105},44865} -> {{192,168,50,137},5222}

=INFO REPORT==== 2009-06-01 13:52:20 ===
D(<0.499.0>:ejabberd_receiver:298) : Received XML on stream = "<?xml version='1.0' ?><stream:stream to='excads.netstat.com' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>"

=INFO REPORT==== 2009-06-01 13:52:20 ===
D(<0.500.0>:ejabberd_c2s:1362) : Send XML on stream = "<?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='3974015530' from='excads.netstat.com' version='1.0' xml:lang='en'>"

=INFO REPORT==== 2009-06-01 13:52:20 ===
D(<0.500.0>:ejabberd_c2s:1362) : Send XML on stream = "<stream:features><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>PLAIN</mechanism></mechanisms><register xmlns='http://jabber.org/features/iq-register'/></stream:features>"

=INFO REPORT==== 2009-06-01 13:52:20 ===
D(<0.499.0>:ejabberd_receiver:298) : Received XML on stream = "<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>AGFnbmVsbG8AMTJxd1FXUVc=</auth>"

=INFO REPORT==== 2009-06-01 13:52:20 ===
D(<0.499.0>:shaper:61) : State: {maxrate,1000,0,1243844540317068}, Size=96
M=48.0, I=4.794


=INFO REPORT==== 2009-06-01 13:52:20 ===
D(<0.251.0>:eldap:587) : {searchRequest,
  {'SearchRequest',"dc=excads,dc=netstat,dc=com",
  wholeSubtree,neverDerefAliases,0,0,false,
  {equalityMatch,
  {'AttributeValueAssertion',"sAMAccountName",
  "agnello"}},
  []}}


=INFO REPORT==== 2009-06-01 13:52:20 ===
D(<0.251.0>:eldap:648) : {searchResEntry,
  {'SearchResultEntry',
  "CN=agnello,CN=Users,DC=excads,DC=netstat,DC=com",
  [{'PartialAttributeList_SEQOF',
  "objectClass",
  ["top","person","organizationalPerson",
  "user"]},
  {'PartialAttributeList_SEQOF',"cn",
  ["agnello"]},
  {'PartialAttributeList_SEQOF',"givenName",
  ["agnello"]},
  {'PartialAttributeList_SEQOF',
  "distinguishedName",
  ["CN=agnello,CN=Users,DC=excads,DC=netstat,DC=com"]},
  {'PartialAttributeList_SEQOF',
  "instanceType",
  ["4"]},
  {'PartialAttributeList_SEQOF',
  "whenCreated",
  ["20090529134023.0Z"]},
  {'PartialAttributeList_SEQOF',
  "whenChanged",
  ["20090529134023.0Z"]},
  {'PartialAttributeList_SEQOF',
  "displayName",
  ["agnello"]},
  {'PartialAttributeList_SEQOF',"uSNCreated",
  ["69678"]},
  {'PartialAttributeList_SEQOF',"uSNChanged",
  ["69684"]},
  {'PartialAttributeList_SEQOF',"name",
  ["agnello"]},
  {'PartialAttributeList_SEQOF',"objectGUID",
  [[140,74,186,186,206,216,118,72,159,124,
  136,45,152,67,18,199]]},
  {'PartialAttributeList_SEQOF',
  "userAccountControl",
  ["512"]},
  {'PartialAttributeList_SEQOF',
  "badPwdCount",
  ["0"]},
  {'PartialAttributeList_SEQOF',"codePage",
  ["0"]},
  {'PartialAttributeList_SEQOF',
  "countryCode",
  ["0"]},
  {'PartialAttributeList_SEQOF',
  "badPasswordTime",
  ["0"]},
  {'PartialAttributeList_SEQOF',"lastLogoff",
  ["0"]},
  {'PartialAttributeList_SEQOF',"lastLogon",
  ["0"]},
  {'PartialAttributeList_SEQOF',"pwdLastSet",
  ["0"]},
  {'PartialAttributeList_SEQOF',
  "primaryGroupID",
  ["513"]},
  {'PartialAttributeList_SEQOF',"objectSid",
  [[1,5,0,0,0,0,0,5,21,0,0,0,49,14,213,
  216,110,128,202,165,151,137,68,35,104,
  4,0,0]]},
  {'PartialAttributeList_SEQOF',
  "accountExpires",
  ["9223372036854775807"]},
  {'PartialAttributeList_SEQOF',"logonCount",
  ["0"]},
  {'PartialAttributeList_SEQOF',
  "sAMAccountName",
  ["agnello"]},
  {'PartialAttributeList_SEQOF',
  "sAMAccountType",
  ["805306368"]},
  {'PartialAttributeList_SEQOF',
  "userPrincipalName",
  ["agnello <at> excads.netstat.com"]},
  {'PartialAttributeList_SEQOF',
  "objectCategory",
  ["CN=Person,CN=Schema,CN=Configuration,DC=excads,DC=netstat,DC=com"]}]}}

=INFO REPORT==== 2009-06-01 13:52:20 ===
D(<0.251.0>:eldap:648) : {searchResRef,
  ["ldap://ForestDnsZones.excads.netstat.com/DC=ForestDnsZones,DC=excads,DC=netstat,DC=com"]}

=INFO REPORT==== 2009-06-01 13:52:20 ===
D(<0.251.0>:eldap:648) : {searchResRef,
  ["ldap://DomainDnsZones.excads.netstat.com/DC=DomainDnsZones,DC=excads,DC=netstat,DC=com"]}

=INFO REPORT==== 2009-06-01 13:52:20 ===
D(<0.251.0>:eldap:648) : {searchResRef,
  ["ldap://excads.netstat.com/CN=Configuration,DC=excads,DC=netstat,DC=com"]}

=INFO REPORT==== 2009-06-01 13:52:20 ===
D(<0.251.0>:eldap:648) : {searchResDone,
  {'LDAPResult',success,[],[],asn1_NOVALUE}}

=INFO REPORT==== 2009-06-01 13:52:20 ===
D(<0.254.0>:eldap:587) : {bindRequest,
  {'BindRequest',3,
  "CN=agnello,CN=Users,DC=excads,DC=netstat,DC=com",
  {simple,"12qwQWQW"}}}


=INFO REPORT==== 2009-06-01 13:52:20 ===
D(<0.254.0>:eldap:648) : {bindResponse,
  {'BindResponse',invalidCredentials,[],
  [56,48,48,57,48,51,48,56,58,32,76,100,97,112,
  69,114,114,58,32,68,83,73,68,45,48,67,48,57,
  48,51,51,52,44,32,99,111,109,109,101,110,
  116,58,32,65,99,99,101,112,116,83,101,99,
  117,114,105,116,121,67,111,110,116,101,120,
  116,32,101,114,114,111,114,44,32,100,97,116,
  97,32,55,55,51,44,32,118,101,99,101,0],
  asn1_NOVALUE,asn1_NOVALUE}}

=INFO REPORT==== 2009-06-01 13:52:20 ===
I(<0.500.0>:ejabberd_c2s:577) : ({socket_state,gen_tcp,#Port<0.437>,<0.499.0>}) Failed authentication for agnello <at> excads.netstat.com

=INFO REPORT==== 2009-06-01 13:52:20 ===
D(<0.500.0>:ejabberd_c2s:1362) : Send XML on stream = "<failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><not-authorized/></failure>"
 
I cant see the issue here , my cfg file looks proper ... and i am able to query the external windows ads server.
Can some one help me in guiding me where exactly i am going wrong .
Thanks 
 
--
Regards
Agnello D'souza


_______________________________________________
ejabberd mailing list
ejabberd <at> jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Pablo Platt | 1 Jun 2009 12:01
Picon
Favicon

Re: access_commands in ejabberd.cfg and vhosts (ejabberd2.1)

Peter,

Thank you for the suggestion.

I've commented the mod_rest part in the modules section of the main config file.
In example1.cfg I have:

{host_config, "example1.com",
 [
  {acl, admin1, {user, "admin1", "example1.com"}},
  {access, rest1, [{allow, admin1}]},
  {{add, modules},
   [
    {mod_rest, [ {access_commands,[{rest1, all, [{host, "example1.com"}]}]} ]}
   ]
  }
]}.

Now any user can execute any command as if the mod_rest config has no effect.
Being able to define access_commands for example for a s pecific host in a separate config file is very helpful.

From: Peter Viskup <skupko.sk <at> gmail.com>
To: ejabberd <at> jabber.ru
Sent: Monday, June 1, 2009 1:47:52 AM
Subject: Re: [ejabberd] access_commands in ejabberd.cfg and vhosts (ejabberd2.1)

Hi Pablo,
this looks similar to my post "Cannot register to our server" -> http://www.ejabberd.im/node/3350
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 example1.com as you require).
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.
It is probably related to Erlang language and it's syntax.

Best regards,
Peter "skupko" Viskup
jabber: skupko <at> jabber.sk
mail: skupko.sk <at> gmail.com


Pablo Platt wrote:
> Hi,
>
> I'm using the trunk version ejabberd2.1
>
> I have two vhosts example1.com and example2.com
> I want to configure mod_rest to allow admin1 from example1.com to execute commands only related to host example1.com
> and the same for admin2 from example2.com to be able to execute commands only related to host example2.com
> The following config works for me. admin1 can execute commands only on example1.com and admin2 can only on example2.com:
> {acl, admin1, {user, "admin1", "example1.com"}}.
> {access, rest1, [{allow, admin1}]}.
> {acl, admin2, {user, "admin2", "example2.com"}}.
> {access, rest2, [{allow, admin2}]}.
> {modules,
>  [
>  {mod_rest, [
>        {access_commands, [
>            {configure, all, []},
>            {rest1, all, [{host, "example1.com"}]},
>            {rest2, all, [{host, "example2.com"}]}
>        ]}
>  ]} ,
>
> Now I'm trying to put vhost related configurations in a separate config file example1.cfg and example2.cfg
> I'm including them at the end of my ejabberd.cfg using:
> {include_config_file, "/etc/ejabberd/example1.cfg"}.
> I removed acl, access and mod_rest configuration related to vhosts and added to example1.cfg, example2.cfg.
> Now admin (access rule configure) can execute commands on any vhost but
> admin1 from example1.com and admin2 from example2.com can't execute any commands.
>
> ejabberd.cfg:
> {modules,
>  [
>  {mod_rest, [
>        {access_commands, [
>            {configure, all, []}
>        ]}
>  ]},
>
> example1.cfg:
> {host_config, "example1.com",
>  [
>  {acl, admin1, {user, "admin1", "example1.com"}},
>  {access, rest1, [{allow, admin1}]},
>  {{add, modules},
>    [
>    {mod_rest, [ {access_commands,[{rest1, all, [{host, "example1.com"}]}]} ]}
>    ]
>  }
> ]}.
>
> Is it possible to configure access_commands in several places or do I have to set all of them in the main config file?
>
> Thanks
>
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ejabberd mailing list
> ejabberd <at> jabber.ru
> http://lists.jabber.ru/mailman/listinfo/ejabberd


_______________________________________________
ejab berd mailing list
ejabberd <at> jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd

_______________________________________________
ejabberd mailing list
ejabberd <at> jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Agnello George | 1 Jun 2009 12:54
Picon

user authentication fails against Windows ADS



Dear List

I have a ejabberd server in set up on Cent OS 5.2 . I  need to connect to an exertnal Ads server for some users . My ejabberd.cfg file looks something like this .


 
{hosts, ["excads.netstat.com"]}.
{host_config, "excads.netstat.com", [{auth_method,ldap},
{ldap_servers,["excads.netstat.com"]},
{ldap_uids, [{"sAMAccountName","%u"}]},
{ldap_base,"dc=excads,dc=netstat,dc=com"},
{ldap_rootdn,"cn=Administrator,cn=Users,dc=excads,dc=netstat,dc=com"},
{ldap_password,"qwerasdf"}]}.




when i try to  login I get  the following error ( i apologies for  posting  a huge log file )


=INFO REPORT==== 2009-06-01 13:52:20 ===
I(<0.244.0>:ejabberd_listener:112) : (#Port<0.437>) Accepted connection {{192,168,10,105},44865} -> {{192,168,50,137},5222}

=INFO REPORT==== 2009-06-01 13:52:20 ===
D(<0.499.0>:ejabberd_receiver:298) : Received XML on stream = "<?xml version='1.0' ?><stream:stream to='excads.netstat.com' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>"

=INFO REPORT==== 2009-06-01 13:52:20 ===
D(<0.500.0>:ejabberd_c2s:1362) : Send XML on stream = "<?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='3974015530' from='excads.netstat.com' version='1.0' xml:lang='en'>"

=INFO REPORT==== 2009-06-01 13:52:20 ===
D(<0.500.0>:ejabberd_c2s:1362) : Send XML on stream = "<stream:features><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>PLAIN</mechanism></mechanisms><register xmlns='http://jabber.org/features/iq-register'/></stream:features>"

=INFO REPORT==== 2009-06-01 13:52:20 ===
D(<0.499.0>:ejabberd_receiver:298) : Received XML on stream = "<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>AGFnbmVsbG8AMTJxd1FXUVc=</auth>"

=INFO REPORT==== 2009-06-01 13:52:20 ===
D(<0.499.0>:shaper:61) : State: {maxrate,1000,0,1243844540317068}, Size=96
M=48.0, I=4.794


=INFO REPORT==== 2009-06-01 13:52:20 ===
D(<0.251.0>:eldap:587) : {searchRequest,
  {'SearchRequest',"dc=excads,dc=netstat,dc=com",
  wholeSubtree,neverDerefAliases,0,0,false,
  {equalityMatch,
  {'AttributeValueAssertion',"sAMAccountName",
  "agnello"}},
  []}}


=INFO REPORT==== 2009-06-01 13:52:20 ===
D(<0.251.0>:eldap:648) : {searchResEntry,
  {'SearchResultEntry',
  "CN=agnello,CN=Users,DC=excads,DC=netstat,DC=com",
  [{'PartialAttributeList_SEQOF',
  "objectClass",
  ["top","person","organizationalPerson",
  "user"]},
  {'PartialAttributeList_SEQOF',"cn",
  ["agnello"]},
  {'PartialAttributeList_SEQOF',"givenName",
  ["agnello"]},
  {'PartialAttributeList_SEQOF',
  "distinguishedName",
  ["CN=agnello,CN=Users,DC=excads,DC=netstat,DC=com"]},
  {'PartialAttributeList_SEQOF',
  "instanceType",
  ["4"]},
  {'PartialAttributeList_SEQOF',
  "whenCreated",
  ["20090529134023.0Z"]},
  {'PartialAttributeList_SEQOF',
  "whenChanged",
  ["20090529134023.0Z"]},
  {'PartialAttributeList_SEQOF',
  "displayName",
  ["agnello"]},
  {'PartialAttributeList_SEQOF',"uSNCreated",
  ["69678"]},
  {'PartialAttributeList_SEQOF',"uSNChanged",
  ["69684"]},
  {'PartialAttributeList_SEQOF',"name",
  ["agnello"]},
  {'PartialAttributeList_SEQOF',"objectGUID",
  [[140,74,186,186,206,216,118,72,159,124,
  136,45,152,67,18,199]]},
  {'PartialAttributeList_SEQOF',
  "userAccountControl",
  ["512"]},
  {'PartialAttributeList_SEQOF',
  "badPwdCount",
  ["0"]},
  {'PartialAttributeList_SEQOF',"codePage",
  ["0"]},
  {'PartialAttributeList_SEQOF',
  "countryCode",
  ["0"]},
  {'PartialAttributeList_SEQOF',
  "badPasswordTime",
  ["0"]},
  {'PartialAttributeList_SEQOF',"lastLogoff",
  ["0"]},
  {'PartialAttributeList_SEQOF',"lastLogon",
  ["0"]},
  {'PartialAttributeList_SEQOF',"pwdLastSet",
  ["0"]},
  {'PartialAttributeList_SEQOF',
  "primaryGroupID",
  ["513"]},
  {'PartialAttributeList_SEQOF',"objectSid",
  [[1,5,0,0,0,0,0,5,21,0,0,0,49,14,213,
  216,110,128,202,165,151,137,68,35,104,
  4,0,0]]},
  {'PartialAttributeList_SEQOF',
  "accountExpires",
  ["9223372036854775807"]},
  {'PartialAttributeList_SEQOF',"logonCount",
  ["0"]},
  {'PartialAttributeList_SEQOF',
  "sAMAccountName",
  ["agnello"]},
  {'PartialAttributeList_SEQOF',
  "sAMAccountType",
  ["805306368"]},
  {'PartialAttributeList_SEQOF',
  "userPrincipalName",
  ["agnello <at> excads.netstat.com"]},
  {'PartialAttributeList_SEQOF',
  "objectCategory",
  ["CN=Person,CN=Schema,CN=Configuration,DC=excads,DC=netstat,DC=com"]}]}}

=INFO REPORT==== 2009-06-01 13:52:20 ===
D(<0.251.0>:eldap:648) : {searchResRef,
  ["ldap://ForestDnsZones.excads.netstat.com/DC=ForestDnsZones,DC=excads,DC=netstat,DC=com"]}

=INFO REPORT==== 2009-06-01 13:52:20 ===
D(<0.251.0>:eldap:648) : {searchResRef,
  ["ldap://DomainDnsZones.excads.netstat.com/DC=DomainDnsZones,DC=excads,DC=netstat,DC=com"]}

=INFO REPORT==== 2009-06-01 13:52:20 ===
D(<0.251.0>:eldap:648) : {searchResRef,
  ["ldap://excads.netstat.com/CN=Configuration,DC=excads,DC=netstat,DC=com"]}

=INFO REPORT==== 2009-06-01 13:52:20 ===
D(<0.251.0>:eldap:648) : {searchResDone,
  {'LDAPResult',success,[],[],asn1_NOVALUE}}

=INFO REPORT==== 2009-06-01 13:52:20 ===
D(<0.254.0>:eldap:587) : {bindRequest,
  {'BindRequest',3,
  "CN=agnello,CN=Users,DC=excads,DC=netstat,DC=com",
  {simple,"12qwQWQW"}}}


=INFO REPORT==== 2009-06-01 13:52:20 ===
D(<0.254.0>:eldap:648) : {bindResponse,
  {'BindResponse',invalidCredentials,[],
  [56,48,48,57,48,51,48,56,58,32,76,100,97,112,
  69,114,114,58,32,68,83,73,68,45,48,67,48,57,
  48,51,51,52,44,32,99,111,109,109,101,110,
  116,58,32,65,99,99,101,112,116,83,101,99,
  117,114,105,116,121,67,111,110,116,101,120,
  116,32,101,114,114,111,114,44,32,100,97,116,
  97,32,55,55,51,44,32,118,101,99,101,0],
  asn1_NOVALUE,asn1_NOVALUE}}

=INFO REPORT==== 2009-06-01 13:52:20 ===
I(<0.500.0>:ejabberd_c2s:577) : ({socket_state,gen_tcp,#Port<0.437>,<0.499.0>}) Failed authentication for agnello <at> excads.netstat.com

=INFO REPORT==== 2009-06-01 13:52:20 ===
D(<0.500.0>:ejabberd_c2s:1362) : Send XML on stream = "<failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><not-authorized/></failure>"
 
I cant see the issue here , my cfg file looks proper ... and i am able to query the external windows ads server.

Can some one help me in guiding me where exactly i am going wrong .


Thanks
--
Regards
Agnello D'souza


_______________________________________________
ejabberd mailing list
ejabberd <at> jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Simon Tennant | 1 Jun 2009 19:08

message archiving

What's the preferred method of message archiving (that works)?

Here's what we have worked through so far:

    * mod_archive_odbc: doesn't work reliably with Postgresql - expiry
      is broken.
    * mod_logdb: only supports an ancient version of ejabberd. It is no
      longer maintained.
    * mod_archive: no support for message expiry and stores stuff in
      mnesia which is not ideal for us.

mod_archive_odbc looks most promising but barfs on expiry (we're
currently sitting on 1.6M messages in the DB).

What are others using for XEP-0136?

S.

--

-- 
Simon Tennant _____________________________________________

fixed: .uk +44 20 7043 6756          .de +49 89 420 955 854  
  mob: .uk +44 78 5335 6047          .de +49 17 8545 0880
 xmpp: simon <at> buddycloud.com
Zbyszek Żółkiewski | 1 Jun 2009 19:25
Picon
Gravatar

Re: message archiving


On Mon, Jun 1, 2009 at 19:08, Simon Tennant <simon <at> imaginator.com> wrote:
What's the preferred method of message archiving (that works)?

   * mod_logdb: only supports an ancient version of ejabberd. It is no
     longer maintained.


it is simply not true. mod_logdb work with latest ejabberd svn (look at jabbim.cz/jabster.pl), also there is project jorge for web access to message archives. Both projects are active and under development. mod_logdb use Ad-hoc commands so it work with almost any client.
jabster.pl hold 100 000 000+ message archive without any problems.

 

mod_archive_odbc looks most promising but barfs on expiry (we're
currently sitting on 1.6M messages in the DB).

What are others using for XEP-0136?


there is no client support for this xep and dont expect to be in near feature


 

Simon Tennant _____________________________________________

fixed: .uk +44 20 7043 6756          .de +49 89 420 955 854
 mob: .uk +44 78 5335 6047          .de +49 17 8545 0880
 xmpp: simon <at> buddycloud.com

_______________________________________________
ejabberd mailing list
ejabberd <at> jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd



--
pozdrawiam,
Zbyszek Żółkiewski
_______________________________________________
ejabberd mailing list
ejabberd <at> jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Jonathan Schleifer | 1 Jun 2009 19:41

Re: message archiving

Zbyszek Żółkiewski <zbyszek <at> toliman.pl> wrote:

> it is simply not true. mod_logdb work with latest ejabberd svn (look
> at jabbim.cz/jabster.pl), also there is project jorge for web access
> to message archives. Both projects are active and under development.
> mod_logdb use Ad-hoc commands so it work with almost any client.
> jabster.pl hold 100 000 000+ message archive without any problems.

When trying to use it in ejabberd trunk (I ported the diff to trunk so
it would at least apply cleanly), it just crashes ejabberd completely
due to using hooks the wrong way. And by crash I don't mean that the
module crashes, no, it shuts down ejabberd completely!

What am I doing wrong here if it's supposed to work with trunk? Is
there another version than this one:

http://www.dp.uz.gov.ua/o.palij/mod_logdb/patch-src-mod_logdb-2.0.3.diff

?

This one is for 2.0.3, which is damn old, and it crashes when you try
to use it in trunk.

--

-- 
Jonathan
_______________________________________________
ejabberd mailing list
ejabberd <at> jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Zbyszek Żółkiewski | 1 Jun 2009 19:48
Picon
Gravatar

Re: message archiving


On 2009-06-01, at 19:41, Jonathan Schleifer wrote:

> When trying to use it in ejabberd trunk (I ported the diff to trunk so
> it would at least apply cleanly), it just crashes ejabberd completely
> due to using hooks the wrong way. And by crash I don't mean that the
> module crashes, no, it shuts down ejabberd completely!
>
> What am I doing wrong here if it's supposed to work with trunk? Is
> there another version than this one:

seems Oleg did not update code on the site, please see here:
https://forge.process-one.net/browse/ejabberd-modules/jorge/trunk
in mod_logdb folder are patches that work. I will ping Oleg to update  
code or info on the site.

If you have problems ping me on xmpp: zbyszek <at> jabster.pl

pozdrawiam,
Zbyszek Żółkiewski
_______________________________________________
ejabberd mailing list
ejabberd <at> jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Jonathan Schleifer | 1 Jun 2009 20:25

Re: message archiving

Ok, this still gives a few .rej files - of course, because it's against
ejabberd 2.0.3. After manually fixing that, I got:

=INFO REPORT==== 2009-06-01 18:23:21 ===
I(<0.20295.0>:mod_logdb:357) : mod_logdb_pgsql connection established

=ERROR REPORT==== 2009-06-01 18:23:21 ===
** Generic server 'ejabberd_mod_logdb_buddycloud.com' terminating 
** Last message in was start
** When Server state == {state,"buddycloud.com",mod_logdb_pgsql,undefined,
                            undefined,undefined,undefined,
                            [{user,"ejabberd"},
                             {password,"cascade22"},
                             {server,"erebor.buddycloud.com"},
                             {port,5432},
                             {db,"location"},
                             {schema,"public"}],
                            [{pgsql,
                                 [{user,"ejabberd"},
                                  {password,"cascade22"},
                                  {server,"erebor.buddycloud.com"},
                                  {port,5432},
                                  {db,"location"},
                                  {schema,"public"}]}],
                            true,[],none,30,10,true}
** Reason for termination == 
** {'function not exported',
       [{ejabberd_ctl,unregister_commands,
            ["buddycloud.com",
             [{"rebuild_stats",
               "rebuild mod_logdb module stats for vhost"}],
             mod_logdb,rebuild_stats]},
        {mod_logdb,cleanup,1},
        {mod_logdb,terminate,2},
        {gen_server,terminate,6},
        {proc_lib,init_p,5}]}

=ERROR REPORT==== 2009-06-01 18:23:21 ===
** Generic server 'ejabberd_mod_logdb_buddycloud.com' terminating 
** Last message in was start
** When Server state == {state,"buddycloud.com",mod_logdb_pgsql,undefined,
                            undefined,undefined,undefined,
                            [{user,"ejabberd"},
                             {password,"cascade22"},
                             {server,"erebor.buddycloud.com"},
                             {port,5432},
                             {db,"location"},
                             {schema,"public"}],
                            [{pgsql,
                                 [{user,"ejabberd"},
                                  {password,"cascade22"},
                                  {server,"erebor.buddycloud.com"},
                                  {port,5432},
                                  {db,"location"},
                                  {schema,"public"}]}],
                            true,[],none,30,10,true}
** Reason for termination == 
** {'function not exported',
       [{ejabberd_ctl,unregister_commands,
            ["buddycloud.com",
             [{"rebuild_stats",
               "rebuild mod_logdb module stats for vhost"}],
             mod_logdb,rebuild_stats]},
        {mod_logdb,cleanup,1},
        {mod_logdb,terminate,2},
        {gen_server,terminate,6},
        {proc_lib,init_p,5}]}

=INFO REPORT==== 2009-06-01 18:23:21 ===
I(<0.20314.0>:mod_logdb:357) : mod_logdb_pgsql connection established

=ERROR REPORT==== 2009-06-01 18:23:21 ===
** Generic server 'ejabberd_mod_logdb_buddycloud.com' terminating 
** Last message in was start
** When Server state == {state,"buddycloud.com",mod_logdb_pgsql,undefined,
                            undefined,undefined,undefined,
                            [{user,"ejabberd"},
                             {password,"cascade22"},
                             {server,"erebor.buddycloud.com"},
                             {port,5432},
                             {db,"location"},
                             {schema,"public"}],
                            [{pgsql,
                                 [{user,"ejabberd"},
                                  {password,"cascade22"},
                                  {server,"erebor.buddycloud.com"},
                                  {port,5432},
                                  {db,"location"},
                                  {schema,"public"}]}],
                            true,[],none,30,10,true}
** Reason for termination == 
** {'function not exported',
       [{ejabberd_ctl,unregister_commands,
            ["buddycloud.com",
             [{"rebuild_stats",
               "rebuild mod_logdb module stats for vhost"}],
             mod_logdb,rebuild_stats]},
        {mod_logdb,cleanup,1},
        {mod_logdb,terminate,2},
        {gen_server,terminate,6},
        {proc_lib,init_p,5}]}

=ERROR REPORT==== 2009-06-01 18:23:21 ===
** Generic server 'ejabberd_mod_logdb_buddycloud.com' terminating 
** Last message in was start
** When Server state == {state,"buddycloud.com",mod_logdb_pgsql,undefined,
                            undefined,undefined,undefined,
                            [{user,"ejabberd"},
                             {password,"cascade22"},
                             {server,"erebor.buddycloud.com"},
                             {port,5432},
                             {db,"location"},
                             {schema,"public"}],
                            [{pgsql,
                                 [{user,"ejabberd"},
                                  {password,"cascade22"},
                                  {server,"erebor.buddycloud.com"},
                                  {port,5432},
                                  {db,"location"},
                                  {schema,"public"}]}],
                            true,[],none,30,10,true}
** Reason for termination == 
** {'function not exported',
       [{ejabberd_ctl,unregister_commands,
            ["buddycloud.com",
             [{"rebuild_stats",
               "rebuild mod_logdb module stats for vhost"}],
             mod_logdb,rebuild_stats]},
        {mod_logdb,cleanup,1},
        {mod_logdb,terminate,2},
        {gen_server,terminate,6},
        {proc_lib,init_p,5}]}

=INFO REPORT==== 2009-06-01 18:23:21 ===
I(<0.20319.0>:mod_logdb:357) : mod_logdb_pgsql connection established

=ERROR REPORT==== 2009-06-01 18:23:21 ===
** Generic server 'ejabberd_mod_logdb_buddycloud.com' terminating 
** Last message in was start
** When Server state == {state,"buddycloud.com",mod_logdb_pgsql,undefined,
                            undefined,undefined,undefined,
                            [{user,"ejabberd"},
                             {password,"cascade22"},
                             {server,"erebor.buddycloud.com"},
                             {port,5432},
                             {db,"location"},
                             {schema,"public"}],
                            [{pgsql,
                                 [{user,"ejabberd"},
                                  {password,"cascade22"},
                                  {server,"erebor.buddycloud.com"},
                                  {port,5432},
                                  {db,"location"},
                                  {schema,"public"}]}],
                            true,[],none,30,10,true}
** Reason for termination == 
** {'function not exported',
       [{ejabberd_ctl,unregister_commands,
            ["buddycloud.com",
             [{"rebuild_stats",
               "rebuild mod_logdb module stats for vhost"}],
             mod_logdb,rebuild_stats]},
        {mod_logdb,cleanup,1},
        {mod_logdb,terminate,2},
        {gen_server,terminate,6},
        {proc_lib,init_p,5}]}

=ERROR REPORT==== 2009-06-01 18:23:21 ===
** Generic server 'ejabberd_mod_logdb_buddycloud.com' terminating 
** Last message in was start
** When Server state == {state,"buddycloud.com",mod_logdb_pgsql,undefined,
                            undefined,undefined,undefined,
                            [{user,"ejabberd"},
                             {password,"cascade22"},
                             {server,"erebor.buddycloud.com"},
                             {port,5432},
                             {db,"location"},
                             {schema,"public"}],
                            [{pgsql,
                                 [{user,"ejabberd"},
                                  {password,"cascade22"},
                                  {server,"erebor.buddycloud.com"},
                                  {port,5432},
                                  {db,"location"},
                                  {schema,"public"}]}],
                            true,[],none,30,10,true}
** Reason for termination == 
** {'function not exported',
       [{ejabberd_ctl,unregister_commands,
            ["buddycloud.com",
             [{"rebuild_stats",
               "rebuild mod_logdb module stats for vhost"}],
             mod_logdb,rebuild_stats]},
        {mod_logdb,cleanup,1},
        {mod_logdb,terminate,2},
        {gen_server,terminate,6},
        {proc_lib,init_p,5}]}

=INFO REPORT==== 2009-06-01 18:23:21 ===
I(<0.20324.0>:mod_logdb:357) : mod_logdb_pgsql connection established

=ERROR REPORT==== 2009-06-01 18:23:21 ===
** Generic server 'ejabberd_mod_logdb_buddycloud.com' terminating 
** Last message in was start
** When Server state == {state,"buddycloud.com",mod_logdb_pgsql,undefined,
                            undefined,undefined,undefined,
                            [{user,"ejabberd"},
                             {password,"cascade22"},
                             {server,"erebor.buddycloud.com"},
                             {port,5432},
                             {db,"location"},
                             {schema,"public"}],
                            [{pgsql,
                                 [{user,"ejabberd"},
                                  {password,"cascade22"},
                                  {server,"erebor.buddycloud.com"},
                                  {port,5432},
                                  {db,"location"},
                                  {schema,"public"}]}],
                            true,[],none,30,10,true}
** Reason for termination == 
** {'function not exported',
       [{ejabberd_ctl,unregister_commands,
            ["buddycloud.com",
             [{"rebuild_stats",
               "rebuild mod_logdb module stats for vhost"}],
             mod_logdb,rebuild_stats]},
        {mod_logdb,cleanup,1},
        {mod_logdb,terminate,2},
        {gen_server,terminate,6},
        {proc_lib,init_p,5}]}

=ERROR REPORT==== 2009-06-01 18:23:21 ===
** Generic server 'ejabberd_mod_logdb_buddycloud.com' terminating 
** Last message in was start
** When Server state == {state,"buddycloud.com",mod_logdb_pgsql,undefined,
                            undefined,undefined,undefined,
                            [{user,"ejabberd"},
                             {password,"cascade22"},
                             {server,"erebor.buddycloud.com"},
                             {port,5432},
                             {db,"location"},
                             {schema,"public"}],
                            [{pgsql,
                                 [{user,"ejabberd"},
                                  {password,"cascade22"},
                                  {server,"erebor.buddycloud.com"},
                                  {port,5432},
                                  {db,"location"},
                                  {schema,"public"}]}],
                            true,[],none,30,10,true}
** Reason for termination == 
** {'function not exported',
       [{ejabberd_ctl,unregister_commands,
            ["buddycloud.com",
             [{"rebuild_stats",
               "rebuild mod_logdb module stats for vhost"}],
             mod_logdb,rebuild_stats]},
        {mod_logdb,cleanup,1},
        {mod_logdb,terminate,2},
        {gen_server,terminate,6},
        {proc_lib,init_p,5}]}

=INFO REPORT==== 2009-06-01 18:23:21 ===
I(<0.20300.0>:ejabberd_listener:201) : (#Port<0.15467>) Accepted connection
{{209,85,162,129},44206} -> {{78,47,197,187},5269}

=INFO REPORT==== 2009-06-01 18:23:21 ===
I(<0.20329.0>:mod_logdb:357) : mod_logdb_pgsql connection established

=ERROR REPORT==== 2009-06-01 18:23:21 ===
** Generic server 'ejabberd_mod_logdb_buddycloud.com' terminating 
** Last message in was start
** When Server state == {state,"buddycloud.com",mod_logdb_pgsql,undefined,
                            undefined,undefined,undefined,
                            [{user,"ejabberd"},
                             {password,"cascade22"},
                             {server,"erebor.buddycloud.com"},
                             {port,5432},
                             {db,"location"},
                             {schema,"public"}],
                            [{pgsql,
                                 [{user,"ejabberd"},
                                  {password,"cascade22"},
                                  {server,"erebor.buddycloud.com"},
                                  {port,5432},
                                  {db,"location"},
                                  {schema,"public"}]}],
                            true,[],none,30,10,true}
** Reason for termination == 
** {'function not exported',
       [{ejabberd_ctl,unregister_commands,
            ["buddycloud.com",
             [{"rebuild_stats",
               "rebuild mod_logdb module stats for vhost"}],
             mod_logdb,rebuild_stats]},
        {mod_logdb,cleanup,1},
        {mod_logdb,terminate,2},
        {gen_server,terminate,6},
        {proc_lib,init_p,5}]}

=ERROR REPORT==== 2009-06-01 18:23:21 ===
** Generic server 'ejabberd_mod_logdb_buddycloud.com' terminating 
** Last message in was start
** When Server state == {state,"buddycloud.com",mod_logdb_pgsql,undefined,
                            undefined,undefined,undefined,
                            [{user,"ejabberd"},
                             {password,"cascade22"},
                             {server,"erebor.buddycloud.com"},
                             {port,5432},
                             {db,"location"},
                             {schema,"public"}],
                            [{pgsql,
                                 [{user,"ejabberd"},
                                  {password,"cascade22"},
                                  {server,"erebor.buddycloud.com"},
                                  {port,5432},
                                  {db,"location"},
                                  {schema,"public"}]}],
                            true,[],none,30,10,true}
** Reason for termination == 
** {'function not exported',
       [{ejabberd_ctl,unregister_commands,
            ["buddycloud.com",
             [{"rebuild_stats",
               "rebuild mod_logdb module stats for vhost"}],
             mod_logdb,rebuild_stats]},
        {mod_logdb,cleanup,1},
        {mod_logdb,terminate,2},
        {gen_server,terminate,6},
        {proc_lib,init_p,5}]}

=INFO REPORT==== 2009-06-01 18:23:21 ===
I(<0.20336.0>:mod_logdb:357) : mod_logdb_pgsql connection established

=ERROR REPORT==== 2009-06-01 18:23:21 ===
** Generic server 'ejabberd_mod_logdb_buddycloud.com' terminating 
** Last message in was start
** When Server state == {state,"buddycloud.com",mod_logdb_pgsql,undefined,
                            undefined,undefined,undefined,
                            [{user,"ejabberd"},
                             {password,"cascade22"},
                             {server,"erebor.buddycloud.com"},
                             {port,5432},
                             {db,"location"},
                             {schema,"public"}],
                            [{pgsql,
                                 [{user,"ejabberd"},
                                  {password,"cascade22"},
                                  {server,"erebor.buddycloud.com"},
                                  {port,5432},
                                  {db,"location"},
                                  {schema,"public"}]}],
                            true,[],none,30,10,true}
** Reason for termination == 
** {'function not exported',
       [{ejabberd_ctl,unregister_commands,
            ["buddycloud.com",
             [{"rebuild_stats",
               "rebuild mod_logdb module stats for vhost"}],
             mod_logdb,rebuild_stats]},
        {mod_logdb,cleanup,1},
        {mod_logdb,terminate,2},
        {gen_server,terminate,6},
        {proc_lib,init_p,5}]}

=ERROR REPORT==== 2009-06-01 18:23:21 ===
E(<0.19760.0>:gen_mod:95) : {noproc,
                             {gen_server,call,
                              [ejabberd_sup,
                               {terminate_child,
                                'ejabberd_mod_logdb_buddycloud.com'},
                               infinity]}}

=ERROR REPORT==== 2009-06-01 18:23:21 ===
E(<0.19760.0>:gen_mod:95) : {noproc,
                             {gen_server,call,
                              [ejabberd_hooks,
                               {delete,user_send_packet,"buddycloud.com",
                                mod_service_log,log_user_send,50}]}}

=ERROR REPORT==== 2009-06-01 18:23:21 ===
E(<0.19760.0>:gen_mod:95) : {noproc,
                                {gen_server,call,
                                    ['ejabberd_mod_archive_odbc_buddycloud.com',
                                     stop]}}

=ERROR REPORT==== 2009-06-01 18:23:21 ===
E(<0.19760.0>:gen_mod:95) : {noproc,
                             {gen_server,call,
                              [ejabberd_hooks,
                               {delete,user_send_packet,"buddycloud.com",
                                mod_logxml,send_packet,90}]}}

=ERROR REPORT==== 2009-06-01 18:23:21 ===
E(<0.19760.0>:gen_mod:95) : {noproc,
                                {gen_server,call,
                                    ['ejabberd_mod_proxy65_service_buddycloud.com',
                                     get_port_ip]}}

=ERROR REPORT==== 2009-06-01 18:23:21 ===
E(<0.19760.0>:gen_mod:95) : {badarg,[{ejabberd_local,unregister_iq_handler,2},
                                     {gen_mod,stop_module_keep_config,2},
                                     {lists,foreach,2},
                                     {ejabberd_app,prep_stop,1},
                                     {application_master,prep_stop,2},
                                     {application_master,loop_it,4}]}

=ERROR REPORT==== 2009-06-01 18:23:21 ===
E(<0.19760.0>:gen_mod:95) : {noproc,
                             {gen_server,call,
                              [ejabberd_hooks,
                               {delete,remove_user,"buddycloud.com",
                                mod_last_odbc,remove_user,50}]}}

=ERROR REPORT==== 2009-06-01 18:23:21 ===
E(<0.19760.0>:gen_mod:95) : {badarg,[{ejabberd_local,unregister_iq_handler,2},
                                     {gen_mod,stop_module_keep_config,2},
                                     {lists,foreach,2},
                                     {ejabberd_app,prep_stop,1},
                                     {application_master,prep_stop,2},
                                     {application_master,loop_it,4}]}

=ERROR REPORT==== 2009-06-01 18:23:21 ===
E(<0.19760.0>:gen_mod:95) : {noproc,
                                {gen_server,call,
                                    ['ejabberd_mod_pubsub_buddycloud.com',
                                     stop]}}

=ERROR REPORT==== 2009-06-01 18:23:21 ===
E(<0.19760.0>:gen_mod:95) : {noproc,
                             {gen_server,call,
                              [ejabberd_hooks,
                               {delete,webadmin_menu_host,"buddycloud.com",
                                mod_shared_roster,webadmin_menu,70}]}}

=ERROR REPORT==== 2009-06-01 18:23:21 ===
E(<0.19760.0>:gen_mod:95) : {noproc,
                                {gen_server,call,
                                    ['ejabberd_mod_muc_log_buddycloud.com',
                                     stop]}}

=ERROR REPORT==== 2009-06-01 18:23:21 ===
E(<0.19760.0>:gen_mod:95) : {noproc,
                             {gen_server,call,
                              [ejabberd_sup,
                               {terminate_child,
                                'ejabberd_mod_muc_sup_buddycloud.com'},
                               infinity]}}

=ERROR REPORT==== 2009-06-01 18:23:21 ===
E(<0.19760.0>:gen_mod:95) : {noproc,
                                {gen_server,call,
                                    [ejabberd_sup,
                                     {terminate_child,ejabberd_http_bind_sup},
                                     infinity]}}

=ERROR REPORT==== 2009-06-01 18:23:21 ===
E(<0.19760.0>:gen_mod:95) : {noproc,
                                {gen_server,call,
                                    ['ejabberd_mod_caps_buddycloud.com',
                                     stop]}}

=ERROR REPORT==== 2009-06-01 18:23:21 ===
E(<0.19760.0>:gen_mod:95) : {noproc,
                             {gen_server,call,
                              [ejabberd_hooks,
                               {delete,remove_user,"buddycloud.com",
                                mod_private,remove_user,50}]}}

=ERROR REPORT==== 2009-06-01 18:23:21 ===
E(<0.19760.0>:gen_mod:95) : {noproc,
                             {gen_server,call,
                              [ejabberd_hooks,
                               {delete,offline_message_hook,"buddycloud.com",
                                mod_offline_odbc,store_packet,50}]}}

=ERROR REPORT==== 2009-06-01 18:23:21 ===
E(<0.19760.0>:gen_mod:95) : {noproc,
                             {gen_server,call,
                              [ejabberd_hooks,
                               {delete,remove_user,"buddycloud.com",
                                mod_vcard_odbc,remove_user,50}]}}

=ERROR REPORT==== 2009-06-01 18:23:21 ===
E(<0.19760.0>:gen_mod:95) : {noproc,
                             {gen_server,call,
                              [ejabberd_hooks,
                               {delete,disco_sm_items,"buddycloud.com",
                                mod_disco,get_publish_items,75}]}}

=ERROR REPORT==== 2009-06-01 18:23:21 ===
E(<0.19760.0>:gen_mod:95) : {badarg,[{ejabberd_local,unregister_iq_handler,2},
                                     {gen_mod,stop_module_keep_config,2},
                                     {lists,foreach,2},
                                     {ejabberd_app,prep_stop,1},
                                     {application_master,prep_stop,2},
                                     {application_master,loop_it,4}]}

=ERROR REPORT==== 2009-06-01 18:23:21 ===
E(<0.19760.0>:gen_mod:95) : {noproc,
                             {gen_server,call,
                              [ejabberd_hooks,
                               {delete,adhoc_sm_commands,"buddycloud.com",
                                mod_configure,adhoc_sm_commands,50}]}}

=ERROR REPORT==== 2009-06-01 18:23:21 ===
E(<0.19760.0>:gen_mod:95) : {noproc,
                             {gen_server,call,
                              [ejabberd_hooks,
                               {delete,privacy_iq_get,"buddycloud.com",
                                mod_privacy,process_iq_get,50}]}}

=ERROR REPORT==== 2009-06-01 18:23:21 ===
E(<0.19760.0>:gen_mod:95) : {noproc,
                             {gen_server,call,
                              [ejabberd_hooks,
                               {delete,roster_get,"buddycloud.com",
                                mod_roster_odbc,get_user_roster,50}]}}

=ERROR REPORT==== 2009-06-01 18:23:21 ===
E(<0.19760.0>:gen_mod:95) : {noproc,
                             {gen_server,call,
                              [ejabberd_hooks,
                               {delete,c2s_stream_features,"buddycloud.com",
                                mod_register,stream_feature_register,50}]}}

=ERROR REPORT==== 2009-06-01 18:23:21 ===
E(<0.19760.0>:gen_mod:95) : {noproc,
                             {gen_server,call,
                              [ejabberd_hooks,
                               {delete,adhoc_local_commands,"buddycloud.com",
                                mod_announce,announce_commands,50}]}}

=ERROR REPORT==== 2009-06-01 18:23:21 ===
E(<0.19760.0>:gen_mod:95) : {noproc,
                             {gen_server,call,
                              [ejabberd_hooks,
                               {delete,user_available_hook,"buddycloud.com",
                                mod_statsdx,user_login,90}]}}

=ERROR REPORT==== 2009-06-01 18:23:21 ===
E(<0.19760.0>:gen_mod:95) : {noproc,
                             {gen_server,call,
                              [ejabberd_hooks,
                               {delete,adhoc_local_commands,"buddycloud.com",
                                mod_adhoc,ping_command,100}]}}

=INFO REPORT==== 2009-06-01 18:23:21 ===
I(<0.19760.0>:ejabberd_app:83) : ejabberd 2.1.0-alpha is stopped in the node ejabberd <at> localhost

=INFO REPORT==== 2009-06-01 18:23:22 ===
    application: ejabberd
    exited: shutdown
    type: temporary

And tada, it shut down the server again. So no difference to the patch
that's linked on the page, it doesn't work with trunk as well.

--

-- 
Jonathan
_______________________________________________
ejabberd mailing list
ejabberd <at> jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Badlop | 1 Jun 2009 20:35
Picon

Re: access_commands in ejabberd.cfg and vhosts (ejabberd2.1)

2009/5/31 Pablo Platt <pablo.platt <at> yahoo.com>:
> I'm using the trunk version ejabberd2.1
>
> I have two vhosts example1.com and example2.com
> I want to configure mod_rest to allow admin1 from example1.com to execute
> commands only related to host example1.com
> and the same for admin2 from example2.com to be able to execute commands
> only related to host example2.com

I found a bug in mod_rest, another in ejabberd_commands and another in
your python test script. Update ejabberd trunk and mod_rest to get the
fixes.

The problem in your python script is that you must send the HTTP call
to the correct host: example1.com or example2.com, not localhost.

The configuration you passed to me was correct. Anyway, I reproduce
again here the working config I tried:

In ejabberd.cfg listen section:
{listen, [
  {8080, ejabberd_http, [
                         {request_handlers, [
                                             {["rest"], mod_rest}
                                            ]}
                        ]},
  ...

]}.

At the bottom of ejabberd.cfg :
{include_config_file, "/etc/ejabberd/custom1.cfg"}.
{include_config_file, "/etc/ejabberd/custom2.cfg"}.

Optionally, instead of the previous lines you may want to put a more
restrictive:
{include_config_file, "/etc/ejabberd/custom1.cfg", [{allow_only,
[host_config]}]}.
{include_config_file, "/etc/ejabberd/custom2.cfg", [{allow_only,
[host_config]}]}.

Content of custom1.cfg :
{host_config, "example1.com",
 [
  {acl, admin1, {user, "admin1", "example1.com"}},
  {access, rest1, [{allow, admin1}]},
  {{add, modules},
   [
    {mod_rest,
     [
      {access_commands,
       [
        {rest1, all, [{host, "example1.com"}]}
       ]}
     ]}
   ]}
 ]}.

Content of custom2.cfg
{host_config, "example2.com",
 [
  {acl, admin2, {user, "admin2", "example2.com"}},
  {access, rest2, [{allow, admin2}]},
  {{add, modules},
   [
    {mod_rest,
     [
      {access_commands,
       [
        {rest2, all, [{host, "example2.com"}]}
       ]}
     ]}
   ]}
 ]}.

Then create two accounts:
  admin1 <at> example1.com with password pass1
  admin2 <at> example2.com with password pass2

And finally, to test this setup, try this simple script:

echo "*** This works:"
echo ""
echo "--auth admin1 example1.com pass1 registered_users example1.com" >aa
echo "---" >>aa
cat aa | lynx http://example1.com:8080/rest/ -mime_header -post_data -
echo ""
echo ""

echo "*** This works:"
echo ""
echo "--auth admin2 example2.com pass2 registered_users example2.com" >aa
echo "---" >>aa
cat aa | lynx http://example2.com:8080/rest/ -mime_header -post_data -
echo ""
echo ""

echo "*** This doesn't work:"
echo ""
echo "--auth admin1 example1.com pass1 registered_users example2.com" >aa
echo "---" >>aa
cat aa | lynx http://example1.com:8080/rest/ -mime_header -post_data -
echo ""
echo ""

echo "*** This doesn't work:"
echo ""
echo "--auth admin1 example1.com pass1 registered_users example2.com" >aa
echo "---" >>aa
cat aa | lynx http://example2.com:8080/rest/ -mime_header -post_data -
echo ""
echo ""

echo "*** This doesn't work:"
echo ""
echo "--auth admin1 example1.com pass1 registered_users example1.com" >aa
echo "---" >>aa
cat aa | lynx http://example2.com:8080/rest/ -mime_header -post_data -
echo ""
echo ""

echo "*** This doesn't work:"
echo ""
echo "--auth admin2 example2.com pass2 registered_users example1.com" >aa
echo "---" >>aa
cat aa | lynx http://example1.com:8080/rest/ -mime_header -post_data -
echo ""
echo ""

echo "*** This doesn't work:"
echo ""
echo "--auth admin2 example2.com pass2 registered_users example1.com" >aa
echo "---" >>aa
cat aa | lynx http://example2.com:8080/rest/ -mime_header -post_data -
echo ""

---
Badlop
ProcessOne
Zbyszek Żółkiewski | 1 Jun 2009 20:51
Picon
Gravatar

Re: message archiving


On 2009-06-01, at 20:25, Jonathan Schleifer wrote:

> Ok, this still gives a few .rej files - of course, because it's  
> against
> ejabberd 2.0.3. After manually fixing that, I got:
>
> And tada, it shut down the server again. So no difference to the patch
> that's linked on the page, it doesn't work with trunk as well.

do:

1) apply mod_logdb patch 2.0.3 (ignore rejects)
2) restore files broken by patch (from svn)
3) apply patch-src-mod_logdb-disable_ejabberd_ctl.diff

and you're done.

dont forget to patch mysql driver with user-flags patch

pozdr,
Zbyszek

Gmane