Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. --[[
  2. Copyright (c) 2022, Vsevolod Stakhov <vsevolod@rspamd.com>
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. ]]--
  13. local ansicolors = require "ansicolors"
  14. local function printf(fmt, ...)
  15. print(string.format(fmt, ...))
  16. end
  17. local function highlight(str)
  18. return ansicolors.white .. str .. ansicolors.reset
  19. end
  20. local function print_plugins_table(tbl, what)
  21. local mods = {}
  22. for k, _ in pairs(tbl) do
  23. table.insert(mods, k)
  24. end
  25. printf("Modules %s: %s", highlight(what), table.concat(mods, ", "))
  26. end
  27. return function(args, _)
  28. print_plugins_table(rspamd_plugins_state.enabled, "enabled")
  29. print_plugins_table(rspamd_plugins_state.disabled_explicitly,
  30. "disabled (explicitly)")
  31. print_plugins_table(rspamd_plugins_state.disabled_unconfigured,
  32. "disabled (unconfigured)")
  33. print_plugins_table(rspamd_plugins_state.disabled_redis,
  34. "disabled (no Redis)")
  35. print_plugins_table(rspamd_plugins_state.disabled_experimental,
  36. "disabled (experimental)")
  37. print_plugins_table(rspamd_plugins_state.disabled_failed,
  38. "disabled (failed)")
  39. end