* fix(cli): keep the running service's ports when `openship up` runs again
startService resolved ports without telling resolvePorts which ones the
running service already holds, so on a re-run they looked busy. It waited
out waitPortFree on each port (about 12s) and then moved the install to
the next pair, rewriting ports.json (7100/7200 became 7101/7201).
While the service is running, pass its stored ports as reclaimable, the
same way the compose path does with composeHeldPorts.
Refs #1570
* fix(cli): verify service-owned ports and align dry-run
---------
Co-authored-by: Hydra <abdelhamedmo59@gmail.com>
* fix(deploy): let webhooks and CLI accept reviewed Compose changes
Webhook and CLI deploys hit COMPOSE_REVIEW_REQUIRED with no way through the gate, and the refusal hid what changed. Accept the current Compose source explicitly per deploy (--accept-compose-changes, or acceptComposeChanges on the hook), and surface the added/changed/removed services in the CLI error and the webhook delivery record.
* test(contracts): include acceptComposeChanges in deployment schema flags
The Compose review gate added acceptComposeChanges to
CreateDeploymentSchema without updating the contract test that
enumerates the schema's public flags, so the contracts suite failed
on CI. Add the flag to the expected list.
* docs(cli): list --accept-compose-changes in the deploy reference
The new deploy flag was missing from the generated CLI reference,
so docs:check failed with a stale reference. Add the row in
declaration order.
* Retain explicit Compose approval through shared deployment admission
---------
Co-authored-by: Hydra <abdelhamedmo59@gmail.com>
* fix(build): scale the managed build-cache budget with the disk
The managed project-cache budget was min(5 GiB, 10% of the Docker
filesystem). A project whose BuildKit cache outgrew 5 GiB was evicted by
the post-build prune after every build, so every deploy started cold.
- buildCacheKeepBytes is now 20% of the Docker filesystem, so the budget
follows the disk in both directions: disks under 50 GiB also move from
10% to 20%. This also applies to managed Cloud workers, which share
the collector.
- Below the 20% free-space GC target the idle budget shrinks to what
still fits above it (never below the old min(5 GiB, 10%)), so idle
caches give space back before rollback artifacts and running apps.
BuildKit's own 20% minFreeSpace still bounds a running worker.
- pruneManagedBuildCaches defaults to that budget instead of 5 GiB.
- The daily sweep marks its call as automaticRetention, so managed caches
use the same budget; keepStorageBytes still bounds native Docker cache.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* feat(servers): configurable build-cache budget per server
Adds an optional managed build-cache budget for remote deployment
servers, edited from a Build cache card on the server Overview tab and
through the existing server update API, CLI and MCP tool. Empty keeps the
automatic share of the Docker filesystem.
- servers.build_cache_budget_bytes (migration 0224), bounded 1 GiB to
64 TiB in the database and the API contract.
- Only remote deployment servers expose and accept it: the local row
builds through the host daemon's native cache and migration sources
never build, so updates there are refused; managed Cloud servers keep
rejecting every field except name. Changing it requires server admin,
since a large budget lets caches hold most of the disk.
- SSH Docker runtimes read the value through a new buildCacheBudgetBytes
connection option on every collection, so a change applies to the next
build without reconnecting. It sets the post-build prune budget,
BuildKit's maxUsedSpace and the daily sweep's managed budget, capped at
the filesystem minus the admission reserve and still reduced under
storage pressure; a failed read falls back to automatic.
- Updates are audited like gpuOverride and do not drop retained SSH
sessions.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* docs: regenerate the MCP and CLI references for the build-cache budget
The server update tool description and the `server configure` help now
mention the build-cache budget, so the generated references changed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(migration): frame streamed rsync progress updates
* fix(migration): preserve exact progress with rsync byte units
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Hydra <abdelhamedmo59@gmail.com>
* fix(security): gate local source contents by instance authority
Local-source preparation with includeEnv and local project scan/import read server-side files. Outside the native runtime, project write alone must not expose those values; require the persisted instance role. Native sourceRoots confinement keeps its existing member access.
* fix(cloud): require a terminal code for device connect consent
The headless CLI device flow trusted an arbitrary `state` from the URL, so a signed-in user could approve an attacker's pending request with one click and hand over a 30-day linked-instance session.
Issue a signed, expiring state plus a short user code from the new POST /api/cloud/device-authorize. connect-handoff rejects unsigned or expired device states, and connect-authorize requires the code bound to that state and PKCE challenge before minting. The CLI prints the code; the consent page asks the user to type it. The browser-redirect connect flow is unchanged.
* refactor(cloud): keep device consent validation self-contained
* refactor(auth): share Better Auth session lifecycle across bridges
* fix(auth): preserve issued lifetimes for bearer sessions
* fix(auth): read live sessions for connection approval
* test(auth): cover HTTP bearer and browser session handling
* test(auth): exercise device approval through Better Auth sessions
* fix(auth): share Cloud approval validation and consume requests once
---------
Co-authored-by: Hydra <abdelhamedmo59@gmail.com>
Cover full published-stack upgrades, retained data and signed sessions, cold restart and fresh installation. Reuse runtime preflight in advisory views and expose source-redeploy prerequisites. Refs #1461 and #1462.
The edge stores server_analytics.response_time as the TOTAL response time of
each minute's requests: site_logger.lua adds every request's time to the
minute's `:t` counter and mgmt_api.lua returns that sum in seconds.
summariseBuckets and buildHourlyPeriods treated the value as a per-minute
average and multiplied it by `requests` again, so the dashboard's Avg Response
grew with traffic: a busy site averaging ~80 ms reported ~7 s. The CLI edge
traffic panel averaged the per-minute totals, which overstated it too.
Divide the summed time by total requests, matching the Cloud path
(response_time_sum / requests), and correct the schema comment that described
the column as an average.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Scoped token grants can carry capabilities in permissions, held on a
project: domains:read|write|delete and deployments:read|trigger. Route tags
map onto them through one table in @repo/core, and the permission check
accepts the root grant when its level permits the action or it holds the
mapped capability. Levels are unchanged and imply the same capabilities.
Mint checks the minter's reach per capability and rejects a capability on
the wrong type. MCP tools/list advertises tools by held capability. The CLI
--grant parser keeps the capability's colon.
CLI domain registration created rows without routing targets.
Attach custom public endpoints through the shared project update flow,
mirroring the dashboard while preserving existing routes.
Fixes#1021
`openship api /api/projects/<id>` requested /api/api/... because the
client always prefixes /api; a leading /api segment is now stripped.
`project env set <id> KEY=VALUE` failed with "too many arguments"; the
pairs are now accepted next to --set. A 401 from a project command now
adds "Run `openship login` first.", as server and service commands do.
Fixes#1023
Route API, platform, deployment, background, Desktop, CLI and browser failures through a bounded redacting reporter with request and operation correlation. Preserve operation behavior and provider-specific credential sanitizers.
Add public browser intake, safe exporter and shutdown behavior, coverage audits in CI and release gates, and regression tests for correlation, privacy, stream semantics, backpressure and real API/browser delivery.