diff --git a/Dockerfile b/Dockerfile index 748ebfea5..8b08db8e1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,7 +28,9 @@ RUN python -m pip install uv \ && uv lock \ && uv export --format requirements.txt --output-file requirements.txt --frozen \ && uv pip install -r requirements.txt --no-cache-dir --system \ - && uv pip install socksio uv pilk --no-cache-dir --system + && uv pip install socksio uv pilk --no-cache-dir --system \ + && uv pip install . --no-deps --no-cache-dir --system \ + && touch /AstrBot/.astrbot EXPOSE 6185 diff --git a/docs/en/deploy/astrbot/docker.md b/docs/en/deploy/astrbot/docker.md index 7fae3e1db..98efbdfa1 100644 --- a/docs/en/deploy/astrbot/docker.md +++ b/docs/en/deploy/astrbot/docker.md @@ -125,6 +125,23 @@ If there are no errors, you will see a log message similar to `🌈 Dashboard st Next, you need to deploy any messaging platform to use AstrBot on that platform. +## Reset the Dashboard Password + +If you forget the dashboard password, you can reset it with the built-in AstrBot CLI inside the container: + +```bash +sudo docker exec -it astrbot astrbot password +``` + +Follow the prompt to enter a new password. To also change the username: + +```bash +sudo docker exec -it astrbot astrbot password --username +``` + +> [!TIP] +> The new password takes effect after restarting the container: `sudo docker restart astrbot`. + ## Configure an HTTP proxy in Docker Set the HTTP proxy in the WebUI under `Settings → Network → Proxy & Dependency Sources → HTTP Proxy`. AstrBot reaches that address **from inside its own container**, so `http://127.0.0.1:7890` points at the AstrBot container itself rather than the host or another container. diff --git a/docs/zh/deploy/astrbot/docker.md b/docs/zh/deploy/astrbot/docker.md index daf081f8c..c944cb161 100644 --- a/docs/zh/deploy/astrbot/docker.md +++ b/docs/zh/deploy/astrbot/docker.md @@ -141,6 +141,23 @@ docker run -itd -p 6185:6185 -p 6199:6199 -e TZ=Asia/Shanghai -v "${PWD}\data:/A 接下来,你需要部署任何一个消息平台,才能够实现在消息平台上使用 AstrBot。 +## 重置 Dashboard 密码 + +如果忘记了 Dashboard 密码,可以通过容器内置的 AstrBot CLI 重置: + +```bash +sudo docker exec -it astrbot astrbot password +``` + +按提示输入新密码即可。如需同时修改用户名: + +```bash +sudo docker exec -it astrbot astrbot password --username <新用户名> +``` + +> [!TIP] +> 修改后需要重启容器才能生效:`sudo docker restart astrbot`。 + ## 在 Docker 中配置 HTTP 代理 AstrBot 的 HTTP 代理在 WebUI:`设置 → 网络 → 代理与依赖源 → HTTP 代理`。填写的地址由 **AstrBot 容器内部**访问,因此 `http://127.0.0.1:7890` 会连到 AstrBot 容器自己,而不是宿主机或其他容器。