Proposal: contribute fork work upstream — core extension points, an app-store plugin (F-Droid with signature verification), app visibility

Aperta
#204 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
12/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
android, java, kotlin, react, typescript

Direzione di ricerca

This is a scoping proposal, not a task: it offers five separate workstreams and asks the maintainers four open questions, so the first step is a maintainer decision on which parts to accept and in what order. Read CONTRIBUTING.md and web/EXTENDING.md for the fork-plugin contract, then the desired-config and agent-state code paths named in the issue to judge the extension-point proposal. Nothing should be started until the questions in "What we'd like to know" are answered; the agent bug reports in part 5 (cross-referenced with #187) belong in their own issues.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Area

Server plugins, admin console extensions, device agent (cross-cutting; a proposal to contribute fork work upstream).

The problem

We run a private fork of MDMesh (based on v0.4.0) for a small fleet of company phones (Samsung Galaxy A26). Following the fork guidance in CONTRIBUTING.md and web/EXTENDING.md, we kept our own logic in plugins/fork/ and web/src/extensions/, but a few things could not be done without touching core, and some of what we built looks generally useful rather than specific to us. We would rather contribute it than carry it privately, and we'd like to ask how (and whether) you would want to receive it before we spend time rebasing onto main.

Proposed solution

Everything below exists and is tested on our side. We can split it into small, focused PRs in whatever order suits you.

1. Neutral extension points in core (small, no feature logic, no fork naming)

  • Server: a plugin can contribute its own section to the desired configuration document and to its revision, and read back the state the agent reports for that section (DesiredConfigContributor gained section(...), sectionRevision, stateReported; DesiredConfig / AgentDeviceState carry an opaque per-plugin x map).
  • Agent: an AgentExtension interface (own capabilities, own config section, hooks on process start / boot / heartbeat, a PackageOperationGate around the agent's own installs and uninstalls), discovered from separate Gradle modules, so a fork adds a module instead of editing core.
  • Console: a device.apps slot on the device's Apps tab (extra columns, row actions, a notice), with a way for an extension to save only its own namespace of a configuration's extensions without wiping the configuration's apps.

2. appstore plugin: install apps from stores, with publisher verification (neutral, self-contained: plugins/fork/appstore + web/src/extensions/appstore)

  • A small provider SPI (StoreProvider: search, info, release, download with its own host/trust policy). Adding a store is one class and one binding line. The engine knows nothing about a particular store.
  • Two providers today:
    • F-Droid: the index is taken through the signed entry.jar; the signer is checked against the pinned fingerprint of the official repository, the index against the SHA-256 in entry.json, each APK against the SHA-256 and signer from the index; an older (replayed) index is rejected. A version is chosen for the fleet (not beta, ABI, minSdk, preferred signer).
    • RuStore (a Russian app store): works, but through its unofficial API, so you may prefer to leave this one out; it is a separate package.
  • The server downloads the APK itself, verifies it with apksig (v2/v3 required, exactly one signer), pins the publisher's signing certificate, adds the app to the library and links it to the chosen configurations.
  • A daily check for new versions, with two modes per app: ask (a badge and an "Update on phones" button) or install at once. If the signing key changes, updates are blocked until an administrator explicitly accepts the new key (recorded: who, when, previous key).
  • Strict network policy (https only, fixed hosts, manual redirects, size and time limits), a dedicated permission, per-customer isolation.
  • Tests: 122 server tests (HTTP and DAOs substituted, real apksig), console tests, and an end-to-end run against live F-Droid and RuStore on a local stand, including a server restart in the middle of a download.

For comparison with the current F-Droid tab: as far as we can tell it reads index-v2.json without checking the repository signature and links the external APK URL. The provider above could replace or complement it; we'd be glad to adapt it to how you want F-Droid to work.

3. App visibility and restrictions (plugin + agent module + console extension)

  • Per configuration: a list of allowed apps; every other app with a launcher icon is hidden (setApplicationHidden), including preinstalled ones; apps assigned to the configuration for install are allowed automatically.
  • A fixed set of protected packages that are never hidden (the agent, Settings, dialer, Play services, system UI, launcher, keyboard, etc.), per-device exceptions, uninstall blocking.
  • Restrictions as separate toggles: install apps, uninstall apps, modify accounts, debugging.
  • A time-limited "service mode" that lifts hiding and restrictions for a technician and returns by itself (survives a changed clock; ends at reboot).
  • Console: labels and row actions on the device's Apps tab.
  • This is our alternative to lock-task kiosk for drivers' phones: the phone stays a normal phone (quick settings work), there is just nothing else to open. Verified on a Galaxy A26 so far: hiding by the allowed list, and agent-driven installs while the install restriction is on; the rest is covered by unit tests and a stand with a simulated device.

4. Russian translation of the console

Done as an extension layered over the UI (no core edits), with a coverage test that fails on any untranslated string. If you plan proper i18n, we can instead contribute the Russian strings in whatever format you choose.

5. Bug reports for the agent (0.4.0), which we will file separately with logs: results of large app.install commands sometimes never reach the server (the command stays "delivered" although the app is installed); when a download in a batch is interrupted, the rest of the batch is abandoned; and a delivered-but-unfinished command is not re-sent for six hours. #187 may already address part of this; we haven't tested main yet.

What we'd like to know
  1. Are you interested in any of this, and which parts?
  2. For parts 2 and 3: would you want them as bundled plugins, as core features, or kept as examples of fork plugins?
  3. Is the unofficial RuStore provider acceptable upstream, or should it stay on our side?
  4. In which order should we send PRs? Our guess: the extension points first (they are the only core changes), then appstore, then the rest.

Our code is on v0.4.0; we will rebase onto current main (and re-test on a device) before opening any PR. Everything would be contributed under the project's Apache-2.0 license.

Alternatives considered

Keeping everything in the private fork. It works, but the core extension points have to be re-applied on every upstream release, and the app-store verification seems useful to other deployments too.

Before submitting
  • I searched existing issues and discussions for the same idea.
Lingua principale
Java
Stelle
44
Fork
25
Merge medio
1g 13h
PR unite (30g)
80

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di MDMesh-app/MDMesh

Tutte le issue di MDMesh-app/MDMesh

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.