Open anirbandas18 opened 2 months ago
Hello @anirbandas18!
In order to use this feature you first need to create a ConfigMap with your plugin files inside. Then you'll need to specify the ConfigMap name and files inside it like so:
prosody:
extraVolumes:
- name: prosody-modules
configMap:
# v Put your ConfigMap name here v #
name: my-custom-prosody-plugins-configmap
extraVolumeMounts:
# Repeat this section for every plugin file...
- name: prosody-modules
subPath: mod_measure_client_presence.lua
mountPath: /prosody-plugins-custom/mod_measure_client_presence.lua
# ...or mount the whole ConfigMap like so:
- name: prosody-modules
mountPath: /prosody-plugins-custom
Hey, I´m running into a similiar issue. I created a custom ConfigMap with my lua script. I send applied it to the cluster and referenced it in my prosody config like explained above.
When restarting prosody its not loading the module. I tried looking at the logs but nothing is mentioned. Do I need to define it somewhere else in my values.yaml file?
Thanks for all the hard work and the new release :)
Can you see this Lua script inside /prosody-plugins-custom
folder in Prosody container?
Can you see the related config in the generated Prosody config in the container?
Yes, inside the container I can see the lua file in the/prosody-plugins-custom
folder.
Here is the content:
local LOGLEVEL = "info"
-- Set this parameter in Prosody config if you dont want cascading updates for
-- affiliation. Cascading updates are needed when the authentication is enabled
-- in Jicofo.
local DISABLE_CASCADING_SET = module:get_option_boolean(
"disable_cascading_set", false
)
local is_admin = require "core.usermanager".is_admin
local is_healthcheck_room = module:require "util".is_healthcheck_room
local timer = require "util.timer"
module:log(LOGLEVEL, "loaded")
local function _is_admin(jid)
return is_admin(jid, module.host)
end
module:hook("muc-occupant-joined", function (event)
local room, occupant = event.room, event.occupant
if is_healthcheck_room(room.jid) or _is_admin(occupant.jid) then
module:log(LOGLEVEL, "skip affiliation, %s", occupant.jid)
return
end
if not event.origin.auth_token then
module:log(LOGLEVEL, "skip affiliation, no token")
return
end
local affiliation = "member"
local context_user = event.origin.jitsi_meet_context_user
if context_user then
if context_user["affiliation"] == "owner" then
affiliation = "owner"
elseif context_user["affiliation"] == "moderator" then
affiliation = "owner"
elseif context_user["affiliation"] == "teacher" then
affiliation = "owner"
elseif context_user["moderator"] == "true" then
affiliation = "owner"
elseif context_user["moderator"] == true then
affiliation = "owner"
end
end
local i = 0
local function setAffiliation()
room:set_affiliation(true, occupant.bare_jid, affiliation)
if DISABLE_CASCADING_SET then return end
if i > 8 then return end
i = i + 1
timer.add_task(0.2 * i, setAffiliation)
end
setAffiliation()
module:log(LOGLEVEL, "affiliation: %s", affiliation)
end)
And here are the mounts:
Mounts: config from config (rw)
config/data from prosody-data (rw)
prosody-plugins-custom/mod_token_affiliation.lua from prosody-modules (rw,path="mod_token_affiliation.lua)
var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-lr2zp (ro)
Could you share the generated Prosody config?
Is token_affiliation
enabled in this config?
The module does not seem to be enabled when checking my config files. Do I have to specify it in any other location, so that it gets enabled? Since this is a standart module from jitsi-contrib, which is already in the docker container under prosody-plugins-contrib. Would it make sense to somehow reference the jitsi-contrib one?
Here is my config file:
prosody:
enabled: true
useExternalProsody: false
server:
extraEnvFrom:
# - secretRef:
# name: '{{ include "prosody.fullname" . }}-jibri'
- secretRef:
name: '{{ include "prosody.fullname" . }}-jicofo'
# - secretRef:
# name: '{{ include "prosody.fullname" . }}-jigasi'
- secretRef:
name: '{{ include "prosody.fullname" . }}-jvb'
- configMapRef:
name: '{{ include "prosody.fullname" . }}-common'
image:
repository: jitsi/prosody
extraVolumes:
- name: prosody-modules
configMap:
name: prosody-modules
extraVolumeMounts:
- name: prosody-modules
subPath: mod_token_affiliation.lua
mountPath: /prosody-plugins-custom/mod_token_affiliation.lua
# service:
# ports:
# If Prosody c2s in needed on private net outside the cluster
# xmppc2snodePort: 30522
custom:
contInit:
_10_config: ""
defaults:
_prosody_cfg_lua: ""
_saslauthd_conf: ""
_jitsi_meet_cfg_lua: ""
tag: "stable-9111"
You don't need to mount the module file since it is already in the official image but you should set XMPP_MUC_MODULES
See the handbook for details
Hi,
I want to use this new feature in order to specify my lua script files as custom prosody plugin into the prosody pod during execution of
helm apply
command using this jitsi-helm chart.However, I am not sure how to make my actual lua script file which is the custom prosody plugin available to this jitsi-helm chart during
helm apply
command in order for this jitsi-helm chart to read the file and ultimately make it available it to the underlying prosody image via the stateful set type pod of prosody from this jitsi-helm chart.Would you be kind enough to throw some light in to the configuration process for specifying this file from the file system to the helm chart when trying to use this feature?