From a06bd8d3b1ea18c68b2330d4633b527c8e493112 Mon Sep 17 00:00:00 2001 From: 0x5487 Date: Thu, 19 Feb 2026 07:23:58 +0800 Subject: [PATCH] config: Update default host bindings to 0.0.0.0 for improved Docker accessibility and add related documentation. --- README.ja.md | 6 +++++- README.md | 6 +++++- README.pt-br.md | 6 +++++- README.zh.md | 6 +++++- config/config.example.json | 4 ++-- pkg/config/config.go | 4 ++-- 6 files changed, 24 insertions(+), 8 deletions(-) diff --git a/README.ja.md b/README.ja.md index 9bd52d203..70ba458e9 100644 --- a/README.ja.md +++ b/README.ja.md @@ -133,6 +133,10 @@ vim config/config.json # DISCORD_BOT_TOKEN, プロバイダーの API キ # 3. ビルドと起動 docker compose --profile gateway up -d +> [!TIP] +> **Docker ユーザー**: デフォルトでは、Gateway は `127.0.0.1` でリッスンしており、ホストからアクセスできません。ヘルスチェックエンドポイントにアクセスしたり、ポートを公開したりする必要がある場合は、環境変数で `PICOCLAW_GATEWAY_HOST=0.0.0.0` を設定するか、`config.json` を更新してください。 + + # 4. ログ確認 docker compose logs -f picoclaw-gateway @@ -398,7 +402,7 @@ picoclaw gateway "enabled": true, "channel_secret": "YOUR_CHANNEL_SECRET", "channel_access_token": "YOUR_CHANNEL_ACCESS_TOKEN", - "webhook_host": "127.0.0.1", + "webhook_host": "0.0.0.0", "webhook_port": 18791, "webhook_path": "/webhook/line", "allow_from": [] diff --git a/README.md b/README.md index 2b962b0cd..01c81b20b 100644 --- a/README.md +++ b/README.md @@ -165,6 +165,10 @@ vim config/config.json # Set DISCORD_BOT_TOKEN, API keys, etc. # 3. Build & Start docker compose --profile gateway up -d +> [!TIP] +> **Docker Users**: By default, the Gateway listens on `127.0.0.1` which is not accessible from the host. If you need to access the health endpoints or expose ports, set `PICOCLAW_GATEWAY_HOST=0.0.0.0` in your environment or update `config.json`. + + # 4. Check logs docker compose logs -f picoclaw-gateway @@ -432,7 +436,7 @@ picoclaw gateway "enabled": true, "channel_secret": "YOUR_CHANNEL_SECRET", "channel_access_token": "YOUR_CHANNEL_ACCESS_TOKEN", - "webhook_host": "127.0.0.1", + "webhook_host": "0.0.0.0", "webhook_port": 18791, "webhook_path": "/webhook/line", "allow_from": [] diff --git a/README.pt-br.md b/README.pt-br.md index 51e6baf7f..171a6557b 100644 --- a/README.pt-br.md +++ b/README.pt-br.md @@ -172,6 +172,10 @@ vim config/config.json # Configure DISCORD_BOT_TOKEN, API keys, etc. # 3. Build & Iniciar docker compose --profile gateway up -d +> [!TIP] +> **Usuários Docker**: Por padrão, o Gateway ouve em `127.0.0.1`, o que não é acessível a partir do host. Se você precisar acessar os endpoints de integridade ou expor portas, defina `PICOCLAW_GATEWAY_HOST=0.0.0.0` em seu ambiente ou atualize o `config.json`. + + # 4. Ver logs docker compose logs -f picoclaw-gateway @@ -439,7 +443,7 @@ picoclaw gateway "enabled": true, "channel_secret": "YOUR_CHANNEL_SECRET", "channel_access_token": "YOUR_CHANNEL_ACCESS_TOKEN", - "webhook_host": "127.0.0.1", + "webhook_host": "0.0.0.0", "webhook_port": 18791, "webhook_path": "/webhook/line", "allow_from": [] diff --git a/README.zh.md b/README.zh.md index 42bd20be4..434805f93 100644 --- a/README.zh.md +++ b/README.zh.md @@ -167,9 +167,13 @@ cd picoclaw cp config/config.example.json config/config.json vim config/config.json # 设置 DISCORD_BOT_TOKEN, API keys 等 -# 3. 构建并启动 +# 3. 構建並啟動 docker compose --profile gateway up -d +> [!TIP] +> **Docker 用戶**: 預設情況下,Gateway 監聽 `127.0.0.1`,這在容器內無法從外部訪問。如果您需要透過端口映射訪問健康檢查接口,請在環境變量中設置 `PICOCLAW_GATEWAY_HOST=0.0.0.0` 或修改 `config.json`。 + + # 4. 查看日志 docker compose logs -f picoclaw-gateway diff --git a/config/config.example.json b/config/config.example.json index 7943898ab..07f052a98 100644 --- a/config/config.example.json +++ b/config/config.example.json @@ -25,7 +25,7 @@ }, "maixcam": { "enabled": false, - "host": "127.0.0.1", + "host": "0.0.0.0", "port": 18790, "allow_from": [] }, @@ -58,7 +58,7 @@ "enabled": false, "channel_secret": "YOUR_LINE_CHANNEL_SECRET", "channel_access_token": "YOUR_LINE_CHANNEL_ACCESS_TOKEN", - "webhook_host": "127.0.0.1", + "webhook_host": "0.0.0.0", "webhook_port": 18791, "webhook_path": "/webhook/line", "allow_from": [] diff --git a/pkg/config/config.go b/pkg/config/config.go index 93f468cc9..0e68a053f 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -360,7 +360,7 @@ func DefaultConfig() *Config { }, MaixCam: MaixCamConfig{ Enabled: false, - Host: "127.0.0.1", + Host: "0.0.0.0", Port: 18790, AllowFrom: FlexibleStringSlice{}, }, @@ -386,7 +386,7 @@ func DefaultConfig() *Config { Enabled: false, ChannelSecret: "", ChannelAccessToken: "", - WebhookHost: "127.0.0.1", + WebhookHost: "0.0.0.0", WebhookPort: 18791, WebhookPath: "/webhook/line", AllowFrom: FlexibleStringSlice{},