-- Prose Pod Server
-- XMPP Server Configuration
-- /!\ This file has been automatically generated by Prose Pod API.
-- /!\ Do NOT edit this file manually or your changes will be overridden during the next reload.

-- Base server configuration
pidfile = "/var/run/prosody/prosody.pid"
admin_socket = "/var/run/prosody/prosody.sock"

authentication = "internal_hashed"

default_storage = "internal"

log = {
  debug = "*console";
}

-- Network interfaces/ports
http_ports = { 5280 }

-- Modules
plugin_paths = { "/usr/local/lib/prosody/modules" }
modules_enabled = {
  "auto_activate_hosts";
  "roster";
  "groups_internal";
  "groups_shell";
  "saslauth";
  "tls";
  "dialback";
  "disco";
  "smacks";
  "private";
  "vcard_legacy";
  "vcard4";
  "version";
  "uptime";
  "time";
  "ping";
  "lastactivity";
  "pep";
  "blocklist";
  "limits";
  "carbons";
  "csi";
  "server_contact_info";
  "websocket";
  "reload_modules";
  "mam";
}
modules_disabled = { "s2s" }

-- mod_reload_modules
reload_modules = { "tls" }

-- Disable in-band registrations (done through the Prose Pod Dashboard/API)
allow_registration = false

-- Mandate highest security levels
c2s_require_encryption = true

-- Enforce safety C2S/S2S limits
c2s_stanza_size_limit = 256 * 1024

limits = {
  c2s = {
    rate = "50kb/s";
    burst = "2s";
  };
}

-- Allow reverse-proxying to WebSocket service over insecure local HTTP
consider_websocket_secure = true

-- MAM settings
archive_expires_after = "never"
default_archive_policy = true
max_archive_query_results = 100

-- Enable vCard legacy compatibility layer
upgrade_legacy_vcards = true

-- mod_cloud_notify
push_notification_with_body = true
push_notification_with_sender = true

-- Server hosts and components
VirtualHost "test.local"
  -- Modules
  modules_enabled = {
    "rest";
    "http_oauth2";
    "admin_rest";
    "cloud_notify";
    "register";
    "prose_version";
    "http_admin_api";
    "invites";
    "invites_groups";
    "invites_register";
    "invites_register_api";
  }

  -- mod_reload_modules
  reload_modules = { "http_oauth2" }

  -- XEP-0157: Contact Addresses for XMPP Services
  contact_info = {
    admin = { "xmpp:evan.turner@test.local" };
  }

  -- HTTP settings
  http_host = "prose-pod-server"

  -- XEP-0030: Service Discovery
  disco_items = {
    {
      "upload.prose.local";
      "HTTP File Upload";
    };
  }

  -- mod_http_oauth2
  allowed_oauth2_grant_types = {
    "authorization_code";
    "refresh_token";
    "password";
  }
  oauth2_access_token_ttl = 10800
  oauth2_refresh_token_ttl = 0
  oauth2_registration_key = ENV_OAUTH2_REGISTRATION_KEY

Component "groups.test.local" "muc"
  name = "Chatrooms"

  -- Modules
  modules_enabled = {
    "muc_public_affiliations";
    "muc_cloud_notify";
    "muc_mam";
  }

  -- MAM settings
  max_archive_query_results = 100

  restrict_room_creation = "local"

  -- MUC settings
  muc_log_all_rooms = true
  muc_log_by_default = true
  muc_log_expires_after = "never"

Component "upload.prose.local" "http_file_share"
  name = "HTTP File Upload"

  -- HTTP settings
  http_external_url = "https://prose.test.local/"
  http_paths = {
    file_share = "/upload";
  }

  -- XEP-0363: HTTP File Upload
  http_file_share_size_limit = 20 * 1024 * 1024
  http_file_share_expires_after = "never"
  http_file_share_daily_quota = 100 * 1024 * 1024
  http_file_share_access = { "test.local" }
