From 46201eefc153c031a9b745ecdddc2f87211bd8f0 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 15 Feb 2025 15:32:06 +0100 Subject: [PATCH] configs/trunk: Use new array append feature to simplify --- configs/prosody-trunk.cfg.lua | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/configs/prosody-trunk.cfg.lua b/configs/prosody-trunk.cfg.lua index 15658f1..4f4bce9 100644 --- a/configs/prosody-trunk.cfg.lua +++ b/configs/prosody-trunk.cfg.lua @@ -98,12 +98,12 @@ local default_modules = { --"welcome"; -- Welcome users who register accounts } -for _, module_name in ipairs(_split(ENV_PROSODY_ENABLE_MODULES) or {}) do - default_modules[#default_modules+1] = module_name; +if ENV_PROSODY_ENABLE_MODULES then + modules_enabled:append(_split(ENV_PROSODY_ENABLE_MODULES)) end if ENV_PROSODY_TURN_SECRET then - default_modules[#default_modules+1] = "turn_external"; + modules_enabled:append{ "turn_external" }; turn_external_secret = ENV_PROSODY_TURN_SECRET turn_external_host = ENV_PROSODY_TURN_HOST turn_external_port = ENV_PROSODY_TURN_PORT @@ -111,17 +111,12 @@ if ENV_PROSODY_TURN_SECRET then end if ENV_PROSODY_RETENTION_DAYS or ENV_PROSODY_ARCHIVE_EXPIRY_DAYS then - default_modules[#default_modules+1] = "mam"; + modules_enabled:append{ "mam" } end modules_enabled = default_modules -local env_disabled_modules = {}; -for _, module_name in ipairs(_split(ENV_PROSODY_DISABLE_MODULES) or {}) do - env_disabled_modules[#env_disabled_modules+1] = module_name; -end - -modules_disabled = env_disabled_modules +modules_disabled = _split(ENV_PROSODY_DISABLE_MODULES) -- Server-to-server authentication