Files
prosody/data/prosody/configuration/prosody.cfg.lua
2026-04-29 21:56:24 +03:00

116 lines
2.9 KiB
Lua

-- Prosody XMPP Server Configuration
-- Domain: xmpp.guschin.info
admins = { "admin@guschin.info", "admin@xmpp.guschin.info" }
plugin_paths = { "/usr/lib/prosody/modules" }
modules_enabled = {
-- Generally required
"roster";
"saslauth";
"tls";
"dialback";
"disco";
-- Not essential, but recommended
"carbons";
"pep";
"private";
"vcard";
"version";
"uptime";
"time";
"ping";
"register";
"mam";
-- Admin interface
"admin_adhoc";
-- Gateway support
"privilege";
"http_file_share";
};
modules_disabled = {
-- "offline";
"posix"; -- Disable posix module to avoid threading issues in Docker
};
-- Logging configuration
log = {
info = "/var/log/prosody/prosody.log";
error = "/var/log/prosody/prosody.err";
};
-- Storage configuration for MySQL
storage = "sql"
sql = {
driver = "MySQL";
database = os.getenv("MYSQL_DATABASE") or "prosody";
username = os.getenv("MYSQL_USER") or "prosody";
password = os.getenv("MYSQL_PASSWORD") or "prosodypass";
host = os.getenv("MYSQL_HOST") or "localhost";
port = 3306;
}
-- Port configuration (global section)
c2s_ports = { 5222 }
s2s_ports = { 5269 }
component_ports = { 5347 }
component_interface = "0.0.0.0"
http_ports = { 5280 }
https_ports = { 5281 }
-- Require TLS on c2s/s2s connections
c2s_require_encryption = true
s2s_require_encryption = true
-- Authentication
authentication = "internal_plain"
-- Message archive settings
archive_expires_after = "never"
-- Certificates directory (global, before VirtualHost)
certificates = "/etc/prosody/certs"
-- Primary virtual host (user@guschin.info)
VirtualHost "guschin.info"
ssl = {
key = "/etc/prosody/certs/guschin.info.key";
certificate = "/etc/prosody/certs/guschin.info.crt";
}
privileged_entities = {
["telegram.guschin.info"] = {
roster = "both"; -- auto add/remove Telegram contacts from roster
message = "outgoing"; -- reflect messages sent via official Telegram apps
iq = {
["http://jabber.org/protocol/pubsub"] = "both"; -- PEP bookmarks
["http://jabber.org/protocol/pubsub#owner"] = "set"; -- message display sync
["urn:xmpp:http:upload:0"] = "get"; -- upload on behalf of users
};
};
}
-- Secondary virtual host (user@xmpp.guschin.info)
VirtualHost "xmpp.guschin.info"
ssl = {
key = "/etc/prosody/certs/xmpp.guschin.info.key";
certificate = "/etc/prosody/certs/xmpp.guschin.info.crt";
}
-- Component for MUC (Multi-User Chat)
Component "muc.guschin.info" "muc"
modules_enabled = { "muc_mam" }
storage = "sql"
-- HTTP file upload (XEP-0363) — used by slidgram for Telegram→XMPP attachments
Component "upload.guschin.info" "http_file_share"
http_file_share_access = { "telegram.guschin.info" }
-- Telegram gateway (slidgram)
Component "telegram.guschin.info"
component_secret = os.getenv("SLIDGRAM_COMPONENT_SECRET")