RVT Chat

Configuração

As opções mais usadas do shared.lua e o arquivo completo comentado.

Edite o shared.lua e reinicie o recurso (restart rvt_chat) para aplicar. Abaixo estão as opções que mais costumam ser ajustadas.

OpçãoPadrãoO que faz
Config.Framework.name"standalone"Framework usado para identidade e moderação: standalone, creative, qb, esx ou custom. Não há detecção automática.
Config.Resource"rvt_chat"Prefixo dos eventos de rede e dos logs. Deve ser igual ao nome da pasta.
Config.App.identifier"rvt_chat"ID do app no LB Phone. Mudar cria outro app no telefone; o histórico não muda.
Config.App.defaultApptrueInstala o app em todos os telefones.
Config.App.registertrueRegistra o app no LB Phone. Deixe true.
Config.Identity.requirePhoneItemtrueExige o item do telefone para usar o app. O número equipado é sempre obrigatório.
Config.Messages.editWindowS900Tempo (em segundos) para editar uma mensagem depois de enviada.
Config.Messages.deleteForEveryoneWindowS172800Tempo (em segundos) para apagar uma mensagem para todos (48 h).
Config.Groups.maxMembers256Máximo de membros por grupo.
Config.Groups.maxCreatedPerAccount50Grupos ativos que uma mesma conta pode criar.
Config.Communities.maxGroups50Máximo de grupos vinculados a uma comunidade.
Config.Channels.maxCreatedPerAccount5Canais que uma mesma conta pode criar.
Config.Status.ttlS86400Duração de um status, em segundos (24 h).
Config.LiveLocation.durations{ 900, 3600, 28800 }Durações permitidas da localização ao vivo, em segundos: 15 min, 1 h e 8 h.
Config.Calls.maxGroupParticipants8Participantes por chamada de voz em grupo.
Config.Calls.groupVideotrueLiga o vídeo em grupo. Com false, as chamadas em grupo ficam só com voz.
Config.Calls.maxGroupVideoParticipants4Participantes por videochamada em grupo. Acima de 4 a qualidade cai.
Config.Media.domains{}Hosts HTTPS aceitos para mídia, por tipo (image, video, audio, sticker, gif). Começam vazios: inclua o host de upload configurado no LB Phone.
Config.Media.maxBytes10 MB / 50 MB / 10 MBTamanho máximo de imagem, vídeo e áudio.
Config.Limits.textLength4096Tamanho máximo de uma mensagem de texto, em caracteres.
Config.Retention.messagesDays0Dias de guarda das mensagens. 0 mantém para sempre.
Config.Admin.ace"rvt_chat.admin"Permissão ACE que libera a moderação do app (todos os modos, exceto creative).
Config.Admin.group""Somente no modo creative: grupo que pode moderar (o nível mínimo fica em Config.Admin.level, padrão 1). Vazio = ninguém.
Config.DebugfalseMostra linhas de depuração no console do servidor.
Ver o shared.lua completo
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