- Rust 99.4%
- Dockerfile 0.6%
| .forgejo/workflows | ||
| .sqlx | ||
| migrations | ||
| src | ||
| tests | ||
| .dockerignore | ||
| .gitignore | ||
| .sqruff | ||
| Cargo.lock | ||
| Cargo.toml | ||
| Dockerfile | ||
| example.compose.yaml | ||
| example.config.toml | ||
| README.md | ||
notgram
Through a dedicated Telegram account, notgram follows a set of Telegram channels and republishes their posts as a single Atom feed, so the channels can be read in any RSS reader without running Telegram on a personal device. It is written in Rust and runs in Docker.
Development
Running notgram needs a reachable PostgreSQL database.
Build and run the binary, which prints the available commands:
cargo run -- --help
Run the tests:
cargo test
Generate a new empty migration under migrations/ with sqlx-cli:
sqlx migrate add <name>
Lint and format a migration with sqruff:
sqruff lint migrations/<file>.sql
sqruff fix migrations/<file>.sql
Before committing database-related changes, regenerate the offline query cache under .sqlx/ with sqlx-cli and commit it alongside the code, so offline builds match the current queries:
cargo sqlx prepare
Deployment
A deployment runs as two Docker containers built from one image, an ingestion service that captures new posts and their media from the Telegram channels into a PostgreSQL database, and a feed service that serves the Atom feed over HTTP from the same database. Both are configured through a data directory that holds the configuration and the Telegram session. See example.compose.yaml and example.config.toml for a starting point.
Feed access
The feed service serves the feed at the /feed route. The route requires HTTP Basic Auth, and the credentials an RSS client sends are checked against username and password from the feed section of the configuration. Requests without valid credentials get a 401 response. The URL itself is not treated as a secret. Basic Auth sends the credentials with every request practically in plain text, so the service should be exposed to the world only through a reverse proxy that terminates TLS.