tako-server-0.0.1 is not a library.
tako-server
Rust crate for the remote Tako runtime and proxy.
Responsibilities
- Start/stop/manage app instances.
- Maintain route table and app load balancers.
- Terminate HTTP/HTTPS traffic and proxy upstream.
- Redirect HTTP traffic to HTTPS (except ACME challenge checks).
- Cache proxied
GET/HEADupstream responses in-memory when response cache directives explicitly allow caching. - Perform health probing using
Host: tako-internal+/statusagainst each app instance. - Perform active health probing.
- Serve management commands over Unix socket.
- Report per-build runtime status (multiple concurrently running builds during rollout).
- Validate on-demand (
instances = 0) deploy startup before finalizing idle state. - Validate app ids, release ids, and deploy paths at the management socket boundary.
- Persist app runtime registration (config/routes + release metadata) to SQLite and restore it on restart.
- Read non-secret env vars from release
app.jsonand secrets from per-appsecrets.json(0600) under the data directory. - Persist server upgrade mode in SQLite and reject mutating commands while upgrading.
- Use a single-owner durable upgrade lock so only one upgrade controller can enter upgrading mode at a time.
- Expose
server_info,enter_upgrading, andexit_upgradingmanagement commands for upgrade orchestration. - Enable zero-downtime reload handoff with SIGHUP child spawn,
SO_REUSEPORTlistener overlap, and pid-specific management sockets (tako-{pid}.sock) behind stable symlinktako.sock. - Support
--instance-port-offsetto shift preferred instance port ranges when overlapping server processes are running.
Routing policy notes:
- Deploy commands must include at least one non-empty route.
- No implicit catch-all/no-routes mode is supported.
Key Runtime Paths
- Socket:
/var/run/tako/tako.sock - Data root:
/opt/tako - Runtime state DB:
/opt/tako/runtime-state.sqlite3 - App releases:
/opt/tako/apps/<app>/releases/<version>/
Run and Test
From repository root:
Example local run:
Related Docs
website/src/pages/docs/quickstart.md(remote server install + first deploy setup)website/src/pages/docs/deployment.md(deploy flow and runtime expectations)website/src/pages/docs/architecture.md(runtime component/data-flow context)