Repository navigation
OpenBox 3.1.0: Hardened Rust Core, Cleaner Tree
OpenBox 3.1.0 hardens the native Rust server across security, concurrency, HTTP streaming, session lifecycle, and platform parity, wires background automation and window flags directly into openbox-server, and consolidates the repository layout while keeping your existing 3.0 and 2.x library 100% compatible.
If 3.0.0 moved the backend from Python to native Rust, 3.1.0 finishes the daemon wiring and closes edge cases under real desktop workloads. Scheduled maintenance, durable media downloads, pause-aware playtime accounting, Windows shell launching and process suspension, macOS tool PATH resolution, FTS5 SQLite search, and lazy file streaming all tighten up without changing library.json or breaking any /api/v2 contract.
Tip
Drop-in upgrade for OpenBox 3.0 and 2.x users: Install 3.1.0 over your existing copy and open it. Your library.json (schema 7), box art, saves, Save Vault snapshots, settings, themes, and playlists load untouched with zero migration and zero re-scraping.
Full changelog: CHANGELOG.md | Code diff: v3.0.0...v3.1.0 | Coming from 1.x? Read upgrade-3.0.md
At a Glance: What Changed in 3.1.0
- Lazy 64 KiB streaming and non-blocking HTTP dispatch: Media and asset downloads stream in
64 KiBasync chunks instead of buffering full files in RAM, while synchronous handlers across all 417 endpoints run on Tokio's blocking pool under a 30-second timeout. - Full daemon lifecycle and CLI flags in
openbox-server: Nativeopenbox-servernow runs the durable media download worker, startup and shutdown commands, hourly maintenance sweeps, structuredtracing-subscriberlogging, graceful HTTP/SSE/webhook draining, and--app-window,--no-app-window,--bigbox,--resolution, and--backup --keep <n>flags. - FTS5 SQLite search and deadlock-free state recovery:
SqliteReadModelauto-enables at 5,000+ games, uses a single persistentCondvarrebuild worker, and runsgames_fts MATCHwithbm25ranking and an escapedLIKEfallback instead of scanning full JSON blobs.JsonStateStoreunifies lock ordering acrossrecover()and schema-6-to-7 migration. - Library projection and integrity check parity: Fixed missing-path
store_installedandplayablestatus on projected game cards (project_game) and restored{severity, count, examples}category objects plus livesave_vaulttotals in/api/v2/library/integrityand--check-library. - Pause-accurate playtime and live session recaps: Double-launch races are blocked with an atomic
"starting"reservation, paused time is subtracted from recorded playtime, session recaps include live screenshot counts, RetroAchievements deltas, and Quick Resume availability, and restarted servers reattach watchers to running games. - Windows, macOS, and Linux platform fixes: Direct Win32
ShellExecuteWlaunching, real Windows process-tree pause/resume,.dlllibretro core detection,\\?\extended/UNC path normalization, macOS Homebrew/MacPortsPATHsetup, typed macOSlibprocstructs, and process-group timeout termination across external tools. - Consolidated repository layout (ADR 0117): Moved 28 flat runtime Python modules into
app/, native host sources intonative/, packaging metadata intopackaging/, and shell scripts intoscripts/, with matching macOS bundle and Windows installer path updates.
Native Rust Server: Security, Concurrency, and API Parity
Every layer of the 15-crate Rust workspace received targeted hardening and Python-oracle parity fixes:
- Streaming media and Range/ETag parity:
send_fileuses lazy64 KiBasync streaming (Body::from_stream) so large videos and manuals stay off the heap.If-None-Matchaccepts weakW/ETags and*, and malformedRangeheaders return400 RANGE_PARSE_ERROR. - Non-blocking route dispatch and duplicate elimination: Synchronous GET and POST route handlers offload to Tokio's blocking pool with a 30-second
REQUEST_TIMEOUT(504 REQUEST_TIMEOUTon timeout), matching async external handlers (/api/v2/netplay/lobbyand/api/v2/emulators/defs/*). Removed a duplicate/api/v2/steam/actionmatch inimports.rsand verified zero shadowed handlers across all 417 routes (413/api/v2/*plus 4/api/host/*). - Stricter HTTP boundaries and error parity:
Hostvalidation rejects malformed loopback headers (localhost:evil,[::1]evil, port0) while accepting bracketed[::1]:port. Querytokenparameters are redacted from RFC 9457instancefields, non-GET/POST requests return405 METHOD_NOT_ALLOWEDwithAllow: GET, POST, static/locale routes reject backslashes, NUL bytes, and dot segments withcanonicalizeroot containment, andAuthRateLimiterprunes expired entries once 256 IPs are tracked. - Restored endpoint parity:
/api/v2/highscoresnow reads per-game scores (read_local_highscores) instead of scanning the home folder,/api/v2/emulators/dependenciesruns realdetect_dependencies,/api/v2/emulators/settingsGET and POST expose and validate plugin-declaredemulator_settingssections,/api/v2/launch/auditreturns{"scanned": false, "job": null}when unscanned,/api/v2/theme-assetreturns404 HTTP_404when missing, and strict game lookup (400 BAD_REQUEST) guards favorite, progress, rating, memories, screenshot, clips, metadata, andsaves/addmutations. - Missing-path projection and integrity report parity:
project_gamenow computesstore_installed(checkingpath_existsandinstall_dirwhen bothsteam_app_idandinstall_dirare set, otherwise falling back topath_exists) andplayable(!manual_entryandstore_installedfor store-backed entries) to match Python when paths are missing on disk, keepingsteam_installableandsteam_repairableaccurate.check_librarynow emits{severity, count, examples}category objects (preserving full counts while cappingexamplesat 20, mappinglibrary_root_missingtokens with raw{gid}: {p}examples, and checking Unixgame_path_unreadablepermissions) as expected bystatic/library_storage.js, and both/api/v2/library/integrityandopenbox-server --check-librarypopulate livesave_vaulttotals viavault_summary_readonly. - Deadlock-free state store and FTS5 read model:
JsonStateStore::load_readonly_lockedremoves the read/reindex lock gap, respects frozen libraries, fsyncs.baktemp files, and keepsthread_lockandfile_lockunified throughrecover()andmigrate_primary_to_v7().SqliteReadModelsetsPRAGMA busy_timeout=5000, exposes livependingandrebuildingflags on its persistentCondvarworker (750 msdebounce,5,000 msmax wait), and queriesgames_fts MATCHwithbm25ordering plus a bounded SQLLIKE ... ESCAPE '\'fallback. - Daemon scheduler, SSE, jobs, and shutdown drain:
openbox-serverstarts the durable media download queue worker, runsstartup_commandsandshutdown_commands, and executes startup plus hourly maintenance ticks (tray recent games, due Time Capsules, scheduled health scans and launch audits, auto-backups, auto Save Vault passes, and Deal Radar refreshes).JobManagerexempts continuousauto-importjobs from foreground worker permits, prunes history/cancel maps, and falls back to OS threads off-runtime.SseHubstrips CR/LF in broadcast JSON, keeps slow subscribers connected when queues fill, and validatesgame_idbefore reading RA caches. On shutdown, the server closes SSE streams, drains active connections and in-flight webhooks for up to 2 seconds, stops running sessions, emits pluginapp_shutdown, cleans upserver.port/server.token, and drains the optional strangler Python proxy (which now reads startup output on a 20-second helper thread and preserves multi-value response headers). - SSRF, archive, backup, and Gameyfin hardening: External requests use typed
HttpRequestOpts(fixing swapped timeout/byte-cap arguments in updates and plugin catalog fetches) and a pooled client (POOLED_PUBLIC_CLIENT) with.no_proxy(). SSRF validation blocks::a.b.c.d,0100::/64, Teredo (2001::/32),2001:2::/48, and2001:20::/28, validates redirect targets, and runs async DNS checks on webhook targets (validate_webhook_async). Zip extraction checks cumulativemax_total_bytes, deletes partial over-limit files, rejects case-insensitive duplicate entry names on Windows and macOS, and serializes7zextraction under a file lock and timeout. Backup and save restores enforce32 GiBtotal and4 GiBper-member limits (1 MiBmanifest limit). Gameyfin sanitizesContent-Dispositionfilenames, uses.no_proxy(), parsesContent-Typecase-insensitively, and re-authenticates only on HTTP401or403. - Identity, rounding, sync, and UTF-8 safety:
stable_game_idtreats empty[]and{}fields identically to empty strings, milestone progress and hour calculations use half-to-even rounding (round_ties_even()), Cloud Sync defaultsfavoritetofalse, Time Machine initializeslibrary_syncmetadata even when zero games changed, and non-ASCII date strings no longer panic byte-slice parsers in discovery and metadata modules.
Platform, Launcher, and Installer Fixes
- Windows launching, pause/resume, and paths: Replaced
cmd /C startwith direct Win32ShellExecuteW(withWin32_UI_WindowsAndMessagingenabled), implemented real Windows process-tree pause and resume viaTH32CS_SNAPTHREAD(SuspendThread/ResumeThread), passedCREATE_NO_WINDOWtotaskkill, treatedERROR_ACCESS_DENIEDinOpenProcessas a live process, accepted.dlllibretro cores inCORE_FILE_RE, and matched Pythonntpathnormalization for\\?\UNC\...,\\?\C:\..., volume prefixes, and bare\\server\sharepaths. - macOS
PATH,libproc, and bundle layout:openbox-serverrunsapply_macos_tool_path()at startup so Homebrew and MacPorts tools are found outside terminal sessions, andcrates/openbox-platformreplaces rawproc_pidinfobyte offsets with typedlibc::proc_bsdinfoandlibc::proc_vnodepathinfostructs checked at compile time.scripts/build_macos_app.shplacesplugin_runner_v2.pyunderContents/Resources/openbox/app/to matchlocate_runner_v2, and emulator test drain waits were raised to 10 seconds for slower shared macOS CI runners. - Linux, gamescope, and timeout-safe subprocesses:
run_command_timeoutisolates Unix child processes in their own process group (setpgid(0, 0)), drains pipes concurrently under bounded capture caps, and kills the full child tree on timeout across7z, Flatpak,mame -listxml,hi2txt,ryzenadj,ludusavi,hoard,pgrep, and screenshot commands.open_pathrejects NUL bytes,open_urlallows onlyhttp://andhttps://, Unix openers prefix leading-paths with./and reap detached opener processes, and deep-link IPC probes running servers over a dedicated no-proxyLOOPBACK_CLIENT.open_uihandles--app-window,--no-app-window,--bigbox,--width/--height/--resolution, scrubbed host environments, andxpropSTEAM_GAMEtagging. - Emulator YAML parsing and Flatpak probing: YAML parsing now handles escaped characters, quoted keys, and commas inside quoted inline-map values.
version_probeinspects native--version,flatpak info --user --show-version, andflatpak remote-info --user flathubunder timeouts,emulator_statuspreserves adapter order and declared platform lists, andbwrapsandbox probing caches its result per executable path. - Installers and CI smoke fixes:
scripts/install.ps1invokesapp/updates.pyfor verification and desktop registration, CIperf-20kchecks out the realrelease/1.19.1baseline branch, andscripts/ui_smoke.cjsretries preset-clear clicks while async search-worker facet counts arrive.
Repository Layout Consolidation (ADR 0117)
If you build from source or maintain packaging, the repository root is now organized around build-time vs runtime concerns:
- Moved into subdirectories: The 28 flat runtime Python modules now live under
app/(mapped toshare/openbox/app/byruntime_modules.txt), native host sources (native_host*.c/.m/.rc,openbox.ico) live undernative/, install metadata (openbox.desktop,openbox.metainfo.xml,io.openbox.GameLauncher.yml) lives underpackaging/, andbuild_appimage.sh+run_all_tests.shjoinscripts/. - Kept at root:
web_app.py,index.html,openbox.svg,openbox-release.pub, and all launcher scripts (openbox.sh,openbox-native.sh,openbox.cmd,openbox.ps1,openbox-native.ps1) stay at the root. Compiled native host binaries (native_host,native_host.exe) and installed user paths remain unchanged.
Upgrade in Under a Minute
Every release package ships the native Rust openbox-server binary directly with zero bundled Python runtime. AppImage, Windows, and macOS downloads include SHA-256 checksums and Ed25519 signatures verified by the installers and in-app updater.
| Platform | Download | What's Inside |
|---|---|---|
| Linux x86_64 | OpenBox-x86_64.AppImage |
Native Rust openbox-server, WebKitGTK host, zero bundled Python, GLIBC_2.35 floor, zsync delta updates, .sha256 / .sig / CycloneDX SBOM |
| Linux aarch64 | OpenBox-aarch64.AppImage |
Native Rust openbox-server, WebKitGTK host, zero bundled Python, GLIBC_2.35 floor, zsync delta updates, .sha256 / .sig / CycloneDX SBOM |
| Linux Flatpak | OpenBox-x86_64.flatpak |
Native Rust openbox-server + WebKitGTK host bundled directly; GNOME 51 runtime |
| Windows x86_64 | OpenBox-x86_64-windows.zip |
Standalone openbox-server.exe + WebView2 native_host.exe (no Python needed to launch), .sha256 / .sig |
| Windows ARM64 | OpenBox-arm64-windows.zip |
Standalone ARM64 openbox-server.exe + ARM64 WebView2 native_host.exe (no Python needed to launch), .sha256 / .sig / CycloneDX SBOM |
| macOS (Universal) | OpenBox-macos.zip |
Universal arm64 + x86_64 OpenBox.app (WKWebView) + openbox-server; ad-hoc signed, .sha256 / .sig / CycloneDX SBOM |
Linux
Use the signed AppImage installer (auto-detects x86_64 or aarch64, verifies the key pin, SHA-256 checksum, and Ed25519 signature, and installs to ~/.local/bin):
VERSION=3.1.0
curl --proto '=https' --tlsv1.2 --fail --location \
--output install.sh \
"https://github.com/vindeckyy/OpenBoxGL/releases/download/v${VERSION}/install.sh"
less install.sh
OPENBOX_RELEASE_TAG="v${VERSION}" bash install.shOr download OpenBox-x86_64.AppImage / OpenBox-aarch64.AppImage directly (chmod +x and run), or install the Flatpak bundle with flatpak install --user OpenBox-x86_64.flatpak.
macOS
Install or upgrade the universal OpenBox.app bundle with the signed installer (pass --replace on the last line when replacing an existing OpenBox.app):
VERSION=3.1.0
curl --proto '=https' --tlsv1.2 --fail --location \
--output install-macos.sh \
"https://github.com/vindeckyy/OpenBoxGL/releases/download/v${VERSION}/install-macos.sh"
less install-macos.sh
OPENBOX_RELEASE_TAG="v${VERSION}" bash install-macos.shWindows
Download and extract OpenBox-x86_64-windows.zip (or OpenBox-arm64-windows.zip):
- Portable launch (no Python required): Run
OpenBox\openbox.cmddirectly from the extracted folder. - Full verified install (Start Menu +
openbox://links + PATH): Runpowershell -ExecutionPolicy Bypass -File .\OpenBox\scripts\install.ps1 -Tag "v3.1.0"from PowerShell (verifies the Ed25519 signature using Python 3.11+ viaapp\updates.pyand installs to%LOCALAPPDATA%\OpenBox). - Source checkouts: Standalone
OpenBox-x86_64-windows-native-host.exeandOpenBox-arm64-windows-native-host.exebinaries (with.sha256and.sig) are also attached to the release for placing alongside a locally builtopenbox-server.exeasnative_host.exe.
Compatibility and Contract Notes
Note
Upgrading from OpenBox 3.0, 2.1, or 2.0? Nothing breaks. Schema 7 opens unchanged, every /api/v2 and /api/host contract stays identical, and deleting sqlite_readmodel.db still loses nothing (the search projection rebuilds automatically from library.json).
- Coming from 1.19 (schema 6) or earlier: Opening a library does not migrate it automatically. Schema 6 waits for
openbox --migrate-library(writinglibrary.v6.backup.jsonfirst). Schema 1 through 5 requires opening once on OpenBox 2.1 before upgrading to 3.x. - Removed legacy surfaces (unchanged from 3.0.0):
openbox --rollback-libraryremains removed (exits 4 without touching files; use OpenBox 2.1.0 to restorelibrary.v6.backup.json). Plugin API v1 remains removed; plugins must declare"api_version": 2. - Python 3.11+ only for source runs and Python plugins: Prebuilt release packages run natively on
openbox-serverwithout Python. Running from Python source (OPENBOX_BACKEND=python) or executing.pyv2 plugins requires Python 3.11 or newer. Buildingopenbox-serverfrom source requires Rust 1.92+ (Edition 2024;rust-toolchain.tomlpins1.99.1).
Technical contract matrix (3.0.0 vs 3.1.0)
| Contract | 3.0.0 | 3.1.0 |
|---|---|---|
| Server backend | Native Rust (openbox-server) |
Native Rust (openbox-server) |
| Formal scale | 50,000 games | 50,000 games |
| Public API | /api/v2 (413 routes) |
/api/v2 (413 routes) |
| Native host channel | /api/host (4 routes) |
/api/host (4 routes) |
| Library schema | 7 (no migration on open) | 7 (no migration on open) |
| Backup format | Write 2, read 1 and 2 | Write 2, read 1 and 2 |
| Plugin API | 2 only | 2 only |
| Sync format | 3 | 3 |
| Canonical store | library.json |
library.json |
Known Limits
- The macOS bundle is ad-hoc signed, so first launch and ad-hoc updates require Privacy & Security confirmation (
System Settings > Privacy & Security > Open Anyway). - Linux-only features (such as Steam Game Mode / Gamescope, Flatpak management, Wine/Proton, and Faugus) remain hidden on Windows and macOS by design via the server capability contract.
- OpenBox 1.19 cannot read a schema 7 library.
- Windows paths longer than 260 characters depend on the system long-path opt-in.
- Flathub submission is tracked separately.