From 916440fb313d3d3431543811e0be221cf1ba0e4c Mon Sep 17 00:00:00 2001 From: Local Dev Date: Thu, 22 Oct 2026 22:58:35 +0300 Subject: [PATCH] prometheus: /submit becomes a 4-step publisher wizard MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The submit page was a one-form upload tester that said "not wired yet" on the three steps that would turn an upload into a published listing. It now walks a publisher through the whole thing in-page. Four client-side steps, state in one object (W = {file, upload, manifest, message, signature}), scroll-to-top on each transition, back buttons preserved so revisions are a correction not a restart: Step 1 — Upload File picker → POST /api/upload. Response rendered as a card showing name + size + short hash + the scan verdict chip ("scan ✓ clean (clamav, 2ms)"). Advance button only enabled when scan is clean; infected or error paths show the reason inline and stay on step 1. Step 2 — Describe Form fields for publisher BNS name, slug, display name, category (optgroup'd by top-level: Apps subs, then Games, then FinTech), version, description, download URL, homepage + icon (optional). Pattern + maxlength validation matches the server's rules in service/listings.js. Submit builds W.manifest and canonicalises the signing message. Step 3 — Sign Shows the canonical message to sign. If window.bitcoincash is injected (Theseus with Aegis), a one-click "Sign with Theseus wallet" button calls bitcoincash.signMessage(). Fallback paste textarea accepts a 86–88 char BIP-137 signature from any wallet (Electron Cash, Deviant, Cashonize). Both paths populate W.signature and enable the continue button. Step 4 — Publish POST /api/listing with the full body. On 201 shows the listing card + a "View your listing →" button pointing at /app//. On error shows the server's reason inline and re-enables the Publish button for retry. Canonical JSON in the client is a direct copy of service/listings.js's canonicalJson — same bytes, same signature. A test that drifts them apart would be nice; for now a comment on each copy flags the pairing. scripts/test-listing-roundtrip.mjs's default category changed from the old `utilities` slug (removed in the taxonomy change) to `productivity`. --- scripts/test-listing-roundtrip.mjs | 2 +- service/pages.js | 410 +++++++++++++++++++++++++---- 2 files changed, 358 insertions(+), 54 deletions(-) diff --git a/scripts/test-listing-roundtrip.mjs b/scripts/test-listing-roundtrip.mjs index 35f6108..46d927a 100644 --- a/scripts/test-listing-roundtrip.mjs +++ b/scripts/test-listing-roundtrip.mjs @@ -28,7 +28,7 @@ import { signMessageBip137, addressFromPrivateKey } from '../service/lib/sign-me const BASE = process.env.BASE || 'http://127.0.0.1:3700'; const PUBLISHER = process.env.PUBLISHER || 'testpub.x'; const SLUG = process.env.SLUG || `hello-world-${Date.now()}`; -const CATEGORY = process.env.CATEGORY || 'utilities'; +const CATEGORY = process.env.CATEGORY || 'productivity'; // A hard-coded deterministic test key — this is NEVER a real wallet key, just // a predictable 32-byte scalar so the roundtrip script can print the matching diff --git a/service/pages.js b/service/pages.js index a24a55c..2fa736c 100644 --- a/service/pages.js +++ b/service/pages.js @@ -307,97 +307,401 @@ export function submit() { return { title: 'Submit an app', description: - 'Upload an app to Prometheus. We scan it, generate the manifest and the APS1 record, you sign with your BNS key and the listing goes on chain.', + 'Upload an app to Prometheus. We scan it, generate the manifest, you sign with your BNS key and the listing goes live.', here: '/submit', body: `

Submit an app

-

Upload, scan, sign, publish. Four screens; your key stays with you.

+

Upload → fill manifest → sign with your wallet → publish. + Your key stays with you.

+
-
Milestone 1 of 4: upload + scan. This step is - live and testable. The next milestone wires the manifest and APS1 record - (see the publishers' walkthrough); payment and the - on-chain publish come after that.
- -
    -
  1. 1. Upload the binary. - Pick a file (any file — we don't care what the format is, only - what ClamAV says about the bytes). The server scans it, hashes it, - and hands back a signed scan report.
  2. -
  3. 2. Fill the manifest. - Name, description, category, version, icon URL. Scan verdict is - attached automatically. Not wired yet.
  4. -
  5. 3. Sign with your BNS key. - The service shows the APS1 payload. Sign in Theseus, paste a - BIP-137 signature from any BCH wallet, or import your name's mnemonic - once in the page (wiped on close). Not wired yet.
  6. -
  7. 4. Pay the listing fee (eventually). - Free during the opening wave; a BCH invoice for the per-listing - fee once storage costs cross a threshold. Not wired yet.
  8. +
      +
    1. Upload the binary (any size up to 2 GiB)
    2. +
    3. Describe name, publisher name, category, description
    4. +
    5. Sign with the BCH key for your publisher BNS name
    6. +
    7. Publish POST to the directory
-
-

Upload a file to try it

-

Pick any file to send through the scanner. The upload is - accepted, SHA-256'd, and either kept (clean) or discarded (infected or - error). Nothing is published; this is just the scan step.

+ +
+

1 · Upload the binary

+

The server scans with ClamAV + VirusTotal (where configured), + computes the SHA-256, and attaches a signed scan report to your listing. + Only clean uploads can proceed.

-
+ -
+
- + +
+ + + + + + + + +