Your platform

Your product is its platform: one deployment, built from scaledbox's module under your brand, on your own accounts, operated by you. This page is how it fits together.

Its parts

Three modes

One stack, three modes. Pick by what your product runs:

saas single static
Your server and cluster yes yes none
Your services boxes, and static services on Cloudflare boxes, and static services on Cloudflare static services on Cloudflare only
Tenants, their apps and databases on clusters of their own none: nothing of the tenant layer is installed none
The tenants API, console and CLI yes no no
Deployed by your server, from a deploy your CLI posts your server, from a deploy your CLI posts your CI, to Cloudflare
Costs your servers your servers nothing: Cloudflare's free plan

The cluster file decides between saas and single: a platform whose clusters run no tenants is single. Everything else is the same: the same components, sync, reconciler and runbooks. The smallest single platform is one cluster on one server; a saas platform adds a cluster for its tenants. A static platform has no cluster file: only scaledbox.toml, every service with provider = "cloudflare". scaledbox's own site, these pages included, is a static platform.

Two CLIs

shop-ops shop
Who runs it you, and your CI your customers, and your backend for one of them
Built from ops.Main tenants.Main
Reaches your server through the control node; from CI, the public API (SHOP_API_URL, and a deploy token in SHOP_TOKEN) the public API with one tenant's token: shop login, or SHOP_TOKEN
Commands sync, nodes and backups; your services' deploys, secrets, logs and databases; tokens; any of your tenants a tenant's apps: deploy, logs, secrets, domains, dumps, dev

shop-ops is never handed out, and its image is what your servers run. shop exists in saas mode only: it contains none of the operator's code, and your CI builds it for your customers' machines and you publish it where they download it (a static service of yours, for one). Its credentials live in their configuration directory under your brand's name (~/.config/shop/ on Linux). Your customers sign it in through your own page: Tenants.

How changes reach your servers

Everything is declared, then reconciled:

What is derived (routes, certificates, Workers, a tenant's boxes) is rendered, applied and pruned by the reconciler, and repaired when changed by hand.

The one exception is a static platform: with no server to post to, its CI's shop-ops deploy plans, applies and prunes Cloudflare itself, with a token scoped to its zones and Workers.

Changes that cost money wait for a person. Your platform reconciles your tenants' clusters by itself, except changes that bill (a new server, a bigger type): those wait for your approval. Nothing removes a server, a firewall, a network or a bucket by itself.

Upgrades

Bump github.com/scaledbox/scaledbox in your go.mod, let your CI build the new image, then run shop-ops sync built from that commit: it rolls out the new server and components, and the database's migrations run forward, in order. Release shop with each upgrade: while scaledbox is in development, an older tenants' CLI may not work against a newer server. A static platform upgrades with its next deploy.