feat(app): the bot's own Chrome in the data folder, reaching only public addresses

- install step browser: Chrome for Testing 157 (pinned SHA-256) into runtime/chrome
- services start it headless with its own profile when features.browser is on; CDP on a free
  loopback port passed to the worker as JARVIS_BROWSER_CDP; a failure leaves the services running
- every Chrome connection goes through the app's loopback egress proxy: one lookup, public
  addresses only (403 otherwise, no host logged), QUIC off, WebRTC only through the proxy
- stop: Browser.close, then kill after 5 s; dashboard shows the browser's state
- the worker's runtime environment follows the settings step, not every step being installed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
javis-bot
2026-11-13 22:01:04 +09:00
parent 69f1bf4fa9
commit 24d0798bae
12 changed files with 724 additions and 16 deletions

View File

@@ -93,6 +93,8 @@ pub struct FeatureSettings {
pub meals: bool,
/// Background collection (admin.spec.md, "Background collection").
pub collect: bool,
/// The bot browser (admin.spec.md, "Bot browser").
pub browser: bool,
}
/// Background collection (admin.spec.md, "Background collection"); no targets by default.
@@ -184,7 +186,7 @@ impl Default for Settings {
response: PolicySettings::default(),
memory: Map::new(),
llm: LlmSettings { url: None, port: 8080, context: 32768 },
features: FeatureSettings { weather: true, web_search: true, meals: true, collect: true },
features: FeatureSettings { weather: true, web_search: true, meals: true, collect: true, browser: true },
mcp_servers: vec![],
collect: CollectSettings { keep_days: 30, targets: vec![] },
}
@@ -505,6 +507,7 @@ pub fn parse_settings(raw: &Value) -> Result<Settings, SettingsError> {
web_search: get_bool(f, "webSearch", "features", d.features.web_search)?,
meals: get_bool(f, "meals", "features", d.features.meals)?,
collect: get_bool(f, "collect", "features", d.features.collect)?,
browser: get_bool(f, "browser", "features", d.features.browser)?,
}
},
mcp_servers: parse_mcp_servers(raw)?,
@@ -804,13 +807,13 @@ mod tests {
#[test]
fn features_and_mcp_servers_are_read_and_checked() {
let s = parse_settings(&json!({}));
assert_eq!(s.unwrap().features, FeatureSettings { weather: true, web_search: true, meals: true, collect: true });
assert_eq!(s.unwrap().features, FeatureSettings { weather: true, web_search: true, meals: true, collect: true, browser: true });
let s = parse_settings(&json!({
"features": {"weather": false, "meals": false},
"mcpServers": [{"name": "brave", "command": "npx", "args": ["-y", "brave"], "env": ["BRAVE_API_KEY", " "]},
{"name": "time-2", "command": "uvx", "enabled": false}]
})).unwrap();
assert_eq!(s.features, FeatureSettings { weather: false, web_search: true, meals: false, collect: true });
assert_eq!(s.features, FeatureSettings { weather: false, web_search: true, meals: false, collect: true, browser: true });
assert_eq!(s.mcp_servers, vec![
McpServerSettings { name: "brave".into(), command: "npx".into(), args: vec!["-y".into(), "brave".into()],
env: vec!["BRAVE_API_KEY".into()], enabled: true },