Copy of README.md from aetherion-autoapply
Generated from aetherion-autoapply/README.md at commit 89a92b10. Edit the source file, not this copy.
Aetherion Auto Apply (browser service)¶
Applies to jobs for admins in a browser that runs on the server. It has no UI of its own:
- Admins use the Auto Apply page of the dashboard (
../frontend). They enter a start date and time and title keywords, then click Start. - Every hour,
smart_apply_backend(../backend) does three things: - finds new jobs whose title matches the keywords
- assigns them to the admin
- sends them to this service's queue
- This service applies to each job in turn, unattended:
- A clean form is submitted.
- Anything that needs a person (flagged answers, a bot check, an emailed code, a rejected submit) is marked failed with a reason. The admin can then hand that job to a bidder.
- The admin can watch the running job live on the page.
| Directory | What | Stack |
|---|---|---|
src/aetherion_web/ |
Browser service: one Playwright browser per admin, the Auto Apply queue, the live view | FastAPI, Playwright, httpx |
tests/ |
unittest suite (API, queue, sessions, extraction, orchestrator) |
smart_apply_backend ──hourly: POST /queue {job_ids} + admin token──▶ browser service
▲ │
└── load job, answer form, resume, POST /auto-apply/jobs/{id}/result ┘
│
dashboard Auto Apply page ──GET /queue, WebSocket /ws (live view)───────┘
- The service checks each bearer token with
/auth/meand accepts admins only. - It loads jobs with
GET /jobs/{id}and reports each result back. For applied and expired results,smart_apply_backendupdates the admin's own application. - The live view is a WebSocket. It carries JSON events (state, URL, log, extracted fields, answers, "needs a person") and binary JPEG frames from Chrome's screencast.
Run locally¶
You need:
- uv, which fetches Python 3.12 if needed
smart_apply_backendrunning on:8000withAUTO_APPLY_URL=http://localhost:8100- the dashboard running on
:5173withVITE_BROWSER_API_BASE=http://localhost:8100
uv sync
uv run playwright install chromium # or set BROWSER_CHANNEL=chrome to use installed Chrome
cp .env.example .env
uv run python -m aetherion_web # :8100
Job pages on localhost or a private network are blocked by default (see Security below). To test with such pages, set ALLOW_PRIVATE_NETWORKS=1 in .env.
Run with Docker¶
docker compose up --build # browser service on :8100
Set the URLs in a .env next to docker-compose.yml:
BACKEND_URL: how the service reachessmart_apply_backend.CORS_ORIGINS: the dashboard's public origin.
Tests¶
uv run python -m unittest discover tests # API, queue, sessions, network guard, extraction, orchestrator
uv run ruff check src tests
The browser tests launch a real Chromium. They are skipped when none is installed, unless AETHERION_REQUIRE_BROWSER=1 is set, which is what CI does.
Security and operations¶
- Private networks. The server-side browser sits next to internal services. Unless
ALLOW_PRIVATE_NETWORKS=1, every request it makes is checked, and requests to loopback, private, link-local and other non-public addresses are aborted. That includes cloud metadata at 169.254.169.254. Service workers are disabled so they can't bypass the check. The guard is not airtight (DNS rebinding, page WebSockets), so also run the service on a network segment that can't reach anything sensitive. - One process. Sessions and queues live in memory, so run a single worker per instance. After a restart, the next hourly sync re-sends every job still queued.
MAX_SESSIONScaps the number of concurrent browsers (default 4). Each open profile costs roughly 200–400 MB of RAM. - Idle sessions. A browser nobody is watching, and whose queue is idle, is closed after
SESSION_IDLE_SECONDS(default 900). - Profiles. Each admin's cookies and site logins persist in
DATA_DIR/profiles/<user id>. MountDATA_DIRon a volume.
Not done yet¶
- Gmail sync: an emailed verification code fails the job instead of being fetched.
- Retrying failed jobs. A failed job stays failed until the admin assigns it to a bidder.
- More than one application at a time per admin.