Configuration
Server-side settings come from a TOML file, environment variables and CLI flags. Precedence:
built-in defaults ← config file ← environment (GRA_*) ← CLI flagsThe config file is --config / GRA_CONFIG (an error if it doesn't exist), otherwise ./gra.toml when present. Unknown keys and invalid values are rejected at startup, so typos never go unnoticed.
Options
| Key | Default | Description |
|---|---|---|
bot_token | — | Telegram bot token (required to run the daemon) |
db_path | gra.db | SQLite path or file: URI |
tick_secs | 15 | How often due accounts are looked up |
ig_delay_ms | 1200 | Pause between paginated Instagram requests |
http_timeout_secs | 60 | Timeout for Instagram requests |
max_concurrent_checks | 2 | Accounts checked in parallel |
log_level | info | Tracing filter, e.g. gra=debug,info (RUST_LOG takes precedence) |
log_file | none | Log file rotated daily (7 kept); omit for stderr |
allowed_user_ids | [] | Telegram user allowlist; empty = everyone |
default_interval_secs | 1800 | Check interval for new users' accounts (≥ 60) |
default_send_posts | true | New users: deliver posts |
default_send_stories | true | New users: deliver stories |
default_send_videos | true | New users: upload videos (else caption + link) |
default_track_stats | true | New users: record follower/following/post counts |
max_send_per_check | 5 | Posts delivered per account per check; the rest follow next check |
media_group_size | 10 | Items per Telegram album (2-10) |
max_follow_list | 60 | Entries loaded from a user's following list |
tg_base_url | https://api.telegram.org | Bot API base (e.g. a local Bot API server) |
ig_base_url | https://www.instagram.com | Instagram base (tests) |
cookie_sets | [] | Server-owner 🌐 cookie sets: name, cookies, optional ua |
The default_* values seed each new user's /defaults; every user can change their own afterwards.
Example
toml
bot_token = "123456:..."
db_path = "file:/data/gra.db?mode=rwc"
log_file = "/data/logs/gra.log"
allowed_user_ids = [11111111, 22222222]
[[cookie_sets]] # shared fallback for all users
name = "owner"
cookies = "file:/data/owner-cookies.txt" # or 'k=v; k2=v2' / cookies.txt content
ua = "Mozilla/5.0 ..."Global cookie sets are synced on every start: entries are matched by name (case-insensitive) and updated; sets removed from the config are deleted, and accounts linked to them fall back to Auto.
Environment variables
| Variable | Overrides |
|---|---|
GRA_CONFIG | config file path |
GRA_BOT_TOKEN | bot_token |
GRA_DB_PATH | db_path |
GRA_TICK_SECS | tick_secs |
GRA_LOG_LEVEL | log_level |
GRA_LOG_FILE | log_file (empty = stderr) |
GRA_ALLOWED_USER_IDS | allowed_user_ids (comma separated) |
CLI flags
gra [--config FILE] [--bot-token TOKEN] [--db-path PATH] [--tick-secs N]
[--log-level FILTER] [--log-file FILE] [--allowed-users IDS] [COMMAND]Flags are global, so they also apply to subcommands such as gra doctor. Run gra --help for details.