Split the apps and the SDK out of Fennec OS

The apps are developed apart from the OS now, each in its own repo under
gitea.bluefox.support/fennec:
- sdk: sf-app (the app contract: manifest, permissions, store rules,
  sandbox, launch; from sf-ipc), sf-ui, sf-pack, the app template, the
  developer guide. The OS depends on it by tag (v0.1.0).
- youtube, steam: store apps. netflex (native) replaces the Netflex web app.
- store: the Fennec catalog, the store source a new TV starts with.

This repo keeps the OS and its own apps (Settings, App Store, AirPlay,
Miracast). sf-ipc re-exports sf-app, so OS code is mostly unchanged.

- Store apps may register for DIAL (the `dial` permission); an official
  app with the same DIAL name wins.
- Built-in icon names are for official apps only.
- The image installs the catalog apps at build time (factory-store.toml,
  sf-update store in mkosi.postinst.chroot). Steam's system part stays in
  the image: 32-bit libraries, controller udev rules (from Valve's apt
  repo), Valve's key.
- Older TVs move over by themselves: sf-update adds the replacements to
  store.toml once, the old factory app stays until its replacement is
  installed, YouTube's and Steam's data folders move to the new ids, and
  the old sf-app-<id> packages are not installed any more.

Shell 0.3.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Tamas Csikel
2026-10-25 17:58:21 +01:00
parent d7e9fe4568
commit deedf1416a
67 changed files with 393 additions and 13476 deletions

View File

@@ -1,10 +1,12 @@
//! DIAL glue: apps with a `[dial]` section in their manifest (YouTube) can be
//! started from a phone.
//! started from a phone. Store apps may do it too (the `dial` permission the
//! user approved); an official app with the same DIAL name wins.
use std::sync::Arc;
use anyhow::{Context, Result};
use sf_dial::{AppState, Config, Handler, LaunchParams};
use sf_ipc::{AppManifest, Origin};
use crate::apps::Core;
@@ -12,7 +14,32 @@ struct Dial(Arc<Core>);
impl Dial {
fn app_for(&self, dial_name: &str) -> Option<String> {
self.0.apps().into_iter().find(|a| a.dial.as_ref().is_some_and(|d| d.name == dial_name)).map(|a| a.id)
pick(self.0.apps(), dial_name)
}
}
/// The app that answers to `dial_name`: official apps first, then store apps
/// (in the app list's order).
fn pick(apps: Vec<AppManifest>, dial_name: &str) -> Option<String> {
let mut found: Vec<AppManifest> = apps.into_iter().filter(|a| a.dial.as_ref().is_some_and(|d| d.name == dial_name)).collect();
found.sort_by_key(|a| a.origin == Origin::Store);
found.into_iter().next().map(|a| a.id)
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn official_dial_app_wins() {
let app = |id: &str, origin| {
let mut a: AppManifest = toml::from_str(&format!("id = '{id}'\nname = 'x'\nkind = 'web'\nurl = 'https://x'\n[dial]\nname = 'YouTube'\n")).unwrap();
a.origin = origin;
a
};
assert_eq!(pick(vec![app("io.x.tube", Origin::Store), app("youtube", Origin::Official)], "YouTube").as_deref(), Some("youtube"));
assert_eq!(pick(vec![app("io.x.tube", Origin::Store)], "YouTube").as_deref(), Some("io.x.tube"));
assert_eq!(pick(vec![app("io.x.tube", Origin::Store)], "Netflix"), None);
}
}