GitHub Repository and Updates
The signed GitHub catalog, entry.json, index, updates and revocations.
This document defines how NextGram distributes plugins through GitHub. It covers the repository layout, catalog metadata, signed index, app flow, moderation and updates. It replaces the earlier "signed catalog on plugins.nextgram.dev" sketch.
Status: app client, UI, updates, revocations and publishing tooling implemented and verified against a signed catalog. The repository scaffold, index builder, signing tools and release workflows live in the separate nextgram-plugins repository; the catalog repository is public and the official public key is pinned in the app. Better Blur is ready to publish; the first release is waiting for the first-party signing secrets. Custom repositories are deferred to the next release.
1. Principles#
- GitHub is transport, not trust. The app trusts a signed index key and each plugin's signing key, not the repository owner.
- Every package is verified by the existing verifier. A repository entry cannot bypass manifest, ZIP, DEX, permission or signature checks.
- No silent installs. A repository install or update always opens the consent screen. Updates show the permission diff.
- Immutable downloads. An artifact URL points to a GitHub Release asset or a commit-pinned raw file. The app also checks SHA-256 from the signed index.
- Source stays reviewable. The repository keeps metadata, source links, icons and screenshots. Large
.ngpbinaries live in GitHub Releases. - Repository compromise is contained. A stolen index key can mark bad plugins as verified, but cannot sign a package update without the publisher key.
- Manual fallback always works. A
.ngpfrom a chat, a file manager or the file picker installs without any repository.
2. Default repository#
| Item | Value |
|---|---|
| Repository | https://github.com/gitwelk/nextgram-plugins |
| Default branch | main |
| Index | catalog/index.json |
| Index signature | catalog/index.sig |
| Revocations | catalog/revocations.json + catalog/revocations.sig, published manually when needed |
| Metadata | plugins/<plugin-id>/entry.json |
| Artifacts | GitHub Releases, tag <plugin-id>-v<version> |
| App entry point | NextGram Settings → Plugins → Repository |
The official repository key fingerprint is pinned in the app. The key is used only by the release workflow. Pull request validation runs with read-only permissions and no signing secrets.
3. Repository layout#
nextgram-plugins/
README.md
CONTRIBUTING.md
KEYS.md
LICENSE
AGENTS.md
.github/
pull_request_template.md
workflows/validate.yml
workflows/auto-release.yml
workflows/tag-release.yml
workflows/release-plugin.yml
workflows/publish.yml
catalog/
index.json
index.sig
revocations.json
revocations.sig
plugins/
<plugin-id>/
entry.json
icon.png
screenshots/
main.webp
README.md
templates/
entry.json
schemas/
catalog-entry.schema.json
index.schema.json
revocations.schema.json
tools/
validate_catalog.py
prepare_release.py
detect_pending_releases.py
build_index.py
sign_index.py
verify_index.py
generate_key.pycatalog/index.json and catalog/index.sig are generated by CI. The revocation feed is published by the maintainers with the same signing key. Do not edit the generated files by hand. A pull request changes plugins/<id>/entry.json, images and documentation only.
A plugin does not have to include source in this repository. entry.json must link to the source repository and to the exact commit or tag that produced the artifact. Source mirrors are welcome when the author agrees.
4. Catalog entry#
plugins/<id>/entry.json is the human-edited catalog record. The plugin package has its own plugin.json; this file adds presentation and release information.
{
"schemaVersion": 1,
"id": "dev.example.hello",
"name": "Hello NextGram",
"summary": "A minimal example plugin with a settings screen and a message action.",
"category": "examples",
"tags": ["sample", "settings", "chat"],
"license": "GPL-3.0",
"source": "https://github.com/gitwelk/nextgram-plugins/tree/main/plugins/dev.example.hello",
"homepage": "https://github.com/gitwelk/NextGram",
"support": "https://github.com/gitwelk/nextgram-plugins/issues",
"authors": [
{"name": "NextGram", "url": "https://github.com/gitwelk"}
],
"icon": "icon.png",
"screenshots": ["screenshots/settings.webp"],
"presentation": {
"accent": "#9D6BFF",
"cover": "cover.webp"
},
"releases": [
{
"version": "1.0.0",
"versionCode": 1,
"tag": "dev.example.hello-v1.0.0",
"asset": "dev.example.hello-1.0.0.ngp"
}
]
}Rules:
idmatches the directory name and the installed plugin ID. Theapp.nextgram.*namespace is reserved for official built-ins.versionCodeincreases for every release and matches the package manifest.tagandassetare required for a published release.sha256,sizeandsignatureFingerprintare added by CI; a contributor may include them for review but CI remains authoritative.sourceis an HTTPS link to the source at the released commit.licenseis an SPDX identifier.iconis a PNG or WebP under the plugin directory, at most 2 MB and 1024×1024.screenshotscontains at most 6 images, each at most 4 MB.presentationis optional.accentis#RRGGBB;coveris a PNG or WebP under the plugin directory. They style the repository card and details header only. They do not change the Telegram theme.- Unknown fields are rejected by the validator until the schema is extended.
entry.json is not trusted at install time. The app reads the generated index and then verifies the actual .ngp.
5. Generated index#
CI builds catalog/index.json from all valid entries and release assets:
{
"format": "ngp-index",
"formatVersion": 1,
"repository": "https://github.com/gitwelk/nextgram-plugins",
"generatedAt": "2026-12-03T12:00:00Z",
"commit": "0123456789abcdef0123456789abcdef01234567",
"plugins": [
{
"id": "dev.example.hello",
"name": "Hello NextGram",
"summary": "A minimal example plugin with a settings screen and a message action.",
"category": "examples",
"tags": ["sample", "settings", "chat"],
"license": "GPL-3.0",
"source": "https://github.com/gitwelk/nextgram-plugins/tree/0123456789abcdef0123456789abcdef01234567/plugins/dev.example.hello",
"authors": [{"name": "NextGram", "url": "https://github.com/gitwelk"}],
"iconUrl": "https://raw.githubusercontent.com/gitwelk/nextgram-plugins/0123456789abcdef0123456789abcdef01234567/plugins/dev.example.hello/icon.png",
"coverUrl": "https://raw.githubusercontent.com/gitwelk/nextgram-plugins/0123456789abcdef0123456789abcdef01234567/plugins/dev.example.hello/cover.webp",
"accent": "#9D6BFF",
"latest": {
"version": "1.0.0",
"versionCode": 1,
"api": 1,
"minHost": ">=13.4.0",
"downloadUrl": "https://github.com/gitwelk/nextgram-plugins/releases/download/dev.example.hello-v1.0.0/dev.example.hello-1.0.0.ngp",
"sha256": "hex...",
"size": 48213,
"signatureFingerprint": "hex...",
"publishedAt": "2026-12-03T11:00:00Z",
"verified": true
},
"versions": []
}
]
}Index rules:
commitis the repository commit that produced the index. Icon and cover URLs are pinned to it.downloadUrlis a GitHub Release asset URL. A self-contained repository may use a commit-pinned raw path instead; arbitrary mutable branch URLs are rejected.verifiedis attached to a release, not to a plugin forever. A new unreviewed version of a previously verified plugin isverified: false.latestis the highest publishedversionCode, not the highest semver string.versionskeeps older releases for rollback and diagnostics. It is optional and may be truncated by CI.index.sigis a detached ECDSA P-256 signature over the exact bytes ofindex.json. The file contains base64-encoded ASN.1 DER with a trailing newline.revocations.jsonuses the format in security.md and has the same detached signature scheme.
6. App flow#
6.1 Browse#
- The user opens NextGram Settings → Plugins → Repository.
- The app fetches
catalog/index.jsonandcatalog/index.sigover HTTPS, with anETag/If-None-Matchcache. - The app verifies the index signature with the pinned key. A missing or invalid signature fails closed and shows an error.
- The repository screen shows search, categories, featured entries and an Updates section. Icons and covers are loaded through the existing image loader with size limits and cached on disk.
- Plugin details show name, summary, author, source link, license, screenshots, permissions, signature fingerprint, changelog and verified badge.
No account identifier, phone number, user ID or device ID is sent. The request is a plain HTTPS GET.
6.2 Install#
- The app downloads the
.ngpfromdownloadUrlwith the 64 MB cap. - SHA-256 and size are checked against the signed index.
- The file goes through
NgpVerifierexactly like a chat or file-manager install: manifest, ZIP safety, limits, DEX, icon and signature. - The normal consent screen opens with source, permissions, key fingerprint and the trusted-code warning. For an update it also shows the permission diff and changelog.
- Install is atomic. A failed update leaves the previous version working.
6.3 Update check#
- Check now is always available in the plugin manager. Plugin details show an update action when a verified update is available.
- Check daily is opt-in and off by default. When enabled it runs at most once per 24 hours and uses the same anonymous HTTPS request.
- An update is offered only when the repository index has the same plugin ID, a higher
versionCode, a compatibleapi/minHostand the same package signing key. - The update is never installed silently. Declining keeps the old version.
- If the index check fails, the current plugin stays installed and the error is shown.
6.4 Revocation#
- Critical revocations disable the plugin as soon as a verified list is applied and again at the next start, with a non-dismissible notice.
- Non-critical revocations show a warning and recommend uninstalling.
- The user can override a non-critical revocation with an explicit warning. The override is stored per plugin, fingerprint and revocation version. Critical malware revocation is not overridable.
- Revocations are checked on repository refresh and on update checks, not silently in the background by default.
6.5 Custom repositories (deferred)#
Custom repositories are not part of v1. The app uses the pinned official catalog only. A future release can add an HTTPS repository URL with the same catalog/index.json and catalog/index.sig layout, a fingerprint confirmation on first use, and the same rule that a custom index cannot grant trust to a package signed by a different key.
7. Moderation#
The repository is curated, but review is not a sandbox. Code plugins run as trusted code; the warning stays in the installer.
A pull request must:
- add a valid
plugins/<id>/entry.jsonand pass the schema; - ship a signed
.ngprelease asset built from the linked source; - use the same signing key as previous releases of that ID;
- increase
versionCode; - include an icon, a short summary and at least one screenshot for UI plugins;
- justify dangerous permissions in the pull request;
- include a license and source link;
- avoid native libraries, downloads of executable code and protected surfaces.
CI checks structure, schema, ID/version monotonicity, image limits, manifest and signature of the artifact. A maintainer reviews behavior, permissions, source and license. verified: true means "reviewed by the NextGram maintainers", not "safe".
Takedown and incident handling follow security.md: remove the entry, publish a revocation, notify users and keep the package hash for diagnostics.
8. Presentation metadata#
presentation.cover and presentation.accent are optional catalog decoration:
- the cover appears in repository cards and the details header;
- the accent tints the plugin icon background and the install button;
- both are validated at index build time and ignored if invalid;
- neither changes Telegram theme colors, chat backgrounds or the app shell.
A future package-level cover can be added to plugin.json and assets/ after the theme runtime exists. Until then the catalog cover is display-only and is not copied into the installed package.
9. Implementation order#
- Repository scaffold — done in
nextgram-plugins/. - Schema, validator and pull request workflow — delivered, including tooling tests and revocation validation.
- Release workflow — delivered in
publish.yml: build the index from entries, read artifacts, signindex.json, commit the catalog.release-plugin.ymlbuilds and signs first-partydev.nextgram.*packages, creates the GitHub Release and callspublish-index;auto-release.ymldispatches it when a mergedplugin.jsonraisesversionCode, andtag-release.ymldoes the same for a pusheddev.nextgram.<id>-v<version>tag. The matching public key is pinned in the app; the protected index and first-party signing secrets still have to be configured before the first release. - App index client — delivered: fetch, ETag cache, signature verification, strict parsing and a developer-mode unsigned fallback.
- Repository UI — delivered: list, search, categories, details, download and install through the existing consent screen. Remote icons use an initial/accent fallback.
- Updates — delivered:
versionCodecomparison, permission diff, changelog, opt-in daily check and explicit update install. - Revocations — delivered: verified refresh, critical disable, notices and non-critical override.
- Custom repositories — trust-on-first-use and fingerprint display. Pending.
- Share to chat — send an installed
.ngpas a document. Pending. - Moderation automation — labels, review checklist, revocation tooling. Pending.
10. Open decisions#
- The custom repository trust model: trust-on-first-use or an explicit key import. Deferred to the next release.
- Catalog governance: who reviews
verifiedplugins and how takedowns are handled. - Whether CI builds third-party artifacts from source or only verifies author-built artifacts. Verification is the v1 baseline.
- Final cover image dimensions and accent validation rules.