pushleft
Deploy your first app
Manual contents
Handbook
HandbookPushleftArchitecture
Operate
Install the control planeYour own serversFleetOperations and alertsAuthenticationAccess gateDomains and DNSUsage and budgetsScheduled jobsAbuse controlsAI provider proxyCustomer mailErrors and performanceLogs and metricsRetentionObject storageContainer registryGit server
Develop
The .pl.yaml manifestOnboard with an AI agentThe pl up demoBuild executorSource ingestionAgent gatewayManaged databasesSecurity findingsTunnels and shellsDev workspacesPrivate hostnamesMesh coordinatorsDesign baseline
Runbooks
Control-plane host failoverControl-plane PostgreSQL failoverControl-plane PostgreSQL restoreCustom domains and certificatesGateway key compromiseIngress host failureNode busyNode disk fullNode drain and replacementNode lostRegistry outageHetzner Robot hostsSecret rotationSecurity incidentStaging fleet on ProxmoxStaging build cacheStuck deploymentVault/OpenBao backup and recovery
More
CI pipelines
Manual · docs/domain-registration.md

Domains and DNS

Buy a domain in the Pushleft console, and Pushleft registers it and hosts its DNS for you. You then manage its DNS records on the same page and serve the domain from any environment.

Console A registered domain with its expiry, nameservers and DNS records.
Console Cloudflare connections: the account, its zones and the token permissions a linked domain needs.

Quick start

  1. In the console, open Domains.

  2. Under Find a domain, type the name, select the period (1 to 5 years) and select Check availability. The result shows the price and the renewal price.

  3. Fill in the Registrant details. The registrar lists this person as the owner. Add registry-specific data only when the registry requirements list it.

  4. Confirm the details and select Register for the quoted price. Pushleft debits the price from your organization’s prepaid domain balance. Nothing funds that balance yet, so checkout returns 402 (insufficient account balance for this domain) unless an operator credited it (billing and renewal boundary).

  5. Select the domain under Your domains to follow its provisioning state, expiry and nameservers.

  6. Under DNS records, add the records you need (A, AAAA, CNAME, MX or TXT) and select Add record.

  7. To serve the domain from an environment, claim the hostname and create the DNS record that the command prints (custom domains on an environment):

    pl domain add www.example.com --production

Features

  • Registration through Openprovider and authoritative DNS on Cloudflare, both run by Pushleft.
  • DNS record sets of type A, AAAA, CNAME, MX and TXT. You can proxy A, AAAA and CNAME records.
  • No ownership TXT record for a domain you buy through Pushleft. The purchase is the proof.
  • Manual renewal. The console warns you during the last 60 days before expiry.
  • Mail from the domain with DKIM records that Pushleft writes for you (customer mail).
  • Mail provider presets: the DNS records of Google Workspace, Microsoft 365, Amazon SES or inbox2 in one step (mail provider presets).

Mail provider presets

A preset adds a mail provider’s MX, SPF, DKIM and verification records as one record set. In the console, open the domain and fill in Mail provider under DNS records. Select Preview records, then Add. From a terminal:

pl dns zones
pl dns preset example.com google-workspace --dkim 'google._domainkey=v=DKIM1; k=rsa; p=…'
pl dns preset example.com google-workspace --dkim 'google._domainkey=v=DKIM1; k=rsa; p=…' --yes

Without --yes, the command prints the records and adds nothing.

PresetYou provide
Google WorkspaceDKIM TXT record and verification TXT, both optional
Microsoft 365MX host (<tenant>.mail.protection.outlook.com), verification TXT optional
Amazon SESthe three DKIM CNAMEs; a MAIL FROM subdomain with its AWS region, optional
inbox2MX host; DKIM and the SPF record inbox2 gives, optional

A name holds one SPF record. Two SPF records make every receiver’s check fail.

  • If your SPF record at the root is alone in its record set, the preset merges it with the provider’s and replaces it. The console and pl do this for you (existing_spf in the API).
  • Any other SPF record at the same name is refused (409). Move it into a record set of its own, or delete it, and add the preset again.

Custom domains on an environment

You can attach any hostname you control to an environment. It does not matter if you bought the domain through Pushleft or elsewhere. Registration (above) and serving are separate steps.

pl domain add www.example.com            # this checkout's project and preview/<branch>
pl domain add www.example.com --production
pl domain list | show <id> | remove <id>

POST /v1/custom-domains {hostname, project, environment, role?} creates a claim. It needs the member role or higher, and the admin role for a production environment. Viewers can list and show claims.

A customer’s own hostname at runtime. An app can attach its customers’ hostnames itself, with a service token and no deploy. In a production environment, the token needs the admin role. Each customer adds one CNAME to the environment’s hostname. role names the web role the hostname serves (pl domain add <host> --role viewer), with that role’s route settings on every path. A role in route.domains that lists the name wins. Without role, or when the release has no such web role, the first web role serves it. Poll GET /v1/custom-domains/{id} for the status, and DELETE the claim when the customer leaves. The response holds the claim and two ways to prove that you control the name:

  • A TXT record _pushleft-challenge.<hostname> with the claim’s token. This works for apex names.
  • A CNAME <hostname> that points to the environment’s preview hostname. This also sends traffic to the ingress. The target is <branch>--<project>--<org>.<base> for a preview and <project>--<org>.<base> for production. <org> is the organization’s handle. The API response and pl domain add print the exact target.

Verification. The scheduler checks the record with a real DNS query. It retries with backoff for 72 hours. After a pass, every release of that environment routes the verified name.

  • Caddy gets the certificate by ACME HTTP-01 or TLS-ALPN-01. The name must resolve to the ingress (A/AAAA or the CNAME), and ports 80 and 443 must be reachable. A claim with an uploaded or issued origin certificate uses that certificate. ACME is not used for it.
  • Before verification, Pushleft routes nothing and requests no certificate.
  • A verified name belongs to one organization and environment until you remove it. A claim from another organization fails with hostname is already verified by another organization or environment.
  • Pushleft refuses names under the preview base domain, .localhost and IP addresses. A wildcard is allowed only as *. over one more label (below).
  • Statuses are pending_verification, verified, active, failed, lapsed and removed. custom_domain_events keeps the history.
  • Remove and add a name again to get a new claim with a new token.
  • Pushleft does not create these DNS records for you, also not in Cloudflare zones it manages. Use the record-set API to add them there. Only a linked domain gets its TXT record written for it.

Runbook: custom-domain verification.

Wildcards and origin certificates

A claim can be a wildcard such as *.shop.example.com. The * covers exactly one label, so a.shop.example.com matches and shop.example.com and a.b.shop.example.com do not. A wildcard is proven by the TXT record _pushleft-challenge.shop.example.com only. A CNAME does not prove it. Pushleft never gets an ACME certificate for it. It routes the wildcard only when the claim is verified and has a certificate.

Upload the certificate, for example a Cloudflare Origin CA certificate with SSL mode Full (strict):

pl domain certificate <id> --cert origin.pem --key origin.key

PUT /v1/custom-domains/{id}/certificate {certificate_pem, key_pem} needs the member role, and the admin role for a production environment. You can also upload one for an exact name; its routes then use it and skip ACME (decided 2026-10-29).

  • The leaf comes first and must name the hostname: its own name, or a one-label wildcard over it. A wildcard claim is covered only by the same wildcard.
  • The certificate must be valid now and for at least 7 more days.
  • The key must be an unencrypted PKCS#8 key (RSA, ECDSA P-256 or P-384, Ed25519) or a PKCS#1 RSA key, and match the certificate.
  • Limits: 64 KiB for the certificate, 16 KiB for the key.
  • The key goes to Vault only. The control plane needs Vault (503 otherwise).
  • A removed, failed or lapsed claim takes no upload (409).

A linked domain gets its origin certificate issued for it, so you upload nothing.

Re-verification (migration 0046). Pushleft checks a verified or active claim again about every 24 hours (23 to 25 hours, jittered). The same TXT-or-CNAME rule applies, so keep the record in place.

  • A pass resets the failure count. After a failure, it appends custom_domain_recheck_passed.
  • A failed check sets last_error and appends custom_domain_recheck_failed with the count. The claim keeps serving.
  • The third failure in a row makes the claim lapsed (custom_domain_lapsed). The third failure comes about two days after the first. last_error then starts with ownership no longer proven.
  • A lapsed claim’s routes drain as for a removal, and Caddy stops renewing its certificate. Another claim, from any organization, can then verify the name.
  • Pushleft never checks a lapsed claim again. To serve the name again, remove the claim and add the name again (new token).
  • A resolver failure counts as a failure. One outage cannot lapse a claim, because three failures need three checks a day apart.

Platform hostnames (migration 0046). Every organization has a globally unique handle (organizations.handle). It is 8 or more lowercase hex characters from md5(id), and it never changes. Derived names end with it:

  • <branch>--<project>--<handle>.<base> for previews;
  • <project>--<handle>.<base> for production.

Project slugs are unique only inside an organization. Without the handle, another organization could create the same project first and hold the name. Project slugs and branch labels cannot contain --. The manifest refuses such a project, and pl collapses -- in branch names. An environment that already owns a name under the current base domain in ingress_hostnames keeps publishing it, so URLs issued before 0046 do not change.

Cloudflare connections

A Cloudflare connection is one of your Cloudflare accounts with an API token. Through it, Pushleft writes a linked domain’s ownership record and issues its origin certificate. It also runs a Cloudflare Tunnel into the ingress node and, when you ask, points the hostname at that tunnel.

pl cloudflare add <name> < token.txt     # the token is read from standard input
pl cloudflare add <name> --account <id>  # when the token reaches several accounts
pl cloudflare list | remove <name>

In the console, the connections are under Settings.

The token. Create an account API token in Cloudflare with these permissions:

SectionPermissionLevelPushleft uses it to
AccountArgo Tunnel (Legacy), or Cloudflare Tunnel, or Cloudflare One Connector: cloudflaredEditcreate the tunnel into each ingress node and set its hostnames
ZoneDNSEditwrite the ownership TXT record and point a hostname at its tunnel
ZoneSSL and CertificatesEditissue the Origin CA certificate the ingress serves for the hostname
ZoneAnalyticsReadoptional: show the edge traffic of linked domains
AccountTurnstileEditoptional: create the Turnstile widget of an environment

Add the zones of your domains under Zone Resources.

The check. Cloudflare does not show a token’s permissions without an extra grant. So POST /v1/cloudflare/connections {name, token, account_id?} (admins) checks each permission by doing and undoing it:

  • It creates and deletes a tunnel pushleft-check-<random>.
  • In each zone, it creates and deletes the TXT record _pushleft-permission-check.<zone>. It checks the first 20 zones the token sees, and only those can take linked domains.
  • In each zone, it issues and revokes a 7-day origin certificate for pushleft-permission-check.<zone>.

This takes a few seconds per zone. A connection with a missing permission is still stored, with ready: false. The console and pl cloudflare name each missing permission as the token form shows it. To change the token, remove the connection and add it again. If an undo fails, that check fails and names the tunnel, record or certificate that is left, so you can remove it by hand.

Linked domains. pl domain add <hostname> --cloudflare <name> (or "cloudflare": "<name>" in POST /v1/custom-domains) links the claim to a ready connection. Pushleft takes the longest of the connection’s zones that the hostname is in, and refuses a hostname in none of them. The controller then:

  1. writes the TXT record _pushleft-challenge.<hostname> with the claim’s token, so the claim verifies without a manual step;
  2. issues a 15-year Origin CA certificate for the hostname, keeps its key in Vault, and records it like an uploaded one (custom_domain_certificate_uploaded with "source": "cloudflare"). The ingress serves it once the claim is routed.

Tunnels. For each connection and each ingress node that routes one of its linked domains, the controller creates a tunnel pushleft-<id> in the connection’s account. It keeps the tunnel’s routing to the linked domains active on that node. Each domain goes to the node’s ingress over HTTPS, with the hostname as SNI and Cloudflare’s Origin CA roots trusted. Anything else gets 404. The tunnel token goes to Vault; a run_tunnel job gives it, wrapped, to that node’s agent.

The agent runs cloudflared (pinned in images.lock.env) on the plt-tunnel bridge (10.127.255.0/24, 253 connectors a node; a /29 with five until 2026-11-13): as the image’s non-root user 65532 (since 2026-11-07; a connector from before, which ran as root, is created again), read-only, no capabilities, 256 MiB, 0.5 CPU. The connector’s routing can be changed from the Cloudflare account. So the pl_tunnel firewall table lets it reach the public internet and, on the host, only port 443. The connector runs with --restart no: the agent starts it, always after applying and reading back that table, at start and every minute. So after a reboot no connector runs before its firewall. About once a minute per tunnel, the controller puts back the tunnel’s routing if it was changed in the Cloudflare dashboard. It also asks Cloudflare whether the connector is connected. When it is not, and no start is pending, it queues a new run_tunnel job. Pushleft retires a tunnel that no active route uses and no hostname’s DNS points at. A stop_tunnel job removes the connector and its token from the node, and a failed one is queued again. The tunnel is deleted in Cloudflare only after that job completes. A connection cannot be removed while it still has a tunnel.

Switching traffic. Pushleft changes the records that send a hostname’s traffic only when an admin asks:

pl domain dns <id> pushleft   # save the A/AAAA/CNAME records, point the hostname at its tunnel
pl domain dns <id> previous   # put the saved records back

POST /v1/custom-domains/{id}/dns {"point": "pushleft" | "previous"} needs an active (routed) claim for pushleft. Before it changes anything, the controller saves the current A, AAAA and CNAME records, with their comments, tags and settings. It then replaces them in one Cloudflare batch request and appends custom_domain_cloudflare_dns_switched with the records it wrote. A name whose records cannot all be read back exactly, or that has 100 or more records, is not switched. The switch to Pushleft waits until Cloudflare reports the tunnel connected. If the route later moves to another node, the DNS moves to that node’s tunnel as soon as it is connected. Pushleft does not wait for the next 5-minute sweep. Between live nodes (a release placed on another application node), the old node keeps routing the hostname for a while. It stops when the CNAME has pointed at the new tunnel for two minutes (hostname_dns, 0125), so the move has no gap. When the old node is lost, it no longer routes the hostname in between, so that gap is part of the node loss. A proxied hostname moves at Cloudflare’s edge within seconds. The batch is committed together, but Cloudflare does not propagate it atomically. For a moment, a resolver can see neither the old nor the new records. Switch at a quiet time. A claim whose hostname points at Pushleft cannot be removed; switch it back first. A claim that lapses or fails while its hostname points at Pushleft gets its saved records back automatically, since it no longer routes.

A failed step is retried every 2 minutes; pl domain list shows the last Cloudflare error and the claim’s events record each one (custom_domain_cloudflare_failed). Removing the claim (or its lapse or failure) deletes its TXT record and revokes the origin certificates Pushleft issued for it (custom_domain_certificate_revoked). A connection cannot be removed while an open claim is linked to it.

Storage. The token goes to Vault at organizations/<org>/cloudflare/connections/<id>. The API writes it once and cannot read it back. Removing a connection destroys the token and keeps the row for history. GET /v1/cloudflare/connections (viewers) returns the connections and the list of required permissions.

Edge traffic

Cloudflare answers some requests itself, and those never reach the service output. A WAF or bot rule can block the request (403), or a rate limit can apply (429). Cloudflare also answers when it cannot reach the tunnel or the ingress (502, 504). The browser then gets a page from Cloudflare, not from the app. A frontend that expects JSON shows that as an unknown error, and the service logs show nothing. Logs → Edge in the console shows these requests for the environment’s linked domains.

  • Statuses. It shows each status pair over the last 24 hours: the status Cloudflare returned and the status the app returned. Each pair has its request count and what it means. App status — (0) means Cloudflare answered without the app. Four tiles show the totals by hour. They count all requests, 5xx that Cloudflare answered (the app was not reached), 5xx from the app, and 403/429 that Cloudflare answered.
  • Security events. The latest 100 events. Each shows the time, the action (block, managed_challenge, log, …), the method, host and path. It also shows the rule that acted and the visitor’s country and IP. The ray id and user agent are shown on hover.

How it works. Every 5 minutes, the controller reads the zone analytics of each connection through Cloudflare’s GraphQL API. It reads the linked hostnames, which are the domains that are verified or active. It reads the last 30 minutes, so the 5-minute buckets that were still filling are counted again, and events already stored are skipped. It stores the request counts per hostname, 5-minute bucket, Cloudflare status and app status, plus each security event, in PostgreSQL (migration 0144). Both are kept 7 days. Both datasets are available on every Cloudflare plan.

The permission. The token needs Zone → Analytics → Read. It is optional: a connection is ready without it, and linked domains work the same. When it is missing, the edge sweep records the error on the connection. pl cloudflare list and the Edge tab show the error. Pushleft checks the permission on every sweep. Add the permission to the token in Cloudflare, and Pushleft picks it up within 5 minutes. You do not need to add the connection again.

GET /v1/environments/{id}/edge?hours=24 (viewers; 1 to 168 hours) returns hostnames and connections (name, last read and error). It also returns requests (per bucket and status pair, summed over hostnames) and events (the latest 100).

DNS safety

  • Customer record sets support A, AAAA, CNAME, MX and TXT.
  • Names must stay inside the managed zone.
  • TTL is automatic (1) or 60 to 86400 seconds.
  • MX records need a priority.
  • Only A, AAAA and CNAME can be proxied.
  • Customer changes find the provider zone through the tenant-owned local zone. They never accept a Cloudflare zone ID.
  • You cannot edit application-managed records, and deleting one needs explicit confirmation.
  • DNSSEC stays off until DS synchronization with Openprovider exists.

Zones for domains registered elsewhere (migration 0043). POST /v1/dns/zones creates a zone for a domain you bought from another registrar. It needs ownership proof first:

  1. The zone starts as pending_verification. The response carries verification.txt.
  2. Publish the TXT record _pushleft-verify.<domain> with that value at your current DNS host.
  3. The scheduler looks it up every 60 seconds with real DNS. After a pass, the zone moves to pending_delegation, and Pushleft queues the Cloudflare zone job.

The controller also refuses the zone job for an unproven zone. Record sets on an unproven zone fail with 409 zone_unverified. After 7 days without proof, the zone becomes expired; post it again to get a new value. The value is public in DNS, so Pushleft stores it as is, like custom-domain tokens.

Provider response snapshots and events exclude credentials and registrant personal data. Customer-facing errors come from an allowlist; detailed provider messages stay on the server.

Internals

Pushleft buys domains through Openprovider and hosts their authoritative DNS in one configured Cloudflare account. Both integrations run only in the backend. Wrangler deploys the application and has no part in domain purchases or customer zone creation.

Durable workflow

The API creates a short-lived quote for your organization, with integer amounts in minor units. Checkout then does these steps:

  1. It checks availability and price again, outside the database transaction.
  2. It locks the normalized domain.
  3. It debits your prepaid domain balance once, with an idempotency key.
  4. It stores your registrant contact.
  5. It queues provisioning.

The controller stores each step:

payment_confirmed → registering → registered → creating_zone → configuring_dns → awaiting_activation → active

  • registration_unknown, price_acceptance_required, manual_intervention and failed keep the last successful step.
  • The controller reconciles an uncertain registration response with Openprovider before another purchase can happen.
  • After registration succeeds, a later DNS error never deletes or buys the domain again.
  • A definite failure before registration credits the internal balance and writes an auditable refund transaction.
  • A price change moves the balance through the SQL function billing_adjust. The customer accepts it, or the controller reconciles it within the approved quote. It writes one ledger row keyed domain-order:<order>:price-adjustment:<token>. A reused key fails the transaction and does not skip the balance change.

Cloudflare zone creation has a stored attempt marker. Pushleft does not adopt a zone that existed before it tried to create one. After an uncertain create response, reconciliation stays inside the configured account and the domain that the open order recorded.

Billing and renewal boundary

Pushleft has no card processor or recurring-charge workflow yet. Domain checkout debits a prepaid balance per organization (billing_accounts) and records the debit in billing_transactions. This is not the usage ledger. The first quote opens the balance at 0. No payment provider and no public endpoint adds to it: only an operator can, in the database, and the controller when it refunds a failed order. Production must connect a payment-confirmation or top-up source before customers can fund that balance.

Renewal is manual on purpose:

  • Registrar autorenew is off.
  • The controller reconciles expiry, registrar status, verification and provider renewal settings daily.
  • The console shows a warning during the last 60 days.

Automatic renewal stays off until five things exist. They are a scheduled charging flow, a customer mandate and an outbound notification policy. The last two are handling of insufficient funds and an idempotent renewal purchase path.

Configuration

  • OPENPROVIDER_ENVIRONMENT: sandbox or live.
  • OPENPROVIDER_USERNAME and OPENPROVIDER_PASSWORD: backend-only credentials for the chosen environment.
  • OPENPROVIDER_BOOTSTRAP_NS_GROUP: an existing nameserver group, used only for the registration request. The controller replaces it with the exact nameservers that Cloudflare assigns.
  • OPENPROVIDER_MAX_PURCHASE_MINOR: the purchase ceiling in integer minor units. A purchase above it fails.
  • PUSHLEFT_DOMAIN_QUOTE_TTL_MINUTES: how long a quote stays valid, clamped to 5 to 60 minutes.
  • CLOUDFLARE_ACCOUNT_ID: the one account where Pushleft creates customer zones.
  • CLOUDFLARE_API_TOKEN: a scoped backend token with Zone Edit and DNS Edit for that account.

The Openprovider sandbox uses separate credentials and creates no live registry objects. Live use also needs a funded Openprovider account and TLD agreements. The adapter gets the restrictions of each TLD and does not assume the .com requirements.

Pushleft normalizes domain names to lowercase ASCII (Punycode) for uniqueness and keeps their Unicode form for display. Internationalized registrations need the registry’s idn_script. Pushleft passes it to the availability, price and registration calls. A missing or unsupported script fails the request; Pushleft does not guess it.

Rendered from the repository at build time. Edit docs/domain-registration.md to change it.