RVT Chat

Configuration

The most used shared.lua options and the full annotated file.

Edit shared.lua and restart the resource (restart rvt_chat) to apply. These are the options you will adjust most often.

OptionDefaultWhat it does
Config.Framework.name"standalone"Framework used for identity and moderation: standalone, creative, qb, esx or custom. There is no auto-detection.
Config.Resource"rvt_chat"Prefix of net events and log lines. Must equal the folder name.
Config.App.identifier"rvt_chat"App ID in LB Phone. Changing it creates another app on the phone; history is unchanged.
Config.App.defaultApptrueInstalls the app on every phone.
Config.App.registertrueRegisters the app in LB Phone. Keep it true.
Config.Identity.requirePhoneItemtrueRequires the phone item to use the app. The equipped number is always required.
Config.Messages.editWindowS900Time (in seconds) to edit a message after sending.
Config.Messages.deleteForEveryoneWindowS172800Time (in seconds) to delete a message for everyone (48 h).
Config.Groups.maxMembers256Maximum members per group.
Config.Groups.maxCreatedPerAccount50Active groups one account can create.
Config.Communities.maxGroups50Maximum groups linked to one community.
Config.Channels.maxCreatedPerAccount5Channels one account can create.
Config.Status.ttlS86400Status lifetime in seconds (24 h).
Config.LiveLocation.durations{ 900, 3600, 28800 }Allowed live location durations in seconds: 15 min, 1 h and 8 h.
Config.Calls.maxGroupParticipants8Participants per group voice call.
Config.Calls.groupVideotrueEnables group video. With false, group calls are voice only.
Config.Calls.maxGroupVideoParticipants4Participants per group video call. Above 4 quality drops.
Config.Media.domains{}HTTPS hosts accepted for media, per kind (image, video, audio, sticker, gif). They start empty: add the upload host configured in LB Phone.
Config.Media.maxBytes10 MB / 50 MB / 10 MBMaximum size of image, video and audio.
Config.Limits.textLength4096Maximum length of a text message, in characters.
Config.Retention.messagesDays0Days messages are kept. 0 keeps them forever.
Config.Admin.ace"rvt_chat.admin"ACE that unlocks the app moderation (every mode except creative).
Config.Admin.group""Creative mode only: group allowed to moderate (the minimum level is Config.Admin.level, default 1). Empty = nobody.
Config.DebugfalsePrints debug lines in the server console.
Show the full shared.lua
shared.lua
Config = {}

-- Standalone is generic. Select an installed framework explicitly before production.
Config.Framework = {
    name = "standalone",       -- string. standalone | creative | qbox | qb | esx | custom (no auto-detection)
    qbResource = "qb-core",    -- string. QB resource name
    qboxResource = "qbx_core", -- string. Qbox resource name
    esxResource = "es_extended" -- string. ESX resource name
}

-- Prefix of net events ("<Resource>:rpc", "<Resource>:event"), log lines and the pma-voice admission name.
-- Must equal the resource folder name. string, default "rvt_chat".
Config.Resource = "rvt_chat"

Config.App = {
    identifier = "rvt_chat",   -- string. LB custom app id
    name = "RVT Chat",         -- string. Name shown on the phone
    description = "Conversas, grupos, comunidades, canais e status.", -- string. App description
    developer = "RVT Scripts", -- string. Developer shown by LB
    defaultApp = true,         -- bool. Installed on every phone
    size = 4096,               -- number. App size shown by LB (KB)
    register = true,           -- bool. false = never calls AddCustomApp
    ui = "web/dist/index.html",-- string. Path inside the resource
    icon = "web/dist/icon.svg" -- string. Path inside the resource
}

-- Every timestamp exchanged with the frontend is Unix epoch in milliseconds (UTC).

Config.Identity = {
    requirePhoneItem = true,   -- bool. Every op needs the phone item (LB HasPhoneItem)
    revalidateMs = 30000       -- number (ms). Re-check identity, equipped number and item
}

Config.Limits = {
    payloadBytes = 16384,      -- bytes. JSON payload per RPC (PAYLOAD_TOO_LARGE above)
    pageSize = 30,             -- default page size
    maxPageSize = 100,         -- hard cap for "limit"
    textLength = 4096,         -- chars. Message body
    captionLength = 1024,      -- chars. Media caption
    displayName = 40,          -- chars. Profile name
    about = 140,               -- chars. Profile "about"
    searchMin = 2, searchMax = 64, -- chars. Search term bounds
    pinnedChats = 3,           -- max pinned chats per account
    pinnedMessages = 3,        -- max pinned messages per chat (oldest drops out)
    forwardTargets = 5,        -- max destination chats per forward
    frequentlyForwardedScore = 5, -- forwards before the "frequently forwarded" flag
    batchIds = 100,            -- max ids in *.batch ops
    reactionBytes = 32         -- max bytes of one reaction emoji
}

Config.Messages = {
    editWindowS = 15 * 60,              -- seconds. Edit window after sending
    deleteForEveryoneWindowS = 48 * 3600, -- seconds. "Delete for everyone" window
    adminDeleteAnyTime = false,         -- bool. Group admins delete outside the window
    disappearingOptions = { 0, 86400, 7 * 86400, 90 * 86400 }, -- allowed timers (0 = off)
    pinDurations = { 86400, 7 * 86400, 30 * 86400 },           -- allowed pin durations
    pollMaxOptions = 12, pollOptionLength = 100, pollQuestionLength = 255
}

Config.Groups = {
    maxMembers = 256,
    maxCreatedPerAccount = 50, -- active groups created by one account
    nameLength = 50,
    descriptionLength = 512,
    -- defaults for new groups; "admins" | "all"; communityJoin: "open" | "request" | "hidden"
    defaults = { editInfo = "admins", send = "all", addMembers = "admins", pin = "admins", approval = false, communityJoin = "request" }
}

Config.Communities = { maxGroups = 50, maxMembers = 2000, maxCreatedPerAccount = 10 }

Config.Channels = { nameLength = 60, descriptionLength = 512, maxAdmins = 16, maxCreatedPerAccount = 5 }

Config.Invites = {
    defaultTtlS = 7 * 86400,   -- seconds. Default link lifetime
    maxTtlS = 30 * 86400,      -- seconds. Upper bound for ttlS
    maxUses = 1000             -- upper bound for maxUses
}

Config.Broadcasts = {
    maxLists = 20,             -- lists per account
    maxRecipients = 256,       -- recipients per list
    requireRecipientContact = true -- bool. Recipient must have the sender in the LB agenda
}

Config.Status = {
    ttlS = 24 * 3600,          -- seconds. Status lifetime
    maxActivePerAccount = 30,
    textLength = 700, captionLength = 700,
    purgeAfterS = 24 * 3600    -- seconds. Physical removal after expiry
}

Config.LiveLocation = {
    durations = { 900, 3600, 28800 }, -- allowed durations (seconds)
    intervalMs = 5000,         -- number (ms). Server tick that reads the position
    labelLength = 120,
    bounds = { minX = -4500.0, maxX = 4500.0, minY = -4500.0, maxY = 8500.0 } -- picked points only
}

Config.Calls = {
    ringTimeoutS = 30,         -- seconds. Ringing before "missed"
    maxGroupParticipants = 8,  -- voice group call
    maxDurationS = 7200,       -- seconds. Hard limit, then reason "max_duration"
    channelBase = 800000, channelRange = 99999, -- reserved pma-voice namespace (see installation)
    groupVideo = true,         -- bool. Enables WebRTC mesh video in group calls
    maxGroupVideoParticipants = 4,
    signalBytes = 8192,        -- bytes. Max size of one call.signal data
    -- Cloudflare TURN credentials are read from server convars, never from the files:
    --   set rvt_chat_turn_token_id "<TURN key id>"
    --   set rvt_chat_turn_api_token "<TURN API token>"
    -- Without them the mesh uses STUN only (fails behind strict NAT).
    turnTtlS = 3600,           -- seconds. Lifetime of generated TURN credentials
    stunUrls = { "stun:stun.cloudflare.com:3478" }
}

Config.Media = {
    -- Set the HTTPS hostnames used by your LB upload provider before enabling media.
    -- A domain entry also accepts its subdomains. Every list starts empty.
    domains = {
        image = {},
        video = {},
        audio = {},
        sticker = {},
        gif = {}
    },
    maxBytes = { image = 10 * 1024 * 1024, video = 50 * 1024 * 1024, audio = 10 * 1024 * 1024, sticker = 1024 * 1024, gif = 15 * 1024 * 1024 },
    maxDurationS = { video = 180, audio = 600 },
    mimes = {
        image = { "image/jpeg", "image/png", "image/webp" }, video = { "video/webm", "video/mp4" },
        audio = { "audio/ogg", "audio/webm", "audio/mpeg", "audio/mp4" },
        sticker = { "image/webp", "image/png" }, gif = { "image/gif", "video/mp4", "image/webp" }
    },
    documents = false,         -- bool. Documents need private storage; none is installed
    maxPerMessage = 10
}

Config.RateLimits = {          -- bucket = { requests, windowMs } per account
    default = { 30, 10000 }, send = { 20, 10000 }, typing = { 6, 5000 }, lookup = { 20, 60000 },
    search = { 10, 10000 }, create = { 5, 60000 }, report = { 5, 60000 }, media = { 20, 60000 },
    call = { 6, 30000 }, signal = { 120, 10000 }, location = { 6, 30000 }
}

Config.Sync = { overlapMs = 5000, maxItems = 300 }

Config.Retention = {           -- days unless noted; 0 on messagesDays keeps forever
    messagesDays = 0, receiptsDays = 30, idempotencyHours = 24,
    callsDays = 60, auditDays = 180, cleanupIntervalS = 60
}

Config.Admin = {
    ace = "rvt_chat.admin",    -- string. ACE that unlocks admin.* ops (every mode except creative)
    group = "",                -- string. creative mode only: group allowed to moderate ("" = nobody)
    level = 1                  -- number. creative mode only: minimum level of that group
}

Config.Notifications = { previewLength = 120 } -- chars of notification body

Config.Debug = false           -- bool. Debug lines in the console