Opened 7 years ago

Closed 5 years ago

#5310 closed enhancement (fixed)

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
Blocked By: Blocking:
Deployments affected: Action Needed: test in build
Verified: no

Description (last modified by gregorio)

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 (13)

comment:1 Changed 7 years ago by daf

  • Component changed from distro to telepathy-other

comment:2 Changed 7 years ago by gdesmott

  • Cc gdesmott added

comment:3 Changed 7 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:

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

comment:4 Changed 7 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.

comment:5 Changed 7 years ago by robot101

  • Cc kimquirk added

comment:6 Changed 7 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

comment:7 Changed 6 years ago by morgs

  • Action Needed set to never set
  • Cc morgs added

comment:8 Changed 6 years ago by gregorio

  • Action Needed changed from never set to test in build
  • Description modified (diff)
  • Owner changed from robot101 to martin.langhoff

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.

Thanks,

Greg S

comment:9 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.

comment:10 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

comment:11 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

comment:12 Changed 6 years ago by martin.langhoff

  • Component changed from telepathy-other to school server
  • Milestone changed from 8.2.0 (was Update.2) to xs-0.6
  • Type changed from defect to enhancement

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

comment:13 Changed 5 years ago by martin.langhoff

  • Resolution set to fixed
  • Status changed from new to closed

Fixed.

Note: See TracTickets for help on using tickets.