Stores · tutorial
A complete store source.
One repository that produces signed packages, a valid store.json, a custom storefront and a GitHub source. This is the smallest end-to-end shape that works in rumahl OS.
What you will build
my-store/
├── apps/
│ └── notes/
│ ├── manifest.json
│ └── frontend/
│ ├── index.html
│ └── main.js
├── keys/ # never commit the private keystore
├── scripts/
│ ├── package.mjs # signed directory -> package document
│ └── index.mjs # catalogue entry generation
├── site/
│ ├── index.html # your custom storefront (optional)
│ ├── app.js
│ ├── store.json
│ ├── packages/
│ │ └── notes.package.json
│ └── media/
│ ├── notes-icon.png
│ └── notes-screen.png
└── trust.json # development verification only
The same site/ directory is both an HTTPS source and a custom storefront. Inside rumahl OS, only store.json and the signed packages matter; the website is an additional discovery surface. The public rumahl store is different: store.rumahl.com serves the public storefront and catalog API, while downloads and updates resolve to github.com/rumahl/apps.
1. The app manifest
{
"formatVersion": 1,
"publisherId": "com.example",
"app": {
"appId": "com.example.notes",
"version": "1.0.0",
"displayName": "Notes",
"runtime": {
"kind": "web",
"entrypoints": [
{ "id": "main", "kind": "web-asset", "path": "frontend/index.html" }
]
},
"lifecycle": "on-demand",
"permissions": [
{ "id": "com.rumahl.os.window", "scope": "user-own", "required": true },
{ "id": "com.rumahl.os.theme", "scope": "user-own", "required": true }
],
"settings": []
}
}
The exact bytes of this file are what the signature covers. The importer validates the schema, entrypoints, permissions and every payload digest.
2. Sign the package
cargo run -p rumahl-app-packages --bin rumahl-package -- keygen \
--key-id example-1 --publisher com.example \
--keystore keys/example.json --trust-store trust.json
cargo run -p rumahl-app-packages --bin rumahl-package -- sign \
--package build/notes \
--manifest apps/notes/manifest.json \
--keystore keys/example.json
cargo run -p rumahl-app-packages --bin rumahl-package -- verify \
--package build/notes --trust-store trust.json
The signed directory now contains package.json, package.sig.json and the payload. Keep keys/example.json out of the repository and out of CI logs.
3. Build the package document
A package URL returns a JSON envelope with base64 file contents. The shell sends the same files through the authenticated import endpoint; the Rust importer still verifies the signature.
import {readdir, readFile, writeFile, mkdir} from "node:fs/promises";
import {join, relative} from "node:path";
async function filesUnder(root, current = root) {
const entries = await readdir(current, {withFileTypes: true});
const files = [];
for (const entry of entries) {
const path = join(current, entry.name);
if (entry.isDirectory()) files.push(...await filesUnder(root, path));
else files.push(path);
}
return files;
}
export async function packageDocument(packageDir, output) {
const files = [];
for (const path of (await filesUnder(packageDir)).sort()) {
files.push({
path: relative(packageDir, path).split("\\").join("/"),
content: (await readFile(path)).toString("base64")
});
}
await mkdir(join(output, "packages"), {recursive: true});
await writeFile(
join(output, "packages", "notes.package.json"),
JSON.stringify({packageVersion: 1, files})
);
}
4. Generate the index
import {writeFile} from "node:fs/promises";
const store = {
storeVersion: 1,
name: "Example Store",
description: "Small local-first apps for the home.",
apps: [
{
id: "com.example.notes",
title: "Notes",
version: "1.0.0",
summary: "A local-first notes app.",
publisher: "Example",
packageUrl: "packages/notes.package.json",
category: "Productivity",
iconUrl: "media/notes-icon.png",
screenshots: ["media/notes-screen.png"],
permissions: ["Control its own window", "Follow the OS theme"]
}
]
};
await writeFile("site/store.json", JSON.stringify(store, null, 2) + "\n");
packageUrl is relative to the index URL, so the same index works on HTTPS and on a GitHub raw URL. Optional fields are omitted when you do not have real values.
5. Host the source
| Option | Index URL | Notes |
|---|---|---|
| Static HTTPS host | https://store.example/store.json | Serve the whole site/ directory |
| GitHub repository | github:example/store | The shell resolves raw.githubusercontent.com/example/store/main/store.json |
| GitHub directory | github:example/store@main/catalog | The index is catalog/store.json |
| GitHub tree URL | https://github.com/example/store/tree/main/catalog | Equivalent to the directory form |
For a GitHub source, relative package URLs resolve against the raw index URL. Keep the packages/ and media/ directories next to store.json.
name: Publish store
on:
push:
tags: ["v*"]
permissions:
contents: read
pages: write
id-token: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Restore signing key
run: |
mkdir -p keys
echo "$RUMAHL_KEYSTORE" | base64 -d > keys/example.json
chmod 600 keys/example.json
env:
RUMAHL_KEYSTORE: ${{ secrets.RUMAHL_KEYSTORE }}
- name: Build package CLI
run: cargo build --locked -p rumahl-app-packages --bin rumahl-package
- name: Sign and package
run: |
mkdir -p build/notes
cp -R apps/notes/frontend build/notes/frontend
target/debug/rumahl-package sign \
--package build/notes \
--manifest apps/notes/manifest.json \
--keystore keys/example.json
node scripts/package.mjs
node scripts/index.mjs
- uses: actions/upload-pages-artifact@v3
with:
path: site
- uses: actions/deploy-pages@v4
Store the keystore as an encrypted repository secret. A leaked signing key lets an attacker publish as your publisher identity; rotate the key and treat the old identity as compromised.
6. Test end to end
- Run the repository’s example store:
scripts/dev-example-store.sh. - Add the local HTTPS URL in Settings → Store sources.
- Confirm the certificate once.
- Install the app and verify the signed package and install journal.
- Open the custom storefront and follow the same source URL instructions.
- Disable the source and confirm the catalogue disappears from the Store navigation.
scripts/dev-example-store.sh
# builds and signs example apps, serves the site, and mirrors a GitHub source tree
7. Add the custom storefront
The optional site/index.html reads the same store.json. It must follow the Store guidelines: identify the publisher, never offer an unsigned install path, tell users to add the source in Settings, and keep the metadata truthful.
The complete external website contract is in Build a custom storefront.
Publish checklist
- The source is HTTPS, stable and does not redirect.
- Each package verifies against the intended trust store.
store.jsonhasstoreVersion: 1and valid app IDs.- Index and manifest agree on ID, version and publisher.
- Package and image URLs resolve on the same host or GitHub raw host.
- No private key, token or database is in the repository or
site/. - The OS Store and the custom storefront show the same catalogue.
- No review, certification or verified badge is claimed.
Next
- Publish an app — the package document in detail.
- Build a custom storefront — the external website contract.
- Store guidelines — the rules for every source.
- Review & release — preflight and rollback.
Was this page helpful?