The settings page gets a Proxy section (Advanced) and a Certificates section (Security), cavekit-proxies-certs.md: - Proxy: No proxy (now the default), webOS's own proxy setting, the Riverstone Relay, WebOne, my own proxy (HTTP/HTTPS/SOCKS, direct list) and a PAC URL, read from and written to the engine's network.proxy.* prefs. The engine's "system proxy" (type 5) reads GNOME's settings and does nothing in the headless build; it is gone from the page. - webOS's proxy setting: the daemon reads com.palm.connectionmanager/getNwProxiesConfig on its own Luna connection at start, at every card connect and on request, and components/jihadProxy.js applies it when the user chose to follow it. - components/jihadCerts.js: at the first page (the daemon announces "jihad-nss-ready"), the CA certificates in webOS's stores that are not HP's 3.0.5 roots, not removed by Mozilla, not Jihad's own and not expired are trusted in memory (NSS temporary certificates). The lists come from HP's doctor image and CCADB (render/goanna/certs/make-cert-lists.py). Switching the setting off takes the trust away at once and clears TLS sessions and idle connections that were checked under it. - The Relay's CA is carried and pinned; trusted only when the user turns it on while the Relay is in use, never through a store or a link. - Opening a CA certificate asks on the card (a JS nsICertificateDialogs), including one sent as a download (WebOne's); the added CAs are listed in Settings with Remove. - A proxy's 407 names the proxy; Enyo and Mochi say "The proxy ... requires a username and password". Found on the way: JS components are read as Latin-1, so non-ASCII in their strings came out garbled (the print status's ellipsis, the persona importer's BOM strip); escaped. The install scripts leave a byte-identical adapter alone: replacing one LunaSysMgr has mapped left a deleted file on / that kept it read-write. Device (Enyo, CE 3.1.0): the five newer roots trusted and nothing written to cert9.db; a SwissSign 2022-1 site loads with the setting on and fails off; a Certificate Manager CA trusted after a start and gone after removal; the Relay re-signs with its CA off and loads with it on; manual, PAC, webOS's setting and a login proxy through a PC test proxy; WebOne 0.18.3's CA from its link, then https through it; the Relay's CA refused from a link. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LcrVQFRMC2ANGDfVaRG9Ed
89 lines
5.0 KiB
C++
89 lines
5.0 KiB
C++
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
*
|
|
* Jihad Browser — the daemon's own LunaService (cavekit-ipc-contract.md R4).
|
|
*
|
|
* WHY THIS EXISTS, and why it is NOT `com.palm.browserServer`.
|
|
* The isis app clears cache/cookies by calling `palm://com.palm.browserServer/clearCache`
|
|
* over the Luna bus. That name belongs to the STOCK browser daemon, which we deliberately
|
|
* coexist with rather than replace — so on a device with Jihad installed, the call SUCCEEDS
|
|
* and clears the wrong browser: measured 2026-08-04, `{"returnValue":true}` came back from
|
|
* the stock daemon while Jihad's own cookies were untouched. Silent, and user-visible the
|
|
* moment cookie persistence started working.
|
|
*
|
|
* So each variant registers its OWN service name, the fifth instance of a pattern this port
|
|
* already uses four times for coexistence (own NPAPI MIME, own YAP service name, own upstart
|
|
* job, own state directory). The alternative — exposing clearCache/clearCookies as scriptable
|
|
* adapter methods — would widen the frozen `callBrowserAdapter` set that cavekit-ui-shell.md
|
|
* R2 holds byte-identical to upstream, i.e. break a met criterion in another kit to fix this
|
|
* one. The service name is not part of that contract; the adapter surface is.
|
|
*
|
|
* NO BUILD-TIME DEPENDENCY. There is no `lunaservice.h` in the ARM sysroot (the device has
|
|
* `/usr/lib/liblunaservice.so` but no headers), so the handful of entry points are declared
|
|
* here and resolved with dlopen/dlsym at startup. That also means a device or a desktop build
|
|
* WITHOUT the library degrades to "no Luna service" instead of failing to start — which is
|
|
* exactly what the desktop harness needs, since there is no Luna bus there at all.
|
|
*
|
|
* The struct layouts below are taken from the webOS 3 sources in this workspace, not guessed:
|
|
* `LSMethod` is {name, function} with NO flags field on this generation (luna-sysmgr
|
|
* BackupManager.cpp, ref-BrowserServer BrowserServer.cpp both terminate with {0,0}).
|
|
*/
|
|
#ifndef JIHAD_LUNA_SERVICE_H
|
|
#define JIHAD_LUNA_SERVICE_H
|
|
|
|
#include <glib.h>
|
|
#include <string>
|
|
|
|
namespace jihad {
|
|
|
|
// Registers `palm://<serviceName>/` with clearCache + clearCookies + notifications and
|
|
// attaches it to the daemon's GLib loop. Returns false (having logged why) if the library, the
|
|
// bus, or the registration is unavailable; the daemon runs on regardless — this is an added
|
|
// capability, never a startup requirement.
|
|
//
|
|
// `notifications` is the SUBSCRIBED method behind the non-blocking message channel
|
|
// (cavekit-gre-widgets.md R5). A card calls it once with {"subscribe":true} at startup and is
|
|
// then pushed one payload per jihad::PostNotification. On success this installs a
|
|
// jihad::NotificationSink; LunaServiceStop clears it again. Same argument as every other
|
|
// method here: this is a LUNA surface, so the byte-frozen YAP command/message interface
|
|
// (cavekit-ipc-contract.md R1) is untouched and no card gains an adapter call.
|
|
bool LunaServiceStart(const std::string& serviceName, GMainLoop* loop);
|
|
|
|
// The app id of THIS variant's card ("net.riverstonerelay.jihad-browser[-variant]"). The methods
|
|
// that change something on the public bus (enableFlash / disableFlash) accept a call only from
|
|
// it. Call before LunaServiceStart; unset means those methods refuse everyone.
|
|
void LunaServiceSetOwnAppId(const std::string& appId);
|
|
|
|
// Who renders a bookmark thumbnail: given a path, arrange for a PNG of the active page to be
|
|
// written there and say whether a page was found. Set by the server before LunaServiceStart.
|
|
typedef bool (*LunaThumbnailFn)(const std::string& path);
|
|
void LunaServiceSetThumbnailFn(LunaThumbnailFn fn);
|
|
|
|
// Who prints: given the card's request (JSON naming the printer), hand the active page to the
|
|
// printing component. Set by the server before LunaServiceStart.
|
|
typedef bool (*LunaPrintFn)(const std::string& requestJson);
|
|
void LunaServiceSetPrintFn(LunaPrintFn fn);
|
|
|
|
// Who knows the active page's certificate: fills `json` (one object, returnValue included)
|
|
// and says whether the page came over TLS. Set by the server before LunaServiceStart.
|
|
typedef bool (*LunaCertificateFn)(std::string* json);
|
|
void LunaServiceSetCertificateFn(LunaCertificateFn fn);
|
|
|
|
// Read webOS's own proxy setting (com.palm.connectionmanager/getNwProxiesConfig) once; the
|
|
// answer, or a returnValue:false saying why there is none, is raised to the components as the
|
|
// observer topic "jihad-webos-proxy" (cavekit-proxies-certs.md R1). Main loop only.
|
|
void LunaServiceReadWebosProxy();
|
|
|
|
// Best-effort unregister. Safe if Start() failed or was never called.
|
|
void LunaServiceStop();
|
|
|
|
// The service name for a variant, derived from its YAP name so the two identities cannot
|
|
// drift: "jihad-browser" -> "net.riverstonerelay.jihad-browser". See
|
|
// context/plans/plan-variant-identity.md, which is the single source for the table.
|
|
std::string LunaServiceNameFor(const char* yapName);
|
|
|
|
} // namespace jihad
|
|
|
|
#endif
|