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

+12 -7
View File
@@ -456,16 +456,21 @@ func runDeploymentAndSyncWithImage(
},
}
if imageOverride != "" {
deployReq.BuildConfig = &deployment.BuildConfig{
BuildType: "prebuilt",
PrebuiltImage: imageOverride,
if imageOverride != "" || service.GitRepo == "" {
// Prebuilt image deploy (rollback, redeploy, or image-sourced
// service): resolve private-registry credentials by image host.
image := imageOverride
if image == "" {
image = service.Image
}
} else if service.GitRepo == "" {
// Image-sourced service: pull the image instead of building.
var ownerID string
_ = db.QueryRow(`SELECT owner_id FROM projects WHERE id = $1`, service.ProjectID).Scan(&ownerID)
auth := registryAuthFor(db, ownerID, image)
deployReq.BuildConfig = &deployment.BuildConfig{
BuildType: "prebuilt",
PrebuiltImage: service.Image,
PrebuiltImage: image,
PullUsername: auth.Username,
PullPassword: auth.Password,
}
} else {
// "auto" leaves BuildType empty so the manager detects it; the static