Skip to content

Let manifest sources be declared in JSON - #46

Open
cheapmanga wants to merge 1 commit into
madoiscool:mainfrom
cheapmanga:feature/json-manifest-sources
Open

Let manifest sources be declared in JSON#46
cheapmanga wants to merge 1 commit into
madoiscool:mainfrom
cheapmanga:feature/json-manifest-sources

Conversation

@cheapmanga

Copy link
Copy Markdown

As discussed — the JSON half only. No plugin loader, no dll, nothing loaded.

A .json file under %AppData%\LuaToolsGui\sources\ declares extra manifest sources. They appear as rows on the Add page and install through the existing pipeline.

{
  "schema": 1,
  "name": "Example sources",
  "sources": [{
    "name": "example-zip",
    "displayName": "Example",
    "kind": "manifestZip",
    "url": "https://raw.githubusercontent.com/someone/some-repo/main/{appid}.zip",
    "badge": "Free"
  }]
}

Why: the sources the app can fetch from are fixed at build time, so following a repo that moved means cutting a release. This makes it a line of JSON.

A file can only say where manifests come from. It names one of two shapes the app already consumes — manifestZip (<appid>.zip) or luaFile (<appid>.lua) — and the app does the fetching. There is no way for one to supply code, a binary, or a routine of its own, so installing one from a stranger cannot execute anything.

Three choices worth flagging for review:

  • Rows are appended after the app's own sources rather than ranked among them. That order is yours to decide, not a dropped-in file's.
  • They're exempt from the lua.tools sign-in gate, since they're fetched from the url the file names and never touch lua.tools.
  • The availability probe goes through GithubProxy like the download does — one that skipped it would report "doesn't have the game" whenever GitHub was blocked, while the download would have gone through a mirror. Hosts that refuse HEAD get a one-byte ranged GET.

Refusals (a name already in use, non-https, missing {appid}, unknown kind) are listed in Settings → Manifest sources with the reason; one bad entry doesn't take a file's good ones with it. Files are re-read when that page opens, so no restart.

All 29 languages. Format documented in SOURCES.md. Happy to change any of it, or drop it if you'd rather not have the surface.

The sources the app can fetch from are fixed at build time, so following a
repo that moved, or adding a community one, means cutting a release. A
`.json` file under %AppData%\LuaToolsGui\sources\ now declares extra
sources; they appear as rows on the Add page and install through the
existing pipeline.

Data only, by design. A file says WHERE manifests come from and nothing
else: it names one of the shapes the app already consumes (a zip or a lua
per appid) and the app does the fetching. There is no way for one of these
files to supply code, a binary, or a routine of its own, so installing one
from a stranger cannot execute anything.

Pack rows are appended after the app's own sources rather than ranked among
them - that order is the app's decision, not a dropped-in file's. They are
also exempt from the lua.tools sign-in gate, since they are fetched from
the url the file names and never touch lua.tools.

The availability probe goes through GithubProxy like the download does; one
that skipped it would report "doesn't have the game" whenever GitHub was
blocked while the download would have succeeded through a mirror. A host
that refuses HEAD is probed with a one-byte ranged GET, because these urls
are whatever host the author picked.

Refusals are shown in Settings with their reason - a name the app already
uses, a non-https url, a missing {appid}, an unknown kind - and one bad
entry never takes a file's good ones with it. Files are re-read when the
Settings page opens, so nothing needs a restart. All 29 languages.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BPSigFCgHqiUUbL9RRPZWs
@madoiscool

Copy link
Copy Markdown
Owner

cool, will merge after dealing with conflits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants