1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//! The shell Ledgeline's apps share: everything between "a router of API
//! routes plus a built SPA" and "a hardened local server in a desktop window".
//!
//! - [`security`] — the per-process bearer token, the `Host` guard, the
//! exact-origin CORS allowlist and the security headers (CSP included), plus
//! [`security::harden`] / [`security::protect`], which put them on a router.
//! - [`spa`] — serving an app's `RustEmbed`-ed SPA same-origin, with the
//! embedded-mode marker injected and a per-response CSP.
//! - [`app_dirs`] — where an app keeps its own state ([`AppDirs`]).
//! - [`recents`] — the recently-opened store, shared by every app.
//! - [`gui`] (the `gui` feature) — the desktop boot pieces: the in-process
//! server on an ephemeral port, the window, the standard menus, the wry
//! webview with its navigation policy, and the platform glue.
//!
//! The UI-preferences data model lives one layer down, in
//! [`ledgeline_core::ui_prefs`], because it is data, not runtime.
//!
//! Nothing here knows which app it is serving: an app describes itself once
//! with an [`AppIdentity`] and hands it to the pieces that need a name.
pub use AppDirs;
/// Who the shell is serving: the names an app shows, logs under and hands to
/// its SPA.
///
/// The SPA reads the two globals at startup, so they are part of the app's
/// contract with its own web build and must never change for an app that has
/// shipped (Ledgeline's are `__LEDGELINE_TOKEN__` and
/// `__LEDGELINE_EMBEDDED__`). The shell embeds them in scripts after checking
/// nothing, so they must be plain JavaScript identifiers.