RVT Chat

Configuration

Les options les plus utilisées de shared.lua et le fichier complet commenté.

Modifiez shared.lua puis redémarrez la ressource (restart rvt_chat) pour appliquer. Voici les options que l'on ajuste le plus souvent.

OptionPar défautRôle
Config.Framework.name"standalone"Framework utilisé pour l'identité et la modération : standalone, creative, qb, esx ou custom. Il n'y a pas de détection automatique.
Config.Resource"rvt_chat"Préfixe des événements réseau et des logs. Doit être égal au nom du dossier.
Config.App.identifier"rvt_chat"ID de l'app dans LB Phone. Le changer crée une autre app sur le téléphone ; l'historique ne change pas.
Config.App.defaultApptrueInstalle l'app sur tous les téléphones.
Config.App.registertrueEnregistre l'app dans LB Phone. Laissez true.
Config.Identity.requirePhoneItemtrueExige l'objet téléphone pour utiliser l'app. Le numéro équipé est toujours obligatoire.
Config.Messages.editWindowS900Délai (en secondes) pour modifier un message après envoi.
Config.Messages.deleteForEveryoneWindowS172800Délai (en secondes) pour supprimer un message pour tous (48 h).
Config.Groups.maxMembers256Nombre maximal de membres par groupe.
Config.Groups.maxCreatedPerAccount50Groupes actifs qu'un même compte peut créer.
Config.Communities.maxGroups50Nombre maximal de groupes liés à une communauté.
Config.Channels.maxCreatedPerAccount5Chaînes qu'un même compte peut créer.
Config.Status.ttlS86400Durée d'un statut, en secondes (24 h).
Config.LiveLocation.durations{ 900, 3600, 28800 }Durées autorisées de la position en direct, en secondes : 15 min, 1 h et 8 h.
Config.Calls.maxGroupParticipants8Participants par appel vocal de groupe.
Config.Calls.groupVideotrueActive la vidéo de groupe. Avec false, les appels de groupe sont uniquement vocaux.
Config.Calls.maxGroupVideoParticipants4Participants par appel vidéo de groupe. Au-delà de 4, la qualité baisse.
Config.Media.domains{}Hôtes HTTPS acceptés pour les médias, par type (image, video, audio, sticker, gif). Ils sont vides au départ : ajoutez l'hôte d'envoi configuré dans LB Phone.
Config.Media.maxBytes10 MB / 50 MB / 10 MBTaille maximale d'une image, d'une vidéo et d'un vocal.
Config.Limits.textLength4096Longueur maximale d'un message texte, en caractères.
Config.Retention.messagesDays0Jours de conservation des messages. 0 les garde pour toujours.
Config.Admin.ace"rvt_chat.admin"ACE qui active la modération de l'app (tous les modes sauf creative).
Config.Admin.group""Mode creative uniquement : groupe autorisé à modérer (le niveau minimum est Config.Admin.level, 1 par défaut). Vide = personne.
Config.DebugfalseAffiche des lignes de débogage dans la console du serveur.
Voir le shared.lua complet
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