- Python 98.8%
- Dockerfile 1.2%
Rewrites README to document Station setup (cert/key, env vars) and removes all tinylog/feed/SYNC_SINCE references. Updates pyproject description and adds commented cert mount example to compose.yml. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .env.example | ||
| .gitignore | ||
| .python-version | ||
| CLAUDE.md | ||
| compose.yml | ||
| db.py | ||
| Dockerfile | ||
| gts.py | ||
| main.py | ||
| pyproject.toml | ||
| README.md | ||
| station.py | ||
| uv.lock | ||
tinylog
Mirrors public posts from a GoToSocial instance to Station, a Gemini-protocol social network, in real time. Handles new posts, self-reply threads, edits, and deletes.
Features
- Real-time streaming via GoToSocial WebSocket API (no polling)
- Propagates edits and deletes to Station
- Self-replies posted as Station replies on the parent post
- HTML-to-gemtext conversion: lists, preformatted blocks, footnote-style links
- Media attachments appended as gemtext link lines
- Long posts split into continuation self-replies to fit Station's 1024-byte URL limit
- Skips posts with content warnings, replies to other accounts, non-public posts, local-only posts, and posts that mention other accounts
Setup
You need a Station account with a TLS client certificate. Export the certificate and private key from your Gemini browser as PEM files.
cp .env.example .env # fill in the four required vars
docker compose up --build -d
docker compose logs -f
Mount your Station cert and key into the container via compose.yml:
volumes:
- ./data:/app/data
- /path/to/station.pem:/certs/station.pem:ro
- /path/to/station.key:/certs/station.key:ro
Then set STATION_CERT_PATH=/certs/station.pem and STATION_KEY_PATH=/certs/station.key in .env.
Configuration
All configuration is via environment variables (.env):
| Variable | Required | Default | Description |
|---|---|---|---|
GTS_BASE_URL |
yes | — | Your GoToSocial instance URL |
GTS_ACCESS_TOKEN |
yes | — | OAuth bearer token with read scope |
STATION_CERT_PATH |
yes | — | Absolute path to your Station TLS client certificate (PEM) |
STATION_KEY_PATH |
yes | — | Absolute path to your Station TLS private key (PEM) |
LOG_LEVEL |
no | INFO |
DEBUG, INFO, WARNING, ERROR |
Station integration is opt-in: if STATION_CERT_PATH or STATION_KEY_PATH are not set, the app runs without posting to Station (useful for testing the GTS connection).
GTS access token
Create an application on your GoToSocial instance and complete the OAuth flow to obtain a bearer token with read scope. No write scope is needed.
Station client certificate
Station uses TLS client certificates for authentication. Generate one in your Gemini browser (e.g. Lagrange or Amfora) when joining Station, then export the certificate and private key as separate PEM files.
Development
# Run locally (requires .env)
uv run python main.py
There are no automated tests in this project.