This repository has no description
Bluesky Avatar Updater#
A Rust tool to automatically rotate your Bluesky profile avatar and banner every hour.
Features#
- Automated Rotation: Automatically updates your profile assets every hour.
- Environment Support: Loads configuration from
.envfiles. - Logging: Robust file logging with 14-day rotation.
- Cron Integration: Self-installs as an hourly cron job for persistent updates.
- Asset Mapping: Supports detailed hourly CID mapping for both avatar and banner.
Requirements#
To run this project, you will need the following:
- Rust 1.85+ (Cargo)
Installation#
-
Clone the repository:
git clone https://github.com/ewanc26/bluesky-avatar-updater.git cd bluesky-avatar-updater -
Build the project:
cargo build --release -
Create a
.envfile in theassets/directory (or the root) and add your environment variables:ENDPOINT=https://bsky.social HANDLE=your_handle.bsky.social PASSWORD=your_app_password DID=did:plc:your_did UPDATE_BANNER=false -
Create
assets/cids.jsonwith hourly blob mappings:{ "00": { "avatar": "cid_for_midnight", "banner": "banner_cid_for_midnight" }, "01": { "avatar": "cid_for_1am", "banner": "banner_cid_for_1am" } }
Usage#
Run the updater from the repository root:
cargo run --release
On start-up, the script will:
- Load configuration and environment variables.
- Confirm the endpoint is healthy.
- Read the CID mapping from
assets/cids.json. - Select the avatar/banner CID for the current hour.
- Log in to Bluesky and update the profile record.
- Ensure an hourly cron job exists for future runs.
File Structure#
src/main.rs: Main orchestration.src/bsky.rs: Bluesky API and blob handling.src/cron.rs: Cron job management.src/utils.rs: Utility functions and environment validation.assets/cids.json: Mapping of hours to avatar and banner CIDs.
License#
This project is licensed under the MIT License. See the LICENSE file for details.
☕ Support#
If you found this useful, consider buying me a ko-fi!