#5310 NORM Update.: automatically enable shared roster on school server

Zarro Boogs per Child bugtracker at laptop.org
Wed Dec 5 13:30:57 EST 2007


#5310: automatically enable shared roster on school server
------------------------------+---------------------------------------------
  Reporter:  daf              |       Owner:  robot101
      Type:  defect           |      Status:  new     
  Priority:  normal           |   Milestone:  Update.1
 Component:  telepathy-other  |     Version:          
Resolution:                   |    Keywords:          
  Verified:  0                |  
------------------------------+---------------------------------------------

Comment(by robot101):

 Notes from Aleksey on the subject:

 Robert McQueen: is there some way to pre-configure the shared roster on an
 ejabberd without having to use the web interface?
 Aleksey Schepin: no user-friendly way
 Robert McQueen: ok, how about unfriendly? :D the OLPC project need to be
 able to make an ejabberd package which can be automatically configured for
 their school servers
 Aleksey Schepin: well there are 2 tables in mnesia: sr_user and sr_group
 Aleksey Schepin: you need to reproduce them on installations
 Robert McQueen: ok
 Aleksey Schepin: and there are many ways of doing that
 Robert McQueen: are the mnesia tables platform or endian independent, or
 is copying them between machines unsafe?
 Aleksey Schepin: hard question :)
 Aleksey Schepin: they might be independent
 Aleksey Schepin: one of ways is to make a backup of these two tables, and
 then restore it
 Aleksey Schepin: if these tables are small, maybe it will be easier for
 you to include some small script to insert these records
 Robert McQueen: the tables are small, we just create one 'Everybody' group
 that has @all@ in it :)
 Robert McQueen: do you have any examples on how a script would look?
 Aleksey Schepin: for example if you have these records:
 > ets:tab2list(sr_user).
 [{sr_user,{[],"all"},{"qwe","e.e.localhost"}},
  {sr_user,{"3333","e.localhost"},{"asd","e.localhost"}},
  {sr_user,{"1111","e.localhost"},{"asd","e.localhost"}},
  {sr_user,{"2222","e.localhost"},{"asd","e.localhost"}}]
 then you run something like this after ejabberd starting:
 mnesia:transaction(fun() -> lists:foreach(fun(R) -> mnesia:write(R) end,
 [{sr_user ...}, <these records here> ...]) end).
 Robert McQueen: cool, ok
 Robert McQueen: from erl after -connect to ejabberd?
 Aleksey Schepin: -remsh, yes
 Robert McQueen: ok

-- 
Ticket URL: <http://dev.laptop.org/ticket/5310#comment:3>
One Laptop Per Child <http://dev.laptop.org>
OLPC bug tracking system



More information about the Bugs mailing list