Skip to content

Commit

Permalink
Merge pull request #187 from youmad/master
Browse files Browse the repository at this point in the history
@ALL@ and @online@ in shared roster groups
  • Loading branch information
rroemhild authored Dec 6, 2018
2 parents 252d19d + 5f90ac5 commit b5ea80b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,14 @@ To add users to shared roster groups, separate with whitespace:
EJABBERD_GROUP_MEMBERS=admin@example.ninja:group1@example.ninja user1@test.com:group2@test.com
```

To add all registered users on a virtual host to a shared roster group:

```
EJABBERD_GROUP_MEMBERS=@all@@example.ninja:group1@example.ninja
```

Please take a note of the format: `@all@@example.ninja`. You need to specify not only the special directive `@all@` but also a virtual host separated by `@`.

## SSL
- **EJABBERD_SKIP_MAKE_SSLCERT**: Skip generating ssl certificates. Default: false
- **EJABBERD_SSLCERT_HOST**: SSL Certificate for the hostname.
Expand Down
2 changes: 1 addition & 1 deletion conf/ejabberd.yml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ language: "en"

modules:
mod_adhoc: {}
{%- if env['EJABBERD_MOD_ADMIN_EXTRA'] == "true" %}
{% if env.get('EJABBERD_MOD_ADMIN_EXTRA', true) == "true" %}
mod_admin_extra: {}
{% endif %}
mod_announce: # recommends mod_adhoc
Expand Down
14 changes: 7 additions & 7 deletions scripts/post/30_ejabberd_setup_groups.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ create_group() {
register_group_member() {
local user=$1
local host=$2
local group=$1
local grouphost=$2
local group=$3
local grouphost=$4

echo "Adding ${user} ${host} to roster group ${group}@${grouphost}"
# Do not exit if user is already a member
Expand Down Expand Up @@ -53,13 +53,13 @@ register_all_group_members() {

for member in ${EJABBERD_GROUP_MEMBERS} ; do
local user=${member%%:*}
local group=${user#*:}
local group=${member#*:}

local username=${user%%@*}
local userhost=${user#*@}
local username=${user%@*}
local userhost=${user##*@}

local groupname=${group%%@*}
local grouphost=${group#*@}
local groupname=${group%@*}
local grouphost=${group##*@}

register_group_member ${username} ${userhost} ${groupname} ${grouphost}
done
Expand Down

0 comments on commit b5ea80b

Please sign in to comment.