A Bluesky feed generator written in Rust, serving posts written in Russian by people living in Netherlands
Go to file
Aleksei Voronov 8ddca6303d Bluesky blew through max int number of messages
Well, end of an era I guess. Time to use a bigger (bigint) cursor.

Interestingly enough, some of Rust parts were already using an i64,
but others weren't. Huh.
2024-10-18 20:04:27 +02:00
.github/workflows Create rust.yml 2023-10-09 16:13:25 +02:00
sql Bluesky blew through max int number of messages 2024-10-18 20:04:27 +02:00
src Bluesky blew through max int number of messages 2024-10-18 20:04:27 +02:00
.env.example Add some untested version of publishing a feed 2023-09-22 13:33:13 +02:00
.gitignore Read chatgpt and postgresql credentials from .env 2023-09-07 19:20:38 +02:00
Cargo.lock Upgrade everything to latest versions 2024-08-18 14:27:23 +02:00
Cargo.toml Upgrade everything to latest versions 2024-08-18 14:27:23 +02:00
Cross.toml Cross-compile using newer GCC 2024-08-18 21:35:03 +02:00
README.md Add some instructions about cross-compiling 2024-08-18 20:59:10 +02:00

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 sqlx and scooby
  • 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
  • Intefacing with Bluesky is implemented using atrium-api

Deployed in production at https://nederlandskie.plansfortheday.org/

Published on Bluesky at https://bsky.app/profile/did:plc:376mcc6k4s5p7qbtyjrgph5k/feed/nederlandskie.

Setup

  1. Set up a PostgreSQL database

  2. Create tables using SQL provided in sql directory.

  3. Copy .env.example into .env and set up the environment variables within:

    • PUBLISHER_BLUESKY_HANDLE to your Bluesky handle
    • PUBLISHER_BLUESKY_PASSWORD to Bluesky app password that you created in settings
    • CHAT_GPT_API_KEY for your ChatGPT key
    • DATABASE_URL for PostgreSQL credentials
    • FEED_GENERATOR_HOSTNAME to the hostname of where you intend to host the feed
  4. Determine your own DID and put it in PUBLISHER_DID env 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

Cross-compiling on non-Linux machines to deploy on Linux

  1. Install cross by following their installation guide

  2. Build the binaries in release mode:

cross build --release
  1. Deploy the binaries in target/x86_64-unknown-linux-gnu/release/ as you see fit