Skip to content

Commit

Permalink
Merge pull request #34 from NethServer/Dev6814
Browse files Browse the repository at this point in the history
Update container authorizations and bind user domains NethServer/dev#6814
  • Loading branch information
stephdl authored Feb 6, 2024
2 parents d8892ec + 24bb6dc commit 97d65e8
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ buildah add "${container}" imageroot /imageroot
buildah add "${container}" ui/dist /ui
# Setup the entrypoint, ask to reserve one TCP port with the label and set a rootless container
buildah config --entrypoint=/ \
--label="org.nethserver.authorizations=traefik@node:certadm node:fwadm" \
--label="org.nethserver.authorizations=traefik@node:certadm node:fwadm cluster:accountconsumer" \
--label="org.nethserver.tcp-ports-demand=0" \
--label="org.nethserver.rootfull=0" \
--label="org.nethserver.images=docker.io/ejabberd/ecs:23.10" \
Expand Down
3 changes: 3 additions & 0 deletions imageroot/actions/configure-module/20configure
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,6 @@ agent.set_env("EJABBERD_PURGE_MNESIA_INTERVAL", mnesia_purge_interval)
agent.set_env("TRAEFIK_LETS_ENCRYPT", le)
agent.set_env("EJABBERD_PURGE_HTTPD_UPLOAD_INTERVAL",purge_httpd_upload_interval)
agent.set_env("EJABBERD_WEBADMIN",webadmin)

# Bind the new domain, overriding previous values (unbind)
agent.bind_user_domains([ldap_domain])
19 changes: 19 additions & 0 deletions imageroot/update-module.d/30bind_user_domain
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env python3

#
# Copyright (C) 2024 Nethesis S.r.l.
# SPDX-License-Identifier: GPL-3.0-or-later
#

import agent
import os
import sys
import json

if not hasattr(agent, 'get_bound_domain_list'):
sys.exit(0) # core version too old, skip and try on next update

user_ldap_domain= os.getenv('EJABBERD_LDAP_DOMAIN')
rdb = agent.redis_connect(use_replica=True)
if user_ldap_domain and not agent.get_bound_domain_list(rdb):
agent.bind_user_domains([user_ldap_domain])
2 changes: 1 addition & 1 deletion ui/public/metadata.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "ejabberd",
"name": "Ejabberd",
"description": {
"en": "ejabberd XMPP server",
"it": "Server XMPP ejabberd"
Expand Down

0 comments on commit 97d65e8

Please sign in to comment.