refactor: move media settings into dedicated config

This commit is contained in:
Leon.Schmidt
2026-08-17 02:13:07 +02:00
parent 3e35a12efd
commit 7d770b838a
5 changed files with 89 additions and 77 deletions
+2 -70
View File
@@ -1,7 +1,8 @@
--[[
Sky Phone configuration
All settings live in this file. Translations remain in config/locales/*.lua.
General settings live in this file. Media providers and upload limits live
in config/media.lua, while translations remain in config/locales/*.lua.
Sections marked "SERVER ONLY" are guarded with IsDuplicityVersion(), so
passwords, API keys, migration settings, and server-owned locations are not
applied by game clients.
@@ -1165,75 +1166,6 @@ if IsDuplicityVersion() then
},
}
-- -------------------------------------------------------------------------
-- Media providers and uploads
-- -------------------------------------------------------------------------
Config.Media = {
GiphyApiKey = "", -- Server-only: paste the GIPHY API key here.
GifPageSize = 24,
GifRating = "pg-13",
UrlMaxLength = 2048,
AllowedGifHosts = { "giphy.com" },
FiveManage = {
ApiKey = "", -- Server-only: paste a newly generated FiveManage V3 Media API token here.
BaseUrl = "https://api.fivemanage.com/api/v3/file",
RequestTimeoutMs = 10000,
UploadTimeoutMs = 25000,
},
Import = {
Enabled = true,
PageSize = 30,
MaxSelection = 10,
MaxPhotoBytes = 15 * 1024 * 1024,
MaxVideoBytes = 150 * 1024 * 1024,
RevalidateAfterSeconds = 3600,
ListActionsPerMinute = 60,
ImportActionsPerMinute = 20,
CandidateTtlSeconds = 300,
ManifestCacheSeconds = 30,
ManifestMaxBytes = 2 * 1024 * 1024,
ManifestMaxItems = 5000,
Websites = {
{
Id = "fivemanage",
Label = "FiveManage",
Enabled = true,
Adapter = "fivemanage",
Path = "sky_phone/imports",
MediaTypes = { "photo", "video" },
-- Direct links entered in Gallery must use one of these hosts or a subdomain.
AllowedMediaHosts = { "fivemanage.com" },
},
--[[
{
Id = "city_media",
Label = "City Media",
Enabled = true,
Adapter = "manifest",
ManifestUrl = "https://media.example.com/sky-phone/media.json",
MediaTypes = { "photo", "video" },
AllowedMediaHosts = { "media.example.com", "cdn.example.com" },
Auth = {
Type = "bearer",
TokenConvar = "sky_phone_city_media_token",
},
RequiredAce = "sky_phone.import.city_media",
},
]]
},
},
Photo = {
Encoding = "jpg",
Quality = 0.95,
},
Video = {
BitrateKbps = 1500,
},
UploadSessionTimeoutMs = 60000,
PageSize = 30,
}
-- -------------------------------------------------------------------------
-- Music library
-- -------------------------------------------------------------------------