feat(services): clone/move ops + owner-scoped registry credentials (C4)

Service lifecycle: POST /services/:id/clone duplicates config, volumes,
domains, access gates, builder settings, and variables (secret ciphertext
copied verbatim); POST /services/:id/move re-parents to another owned
project. Both enforce ownership, reject name conflicts, and audit.

Registries: CRUD at /registries — host-matched pull credentials for
prebuilt-image deploys, encrypted at rest via secrets pkg, never returned
(has_password flag). Empty password on update keeps the stored credential;
host normalized (scheme/case/trailing slash). Credentials thread through
BuildConfig → BuildRequest → pull auth config, used only for the pull.

Surfaces: CLI services clone|move + registries group, 7 MCP tools,
OpenAPI paths/schemas, frontend Lifecycle card (clone/move/delete) and
Settings registries section, llms.txt + CLI.md.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Tomas DvorakandDevin committed 2026-10-08 17:21:27 +02:00
1 parent 912f6f5142
commit 3664eaed1a
20 files changed
+1591 -13

No files matched your search

+290
View File
@@ -971,6 +971,276 @@ export interface paths {
patch?: never;
trace?: never;
};
"/services/{id}/clone": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get?: never;
put?: never;
/**
* Clone service
* @description Duplicates config, volumes, domains, access gates, builder settings, and variables into the same or another project. Containers are not cloned — the copy starts stopped.
*/
post: {
parameters: {
query?: never;
header?: never;
path: {
id: string;
};
cookie?: never;
};
requestBody?: {
content: {
"application/json": {
/** @description Name for the clone (default "<name>-copy") */
name?: string;
/**
* Format: uuid
* @description Target project (default same project; caller must own it)
*/
project_id?: string;
/** @enum {string} */
environment?: "production" | "preview" | "development";
};
};
};
responses: {
/** @description Clone created */
201: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
/** Format: uuid */
service_id?: string;
name?: string;
message?: string;
};
};
};
/** @description Name already exists in target project */
409: {
headers: {
[name: string]: unknown;
};
content?: never;
};
};
};
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/services/{id}/move": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get?: never;
put?: never;
/**
* Move service
* @description Re-parents the service to another project the caller owns. Variables, domains, and volumes follow the service; running containers keep running and join the new project's network on next deploy.
*/
post: {
parameters: {
query?: never;
header?: never;
path: {
id: string;
};
cookie?: never;
};
requestBody: {
content: {
"application/json": {
/** Format: uuid */
project_id: string;
};
};
};
responses: {
/** @description Service moved */
200: {
headers: {
[name: string]: unknown;
};
content?: never;
};
/** @description Name conflict in target project */
409: {
headers: {
[name: string]: unknown;
};
content?: never;
};
};
};
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/registries": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* List registry credentials
* @description Private-image pull credentials for the caller. Passwords are never returned — `has_password` signals presence.
*/
get: {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Registry list */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
registries?: components["schemas"]["Registry"][];
};
};
};
};
};
put?: never;
/**
* Add registry credential
* @description Credentials are matched by image host (e.g. ghcr.io, registry.example.com, docker.io for Docker Hub) on prebuilt-image deploys. Password stored encrypted at rest.
*/
post: {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
requestBody: {
content: {
"application/json": components["schemas"]["RegistryRequest"];
};
};
responses: {
/** @description Registry created */
201: {
headers: {
[name: string]: unknown;
};
content?: never;
};
/** @description A registry for this host already exists */
409: {
headers: {
[name: string]: unknown;
};
content?: never;
};
};
};
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/registries/{id}": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get?: never;
/**
* Update registry credential
* @description Empty password keeps the stored credential — delete and recreate to remove a password.
*/
put: {
parameters: {
query?: never;
header?: never;
path: {
id: string;
};
cookie?: never;
};
requestBody: {
content: {
"application/json": components["schemas"]["RegistryRequest"];
};
};
responses: {
/** @description Registry updated */
200: {
headers: {
[name: string]: unknown;
};
content?: never;
};
/** @description Registry not found */
404: {
headers: {
[name: string]: unknown;
};
content?: never;
};
};
};
post?: never;
/** Remove registry credential */
delete: {
parameters: {
query?: never;
header?: never;
path: {
id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Registry removed */
200: {
headers: {
[name: string]: unknown;
};
content?: never;
};
/** @description Registry not found */
404: {
headers: {
[name: string]: unknown;
};
content?: never;
};
};
};
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/services/{id}/domains": {
parameters: {
query?: never;
@@ -8221,6 +8491,26 @@ export interface components {
/** @description Plaintext on write — stored as bcrypt htpasswd; never returned */
password: string;
};
Registry: {
/** Format: uuid */
id?: string;
name?: string;
/** @description Registry host matched against the image reference — ghcr.io, registry.example.com, docker.io for Docker Hub */
host?: string;
username?: string;
has_password?: boolean;
/** Format: date-time */
created_at?: string;
/** Format: date-time */
updated_at?: string;
};
RegistryRequest: {
name: string;
host: string;
username?: string;
/** @description Plaintext on write — stored encrypted; never returned. Empty on update keeps the stored credential. */
password?: string;
};
ServiceVolume: {
/**
* @description volume = docker named volume, bind = host path