prosody.cfg.lua 7.1 KB

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