Skip to content

feat: add Salad earnings collector#13

Open
GeiserX wants to merge 4 commits intomainfrom
feat/salad-collector
Open

feat: add Salad earnings collector#13
GeiserX wants to merge 4 commits intomainfrom
feat/salad-collector

Conversation

@GeiserX
Copy link
Copy Markdown
Owner

@GeiserX GeiserX commented Mar 31, 2026

Summary

  • Adds SaladCollector — fetches current balance from app-api.salad.io/api/v1/profile/balance using the sAccessToken browser cookie
  • Registered in COLLECTOR_MAP with config key salad_access_token
  • Updated services/compute/salad.yml collector notes with actual API details
  • Updated docs/guides/salad.md with real setup instructions (get token from browser DevTools)

Config

salad_access_token=<sAccessToken cookie from app.salad.io>

Test plan

  • All 411 tests pass (uv run pytest — 0 failures)
  • Deploy and verify balance collection with a real sAccessToken

GeiserX added 4 commits March 31, 2026 23:38
- New SaladCollector using app-api.salad.io/api/v1/profile/balance
- Auth via sAccessToken cookie (browser DevTools)
- Returns currentBalance in USD
- Registered in COLLECTOR_MAP with access_token config key
- Updated service YAML and guide docs with actual API details
- app-api.salad.io is dead, new base is app-api.salad.com
- Auth changed from sAccessToken cookie to Bearer token header
- Updated collector, service YAML, and guide docs
Tested against live API — the auth mechanism is:
- Cookie: auth=<token>
- Header: X-XSRF-TOKEN=<same token>

Verified: returns currentBalance and lifetimeBalance in USD.
Config key changed from salad_access_token to salad_auth_cookie.
When saving collector credentials via POST /api/config, auto-insert
an "external" deployment record for services that have no Docker
image (manual-only). Without this, _run_collection() never
instantiates collectors for Salad, Grass, Bytelixir, or any future
manual-only service because make_collectors() requires a matching
deployment row.

Also adds auth_cookie to the secret_args mask list.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant