Skip to content

feat: ship astrbot CLI in Docker image for in-container password reset - #10442

Merged
Soulter merged 6 commits into
masterfrom
codex/docker-cli-password
Oct 7, 2026
Merged

Soulter merged 6 commits into
masterfrom
codex/docker-cli-password

Conversation

@Soulter

@Soulter Soulter commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Install the project itself (uv pip install -e . --no-deps) in the Docker image so the astrbot console script is available inside the container
  • Create the /AstrBot/.astrbot marker so the CLI recognizes the container working directory as an initialized AstrBot root
  • Document the password reset workflow in the zh/en Docker deployment guides
  • Reorganize the zh/en FAQ forgot-password section by deployment method (Docker / uv & pip package / other)

Motivation

The astrbot password / astrbot conf set dashboard.password commands already existed, but the Docker image only installed third-party dependencies, not the project itself, so there was no astrbot entrypoint in the container. Additionally, .astrbot is excluded by .dockerignore, so the CLI refused to run with "not a valid AstrBot root directory".

Docker users can now reset a forgotten dashboard password with:

docker exec -it astrbot astrbot password  # the first `astrbot` is your container name (check with `docker ps`)
docker restart astrbot  # required: the running server holds the config in memory

Verification

Built the image locally and verified end-to-end in a running container:

  1. which astrbot -> /usr/local/bin/astrbot; /AstrBot/.astrbot exists
  2. docker exec -i <c> astrbot password writes pbkdf2_password + legacy md5 hash to data/cmd_config.json and clears password_change_required / sets password_storage_upgraded
  3. After docker restart, POST /api/auth/login with the new password returns a JWT (wrong password is rejected)

Image size impact is minimal (a small .pth-based editable install pointing back to the baked-in source tree; deps are not reinstalled thanks to --no-deps). The editable install keeps the CLI in sync with the server code shipped in the image, so the two never drift apart within one image build.

Summary by Sourcery

Enable dashboard password resets from Docker containers and document the workflow across deployment guides and FAQs.

New Features:

  • Add the AstrBot CLI to Docker images and initialize the container working directory so password resets can be performed in-container.

Build:

  • Install the project package in the Docker image (editable, no dependency reinstallation).

Documentation:

  • Document Docker dashboard password reset procedures and organize forgot-password guidance by deployment method in English and Chinese documentation.

Install the project itself into the image so the `astrbot` console
script (including `astrbot password` and `astrbot conf set`) is
available inside the container, and mark /AstrBot as an initialized
AstrBot root via the .astrbot marker file.

This lets Docker users reset a forgotten dashboard password with:

    docker exec -it astrbot astrbot password

Document the workflow in the zh/en Docker deployment guides, including
the required container restart for the new password to take effect.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Sourcery assessment

Needs a human reviewer. The image now exposes a command that can persistently change the dashboard username and password, so a faulty packaging or CLI interaction could lock users out or alter authentication state in a way that reverting the image would not undo. Docker exec access limits who can invoke it, but the credential change itself outlives a revert.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Split the forgot-password FAQ entry into Docker, uv/pip package, and
other deployment subsections. The Docker entry uses the in-container
CLI shipped with the image; the uv/pip entry covers `astrbot password`
and `astrbot run --reset-password`; the manual cmd_config.json edit
remains as the universal fallback.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
astrbot-docs 2d99044 Commit Preview URL

Branch Preview URL
Oct 07 2026, 03:41 PM

Install the project with 'uv pip install -e .' so the astrbot console
script always reflects the source tree baked into the image, avoiding
drift between the CLI and the running server code.
@Soulter
Soulter merged commit 65cbe98 into master Oct 7, 2026
23 of 24 checks passed
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.

1 participant