Skip to content

Conversation

@Sjshi763
Copy link
Contributor

@Sjshi763 Sjshi763 commented Nov 15, 2025

Sourcery 摘要

澄清 napcat.md 中 Docker 部署的网络说明,明确同一网络中容器的 websocket URL,并建议在不同网络时使用内部或公共 IP,同时附带安全警告。

文档:

  • 当两个容器位于同一 Docker 网络时,指定 ws://astrbot:6199/ws
  • 如果容器不在同一 Docker 网络中,添加说明建议使用内部或公共 IP 地址(安全性较低)进行 websocket 连接
Original summary in English

Summary by Sourcery

Clarify Docker deployment networking instructions in napcat.md, specifying the websocket URL for containers on the same network and advising use of internal or public IP when not, with a security caveat.

Documentation:

  • Specify ws://astrbot:6199/ws when both containers are on the same Docker network
  • Add a note to use an internal or public IP address (less secure) for websocket connections if containers are not in the same Docker network

sourcery-ai[bot]
sourcery-ai bot previously requested changes Nov 15, 2025
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你好 - 我已经审阅了你的更改,它们看起来很棒!

阻塞性问题

  • 检测到不安全的 WebSocket。所有 WebSocket 连接都应使用 WebSocket Secure (wss)。 (link)
  • 检测到不安全的 WebSocket。所有 WebSocket 连接都应使用 WebSocket Secure (wss)。 (link)
AI 代理提示
请解决此代码审查中的评论:

## 单独评论

### 评论 1
<location> `deploy/platform/aiocqhttp/napcat.md:125` </location>
<code_context>
> 注意如果是docker部署(同时把两个容器接入一个网络)那么填写的应该是`ws://astrbot:6199/ws`(例如本文档的docker脚本)
</code_context>

<issue_to_address>
**security (javascript.lang.security.detect-insecure-websocket):** 检测到不安全的 WebSocket。所有 WebSocket 连接都应使用 WebSocket Secure (wss)。

*Source: opengrep*
</issue_to_address>

### 评论 2
<location> `deploy/platform/aiocqhttp/napcat.md:128` </location>
<code_context>
> 由于docker网络隔离的原因,不在同一个网络时请使用内网ip地址或公网ip地址 ***(不安全)*** 进行连接,也就是`ws://(内网/公网):6199/ws`
</code_context>

<issue_to_address>
**security (javascript.lang.security.detect-insecure-websocket):** 检测到不安全的 WebSocket。所有 WebSocket 连接都应使用 WebSocket Secure (wss)。

*Source: opengrep*
</issue_to_address>

Sourcery 对开源项目免费 - 如果你喜欢我们的评论,请考虑分享它们 ✨
帮助我更有用!请在每条评论上点击 👍 或 👎,我将利用这些反馈来改进你的评论。
Original comment in English

Hey there - I've reviewed your changes and they look great!

Blocking issues:

  • Insecure WebSocket Detected. WebSocket Secure (wss) should be used for all WebSocket connections. (link)
  • Insecure WebSocket Detected. WebSocket Secure (wss) should be used for all WebSocket connections. (link)
Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location> `deploy/platform/aiocqhttp/napcat.md:125` </location>
<code_context>
> 注意如果是docker部署(同时把两个容器接入一个网络)那么填写的应该是`ws://astrbot:6199/ws`(例如本文档的docker脚本)
</code_context>

<issue_to_address>
**security (javascript.lang.security.detect-insecure-websocket):** Insecure WebSocket Detected. WebSocket Secure (wss) should be used for all WebSocket connections.

*Source: opengrep*
</issue_to_address>

### Comment 2
<location> `deploy/platform/aiocqhttp/napcat.md:128` </location>
<code_context>
> 由于docker网络隔离的原因,不在同一个网络时请使用内网ip地址或公网ip地址 ***(不安全)*** 进行连接,也就是`ws://(内网/公网):6199/ws`
</code_context>

<issue_to_address>
**security (javascript.lang.security.detect-insecure-websocket):** Insecure WebSocket Detected. WebSocket Secure (wss) should be used for all WebSocket connections.

*Source: opengrep*
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@Soulter
Copy link
Member

Soulter commented Nov 18, 2025

方便重新提交一下 PR 吗~ 我们之前适配国际化可能改了一些文档结构。

> [!IMPORTANT]
> 注意如果您使用 Docker Compose 部署,并且同时把两个容器接入一个网络,那么填写的应该是 `ws://astrbot:6199/ws`(例如本文档的 Docker Compose 部署方案)

> [!IMPORTANT]
> 由于 Docker 网络隔离的原因,不在同一个网络时请使用内网 IP 地址或公网 IP 地址 ***(不安全)*** 进行连接,也就是`ws://(内网/公网):6199/ws`

@Sjshi763
Copy link
Contributor Author

666

@Sjshi763 Sjshi763 marked this pull request as draft November 21, 2025 09:58
@Sjshi763
Copy link
Contributor Author

气死我了,还要我开IDE才可以合并

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New security issues found

@Sjshi763 Sjshi763 marked this pull request as ready for review November 21, 2025 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants