Add ePDS-native pdsadmin CLI#5
Merged
Merged
Conversation
Upstream Bluesky pdsadmin isn't bundled with ePDS and assumes the /pds docker-compose layout, so it fails on an ePDS box. This adds a wrapper under scripts/pdsadmin/ reading ePDS's own .env (PDS_ENV_FILE, default /opt/epds/.env): - account list — reads the pds-core account DB directly (read-only, WAL-safe) ordered by actor.createdAt, so it shows every account (including repo-less/deactivated ones that com.atproto.sync.listRepos omits) in true creation order, with an optional --limit. Surfaces a deactivated column. - account create/delete/takedown/untakedown/reset-password, create-invite-code, request-crawl — authenticated XRPC calls. The upstream 'update' subcommand is intentionally omitted: it pulls Bluesky's image and restarts via systemd, which would break ePDS's docker compose build/up flow. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
dirname "${BASH_SOURCE[0]}" returns the symlink's directory, so a
symlink (e.g. /usr/local/bin/pdsadmin) made the dispatcher look for its
sibling scripts next to the link instead of in scripts/pdsadmin/, failing
with "/usr/local/bin/account.sh: No such file". Walk the symlink chain to
the real script location before computing SCRIPT_DIR.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an ePDS-native
pdsadminCLI underscripts/pdsadmin/, so operators get the familiar Blueskypdsadminadmin commands against an ePDS deployment. The upstream Bluesky script isn't bundled with ePDS and assumes the/pdsdocker-compose layout (/pds/pds.env, apdscontainer, systemdupdate), so running./pdsadmin …on an ePDS box fails withcommand not found.account list [--limit N]— reads the pds-core account DB directly (actorjoined withaccount), read-only and WAL-safe, ordered byactor.createdAtnewest-first. This is deliberately notcom.atproto.sync.listRepos, which inner-joinsrepo_rootand filters by account status (so it omits repo-less / deactivated accounts) and only exposes a re-indexindexedAtrather than creation time. Surfaces aDeactivatedcolumn.account create / delete / takedown / untakedown / reset-password,create-invite-code [useCount],request-crawl [relay]— authenticated XRPC calls.PDS_HOSTNAME/PDS_ADMIN_PASSWORDfromPDS_ENV_FILE(default/opt/epds/.env; override for local/dev).account listadditionally needs Docker access (run withsudo); container/DB path overridable viaPDS_CORE_CONTAINER/PDS_ACCOUNT_DB.updatesubcommand is intentionally omitted — it pulls Bluesky's image and restarts via systemd, which would break ePDS'sdocker compose build/upflow.Because it depends only on stable AT Protocol lexicon endpoints / the account DB schema plus two core env vars (not on package code), it keeps working across future repo changes.
Test plan
account list --limit 10on the self.surf deploy returns the genuine newest accounts (top row matchesactor.createdAtfrom a direct DB query), correctly aligned.--limitrejected before any I/O; bad DIDs rejected for delete/takedown/etc.PDS_HOSTNAME/PDS_ADMIN_PASSWORDerror clearly.helprenders; unknown commands fall back to help.account createmirroring upstream (random password, bypasses ePDS OTP/community-DID provisioning) is acceptable, or should be dropped.Usage on the server:
🤖 Generated with Claude Code