Repository navigation
Operations User Session
The native runtime uses a separately configured tdlight HTTP service. It does not log in to Telegram or create session files. Without configuration, status reports available: false and protected session operations return an unavailable error.
The server reads these settings with the YOINK_RUST_ prefix. It does not load an env file.
| Setting | Default | Maximum |
|---|---|---|
USER_SESSION_URL |
Unconfigured | Trusted HTTP or HTTPS origin |
USER_SESSION_TOKEN_FILE |
Unconfigured | Absolute file path |
USER_SESSION_TIMEOUT_SECS |
30 | 120 |
USER_SESSION_TOKEN_TIMEOUT_MS |
1000 | 10000 |
USER_SESSION_RESPONSE_BYTES |
4194304 | 16777216 |
USER_SESSION_TOKEN_BYTES |
4096 | 16384 |
USER_SESSION_SCAN_PAGES |
100 | 100 |
USER_SESSION_SCAN_TOPICS |
10000 | 10000 |
Set URL and token file together. The origin cannot contain credentials, a path prefix, a query or a fragment. The token file must belong to the runtime UID, have no group or other permissions, and have one hard link. Every path component must be free of symlinks. Mount the file read-only into the runtime container.
The client reads the token before every request. Token rotation does not require a restart. Reads have a deadline, a byte limit and one concurrent blocking reader per client. Redirects and environment proxies are disabled.
Public errors omit token paths, upstream bodies and transport URLs. The tdlight protocol places the token in /user{token}/method. Operators must keep upstream access logs private.
The composition root registers these routes once, with authentication and runtime readiness checks:
GET /api/v1/threads/statusPOST /api/v1/threads/scan/{group_id}GET /api/v1/forum/topics/{chat_id}GET /api/v1/forum/topics/{chat_id}/{thread_id}GET /api/v1/forum/topics/{chat_id}/{thread_id}/linkGET /api/v1/forum/search/{chat_id}GET /api/v1/forum/history/{chat_id}GET /api/v1/messages/{chat_id}/{message_id}/viewersGET /api/v1/messages/{chat_id}/{message_id}/linkGET /api/v1/messages/{chat_id}/{message_id}/read-dateGET /api/v1/messages/{chat_id}/{message_id}/threadGET /api/v1/messages/{chat_id}/by-date
Each handler checks current database authority through configuration_authorized. Status requires an administrator. Session proxy operations and scan require the owner. Scan also requires a negative group ID. An unavailable adapter returns HTTP 503 after authorization and input validation. An invalid scan ID returns HTTP 422.
A configured scan verifies the group before requests, rechecks authority before every page, and rechecks authority inside the write transaction. It updates discovered topic names without deleting manual policies or changing existing enabled flags. The existing schema represents all scan data, so this integration needs no migration.
yoink_user_session::Client owns transport and typed DTOs. Its member API is get_chat_members(chat_id, filter, offset, limit). ChatMemberFilter supports Members, Administrators, Banned and Restricted. The page limit is at most 200.
A Stats adapter must check offset arithmetic. It must preserve failed pages instead of treating them as empty. Missing tokens and authorization failures need actionable unavailable results. Client available() checks the token asynchronously. A synchronous capability flag does not prove that a session request will succeed.
Run just test-user-session from backend/ for client, HTTP, identity and server contracts. HTTP fixtures use the production composition factory and a loopback tdlight service. They cover missing configuration, authorization, upstream failures, atomic topic-name updates and runtime readiness. Run just format-user-session for the affected Rust crates.
Real tdlight connectivity and the Stats runtime bridge require separate integration acceptance. Unit and loopback checks do not establish production session availability.
- Native backup and restore
- Configuration
- Deployment and rollback
- PostgreSQL data import
- Installation
- Image publication
- Local releases
- User-mode Telegram session
- YouTube services
- Downloads
- Downloader commands and compatibility
- Cookies and YouTube authentication
- Native deferred private media
- Download history and automatic proxy routing
- Native downloader inline lookup
- Native downloader NSFW policy
- Downloader settings
- Inbox
- Inbox content processing
- Inbox durability and compatibility
- Inbox runtime
- Inbox Telegram delivery
- Access control and identity
- HTTP API
- Frontend architecture
- Runtime architecture
- Persistence and recovery
- Native Music and Stats composition
- Worker protocol
- Documentation and Wiki
- Local GitHub CI
- Media acceptance fixtures
- Development and verification
- Worker development