Introducing a new way to review your PRs.

Read the announcement

gotempsh / temps

AI-native open-source alternative to Vercel + Sentry + PostHog + Pingdom + Resend + E2B. 440+ CLI operations with drop-in skills for Claude Code, Codex & OpenCode — deployments, analytics, session replay, error tracking, OpenTelemetry, email, sandboxes & AI gateway in one self-hosted Rust binary.

View on GitHub

25 documents · Updated Oct 21, 2026

docs / domains-and-networking

Domains and networking

Domains and networking turn a deployed workload into a reachable service. The platform proves domain ownership, obtains certificates, resolves public and internal names, selects routes, forwards requests through proxies, and connects workers across nodes. This page is a child of Deployment lifecycle and relates to Deployment orchestration, Projects and environments, and Project groups and templates.

Network exposure model

The platform separates public application traffic, internal workload traffic, node traffic, and public console callbacks. The control plane publishes route and DNS state. Workers and proxies keep local views so normal requests do not need a database read.

This diagram shows how a public name or an internal service name reaches a live workload.

flowchart LR
    Client[Public client] --> DNS[Public DNS]
    DNS --> Proxy[Public proxy]
    Proxy --> Routes[Route view]
    Routes --> Workload[Live workload]

    App[Workload] --> InternalDNS[temps.local DNS]
    InternalDNS --> InternalProxy[Worker internal proxy]
    InternalProxy --> Workload

    Control[Control plane] --> Sync[Route and DNS sync]
    Sync --> Worker[Worker agent]
    Worker --> Overlay[Private worker network]
    Overlay --> Workload

    Callback[Webhook or ingest client] --> PublicSurface[Public-only console surface]

Public names

Public names map to a route that identifies a project, environment, deployment, or operator-defined backend. Exact names take priority over one-label wildcard names. Stable environment and service names can start certificate work when a deployment becomes live. crates/…/route_table.rs• L365-471, crates/…/route_table.rs• L1451-1668.

Operator-defined routes can use HTTP routing or TLS/SNI passthrough. HTTP routing terminates TLS at the proxy and forwards an HTTP request. TLS/SNI routing selects a backend from the encrypted connection and leaves certificate handling to that backend. The route form can use a managed domain, a manually entered domain, or a subdomain built from a selected wildcard domain. The routes screen lets instance admins edit the backend host and port or remove a route. web/…/AddRoute.tsx• L50-195, web/…/AddRoute.tsx• L225-367, web/…/AddRoute.tsx• L373-589, web/…/RoutesManagement.tsx• L163-198, web/…/RoutesManagement.tsx• L251-300.

Operator-defined custom routes are part of the same exposure model. The proxy keeps enabled exact and wildcard custom routes in an in-memory snapshot. A background refresh makes changes visible to traffic within about 60 seconds in the split console and proxy topology. crates/…/lb_service.rs• L62-99, crates/…/lb_service.rs• L110-170, crates/…/services.rs• L310-340.

References: crates/…/route_table.rs• L365-471 crates/…/route_table.rs• L1451-1668 web/…/AddRoute.tsx• L50-195 web/…/AddRoute.tsx• L225-367 web/…/AddRoute.tsx• L373-589 web/…/RoutesManagement.tsx• L163-198 web/…/RoutesManagement.tsx• L251-300 crates/…/lb_service.rs• L62-170

Request forwarding

The proxy uses the TLS server name, host, path, and method to select a destination. Project traffic goes to a live workload. Console traffic goes to the control plane. A known project host with no live backend returns an upstream failure rather than falling through to the console. During startup, an unmatched request can wait briefly for the first route view to load. crates/…/traits.rs• L66-110, crates/…/services.rs• L99-307, crates/…/proxy.rs• L6051-6090.

The public ingress hostname always reaches only the public console surface when that listener exists. Public ingest paths include the platform callback paths and OTLP ingest paths. The OTLP query API remains on the full authenticated console surface. These rules prevent a public callback host from reaching project routes or the management API. crates/…/services.rs• L19-25, crates/…/services.rs• L111-159, crates/…/proxy.rs• L1075-1087.

The proxy keeps request-path reads in local snapshots or short-lived caches. It sends logs and tracking data to bounded background writers. The ACME HTTP-01 lookup is the narrow exception because certificate validation needs the current challenge token. crates/…/proxy.rs• L4-21.

HTTP-to-HTTPS behavior uses the local certificate state and the environment policy. ACME validation and internal node management stay on HTTP because they can run before a certificate exists. External TLS termination disables origin redirects so a CDN or tunnel does not enter a redirect loop. The proxy checks listener addresses before startup, so a port conflict or permission error is reported as a startup failure. crates/…/proxy.rs• L490-672, crates/…/server.rs• L41-79, crates/…/server.rs• L447-458, crates/…/server.rs• L801-869.

References: crates/…/services.rs• L19-159 crates/…/services.rs• L230-307 crates/…/proxy.rs• L4-21 crates/…/proxy.rs• L490-672 crates/…/server.rs• L41-79 crates/…/server.rs• L447-458 crates/…/server.rs• L801-869 crates/…/traits.rs• L66-149

Request protection

Routed traffic can be stopped before it reaches a workload. Project and environment policy, client-IP rules, connection limits, rate limits, attack mode, and password protection form separate controls. A denial remains distinct from an unavailable control service so operators can tell a policy block from a platform fault. crates/…/proxy.rs• L5680-5817, crates/…/proxy.rs• L6484-6610.

Attack mode uses a browser proof-of-work challenge. CAPTCHA and solver paths stay reachable so a visitor can pass the challenge. Password protection shows a project and environment password wall, then grants access with a signed cookie tied to the environment and current password hash. A password change therefore invalidates old grants. crates/…/password_wall.rs• L129-138, crates/…/password_wall.rs• L195-235, crates/…/password_wall.rs• L237-277, crates/…/proxy.rs• L6484-6610.

Path-routed environments use a cookie scoped to the route prefix. The password form carries the routed path on its verification request, so the verification stays with the target environment and cannot borrow an unrelated host route. crates/…/password_wall.rs• L54-126, crates/…/password_wall.rs• L140-177, crates/…/password_form.html• L252-279.

References: crates/…/proxy.rs• L5680-5817 crates/…/proxy.rs• L6484-6610 crates/…/password_wall.rs• L129-277 crates/…/password_form.html• L252-279

Project IP access

Project IP access is an optional client-address policy for a project or one of its environments. An allow list admits only listed networks. A deny list blocks listed networks. A disabled environment policy explicitly avoids the project-wide policy. An environment policy replaces the project policy for that environment rather than merging with it. crates/…/project_ip_access_service.rs• L4-12, crates/…/mod.rs• L27-39.

The management API validates and stores complete policies. It can test a saved policy or an unsaved draft with the same matching rules used by the proxy. A save that would exclude or block the caller is refused unless the caller acknowledges the lockout. Changes are audited after a successful write. crates/…/project_ip_access.rs• L205-294, crates/…/project_ip_access.rs• L326-416, crates/…/project_ip_access_service.rs• L448-515.

The proxy resolves the client address from the trusted connection path. It does not accept arbitrary client-supplied forwarding headers. The enforcement gate uses a local policy snapshot and keeps the last good snapshot if a later refresh fails, so a storage outage does not silently open a protected workload. The initial forwarded-IP trust choice is loaded before the proxy accepts traffic and is retained across refresh errors. crates/…/mod.rs• L4-17, crates/…/gate.rs• L21-56, crates/…/proxy.rs• L3858-3960, crates/…/server.rs• L58-116.

References: crates/…/project_ip_access_service.rs• L4-12 crates/…/project_ip_access_service.rs• L148-247 crates/…/project_ip_access_service.rs• L448-515 crates/…/project_ip_access.rs• L205-294 crates/…/mod.rs• L4-17 crates/…/gate.rs• L21-56 crates/…/proxy.rs• L3858-3960 crates/…/server.rs• L58-116

Domain management and TLS

Domain management covers ownership proof, certificate issue, renewal, and operator-visible status. HTTP-01 proves a name with a token over HTTP. DNS-01 proves it with TXT records and supports wildcard names. crates/…/domain_service.rs• L183-251, crates/…/domain_service.rs• L303-451.

Domain ownership checks

Adding a domain creates pending state and an ACME order. HTTP-01 needs a reachable port 80 and a challenge token. DNS-01 needs the expected TXT value at the ACME challenge name. The domain screens explain the DNS target for direct or NAT access, show when port forwarding is needed, and defer domain and certificate control to Cloudflare Tunnel when that mode is active. web/…/AddDomain.tsx• L31-40, web/…/AddDomain.tsx• L80-110, web/…/AddDomain.tsx• L259-363, web/…/AddDomain.tsx• L441-480, web/…/DNSConfigurationHelper.tsx• L27-48, web/…/DNSConfigurationHelper.tsx• L63-145, web/…/DNSConfigurationHelper.tsx• L146-295.

On success the platform stores the certificate and marks the domain active. The private key is protected before storage. Automatic DNS changes record enough provider state to support later cleanup. Operators can renew or delete a domain when their platform mode and permissions allow it. crates/…/domain_service.rs• L505-667, crates/…/domain_handler.rs• L1046-1134, crates/…/domain_handler.rs• L2382-2623, web/…/DomainsManagement.tsx• L104-162, web/…/DomainsManagement.tsx• L246-295.

References: web/…/AddDomain.tsx• L31-40 web/…/AddDomain.tsx• L80-110 web/…/AddDomain.tsx• L259-363 web/…/DNSConfigurationHelper.tsx• L27-48 web/…/DNSConfigurationHelper.tsx• L63-145 web/…/DNSConfigurationHelper.tsx• L146-295 web/…/DomainsManagement.tsx• L104-162 web/…/DomainsManagement.tsx• L246-295 crates/…/domain_service.rs• L183-251 crates/…/domain_service.rs• L505-667 crates/…/domain_handler.rs• L2382-2623

Certificate states

Certificate state separates serving health from renewal health. A failed renewal can leave a still-valid certificate in service while the domain is marked degraded. If no usable certificate remains, HTTPS cannot serve the name until issue succeeds. The domain list presents this distinction as an active certificate with a renewal failure rather than as an outage. crates/…/domain_service.rs• L140-180, crates/…/domain_service.rs• L669-726, crates/…/domain_service.rs• L918-983, web/…/DomainsManagement.tsx• L383-404, web/…/DomainsManagement.tsx• L474-500.

Eligible stable hostnames can trigger on-demand certificate issue during a TLS handshake. The proxy accepts only direct names in the configured zone with a certificate-eligible route, deduplicates in-flight work, applies backoff and issuance caps, and runs ACME work in the background. The first TLS attempt can fail fast. Later attempts succeed after the certificate becomes active. Ephemeral deployment names do not start this flow. crates/…/on_demand_cert.rs• L284-403, crates/…/on_demand_cert.rs• L494-649, crates/…/proxy.rs• L2539-2618, crates/…/server.rs• L129-163, crates/…/server.rs• L183-255.

Status-page custom hostnames are a special certificate case. The proxy serves a certificate only after ownership is proven and the page is published. An unverified or unpublished status host does not use an exact certificate, wildcard fallback, or on-demand issuance. crates/…/server.rs• L129-149, crates/…/server.rs• L183-255.

References: crates/…/domain_service.rs• L140-180 crates/…/domain_service.rs• L669-726 crates/…/domain_service.rs• L918-983 web/…/DomainsManagement.tsx• L383-404 crates/…/on_demand_cert.rs• L284-403 crates/…/on_demand_cert.rs• L494-649 crates/…/proxy.rs• L2539-2618 crates/…/server.rs• L129-255

Certificate lookup

The TLS layer checks an exact certificate before a one-label wildcard. It keeps short-lived present and missing results in memory. A bounded last-known-good copy can keep known names serving during a short database outage. crates/…/tls_cert_loader.rs• L105-153, crates/…/tls_cert_loader.rs• L207-239, crates/…/tls_cert_loader.rs• L243-447.

Managed edge names can use an allowlisted origin certificate. The public certificate remains at the edge while the origin validates the expected hostname. Status-page names are checked for ownership and publication before certificate selection. crates/…/tls_cert_loader.rs• L357-447, crates/…/server.rs• L112-149.

References: crates/…/tls_cert_loader.rs• L105-153 crates/…/tls_cert_loader.rs• L243-447 crates/…/server.rs• L112-149

DNS provider actions

An automatic provider can publish and remove A and TXT records. DNS-01 preserves other TXT values at the same name because several certificate orders can overlap. Cleanup is conservative when the provider cannot identify the exact record. crates/…/dns_provider.rs• L34-42, crates/…/dns_provider.rs• L165-295, crates/…/domain_handler.rs• L2410-2623.

Renewal uses a fail-closed authorization check for the selected provider, zone, domain, and TXT batch. Denials and publish results are audited without storing TXT values. crates/…/service.rs• L888-1042.

References: crates/…/dns_provider.rs• L34-42 crates/…/dns_provider.rs• L165-295 crates/…/domain_handler.rs• L2410-2623 crates/…/service.rs• L888-1042

DNS resolution

Public DNS directs clients to the platform and proves domain control. Internal DNS gives workloads stable service names without exposing changing container addresses.

Public DNS lookups

The platform can resolve A records for an operator and can check DNS-01 propagation through several public resolvers. A challenge is ready only when enough resolvers return all expected TXT values. The UI gives direct and NAT deployments a target IP and calls out the need to forward ports 80 and 443 when the platform is behind a router. crates/…/dns.rs• L19-109, crates/…/dns.rs• L39-87, crates/…/dns_provider.rs• L568-595, crates/…/dns_provider.rs• L650-849, web/…/DNSConfigurationHelper.tsx• L146-295.

References: crates/…/dns.rs• L19-109 crates/…/dns.rs• L39-87 crates/…/dns_provider.rs• L568-595 crates/…/dns_provider.rs• L650-849 web/…/DNSConfigurationHelper.tsx• L146-295

Internal service names

The internal zone is *.temps.local. Its registry maps stable service, node, and deployment names to current endpoints. Deployment names point to a worker proxy rather than directly to a container, so restarts do not change the name used by another workload. crates/…/dns_registry.rs• L4-35, crates/…/dns_registry.rs• L88-107.

Registry changes replace all records for an owner and advance a cluster generation. Workers receive a full zone snapshot and acknowledge that generation. crates/…/dns_registry.rs• L316-421, crates/…/dns_registry.rs• L571-673.

References: crates/…/dns_registry.rs• L4-35 crates/…/dns_registry.rs• L316-421 crates/…/dns_registry.rs• L571-673

Resolver delivery

Workers can run a local resolver for the internal zone. The agent gives its bridge address to new containers only while the resolver is enabled and healthy. Otherwise containers use the normal Docker resolver. crates/…/network_sync.rs• L441-454, crates/…/network_sync.rs• L635-791.

In split proxy mode, exact node DNS sync endpoints can use a local authenticated service. They do not become general workload routes. crates/…/config.rs• L21-24, crates/…/services.rs• L27-46, crates/…/services.rs• L275-290.

References: crates/…/network_sync.rs• L441-454 crates/…/network_sync.rs• L635-791 crates/…/config.rs• L21-24 crates/…/services.rs• L27-46 crates/…/services.rs• L275-290

Routes and workload proxying

The route view joins domains, environments, deployments, containers, custom routes, and path routes. The control plane publishes it. Workers mirror it so the proxy can make local decisions.

Route publication

Route rebuilds select a local endpoint or a private endpoint for each live container. Sleeping, stopped, paused, and unreachable deployments remain known for attribution but do not receive a live backend. A known host with no live upstream returns a 503 path instead of the console, while project context and access policy still apply to that request. crates/…/route_table.rs• L178-243, crates/…/route_table.rs• L730-967, crates/…/services.rs• L230-273, crates/…/traits.rs• L10-22.

The route view can also contain paths that hand a prefix on one host to another service. The target environment controls project context, access policy, static serving, and upstream choice for that prefix. crates/…/traits.rs• L151-170, crates/…/proxy.rs• L1099-1104, crates/…/services.rs• L449-450.

Workers acknowledge route generations and keep a disk snapshot for restart and short control-plane outage recovery. crates/…/route_sync.rs• L4-33, crates/…/route_store.rs• L86-187.

References: crates/…/route_table.rs• L178-243 crates/…/route_table.rs• L730-967 crates/…/services.rs• L230-340 crates/…/traits.rs• L10-22 crates/…/traits.rs• L151-170 crates/…/proxy.rs• L1099-1104 crates/…/route_sync.rs• L4-33 crates/…/route_store.rs• L86-187

Sleeping environments

On-demand environments stop after an idle period and wake when a request reaches an exact or wildcard hostname. The first request reserves a bounded wake slot. One caller starts the local containers while other callers wait for the result. crates/…/on_demand.rs• L68-112, crates/…/on_demand.rs• L217-225, crates/…/on_demand.rs• L392-444, crates/…/on_demand.rs• L599-661.

Wake starts containers, waits for health, records activity, publishes an in-process route reload, and sends a database notification for remote nodes. Partial start or health failure stops what it started and restores sleeping state. A request that cannot wait or cannot wake receives a retryable 503. crates/…/on_demand.rs• L664-921, crates/…/on_demand.rs• L933-972, crates/…/proxy.rs• L5739-5794, crates/…/proxy.rs• L5937-6008.

The wake path starts only containers owned by the current node. A mixed deployment can wake its local containers while remote containers wait for their own node. A fully remote environment remains sleeping and returns an honest retryable error until remote wake support is available. crates/…/on_demand.rs• L717-769.

References: crates/…/on_demand.rs• L68-112 crates/…/on_demand.rs• L217-225 crates/…/on_demand.rs• L599-769 crates/…/on_demand.rs• L895-959 crates/…/proxy.rs• L5739-5794

Static site delivery

Static deployments can serve files from local storage or an operator-selected S3-compatible store. Both paths use the same request candidate order: the requested file, an index, an extensionless HTML page, 404.html, and then the SPA shell where appropriate. crates/…/static_file_serving.rs• L440-559, crates/…/server.rs• L541-585.

The static layer confines paths to the deployment, rejects unsafe and sensitive paths, checks symlinks, bounds response reads, and supports conditional requests. A deployment 404.html produces a real 404. A missing page in a pure SPA can use the root shell. crates/…/static_file_serving.rs• L252-395, crates/…/static_file_serving.rs• L597-660.

References: crates/…/static_file_serving.rs• L252-395 crates/…/static_file_serving.rs• L440-559 crates/…/static_file_serving.rs• L597-660 crates/…/server.rs• L541-585

Internal workload traffic

The worker internal proxy serves *.temps.local from the worker route store. It forwards only to a live backend and checks that the caller belongs to a current container in the same project. Unknown hosts, unavailable targets, and untrusted callers fail closed. crates/…/internal_proxy.rs• L4-46, crates/…/internal_proxy.rs• L267-443.

This boundary gives workloads service discovery without creating a general network forwarder. Docker network ownership identifies the caller. Route metadata identifies the target project. crates/…/internal_proxy.rs• L324-443.

References: crates/…/internal_proxy.rs• L4-46 crates/…/internal_proxy.rs• L267-443

Workspace preview traffic

Workspace previews use a reserved hostname that carries a sandbox identifier and port. The public proxy checks the sandbox and accepts a password cookie or platform session grant before it contacts the preview gateway. crates/…/preview_auth.rs• L131-160, crates/…/preview_auth.rs• L586-797.

After authentication the proxy sends a short-lived gateway token and removes tenant authorization data. The gateway maps the host to a sandbox container and supports HTTP and long-lived streams. The reserved public ingress hostname is excluded before preview parsing. crates/…/proxy.rs• L4111-4168, crates/…/proxy.rs• L4929-4949, crates/…/main.rs• L170-305.

References: crates/…/preview_auth.rs• L131-160 crates/…/preview_auth.rs• L586-797 crates/…/proxy.rs• L4111-4168 crates/…/proxy.rs• L4929-4949 crates/…/main.rs• L170-305

Proxy traffic records

The proxy records request outcomes for operations and analytics. Counters partition traffic into project, console, and proxy-handled requests. Latency is split between backend time and proxy time. WebSocket and SSE lifetimes are reported as streaming sessions rather than ordinary request latency. IP access denials have their own counter. crates/…/metrics.rs• L69-151, crates/…/metrics.rs• L231-321.

The request path updates lock-free counters. A background sampler writes interval deltas as node metrics. A separate bounded writer persists access logs and tracking events. If the log channel or backend is overloaded, logs can be dropped while live request handling continues. crates/…/metrics_sampler.rs• L4-15, crates/…/metrics_sampler.rs• L60-103, crates/…/proxy_log_batch_writer.rs• L122-190.

Proxy log reads and writes can use TimescaleDB or ClickHouse. Both backends expose the same service contract. ClickHouse is selected only when its full configuration is present. It uses bounded time windows, bound filter values, query-time aggregation, and a native retention period. TimescaleDB remains the default. crates/…/proxy_log_service.rs• L260-400, crates/…/proxy_log_service.rs• L900-963, crates/…/clickhouse.rs• L4-49, crates/…/clickhouse.rs• L1005-1193, crates/…/plugin.rs• L99-130.

References: crates/…/metrics.rs• L69-151 crates/…/metrics.rs• L231-321 crates/…/metrics_sampler.rs• L60-103 crates/…/proxy_log_batch_writer.rs• L122-190 crates/…/proxy_log_service.rs• L260-400 crates/…/proxy_log_service.rs• L900-963 crates/…/clickhouse.rs• L4-49 crates/…/clickhouse.rs• L1005-1193

Multi-node connectivity

Multi-node connectivity gives each worker a separate compute network and a path to peer compute networks. The control plane allocates the topology. The agent reconciles it with the host kernel, Docker, and container namespaces.

Address allocation

The control plane allocates one compute network per node from a cluster pool. It returns local and peer allocations plus underlay addresses. Workers validate pool membership, prefix size, non-overlap, and underlay placement before installing routes. crates/…/network.rs• L38-111, crates/…/network.rs• L149-210, crates/…/network_sync.rs• L367-395, crates/…/network_sync.rs• L472-527.

References: crates/…/network.rs• L38-111 crates/…/network.rs• L149-210 crates/…/network_sync.rs• L367-395 crates/…/network_sync.rs• L472-527

Overlay transport

The compute network uses VXLAN by default or native kernel routing when the underlay already reaches every compute network. The managed Docker network stays on the platform bridge. The network manager reconciles peer changes so repeated syncs converge on the same state. crates/…/config.rs• L17-49, crates/…/docker.rs• L142-305, crates/…/manager.rs• L21-176.

References: crates/…/config.rs• L17-49 crates/…/docker.rs• L142-305 crates/…/manager.rs• L21-176

Container peer routes

Containers receive explicit routes for peer compute networks after the overlay exists. The agent repeats the route sweep during later sync cycles so a container restart does not remove cross-worker reachability. crates/…/overlay_routes.rs• L4-111, crates/…/network_sync.rs• L456-467, crates/…/network_sync.rs• L541-632.

References: crates/…/overlay_routes.rs• L4-111 crates/…/network_sync.rs• L456-467 crates/…/network_sync.rs• L541-632

WireGuard connectivity

WireGuard is a secure underlay and worker enrollment path. In relay mode a joining worker creates keys, receives peer details, starts a userspace interface, and registers through the tunnel. In direct mode the operator supplies the private address and manages the underlay path. crates/…/join.rs• L404-541.

The compute network can also use a WireGuard interface as its underlay device. WireGuard is therefore separate from the default VXLAN compute overlay, but it can carry that overlay when the network is configured to use it. crates/…/lib.rs• L4-8, crates/…/lib.rs• L57-71, crates/…/lib.rs• L146-323, crates/…/network.rs• L62-81.

References: crates/…/join.rs• L404-541 crates/…/lib.rs• L4-8 crates/…/lib.rs• L57-71 crates/…/lib.rs• L146-323 crates/…/network.rs• L62-81

Edge services

An edge node is a database-free public proxy near clients. It keeps route and certificate views, serves cacheable static assets, and sends dynamic requests to the origin control plane.

Edge route state

The edge accepts complete route snapshots with monotonic versions. It replaces its exact and wildcard maps only when a newer version arrives. Encrypted certificate bundles remain in memory and are selected by exact SNI or wildcard fallback. crates/…/route_table.rs• L44-143, crates/…/tls.rs• L4-9, crates/…/tls.rs• L34-39, crates/…/tls.rs• L55-158.

References: crates/…/route_table.rs• L44-143 crates/…/tls.rs• L4-9 crates/…/tls.rs• L34-39 crates/…/tls.rs• L55-158

Edge request handling

The edge requires a known public route before it handles a request. It serves known static assets from a local pull-through cache and forwards dynamic traffic to the origin with the original host. Missing routes and origin failures have different gateway results. crates/…/proxy.rs• L39-50, crates/…/proxy.rs• L265-351, crates/…/proxy.rs• L405-490.

References: crates/…/proxy.rs• L39-50 crates/…/proxy.rs• L265-351 crates/…/proxy.rs• L405-490

Change checklist

When these files or sections are changed, remember to consider these:

  • When hostname or route eligibility changes, check public route lookup, internal DNS, preview parsing, public ingress reservation, path-route password verification, and certificate eligibility together.
  • When route type or domain input changes, keep managed-domain selection, wildcard expansion, HTTP termination, TLS/SNI passthrough, and route API values aligned.
  • When a route snapshot changes, update the control-plane response, worker sync, disk snapshot, sleeping-environment lookup, on-demand certificate eligibility, and proxy consumers as one contract.
  • When public callback routing changes, keep the public-only listener, ingress hostname reservation, path allowlist, OTLP ingest paths, CAPTCHA routes, telemetry ingest, status-page routes, and preview exclusion aligned.
  • When HTTPS policy changes, keep local certificate checks, environment overrides, external TLS settings, ACME paths, internal cluster paths, and console behavior aligned.
  • When on-demand wake changes, keep local and remote container ownership, atomic sleep state, wake-slot limits, route reload publication, health checks, and retryable 503 behavior aligned.
  • When domain management changes, keep Cloudflare capability checks, DNS target guidance, certificate status labels, renewal actions, and delete consequences aligned.
  • When custom-route behavior changes, keep exact and wildcard matching, status-page hostname claims, snapshot refresh, admin permissions, and stale-read handling aligned.
  • When the compute pool, node prefix, transport, MTU, or WireGuard underlay changes, check allocator output, worker validation, Docker IPAM, kernel routes, and firewall rules together.
  • When edge route or certificate payloads change, update origin serialization, edge decryption, SNI lookup, and monotonic version handling together.

Important failure modes

TriggerConsequenceGuard
A public callback host reaches the full console listenerAn unauthenticated callback can expose the management surfacePublic-only listener, reserved ingress hostname, and public-path allowlist
A public ingress hostname is parsed as a workspace previewCallback traffic reaches a sandbox login flowIngress-host exclusion before preview parsing
A known project host has no live backendThe request could fall through to the consoleUnavailable-route state and upstream 503 classification
A project allow list excludes the operator's current addressA policy save can cut off the operator before the proxy reloads itLockout check and explicit acknowledgement
A project or environment policy refresh failsThe proxy could use incomplete or open policy stateRequired initial load and last-known-good snapshot on later failures
A client sends an untrusted forwarding headerThe client could choose an address that bypasses or triggers an IP policyUse the TCP peer unless a trusted proxy or known edge supplies the forwarded address
A path-routed password form posts without its route prefixVerification can target the host environment or a platform pathSame-origin routed-path lookup and path-scoped cookie
A password changes while old cookies existOld access grants could remain validCookie signature derives from the current password hash
A request arrives while an environment is sleeping and wake capacity is fullThe proxy can pin too many request tasksBounded wake slots and retryable 503
A fully remote sleeping environment receives a wake requestThe proxy cannot start its containers and must not claim that it didLocal-container ownership check and sleeping-state rollback
A static path escapes its deployment or uses a sensitive aliasPrivate files could be publishedPath normalization, containment checks, and symlink rejection
A log channel or storage backend is overloadedAccess-log rows are lost while live requests continueBounded non-blocking send, drop counters, and background retry for transient conflicts
A custom route update reaches the console but not the proxyTraffic uses a stale route for up to the refresh windowPeriodic in-memory snapshot refresh
Compute CIDRs overlap or leave the cluster poolOverlay setup refuses to change network stateControl-plane allocation and worker preflight validation
An edge receives an older route snapshotStale exposure can replace current exposureMonotonic route versions
A proxy listener address is already used or lacks permissionThe proxy can start without a working HTTP or TLS listenerPreflight bind checks with an actionable startup error
External TLS is treated as a reason to redirect the originA CDN or tunnel can enter an HTTPS redirect loopLoad external TLS policy before startup and disable the origin redirect

Key files

FileWhy to read it
crates/…/route_table.rsHost, wildcard, path, backend, and certificate eligibility decisions
crates/…/proxy.rsEnd-to-end request policy, routing, wake, protection, and forwarding behavior
crates/…/services.rsHost, method, path, console, ingress, DNS sync, and public-surface selection
crates/…/server.rsListener startup, TLS SNI policy, external TLS behavior, and proxy refresh services
crates/…/traits.rsBoundary contracts for upstream and project-context resolution
crates/…/password_wall.rsEnvironment and path-route password access contract
crates/…/project_ip_access.rsProject and environment IP policy API and audit boundary
crates/…/gate.rsLive project IP policy enforcement and refresh behavior
crates/…/project_ip_access_service.rsPolicy scope, inheritance, validation, and lockout protection
crates/…/on_demand.rsSleep, wake, local-node ownership, health, and route reload behavior
crates/…/on_demand_cert.rsOn-demand certificate eligibility, limits, and background issue flow
crates/…/static_file_serving.rsStatic site candidate order and publication safety
crates/…/domain_service.rsDomain ownership and certificate lifecycle
crates/…/service.rsRenewal, DNS publication, authorization, and audit outcomes
crates/…/dns_registry.rsInternal name ownership and generation updates
crates/…/network_sync.rsWorker network, resolver, route, and overlay reconciliation
crates/…/manager.rsMulti-node compute network lifecycle
crates/…/lib.rsWireGuard interface and peer lifecycle
crates/…/lb_service.rsOperator-defined custom-route snapshot behavior
crates/…/metrics.rsProxy traffic, IP access, and latency counters
crates/…/metrics_sampler.rsPersistence of proxy metrics as node data
crates/…/proxy_log_batch_writer.rsNon-blocking log and tracking persistence path
crates/…/proxy_log_service.rsShared proxy-log query and storage dispatch contract
crates/…/clickhouse.rsClickHouse proxy-log retention, filtering, and aggregation behavior
crates/…/timescaledb.rsDefault TimescaleDB proxy-log behavior
crates/…/proxy.rsEdge cache and origin request outcomes
crates/…/route_table.rsEdge route versioning and wildcard lookup
web/…/AddDomain.tsxDomain and certificate challenge user flow
web/…/DNSConfigurationHelper.tsxAccess-mode-specific DNS and port-forwarding guidance
web/…/DomainsManagement.tsxDomain status, renewal, deletion, and Cloudflare management behavior
web/…/AddRoute.tsxHTTP, TLS/SNI, managed-domain, and wildcard route setup flow
web/…/RoutesManagement.tsxRoute listing, admin-only edits, backend changes, and deletion behavior