> For the complete documentation index, see [llms.txt](https://documentation.rcore.cz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.rcore.cz/paid-resources/rcore_mdt/configuration/server-config.md).

# Server Config

Edit `configs/sv_config.lua` for the database, photo uploads, and Discord logs. Restart the resource after any change.

## 🗄️ Database

```lua
SV_CONFIG.MysqlType = nil
```

Leave this as `nil`. The database resource is detected automatically. See [Database](https://documentation.rcore.cz/paid-resources/rcore_mdt/integrations/database.md).

## 📷 Photo Uploads

Every in-game photo is captured with `screencapture` and uploaded to the host selected here.

```lua
SV_CONFIG.ImageUpload = {
    Provider = 'fivestorage',

    FiveStorage = {
        Url    = 'https://api.fivestorage.io/api/v1/images',
        ApiKey = 'YOUR_API_KEY',
    },

    FiveManage = {
        Url    = 'https://fmapi.net/api/v2/image',
        ApiKey = 'YOUR_API_TOKEN',
    },
}
```

| Option     | Description                                                                                      |
| ---------- | ------------------------------------------------------------------------------------------------ |
| `Provider` | `'fivestorage'` or `'fivemanage'`.                                                               |
| `Url`      | Upload endpoint. Keep the default.                                                               |
| `ApiKey`   | Your API key from [FiveStorage](https://fivestorage.io) or [FiveManage](https://fivemanage.com). |

{% hint style="danger" %}
Keep your API key private. Anyone with the key can upload to your image host account.
{% endhint %}

## 📝 Discord Logs

Sends important MDT actions to a Discord channel.

```lua
SV_CONFIG.Webhook = {
    Enabled   = false,
    Url       = '',
    Username  = 'rcore MDT',
    AvatarUrl = '',
    Actions = {
        incidents  = true,
        penalCodes = true,
        bolos      = true,
        bulletins  = true,
        profiles   = true,
        caseFiles  = true,
        boards     = true,
        fines      = true,
        medical    = true,
        vehicles   = true,
    },
}
```

| Option      | Description                            |
| ----------- | -------------------------------------- |
| `Enabled`   | Turns all logging on or off.           |
| `Url`       | Discord webhook URL.                   |
| `Username`  | Name shown for the webhook in Discord. |
| `AvatarUrl` | Optional avatar image for the webhook. |
| `Actions`   | Turns each log category on or off.     |

See [Audit Logs](https://documentation.rcore.cz/paid-resources/rcore_mdt/features/audit-logs.md) for what each category logs.
