Skip to content

feat(umbrel): add headless seeder daemon, Axum web server, and Umbrel packaging - #2

Open
borocode wants to merge 23 commits into
lnbits:mainfrom
borocode:feat/umbrel-headless-daemon
Open

feat(umbrel): add headless seeder daemon, Axum web server, and Umbrel packaging#2
borocode wants to merge 23 commits into
lnbits:mainfrom
borocode:feat/umbrel-headless-daemon

Conversation

@borocode

Copy link
Copy Markdown

Summary

This PR adds support for running Napstr as a 24/7 headless sovereign audio seeder and web player for Umbrel / UmbrelOS (and any headless server/docker environment).

Key Additions

  1. Headless Daemon (napstr-daemon):

    • Lightweight binary running an Axum REST + WebSocket server on port 30421.
    • Auto-manages the Tor onion controller and Nostr relay connections.
    • Watches and indexes local music libraries (/music) without needing a desktop window open.
  2. Universal Dual-Mode Client:

    • Added $lib/api.ts bridge that automatically detects whether Napstr is running in desktop Tauri or inside a web browser.
    • Added in-browser HTML5 WebAudio streaming engine ($lib/webAudio.ts) with HTTP Range request (206 Partial Content) support.
  3. Decoupled Event Layer:

    • EventEmitter trait implemented for both Tauri IPC (TauriEmitter) and Tokio broadcast channels (BroadcasterEmitter).
  4. Umbrel App Store Packaging:

    • umbrel-app.yml manifest, docker-compose.yml, and multi-stage Dockerfile.umbrel.

Verification

  • npm run build passes with 0 errors (static Svelte 5 SPA).
  • cargo build --bin napstr-daemon compiles and links cleanly.

borocode and others added 23 commits August 22, 2026 17:14
… app packaging

- Add napstr-daemon headless entrypoint running 24/7 on port 30421
- Add Axum REST and WebSocket API router mirroring all Tauri commands
- Add HTML5 WebAudio in-browser audio streaming with HTTP Range seek support
- Add universal frontend API client bridge supporting desktop and web
- Decouple EventEmitter abstraction for Tauri and Tokio broadcast channels
- Add umbrel-app.yml, docker-compose.yml, and multi-stage Dockerfile.umbrel
Daemon is built from src-tauri and links against webkit2gtk/gtk3/soup3/
javascriptcore/wayland even in headless mode. Runtime stage only had
libasound2+libdbus -> 13 'not found' libs on arm64 (libwayland-client first).
Verified via QEMU arm64 ldd against the exact GHCR image: 0 missing after
adding libwebkit2gtk-4.1-0, libgtk-3-0, libsoup-3.0-0, libjavascriptcoregtk-4.1-0.
setup-buildx-action has no 'builder' input - the previous config silently
fell back to whichever builder was last selected on the runner host
(docker driver), which cannot do linux/amd64+linux/arm64 multi-platform.
Now: ensure mybuilder exists (docker-container driver), bootstrap it,
and set it as the default for the job. No more ambient host-state dependency.
setup-buildx-action create hit 'existing instance but no append mode' and
did not switch the active builder; build still ran on docker driver.
build-push-action accepts a per-invocation 'builder' input - targeting
mybuilder directly, no global-state switching required.
Self-hosted Windows runner is a minefield for docker builds: PowerShell
run-steps mangle /dev/null into C:\dev\null, builder selection depends on
fragile host state, and the docker driver cannot multi-platform build.
ubuntu-latest gives a clean linux environment with working containerd
store + native buildx multi-platform support. GHA layer caching added to
offset slower hosted hardware.
- Merge upstream/main (0.1.4): daemon core rewrite (scan_lock/scan_cancel,
  progress events), player + network fixes, 3000-track indexing fix.
- Add headless wrappers (index_path_headless, start_folder_watcher_headless)
  so the Umbrel seeder daemon runs without a Tauri AppHandle.
- Re-point server/daemon to queue_catalogue_publish + re-expose IndexReport
  as pub for the web layer.
- Bump umbrel-app.yml version 0.1.0 -> 0.1.4.
- Verified: cargo check passes for both napstr-daemon and tauri desktop.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant