From 92a69cae80d8cd1c20d6b8182700674164b72fa0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=BE=E6=96=87=E9=94=8B0668000834?= Date: Tue, 7 Apr 2026 14:04:14 +0800 Subject: [PATCH 1/6] fix: improve channel allow_from logging for better debugging (Closes #2381) --- pkg/channels/base.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/channels/base.go b/pkg/channels/base.go index bd4ced849..6a1090837 100644 --- a/pkg/channels/base.go +++ b/pkg/channels/base.go @@ -5,6 +5,7 @@ import ( "crypto/rand" "encoding/binary" "encoding/hex" + "fmt" "regexp" "strconv" "strings" @@ -118,10 +119,15 @@ func NewBaseChannel( // currently defaults to accepting messages from ANYONE. To explicitly // acknowledge and permit this (e.g. for a public bot), use ["*"]. if len(bc.allowList) == 0 { - logger.WarnCF("channels", "SECURITY: Channel allows EVERYONE (allow_from is empty)", map[string]any{ + logger.WarnCF("channels", fmt.Sprintf("SECURITY: Channel '%s' allows EVERYONE (allow_from is empty)", bc.name), map[string]any{ "channel": bc.name, "hint": "Set allow_from to your ID, or use '*' to explicitly acknowledge open access.", }) + } else { + logger.InfoCF("channels", fmt.Sprintf("Channel '%s' allow_from configured", bc.name), map[string]any{ + "channel": bc.name, + "allow_list": bc.allowList, + }) } return bc From ffa769f125fb87d16a465d7ff14d89ef8827e090 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=BE=E6=96=87=E9=94=8B0668000834?= Date: Tue, 7 Apr 2026 14:09:24 +0800 Subject: [PATCH 2/6] fix(docker): add HOME environment variable to docker-compose.full.yml (Closes #2269) --- docker/docker-compose.full.yml | 8 ++++++++ docker/docker-compose.yml | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/docker/docker-compose.full.yml b/docker/docker-compose.full.yml index 6f34448c4..9c1d58d2b 100644 --- a/docker/docker-compose.full.yml +++ b/docker/docker-compose.full.yml @@ -10,6 +10,10 @@ services: container_name: picoclaw-agent-full profiles: - agent + environment: + # PicoClaw runs as root in container by default + # If running as non-root user, update these paths to match the user's home directory + - HOME=/root volumes: - ../config/config.json:/root/.picoclaw/config.json:ro - picoclaw-workspace:/root/.picoclaw/workspace @@ -30,6 +34,10 @@ services: restart: unless-stopped profiles: - gateway + environment: + # PicoClaw runs as root in container by default + # If running as non-root user, update these paths to match the user's home directory + - HOME=/root volumes: # Configuration file - ../config/config.json:/root/.picoclaw/config.json:ro diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 7c940621f..b5643d79d 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -12,7 +12,7 @@ services: #extra_hosts: # - "host.docker.internal:host-gateway" volumes: - - ./data:/root/.picoclaw + - ./data:/home/picoclaw/.picoclaw entrypoint: ["picoclaw", "agent"] stdin_open: true tty: true @@ -31,7 +31,7 @@ services: #extra_hosts: # - "host.docker.internal:host-gateway" volumes: - - ./data:/root/.picoclaw + - ./data:/home/picoclaw/.picoclaw # ───────────────────────────────────────────── # PicoClaw Launcher (Web Console + Gateway) @@ -52,4 +52,4 @@ services: - "18800:18800" - "18790:18790" volumes: - - ./data:/root/.picoclaw + - ./data:/home/picoclaw/.picoclaw From 8c9fa7d442c31621ad980cf2c216a00a9c5c9a0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=BE=E6=96=87=E9=94=8B0668000834?= Date: Tue, 7 Apr 2026 14:14:10 +0800 Subject: [PATCH 3/6] docs: fix Go version badge to match go.mod (1.23) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a48a53d47..794825b6e 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@

$10 Hardware · 10MB RAM · ms Boot · Let's Go, PicoClaw!

- Go + Go Hardware License
From 4af73dc2329da625659e6822b31d96c0def7c2a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=BE=E6=96=87=E9=94=8B0668000834?= Date: Tue, 7 Apr 2026 14:16:17 +0800 Subject: [PATCH 4/6] chore: add more patterns to .gitignore for temp and local files --- .gitignore | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.gitignore b/.gitignore index 135867842..4b35ebe77 100644 --- a/.gitignore +++ b/.gitignore @@ -69,3 +69,24 @@ web/backend/dist/* docker/data .omc/ + +# Temporary files +*.tmp +*.temp +*.log + +# Local development +local/ +local.* + +# Node modules for frontend +web/frontend/node_modules/ +web/frontend/dist/ +web/frontend/.cache/ + +# Python virtual environments +venv/ +env/ +ENV/ +__pycache__/ +*.py[cod] From 6124b016789019ce0a506d01e30a7dc1d800bd2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=BE=E6=96=87=E9=94=8B0668000834?= Date: Tue, 7 Apr 2026 14:17:01 +0800 Subject: [PATCH 5/6] chore: add .editorconfig for consistent coding styles --- .editorconfig | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..cdc283d0a --- /dev/null +++ b/.editorconfig @@ -0,0 +1,35 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Default settings for all files +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +# Go files +[*.go] +indent_style = tab +indent_size = 4 + +# JSON, YAML, and Markdown files +[*.{json,yml,yaml,md}] +indent_style = space +indent_size = 2 + +# JavaScript/TypeScript files +[*.{js,ts,tsx}] +indent_style = space +indent_size = 2 + +# Shell scripts +[*.sh] +indent_style = space +indent_size = 2 + +# Makefile +[Makefile] +indent_style = tab From 31e05ea19c7217cdf10e6efd556bb73b0cd36ad4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=BE=E6=96=87=E9=94=8B0668000834?= Date: Tue, 7 Apr 2026 14:41:19 +0800 Subject: [PATCH 6/6] fix(channels): improve security warning for empty allow_from (fixes #2381) --- pkg/channels/base.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/channels/base.go b/pkg/channels/base.go index 6a1090837..f2de3699e 100644 --- a/pkg/channels/base.go +++ b/pkg/channels/base.go @@ -119,14 +119,16 @@ func NewBaseChannel( // currently defaults to accepting messages from ANYONE. To explicitly // acknowledge and permit this (e.g. for a public bot), use ["*"]. if len(bc.allowList) == 0 { - logger.WarnCF("channels", fmt.Sprintf("SECURITY: Channel '%s' allows EVERYONE (allow_from is empty)", bc.name), map[string]any{ - "channel": bc.name, - "hint": "Set allow_from to your ID, or use '*' to explicitly acknowledge open access.", + logger.WarnCF("channels", fmt.Sprintf("SECURITY: Channel '%s' allows EVERYONE (allow_from is empty). This is a potential security risk.", bc.name), map[string]any{ + "channel": bc.name, + "channelID": bc.name, + "hint": "Set allow_from to your ID, or use ['*'] to explicitly acknowledge open access. See: https://github.com/sipeed/picoclaw/blob/main/docs/configuration.md", }) } else { - logger.InfoCF("channels", fmt.Sprintf("Channel '%s' allow_from configured", bc.name), map[string]any{ + logger.InfoCF("channels", fmt.Sprintf("Channel '%s' allow_from configured (%d entries)", bc.name, len(bc.allowList)), map[string]any{ "channel": bc.name, "allow_list": bc.allowList, + "count": len(bc.allowList), }) }