{"id":47243721,"url":"https://github.com/en9inerd/rig","last_synced_at":"2026-05-05T06:04:54.359Z","repository":{"id":344204312,"uuid":"1180926266","full_name":"en9inerd/rig","owner":"en9inerd","description":"Lightweight automation runtime in Go","archived":false,"fork":false,"pushed_at":"2026-04-05T04:00:50.000Z","size":5525,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-05T05:22:53.964Z","etag":null,"topics":["automation","bot","go","golang","telegram"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/en9inerd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-13T15:02:06.000Z","updated_at":"2026-04-05T03:59:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"1ca30014-4f5c-4e73-9ab1-847aa135204e","html_url":"https://github.com/en9inerd/rig","commit_stats":null,"previous_names":["en9inerd/rig"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/en9inerd/rig","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/en9inerd%2Frig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/en9inerd%2Frig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/en9inerd%2Frig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/en9inerd%2Frig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/en9inerd","download_url":"https://codeload.github.com/en9inerd/rig/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/en9inerd%2Frig/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31426193,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T02:22:46.605Z","status":"ssl_error","status_checked_at":"2026-04-05T02:22:33.263Z","response_time":75,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","bot","go","golang","telegram"],"created_at":"2026-03-14T03:10:14.060Z","updated_at":"2026-05-05T06:04:54.350Z","avatar_url":"https://github.com/en9inerd.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rig\n\nA lightweight automation runtime in Go. Each unit of work is a **task** - a self-contained module that wires an event source to one or more actions. The runtime manages task lifecycle, shared services, and the HTTP server.\n\n## Tasks\n\n| Task | Type | Description |\n|---|---|---|\n| **Visitor Notifier** | HTTP endpoint | Receives visitor data via `POST /{token}/visitor`, geolocates the IP using a local MaxMind database, and sends a Telegram notification. Supports multiple sites, each with its own token and tag. |\n| **Feed Watcher** | Ticker | Polls an Atom feed at a configurable interval and sends new posts to Telegram |\n| **IP Watcher** | Ticker | Monitors the server's public IP and sends a Telegram notification on change |\n\nTasks are independent, each manages its own goroutine(s), state, and config. Disable any task via environment variables.\n\n## Quick Start\n\n```bash\ncp .env.example .env\n# Edit .env with your Telegram bot token, chat IDs, and MaxMind credentials\n\n# Generate visitors.json with a random auth token (pick one)\nrig --init \u003e visitors.json                           # local binary\ndocker run --rm enginerd/rig --init \u003e visitors.json  # from Docker image\n# Edit visitors.json with your site names and chat IDs\n\ndocker compose up -d\n```\n\nThe `geoipupdate` sidecar downloads the GeoLite2-City database before `rig` starts. A free [MaxMind account](https://www.maxmind.com/en/geolite2/signup) is required.\n\n## Configuration\n\nAll configuration is via environment variables.\n\n### Global\n\n| Variable | Description | Default |\n|---|---|---|\n| `RIG_HTTP_ADDR` | HTTP listen address | `:8080` |\n| `RIG_TELEGRAM_BOT_TOKEN` | Telegram Bot API token | - |\n| `RIG_STORE_PATH` | Path to persistent state file | `/data/rig.json` |\n| `RIG_CORS_ORIGIN` | Allowed CORS origin | - |\n| `RIG_TLS_CERT` | Path to TLS certificate file | - |\n| `RIG_TLS_KEY` | Path to TLS private key file | - |\n| `RIG_VERBOSE` | Enable debug logging | `false` |\n\n### Visitor Notifier\n\n| Variable | Description | Default |\n|---|---|---|\n| `RIG_VISITOR_ENABLED` | Enable task | `true` |\n| `RIG_VISITOR_SITES_FILE` | Path to JSON file defining visitor sites | - |\n| `RIG_VISITOR_GEOIP_DB` | Path to MaxMind GeoLite2-City database | `/data/geoip/GeoLite2-City.mmdb` |\n| `RIG_VISITOR_DEDUP` | Drop repeat notifications for same IP+URL within the window | `false` |\n| `RIG_VISITOR_DEDUP_WINDOW` | Deduplication window (when enabled) | `10m` |\n\nThe sites file is a JSON array. Generate a starter file with `rig --init`, or create one manually:\n\n```json\n[\n  {\"name\": \"blog\", \"authToken\": \"TOKEN\", \"chatId\": \"CHAT_ID\", \"tag\": \"Blog\"}\n]\n```\n\nEach site gets its own endpoint: `POST /{authToken}/visitor`. The `tag` field is optional and defaults to the site name.\n\n### Feed Watcher\n\n| Variable | Description | Default |\n|---|---|---|\n| `RIG_FEED_ENABLED` | Enable task | `true` |\n| `RIG_FEED_URL` | Atom/RSS feed URL | - |\n| `RIG_FEED_INTERVAL` | Poll interval | `15m` |\n| `RIG_FEED_CHAT_ID` | Telegram chat ID | - |\n\n### IP Watcher\n\n| Variable | Description | Default |\n|---|---|---|\n| `RIG_IP_ENABLED` | Enable task | `true` |\n| `RIG_IP_INTERVAL` | Poll interval | `15m` |\n| `RIG_IP_CHAT_ID` | Telegram chat ID | - |\n\n### MaxMind GeoIP (geoipupdate sidecar)\n\n| Variable | Description |\n|---|---|\n| `GEOIPUPDATE_ACCOUNT_ID` | MaxMind account ID |\n| `GEOIPUPDATE_LICENSE_KEY` | MaxMind license key |\n\n## Development\n\n```bash\n# Build\nmake build\n\n# Run locally (loads .env)\nmake run\n\n# Run with debug logging\nmake run-verbose\n\n# Tests\nmake test\n```\n\n## Adding a Task\n\n1. Create `internal/tasks/yourtask/yourtask.go` - implement `tasks.Task` (or `tasks.HTTPTask` for HTTP routes)\n2. Create `internal/tasks/yourtask/config.go` - define `Config` struct and `LoadConfig(getenv)` that returns `(*Config, error)` (`nil` when `RIG_YOURTASK_ENABLED=false`)\n3. Register in `cmd/rig/main.go`:\n\n```go\nytcfg, err := yourtask.LoadConfig(getenv)\nif err != nil {\n    return fmt.Errorf(\"yourtask config: %w\", err)\n}\nif ytcfg != nil {\n    rt.Register(yourtask.New(notifier, logger, *ytcfg))\n}\n```\n\n## Deployment\n\nDocker image is multi-stage (`golang:1.26-alpine` build, `alpine:3.23` runtime) with cross-compilation support. The CI workflow builds for `linux/amd64` and `linux/arm64`.\n\n```bash\n# Build and start\ndocker compose up -d --build\n\n# Logs\ndocker compose logs -f\n\n# Stop\ndocker compose down\n```\n\nAll task state is persisted in a single JSON file (`/data/rig.json` by default) in the `rig-data` volume. Writes are atomic (temp file + rename) so a crash can never corrupt state. The GeoIP database lives in the `geoip` volume, shared read-only with the `rig` container.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fen9inerd%2Frig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fen9inerd%2Frig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fen9inerd%2Frig/lists"}