Server Config (Secrets)
server/config.lua is server-only — it is never sent to clients and never exposed in any UI. This is where API keys, bot tokens, and webhook URLs live.
It is also escrow-ignored, so server owners can edit it after purchasing.
Full File Layout
ServerConfig = {
-- ╔═══════════════════════════════════════════════════════════════╗
-- ║ DISCORD ROLE PERMISSIONS ║
-- ╚═══════════════════════════════════════════════════════════════╝
DiscordBotToken = "",
DiscordGuildId = "",
DiscordCacheDuration = 120,
-- ╔═══════════════════════════════════════════════════════════════╗
-- ║ YOUTUBE API ║
-- ╚═══════════════════════════════════════════════════════════════╝
YouTubeAPIKey = "",
-- ╔═══════════════════════════════════════════════════════════════╗
-- ║ DASHCAM UPLOAD ║
-- ╚═══════════════════════════════════════════════════════════════╝
DashCamUploadProvider = "fivemanage", -- "fivemanage" or "discord"
DashCamFivemanageApiKey = "",
DashCamDiscordWebhook = "",
-- ╔═══════════════════════════════════════════════════════════════╗
-- ║ SECURITY CAM UPLOAD ║
-- ╚═══════════════════════════════════════════════════════════════╝
SecurityCamUploadProvider = "fivemanage",
SecurityCamFivemanageApiKey = "", -- empty = inherits dashcam key
SecurityCamDiscordWebhook = "", -- empty = inherits dashcam webhook
}
Discord Bot
Used to fetch player Discord roles for permission gating.
| Field | Type | Description |
|---|---|---|
DiscordBotToken | string | Bot token from Discord Developer Portal |
DiscordGuildId | string | Server (guild) ID — copy from Discord with Developer Mode |
DiscordCacheDuration | number | How long to cache role lookups in seconds (default 120) |
Setup
- discord.com/developers/applications → New Application
- Add a Bot → copy the Bot Token
- Enable Server Members Intent (Privileged Gateway Intents)
- Invite the bot to your server with the
botscope and at minimum View Server Members permission - In Discord with Developer Mode enabled, right-click your server → Copy Server ID
When Empty
If either DiscordBotToken or DiscordGuildId is empty, all discordRoles checks are silently skipped. Job-based permissions still work without Discord.
Cache Tuning
120(default) — good for most servers300-600— for servers where roles rarely change, reduces API calls30— for fast role-change propagation0— disables caching entirely (one API call per check, not recommended)
YouTube API Key
Required for music search.
| Field | Type | Description |
|---|---|---|
YouTubeAPIKey | string | YouTube Data API v3 key from Google Cloud Console |
Setup
- console.cloud.google.com → create project (or use existing)
- Enable YouTube Data API v3
- Create credentials → API key
- (Recommended) restrict the key to YouTube Data API v3 + IP allowlist
Quota
The free tier is 10,000 units/day. Each search call costs ~100 units. A single key easily covers a busy server (~100 searches/day per player at 10 players).
If you hit quota limits, create a second project and rotate keys, or apply for a higher quota.
When Empty
Music search does not work. Liked songs and pre-saved playlists with already-fetched titles still play correctly — only the search box returns empty.
DashCam Upload
| Field | Type | Description |
|---|---|---|
DashCamUploadProvider | string | "fivemanage" or "discord" |
DashCamFivemanageApiKey | string | API key from fivemanage.com |
DashCamDiscordWebhook | string | Webhook URL from a Discord channel |
Provider Comparison
| Provider | File limit | Setup |
|---|---|---|
| Fivemanage | Unlimited | API key — paid service with free tier |
| Discord | 25 MB | Webhook URL — completely free |
Discord's 25 MB hard limit means you can only upload ~1.5 minutes at typical bitrate. For full 5-minute recordings, use Fivemanage.
Fivemanage Setup
- Sign up at fivemanage.com
- Dashboard → API Keys → Create
- Set the permission to allow video uploads
- Copy the key
Discord Webhook Setup
- In your Discord server, create a channel for recordings
- Channel settings → Integrations → Webhooks → New Webhook → Copy Webhook URL
- (Optional) customize the webhook avatar / name
Security Camera Upload
Independent settings — security cam recordings can go to a different destination than dashcam recordings.
| Field | Type | Description |
|---|---|---|
SecurityCamUploadProvider | string | "fivemanage" or "discord" |
SecurityCamFivemanageApiKey | string | Empty → inherits DashCamFivemanageApiKey |
SecurityCamDiscordWebhook | string | Empty → inherits DashCamDiscordWebhook |
Common patterns:
- One destination for everything → leave both Security fields empty, set DashCam credentials, both feed the same destination
- Dashcam to Discord, Security cam to Fivemanage → set Discord webhook on DashCam fields, set Fivemanage key on Security fields
- Two separate Discord channels → set both
DashCamDiscordWebhookandSecurityCamDiscordWebhookto different webhook URLs
Adding Custom Secrets
server/config.lua is your space — add your own keys for custom server-side modules:
ServerConfig.MySecretApiKey = "..."
ServerConfig.MyWebhook = "..."
Reference them from server-side Lua: ServerConfig.MySecretApiKey. Never reference from client-side code.
