Repository navigation
Install your own .wgt or .tpk, sent from a phone or PC browser (#30) - #38
Merged
Merged
Conversation
- The service serves an upload page at http://<TV IP>:8077/upload and takes one package at a time (PUT /upload, 400 MB cap, must be a Tizen package: manifest.js reads the ids from config.xml or tizen-manifest.xml). Nothing is signed or installed until the TV-Store screen asks for it with the token the service writes into the package's private data folder at start, which no other app on the TV can read. - The page polls /uploads, shows the file (sender, ids, hash) in a sheet with Install on this TV / Not now / Discard, and reuses the install and done screens. - Settings shows the upload address as a QR code. - test/manifest.test.js and test/upload.test.js, both in the workflows.
This was referenced Oct 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #30. Replaces #36, which GitHub closed when its base branch (#35, now merged) was deleted; rebased onto main.
Inderdeep29 asked to send a custom package to TV-Store from a browser, since with Host PC IP pointing at the TV the phone and PC can no longer install. This adds that, with the TV in charge of what gets installed.
How it works
http://<TV IP>:8077/upload(Settings on the TV shows it as a QR code): a small page, pick a.wgtor.tpk, Send to the TV, with a progress bar.PUT /upload?name=), streams it to its data folder while hashing it, and reads the package's own ids fromconfig.xmlortizen-manifest.xml(newservice/manifest.js, also used for thevd_appinstallapp id). Anything that is not a Tizen package, is not.wgt/.tpk, or is over 400 MB is refused with a reason the page shows. One file waits at a time; a new one replaces it./uploadsevery 3 s and opens a sheet: who sent it, the file, what it calls itself and its version, the hash, an Update from vX / Installed badge when the TV has that package, and a warning that the file is not from the catalog. Install on this TV runs the normal install and done screens (first step reads "Received from your phone or PC"); Not now keeps it waiting; Discard deletes it.Who may install an upload
The service's stance (
install()): the port is open to every app on the TV, and none of them gets to pick what is signed with the user's certificate. An upload path must not undo that, soPOST /install { upload, token }requires a token the service generates at every start and writes into the package's private data folder (.a2s-upload-token, next to the certificate). The page reads it throughtizen.filesystem(wgt-private), which no other app on the TV can read, fresh before every upload install so a restarted service still accepts it. If the page cannot read it, the sheet says so and the Install button is disabled; catalog installs are untouched.The upload page and
PUT /uploadare open to the LAN like/log.txt(the file sits on the TV until someone at the TV decides; capped, one at a time, logged with the sender's IP). Nothing installs without OK on the remote. README has a section on this.Tests
test/manifest.test.js: ids from a.wgtand a.tpk, no-manifest and not-a-zip refused.test/upload.test.js: the real service as a child (data folder viaTMPDIR): junk and.txtrefused, a.wgtstored and named (path traversal in the name stripped),/uploadslists it, install without the token refused (NO_TOKEN), with the token it reaches the signer (no certificate there, so the file keeps waiting), discard clears it.build-wgt.yml(Node 20 and the TV's 4.4.3) andrelease.yml;manifest.jsin the syntax check. Whole suite passes locally on Node 18.{ upload, token }and lands on the done screen, the no-token case disables Install with the reason, Discard clears it; the real service's upload page rendered at phone size.wgt-privateon the page is the same folder as the service'sapps_rw/<pkg>/dataon every Tizen version (it is where the certificate already lives, per the comments inindex.js).No version bump; that is for the release PR.