Ticket #5310 (closed enhancement: fixed)

Opened 6 years ago

Last modified 5 years ago

automatically enable shared roster on school server

Reported by: daf Owned by: martin.langhoff
Priority: normal Milestone: xs-0.6
Component: school server Version:
Keywords: schoolserver Cc: gdesmott, wad, jg, kimquirk, morgs
Action Needed: test in build Verified: no
Deployments affected: Blocked By:

Description (last modified by gregorio) (diff)

For Update.1, school servers need to have Ejabberd installed and configured with a shared roster. Currently, enabling the shared roster needs to be done through Ejabberd's web management console. This is not acceptable as configuration needs to be automatic.

Change History

Changed 6 years ago by daf

  • component changed from distro to telepathy-other

Changed 6 years ago by gdesmott

  • cc gdesmott added

Changed 6 years ago 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:



{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

Changed 6 years ago by robot101

  • cc wad, jg added

Will investigate further tomorrow, and ideally we'll be able apply a fix into our OLPC server ejabberd RPM. CCing wad so he can keep abreast of the situation.

Changed 6 years ago by robot101

  • cc kimquirk added

Changed 6 years ago by robot101

Good news: mod_ctlextra adds a command-line way of creating shared roster groups Bad news: it doesn't know how to create @all@ (everyone on the server) groups Good news: I'm learning how to read and write erlang... :P

Changed 6 years ago by morgs

  • cc morgs added
  • next_action set to never set

Changed 6 years ago by gregorio

  • owner changed from robot101 to martin.langhoff
  • next_action changed from never set to test in build
  • description modified (diff)

Hi Martin,

We think this one is ready and may be in the XS code. Can you confirm? Also, can you kick back the link to what ejabberd code is in the XS and how collabora gets fixes included in XS builds?

Let's also add that to the XS release notes for each version.


Greg S

Changed 6 years ago by martin.langhoff

  • keywords schoolserver added

Ah, I had this filed as #7707.

  • This is still a problem on the XS, and would love to see it fixed.
  • We are using a patched 2.0.0 from Collabora, Wad knows more about it.
  • Collabora should ping me when they have a new version, but so far noone at Collabora has answered any of my emails. Perhaps an introduction is needed?
  • No need for release notes, this is in the install documentation.

Changed 6 years ago by gdesmott

In this branch [1] I patched mod_ctlextra.erl to add the following commands to ejabberdctl:

{"srg-set-all-users group host", "add the @all@ pseudo-user to the group on host"},

{"srg-set-online-users group host", "add the @online@ pseudo-user to the group on host"},

So the @online@ shared roster can easily be created using these 2 commands:

ejabberdctl srg-create online schoolserver.random.xs.laptop.org  online online online
ejabberdctl srg-set-online-users online schoolserver.random.xs.laptop.org

Problem: we need the server name to create and configure the group. So if we want to automatically create it when installing the package we need to ask to the user what's the server's name; which is impossible with RPM afaik.

[1] http://git.collabora.co.uk/?p=user/cassidy/ejabberd-rpm;a=shortlog;h=refs/heads/patch-extra

Changed 6 years ago by gdesmott

Alternatively I created this branch [2] which use the mod_push_groups module. The advantage of this approach is to define the shared roster in the ejabberd.cfg configuration file.

Once the package is installed, the user just have to execute the following command to create the group:

ejabberdctl vhost host push-groups

But there is still the same problem as we need to know the host so we can't execute this command at RPM installation.

[2] http://git.collabora.co.uk/?p=user/cassidy/ejabberd-rpm;a=shortlog;h=refs/heads/push-groups

Changed 5 years ago by martin.langhoff

  • type changed from defect to enhancement
  • component changed from telepathy-other to school server
  • milestone changed from 8.2.0 (was Update.2) to xs-0.6

I'm taking this over, and using Guillaume's patch in the integration with Moodle.

Changed 5 years ago by martin.langhoff

  • status changed from new to closed
  • resolution set to fixed


Note: See TracTickets for help on using tickets.