← Security sheet
Transparency

Addon source code

These are, unmodified, the Lua files the GMod and FiveM auto-updaters download and run on your server. {API_KEY}, {SERVER_ID}, {BACKEND_URL} and {INGEST_URL} are replaced with your values at download time; nothing else changes.

To verify what actually runs on your box: download the raw version and diff it against the file your server received (only the lines holding those placeholders differ).

addon/gmod/flitt/lua/autorun/server/flitt.lua
Downloaded from: Installed manually (Workshop / zip). Downloads the addon below at startup.
Template SHA-256: 0111949d6d6d7b4099f56a55bcf997e9bcb412107fd5d98ae3e4c7269d0dfb66

The {API_KEY} / {SERVER_ID} / {BACKEND_URL} / {INGEST_URL} / {PANEL_URL} placeholders are substituted with your values at download time.

1local API_KEY = "{API_KEY}"2local SERVER_ID = "{SERVER_ID}"34local function GetConvarValue(name, fallback)5    if not GetConVar then return fallback end6    local cvar = GetConVar(name)7    if not cvar then return fallback end8    local value = cvar:GetString() or ""9    if value ~= "" then return value end10    return fallback11end1213local function ResolveConfigValue(raw, cvarName)14    local value = tostring(raw or "")15    if value == "" or value:find("{", 1, true) then16        local fromCvar = GetConvarValue(cvarName, "")17        if fromCvar ~= "" then return fromCvar end18    end19    return value20end2122local function UrlEncode(value)23    if string and string.URLEncode then24        return string.URLEncode(tostring(value or ""))25    end26    if url and url.encode then27        return url.encode(tostring(value or ""))28    end29    return tostring(value or "")30        :gsub("\n", "\r\n")31        :gsub("([^%w%-_%.~])", function(c)32            return string.format("%%%02X", string.byte(c))33        end)34end3536local function FLT_Line(msg, color)37    if MsgC and Color and color then38        MsgC(color, msg .. "\n")39    else40        print(msg)41    end42end4344local function FLT_Banner()45    local innerWidth = 5246    local border = " -" .. string.rep("-", innerWidth) .. "- "47    local empty =  " |" .. string.rep(" ", innerWidth) .. "| "4849    local function padCenter(text)50        local s = tostring(text or "")51        if #s > innerWidth then52            s = string.sub(s, 1, innerWidth)53        end54        local total = innerWidth - #s55        local left = math.floor(total / 2)56        local right = total - left57        return " |" .. string.rep(" ", left) .. s .. string.rep(" ", right) .. "| "58    end5960    FLT_Line(" ")61    FLT_Line(border, Color(120, 180, 255))62    FLT_Line(empty, Color(200, 200, 200))63    FLT_Line(padCenter("Flitt GMOD Auto-Update"), Color(255, 255, 255))64    FLT_Line(padCenter("Fetching latest addon..."), Color(180, 255, 180))65    FLT_Line(empty, Color(200, 200, 200))66    FLT_Line(border, Color(120, 180, 255))67    FLT_Line(" ")68end6970local function FLT_Info(msg)71    FLT_Line("[Flitt] " .. tostring(msg), Color(200, 220, 255))72end7374local function FLT_Warn(msg)75    FLT_Line("[Flitt] " .. tostring(msg), Color(255, 210, 120))76end7778local function FLT_Error(msg)79    FLT_Line("[Flitt] " .. tostring(msg), Color(255, 120, 120))80end8182Flitt_UpdateReady = false83FLT_Banner()84FLT_Info("Server initialized. Fetching addon code from panel...")8586local apiKey = ResolveConfigValue(API_KEY, "FLT_API_KEY")87local serverId = ResolveConfigValue(SERVER_ID, "FLT_SERVER_ID")8889if apiKey:find("{", 1, true) or serverId:find("{", 1, true) or apiKey == "" or serverId == "" then90    FLT_Error("API_KEY/SERVER_ID invalid (placeholders not replaced?)")91    FLT_Warn("API_KEY: " .. tostring(API_KEY))92    FLT_Warn("SERVER_ID: " .. tostring(SERVER_ID))93    Flitt_UpdateReady = true94    return95end9697local url = "https://flitt.me/api/addons/gmod?server_id=" .. UrlEncode(serverId)9899http.Fetch(url,100    function(b, l, h, c)101        if c == 200 then102            FLT_Info("Code received. Executing...")103            local f = CompileString(b, "auto_update", false)104            if type(f) == "function" then105                f()106            else107                FLT_Error("Compilation error: " .. tostring(f))108            end109        else110            FLT_Error("HTTP error: " .. tostring(c))111        end112        Flitt_UpdateReady = true113    end,114    function(e)115        FLT_Error("HTTP request failed: " .. tostring(e))116        FLT_Warn("Make sure the server can reach the panel over HTTPS.")117        Flitt_UpdateReady = true118    end,119    { ["X-API-Key"] = apiKey }120)