Electus LogoElectus Documentation

Electus Core Upload service

Set up the image upload provider used by Electus Heists, Graffiti and Computers.

electus_core handles image uploads for Electus scripts. Heists uses it to upload blueprints, Graffiti uses it to upload graffiti images, and Computers uses it for gallery images, wallpapers and documents. All three use the same provider setup.

1. Choose a provider

ProviderConfig.UploadMethodRequirement
FivemanageFivemanageA Fivemanage media API key
Qbox CDNQboxA Qbox CDN API key
LB PresignedLBPresignedThe lb-presigned resource

2. Add your credentials

Add your media API key to server.cfg:

set FIVEMANAGE_MEDIA_API_KEY "your_api_key"

Add your CDN API key to server.cfg:

set QBOX_CDN_API_KEY "your_api_key"

Install and configure lb-presigned, then start it before electus_core:

ensure lb-presigned
ensure electus_core

Use set, not setr, for API keys. setr replicates the value to every connected client.

3. Select the upload method

Set Config.UploadMethod in the config/config.lua of each script that uploads images:

Config.UploadMethod = "auto" -- "auto", "Fivemanage", "Qbox" or "LBPresigned"

With auto, the first available provider is used in this order:

  1. lb-presigned, when the resource is started
  2. Fivemanage, when FIVEMANAGE_MEDIA_API_KEY is set
  3. Qbox CDN, when QBOX_CDN_API_KEY is set

If more than one provider is available, set the method explicitly. If none is found, uploads fail until you add a key or start lb-presigned.

Custom providers

The upload adapter lives in electus_core/loaf_wrapper/server/functions/upload.lua. Changes there affect every resource that uploads through electus_core.