Commit b8c862e4 authored by Lisa's avatar Lisa

fix: register browser/computer capabilities after controller init

parent 9f498292
......@@ -261,7 +261,7 @@ cat > "$CONFIG_DIR/config.json" << EOF
"permissions": {
"deny": ["sudo", "su", "doas", "dd if=", "mkfs", "fdisk", "wipe"],
"ask": ["rm -rf", "dd if=", "> /dev/", "chmod", "chown", "mv /", ":/usr/", ":/etc/", ":/bin/", ":/sbin/"],
"allow": []
"allow": []
}
}
EOF
......
......@@ -544,14 +544,14 @@ class NodeAgent:
def __init__(self, config_path: Optional[str] = None):
self.config = self._load_config(config_path)
self.executor = make_executor(self.config)
self.capabilities = self._detect_capabilities()
self.computer = make_computer_controller(self.config)
self.browser = None
if self.capabilities.get('enable_browser') and HAS_BROWSER:
if self.config.get('enable_browser') and HAS_BROWSER:
try:
self.browser = BrowserController()
except Exception as e:
_log_init_warning('browser_control', e)
self.capabilities = self._detect_capabilities()
def _load_config(self, path: Optional[str]) -> Dict[str, Any]:
"""Load node configuration from JSON."""
......
......@@ -261,7 +261,7 @@ cat > "$CONFIG_DIR/config.json" << EOF
"permissions": {
"deny": ["sudo", "su", "doas", "dd if=", "mkfs", "fdisk", "wipe"],
"ask": ["rm -rf", "dd if=", "> /dev/", "chmod", "chown", "mv /", ":/usr/", ":/etc/", ":/bin/", ":/sbin/"],
"allow": []
"allow": []
}
}
EOF
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment