mirror of
https://github.com/storytold/effectcraft.git
synced 2026-11-16 15:22:43 +00:00
Plug-in Library: a package downloads only release assets of its repository
A catalog release's url was checked only for its host: any https:// URL on GitHub's hosts was downloaded, from any repository and any path, including a raw file on a branch or a path with dot segments that curl resolves to another repository. library.install, library.update and library.preview now refuse a url that isn't https://github.com/<owner>/<repo>/releases/download/<tag>/<file>. When the package's repo is a https://github.com/<owner>/<repo> URL, the asset must be in that repository (owner and name compared without case). Dot segments, also percent-encoded, empty segments, backslashes, queries and fragments are refused. file:// releases from a local catalog are read as before, and the SHA-256 and size checks are unchanged. A catalog other than the community one is still read only when library.refresh names it (https:// on GitHub's hosts, or a local file://). docs/plugins.md, docs/publishing-plugins.md and the library.install params text describe the rules.
This commit is contained in:
1 parent
3102b6e632
commit
75fed052e3
4 files changed
+134
-4
No files matched your search
+5
-1
@@ -374,7 +374,11 @@ package can't read files, open the network or crash the app.
|
||||
Install (`library.install`) downloads the package's `.wasm`, checks its SHA-256 (and its size, when the
|
||||
catalog gives one) against the catalog and loads it. Downloads use the system's `curl`,
|
||||
`https://` only and starting on GitHub's hosts (redirects stay on `https://`; the SHA-256 check
|
||||
is what guarantees the file).
|
||||
is what guarantees the file). A package's `url` must be a release asset
|
||||
(`https://github.com/<owner>/<repo>/releases/download/…`), in the package's `repo` when that is
|
||||
a GitHub repository URL. A catalog other than the community one is read only when
|
||||
`library.refresh {catalog}` names it: an `index.json` on GitHub's hosts over `https://`, or a
|
||||
local `file://` path.
|
||||
* **Where it goes.** `<Plug-ins>/Library/<id>/<version>/<id>.wasm` (the `Plug-ins` folder next to
|
||||
the settings), listed in `Library/installed.json`. Installed packages load at start-up, each
|
||||
checked against the SHA-256 it was installed with. The catalog last fetched is kept as
|
||||
|
||||
Reference in new issue
Block a user