From f283674da334a9e351537b23796af68a5ca68bda Mon Sep 17 00:00:00 2001 From: yankun Date: Sun, 2 Aug 2026 17:45:30 +0800 Subject: [PATCH] Allow cloud console host for pi-web --- install.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/install.sh b/install.sh index 4ffdeb4..7c3819c 100755 --- a/install.sh +++ b/install.sh @@ -127,6 +127,7 @@ resolve_bin() { write_pi_web_service() { local pi_web_bin="$1" local service_file="/etc/systemd/system/pi-web.service" + local allowed_hosts="$PI_WEB_ALLOWED_HOSTS_VALUE" info "Writing pi-web systemd service ..." run_root tee "$service_file" >/dev/null </dev/null || true)" + fi + + if [ -n "$claw_id" ]; then + printf '%s.claw.cutos.ai' "$claw_id" + else + printf '' + fi +} + configure_clawd_agent_type() { local config_dir="/etc/clawd" local env_file="$config_dir/env" @@ -197,9 +214,15 @@ TARGET_USER="$(detect_user)" TARGET_HOME="$(detect_home "$TARGET_USER")" TARGET_GROUP="$(id -gn "$TARGET_USER" 2>/dev/null || printf '%s' "$TARGET_USER")" PI_HOME="$TARGET_HOME/.pi" +PI_WEB_ALLOWED_HOSTS_VALUE="$(detect_pi_web_allowed_hosts)" info "Installing for user: $TARGET_USER" info "Pi working directory: $PI_HOME" +if [ -n "$PI_WEB_ALLOWED_HOSTS_VALUE" ]; then + info "Pi Web allowed hosts: $PI_WEB_ALLOWED_HOSTS_VALUE" +else + warn "claw_id not found in /etc/clawd/config.json; Pi Web external host is not configured yet." +fi configure_clawd_agent_type @@ -242,6 +265,7 @@ CutOS Agent install complete. Pi home: $PI_HOME Service: pi-web.service + Pi Web allowed hosts: ${PI_WEB_ALLOWED_HOSTS_VALUE:-not configured} clawd env: /etc/clawd/env Logs: journalctl -u pi-web -f Console: http://127.0.0.1:30141/