The host has changed recently and the cursors are, apparently, incompatible with each other, so we need to migrate to the new one, and this seems like the easiest way to do it: 1. Store the host as part of the subscription state 2. Roll out the version that uses that new column as part of all queries 3. Switch to the new host 4. Roll out the version with the new host - The new instance will start processing messages with a 0 cursor and so start anew - The old instance will die off |
||
|---|---|---|
| .github/workflows | ||
| sql | ||
| src | ||
| .env.example | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| Cross.toml | ||
| README.md | ||
README.md
nederlandskie
A Bluesky feed generator written in Rust.
The specific algorithm indexes and serves posts written in Russian language, by people living in Netherlands.
- Posts are stored in PostgreSQL via
sqlxandscooby - Language of posts is determined via
lingua-rs - Country of residence is inferred from profile information through ChatGPT via
chat-gpt-lib-rs - Feed is served via
axum
Deployed in production at https://nederlandskie.plansfortheday.org/
Published on Bluesky at https://bsky.app/profile/did:plc:376mcc6k4s5p7qbtyjrgph5k/feed/nederlandskie.
Setup
-
Set up a PostgreSQL database
-
Create tables using SQL provided in [sql/01_create_tables.sql].
-
Copy
.env.exampleinto.envand set up the environment variables within:PUBLISHER_BLUESKY_HANDLEto your Bluesky handlePUBLISHER_BLUESKY_PASSWORDto Bluesky app password that you created in settingsCHAT_GPT_API_KEYfor your ChatGPT keyDATABASE_URLfor PostgreSQL credentialsFEED_GENERATOR_HOSTNAMEto the hostname of where you intend to host the feed
-
Determine your own DID and put it in
PUBLISHER_DIDenv variable in.env:cargo run --bin who_am_i
Running
Populate and serve the feed
cargo run
The feed will be available at http://localhost:3030/.
Determine your own did for publishing
cargo run --bin who_am_i
Publish the feed
cargo run --bin publish_feed -- --help
Force a profile to be in a certain country
cargo run --bin force_profile_country -- --help