prosody.cfg.lua 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. {{ $LOG_LEVEL := .Env.LOG_LEVEL | default "info" }}
  2. {{ $XMPP_PORT := .Env.XMPP_PORT | default "5222" -}}
  3. {{ $ENABLE_IPV6 := .Env.ENABLE_IPV6 | default "true" | toBool -}}
  4. {{ $GC_TYPE := .Env.GC_TYPE | default "incremental" -}}
  5. {{ $GC_INC_TH := .Env.GC_INC_TH | default 150 -}}
  6. {{ $GC_INC_SPEED := .Env.GC_INC_SPEED | default 250 -}}
  7. {{ $GC_INC_STEP_SIZE := .Env.GC_INC_STEP_SIZE | default 13 -}}
  8. {{ $GC_GEN_MIN_TH := .Env.GC_GEN_MIN_TH | default 20 -}}
  9. {{ $GC_GEN_MAX_TH := .Env.GC_GEN_MAX_TH | default 100 -}}
  10. -- Prosody Example Configuration File
  11. --
  12. -- Information on configuring Prosody can be found on our
  13. -- website at http://prosody.im/doc/configure
  14. --
  15. -- Tip: You can check that the syntax of this file is correct
  16. -- when you have finished by running: luac -p prosody.cfg.lua
  17. -- If there are any errors, it will let you know what and where
  18. -- they are, otherwise it will keep quiet.
  19. --
  20. -- The only thing left to do is rename this file to remove the .dist ending, and fill in the
  21. -- blanks. Good luck, and happy Jabbering!
  22. ---------- Server-wide settings ----------
  23. -- Settings in this section apply to the whole server and are the default settings
  24. -- for any virtual hosts
  25. -- This is a (by default, empty) list of accounts that are admins
  26. -- for the server. Note that you must create the accounts separately
  27. -- (see http://prosody.im/doc/creating_accounts for info)
  28. -- Example: admins = { "user1@example.com", "user2@example.net" }
  29. admins = { }
  30. -- Enable use of libevent for better performance under high load
  31. -- For more information see: http://prosody.im/doc/libevent
  32. --use_libevent = true;
  33. -- This is the list of modules Prosody will load on startup.
  34. -- It looks for mod_modulename.lua in the plugins folder, so make sure that exists too.
  35. -- Documentation on modules can be found at: http://prosody.im/doc/modules
  36. modules_enabled = {
  37. -- Generally required
  38. "roster"; -- Allow users to have a roster. Recommended ;)
  39. "saslauth"; -- Authentication for clients and servers. Recommended if you want to log in.
  40. "tls"; -- Add support for secure TLS on c2s/s2s connections
  41. "dialback"; -- s2s dialback support
  42. "disco"; -- Service discovery
  43. -- Not essential, but recommended
  44. "private"; -- Private XML storage (for room bookmarks, etc.)
  45. "vcard"; -- Allow users to set vCards
  46. "limits"; -- Enable bandwidth limiting for XMPP connections
  47. -- These are commented by default as they have a performance impact
  48. --"privacy"; -- Support privacy lists
  49. --"compression"; -- Stream compression (Debian: requires lua-zlib module to work)
  50. -- Nice to have
  51. "version"; -- Replies to server version requests
  52. "uptime"; -- Report how long server has been running
  53. "time"; -- Let others know the time here on this server
  54. "ping"; -- Replies to XMPP pings with pongs
  55. "pep"; -- Enables users to publish their mood, activity, playing music and more
  56. "register"; -- Allow users to register on this server using a client and change passwords
  57. -- Admin interfaces
  58. "admin_adhoc"; -- Allows administration via an XMPP client that supports ad-hoc commands
  59. --"admin_telnet"; -- Opens telnet console interface on localhost port 5582
  60. -- HTTP modules
  61. --"bosh"; -- Enable BOSH clients, aka "Jabber over HTTP"
  62. --"http_files"; -- Serve static files from a directory over HTTP
  63. -- Other specific functionality
  64. "posix"; -- POSIX functionality, sends server to background, enables syslog, etc.
  65. --"groups"; -- Shared roster support
  66. --"announce"; -- Send announcement to all online users
  67. --"welcome"; -- Welcome users who register accounts
  68. --"watchregistrations"; -- Alert admins of registrations
  69. --"motd"; -- Send a message to users when they log in
  70. --"legacyauth"; -- Legacy authentication. Only used by some old clients and bots.
  71. {{ if .Env.GLOBAL_MODULES }}
  72. "{{ join "\";\n\"" (splitList "," .Env.GLOBAL_MODULES) }}";
  73. {{ end }}
  74. };
  75. component_ports = { }
  76. https_ports = { }
  77. -- These modules are auto-loaded, but should you want
  78. -- to disable them then uncomment them here:
  79. modules_disabled = {
  80. -- "offline"; -- Store offline messages
  81. -- "c2s"; -- Handle client connections
  82. "s2s"; -- Handle server-to-server connections
  83. };
  84. -- Disable account creation by default, for security
  85. -- For more information see http://prosody.im/doc/creating_accounts
  86. allow_registration = false;
  87. -- Enable rate limits for incoming client and server connections
  88. limits = {
  89. c2s = {
  90. rate = "10kb/s";
  91. };
  92. s2sin = {
  93. rate = "30kb/s";
  94. };
  95. }
  96. --Prosody garbage collector settings
  97. --For more information see https://prosody.im/doc/advanced_gc
  98. {{ if eq $GC_TYPE "generational" }}
  99. gc = {
  100. mode = "generational";
  101. minor_threshold = {{ $GC_GEN_MIN_TH }};
  102. major_threshold = {{ $GC_GEN_MAX_TH }};
  103. }
  104. {{ else }}
  105. gc = {
  106. mode = "incremental";
  107. threshold = {{ $GC_INC_TH }};
  108. speed = {{ $GC_INC_SPEED }};
  109. step_size = {{ $GC_INC_STEP_SIZE }};
  110. }
  111. {{ end }}
  112. pidfile = "/config/data/prosody.pid";
  113. -- Force clients to use encrypted connections? This option will
  114. -- prevent clients from authenticating unless they are using encryption.
  115. c2s_require_encryption = false
  116. -- set c2s port
  117. c2s_ports = { {{ $XMPP_PORT }} } -- Listen on specific c2s port
  118. {{ if $ENABLE_IPV6 }}
  119. c2s_interfaces = { "*", "::" }
  120. {{ else }}
  121. c2s_interfaces = { "*" }
  122. {{ end }}
  123. -- Force certificate authentication for server-to-server connections?
  124. -- This provides ideal security, but requires servers you communicate
  125. -- with to support encryption AND present valid, trusted certificates.
  126. -- NOTE: Your version of LuaSec must support certificate verification!
  127. -- For more information see http://prosody.im/doc/s2s#security
  128. s2s_secure_auth = false
  129. -- Many servers don't support encryption or have invalid or self-signed
  130. -- certificates. You can list domains here that will not be required to
  131. -- authenticate using certificates. They will be authenticated using DNS.
  132. --s2s_insecure_domains = { "gmail.com" }
  133. -- Even if you leave s2s_secure_auth disabled, you can still require valid
  134. -- certificates for some domains by specifying a list here.
  135. --s2s_secure_domains = { "jabber.org" }
  136. -- Select the authentication backend to use. The 'internal' providers
  137. -- use Prosody's configured data storage to store the authentication data.
  138. -- To allow Prosody to offer secure authentication mechanisms to clients, the
  139. -- default provider stores passwords in plaintext. If you do not trust your
  140. -- server please see http://prosody.im/doc/modules/mod_auth_internal_hashed
  141. -- for information about using the hashed backend.
  142. authentication = "internal_hashed"
  143. -- Select the storage backend to use. By default Prosody uses flat files
  144. -- in its configured data directory, but it also supports more backends
  145. -- through modules. An "sql" backend is included by default, but requires
  146. -- additional dependencies. See http://prosody.im/doc/storage for more info.
  147. --storage = "sql" -- Default is "internal" (Debian: "sql" requires one of the
  148. -- lua-dbi-sqlite3, lua-dbi-mysql or lua-dbi-postgresql packages to work)
  149. -- For the "sql" backend, you can uncomment *one* of the below to configure:
  150. --sql = { driver = "SQLite3", database = "prosody.sqlite" } -- Default. 'database' is the filename.
  151. --sql = { driver = "MySQL", database = "prosody", username = "prosody", password = "secret", host = "localhost" }
  152. --sql = { driver = "PostgreSQL", database = "prosody", username = "prosody", password = "secret", host = "localhost" }
  153. -- Logging configuration
  154. -- For advanced logging see http://prosody.im/doc/logging
  155. --
  156. -- Debian:
  157. -- Logs info and higher to /var/log
  158. -- Logs errors to syslog also
  159. log = {
  160. { levels = {min = "{{ $LOG_LEVEL }}"}, timestamps = "%Y-%m-%d %X", to = "console"};
  161. }
  162. {{ if .Env.GLOBAL_CONFIG }}
  163. {{ join "\n" (splitList "\\n" .Env.GLOBAL_CONFIG) }}
  164. {{ end }}
  165. -- Enable use of native prosody 0.11 support for epoll over select
  166. network_backend = "epoll";
  167. -- Set the TCP backlog to 511 since the kernel rounds it up to the next power of 2: 512.
  168. network_settings = {
  169. tcp_backlog = 511;
  170. }
  171. unbound = {
  172. resolvconf = true
  173. }
  174. http_ports = { 5280 }
  175. {{ if $ENABLE_IPV6 }}
  176. http_interfaces = { "*", "::" }
  177. {{ else }}
  178. http_interfaces = { "*" }
  179. {{ end }}
  180. data_path = "/config/data"
  181. smacks_max_unacked_stanzas = 5;
  182. smacks_hibernation_time = 60;
  183. smacks_max_hibernated_sessions = 1;
  184. smacks_max_old_sessions = 1;
  185. Include "conf.d/*.cfg.lua"