aitododocs Coming soonAutonomous delivery

Running the server

Markdown

Whoever deploys the server is its operator: lists and deletes projects, mints a recovery admin token, issues invite codes and finishes a half-done store move.

Guideabout 8 min10 commands
On this page

The operator never sees a token value and has no ticket access over the API; a store: server project keeps its store on the server's disk (AITODO_SERVER_DATA).

Terminal
$ tkt operator projects --server https://tkt.ideathon.me
Details11 items
  • Over HTTP (for a server without a shell): the secret AITODO_OPERATOR_TOKEN (at least 32 characters; without it every /v1/operator/** is 404 and the CLI says it is off) is no project token and never stored in server.db. The CLI reads it from the variable or a hidden prompt, never an argument (no --token), and never prints it. A wrong secret: 401 ERR_AUTH_REQUIRED; a project token (even admin) never works here, nor the secret on project endpoints. One log line per call (action, project id, time, outcome; no secret).
  • tkt operator projects --server <url> --json (id, name, created, by, how, tokens, last use, disk; first the disk's free space); tkt operator project-delete <id> --server <url> --confirm <name-or-id> (its tokens get 401 afterwards); tkt operator admin-token --project <id> --name <n> --server <url> (shown once); tkt operator store-unfreeze <id> --server <url> (back to the server) or tkt operator store-release <id> --server <url> (to the repo, the server copy archived).
  • On the server host without HTTP: tkt server admin-token --project <id> --name <n>, tkt server project-delete <id> --confirm <name-or-id> --json.
  • Disk (AITODO_STORE_MAX_BYTES, AITODO_DISK_MIN_FREE_BYTES): a project's quota counts its store with the whole git history and derived files, its archives (stores/.archive/<id>-<date>) and an import being built, as allocated on disk; before it refuses a write the server packs the store's loose git objects (every commit stays). Free space is the operator's: under 5120 MB (AITODO_DISK_WARN_FREE_BYTES, above the stop level) the server logs one warning line per 10 minutes at most and users see nothing; under 1024 MB every write that grows the disk (a forwarded write, a store create, an import) is paused for every project; reads, export and release go on. tkt operator projects shows the state (ok, low, full). Nothing is deleted on its own: an archive holds the server-side git history of a store that went back to its repo (the audit trail); remove one by hand only when that history is kept elsewhere.
  • Registration: AITODO_REGISTRATION=open|invite|closed; unset: invite with a valid operator token, else closed (with one warning line); open only when set explicitly (a local or dev server). closed: 403 ERR_AUTH_FORBIDDEN; GET /v1/meta shows it in registration.
  • Limits (never on the operator): 10 registrations and server store creations together per hour from one client address (AITODO_REGISTRATION_RATE_LIMIT; a refused try counts too; 429 ERR_RATE_LIMITED); at most 1000 projects on the server (AITODO_MAX_PROJECTS; then 403 ERR_AUTH_FORBIDDEN, the invite stays unused). A bad value stops the server at startup.
  • Proxy: the container takes the client address (log, the hourly limit above) and the scheme (https:// in links and redirects) from X-Forwarded-For / X-Forwarded-Proto only on a connection from AITODO_TRUSTED_PROXIES: IP addresses and CIDR networks, comma separated (the proxy's Docker network, e.g. 10.0.1.0/24), none without a proxy. Headers from anywhere else do not count. Unset or a bad value (* too): the container does not start. Only the proxy should reach the container port.
  • Invites: tkt operator invite --name N --expires 7d|YYYY-MM-DD --server <url> --json: a one-time code (arc_…), shown once, 7 days by default, --name fixes the name, only its hash is kept. tkt operator invites --server <url> (open|used|expired|revoked, never a code), tkt operator invite-revoke <invite-id> --server <url>. The registrant sets AITODO_INVITE or types it at the prompt (no --invite); it is used up in the transaction that creates the project. None or unknown: 401 ERR_AUTH_REQUIRED; used, expired, revoked or another --name: 403 ERR_AUTH_FORBIDDEN. A log line per mint, use and revoke, never the code.
  • Without an invite: tkt project register <url> --name N --operator and tkt store init --server <url> --register --name N --operator go through POST /v1/operator/projects with the secret (never in the credentials file), in any mode; the rest is an ordinary registration (--as, default $USER; the pin rules), listed via operator (beside via invite <id>, via open). A set AITODO_INVITE stays unused: AITODO_INVITE is set but ignored with --operator: the invite stays unused. API off: 404 ERR_NOT_FOUND; a wrong secret or a project token: 401 ERR_AUTH_REQUIRED. Log line: action=register.
  • Health and diagnosis: GET /v1/healthz is always 200 (liveness: a busy database must not restart the container); status is ok or degraded, db holds read and write (ok, busy, error), when busy the request holding the lock (holder: id, method, path) and for how long (heldSeconds); the probe never waits. The server writes to stderr the start of every request with its id (request start), the begin and end of every database write with the same id (write begin, write end), a write held over a second with where it opened (slow write), and a write that did not get the lock with its holder (write lock busy). kill -USR1 1 in the container dumps every thread's stack.
  • AI agents run these only when the user asks, and never ask for an invite code or the operator secret.

Commands on this page#

tkt operator projectsEvery project on the server: id, name, created, created by, how it was created (an invite id, open or operator), token counts, last use (never a token), its AI plan and AI use (calls ever, credits this month), and what it takes on the server's disk (its store with the git history, its archives); first the disk's free space→ tkt operator project-deleteDelete a project and everything the server keeps for it (tokens, LLM usage and caps, id counters, claim leases), e.g. one whose admin tokens are lost→ tkt operator admin-tokenMint a new admin token for a project (recovery when every admin token is lost); shown once→ tkt operator inviteMint a one-time registration code (arc_…) for a server that registers by invite (AITODO_REGISTRATION=invite, the default with an operator token)→ tkt operator invitesEvery invite: id, status (open, used, expired, revoked), the fixed project name, created, expires, and the project it created→ tkt operator invite-revokeRevoke an unused invite by its id (from tkt operator invites); its code is refused from then on→ tkt operator store-unfreezeA tkt store move --to repo that never finished leaves the project's server store frozen (moving)→ tkt operator store-releaseFinish a store move left half-done (moving): the location becomes repo and the server's copy is archived under stores/.archive/ (never deleted)→ tkt server project-deleteDelete a project straight in AITODO_SERVER_DATA, e.g. one whose admin tokens are lost→ tkt server admin-tokenMint a new admin token straight in AITODO_SERVER_DATA (recovery, D8)→
Generated from the registry: src/aitodo/api/selfdoc_entries/team.py · team.operatorv0.1.298