Help us shape the future of Go! Take the 2026 Go Developer Survey

project

package
v2.16.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2026 License: BSD-3-Clause Imports: 86 Imported by: 0

Documentation

Overview

Package project owns compose project persistence, lifecycle, discovery, and routes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildConfiguredUpdateInfo added in v2.11.0

func BuildConfiguredUpdateInfo(
	projectID string,
	services []types.ServiceConfig,
	byRef map[string]*imagetypes.UpdateInfo,
	records []imageupdate.ImageUpdateRecord,
	runtimeUpdates ...map[string]*imagetypes.UpdateInfo,
) *projecttypes.UpdateInfo

BuildConfiguredUpdateInfo matches checks to current services and aggregates their results.

func EncodeSyncedFiles added in v2.15.0

func EncodeSyncedFiles(files []string) *string

EncodeSyncedFiles converts tracked synced-file paths to their stored JSON form.

func IconCatalogForContext

func IconCatalogForContext(ctx context.Context) string

IconCatalogForContext resolves the icon catalog of the requesting user. On agent-proxied calls the caller is a synthetic user whose preference is populated from the X-Arcane-Icon-Catalog header the manager forwards. Background jobs have no user attached and fall back to the default catalog.

func ParseEnvText added in v2.8.1

func ParseEnvText(raw *string) (map[string]string, error)

ParseEnvText reads admin-configured env config as the same KEY=VALUE text format used by .env files: one entry per line, blank and "#"-prefixed lines ignored, keys must match POSIX identifier syntax. Reuses the strict parser also used for stdout-capture.

func ParseExtraMountsText added in v2.8.1

func ParseExtraMountsText(raw *string) ([]lifecycletype.ExtraMount, error)

ParseExtraMountsText reads admin-configured bind mounts in docker-CLI "src:tgt[:ro|:rw]" form, one per line. Blank and "#"-prefixed lines are ignored. Both source and target must be absolute paths; mode defaults to read-write.

func RegisterProjects

func RegisterProjects(api huma.API, projectService *ProjectService, activityService *activity.ActivityService, appCtx handlerutil.ActivityAppContext)

RegisterProjects registers project management routes using Huma. WebSocket and streaming endpoints live in api/ws.

Types

type ArchiveProjectInput

type ArchiveProjectInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	ProjectID     string `path:"projectId" doc:"Project ID"`
}

type BuildProjectInput

type BuildProjectInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	ProjectID     string `path:"projectId" doc:"Project ID"`
	Body          *project.BuildRequest
}

type CreateProjectInput

type CreateProjectInput struct {
	EnvironmentID string         `path:"id" doc:"Environment ID"`
	RawBody       multipart.Form `contentType:"multipart/form-data"`
}

type DeployProjectInput

type DeployProjectInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	ProjectID     string `path:"projectId" doc:"Project ID"`
	Body          *project.DeployOptions
}

type DestroyProjectInput

type DestroyProjectInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	ProjectID     string `path:"projectId" doc:"Project ID"`
	Body          *project.Destroy
}

type DownProjectInput

type DownProjectInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	ProjectID     string `path:"projectId" doc:"Project ID"`
}

type GetProjectInput

type GetProjectInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	ProjectID     string `path:"projectId" doc:"Project ID"`
}

type GetProjectStatusCountsInput

type GetProjectStatusCountsInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
}

type GetProjectWorkspaceFileInput

type GetProjectWorkspaceFileInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	ProjectID     string `path:"projectId" doc:"Project ID"`
	RelativePath  string `query:"relativePath" doc:"Path relative to the project workspace root"`
}

type GetProjectWorkspaceInput

type GetProjectWorkspaceInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	ProjectID     string `path:"projectId" doc:"Project ID"`
}

type GitOpsSync added in v2.8.1

type GitOpsSync struct {
	database.BaseModel

	Environment    *environment.Environment `json:"environment,omitempty" gorm:"foreignKey:EnvironmentID"`
	Repository     *gitrepo.GitRepository   `json:"repository,omitempty" gorm:"foreignKey:RepositoryID"`
	ProjectID      *string                  `json:"projectId,omitempty" sortable:"true"` // Set after project is created
	Project        *Project                 `json:"project,omitempty" gorm:"foreignKey:ProjectID"`
	SyncedFiles    *string                  `json:"syncedFiles,omitempty" gorm:"column:synced_files"` // JSON array of synced file paths
	LastSyncAt     *time.Time               `json:"lastSyncAt,omitempty" sortable:"true"`
	LastSyncStatus *string                  `json:"lastSyncStatus,omitempty" search:"status,success,failed,pending,error"`
	LastSyncError  *string                  `json:"lastSyncError,omitempty"`
	LastSyncCommit *string                  `json:"lastSyncCommit,omitempty" search:"commit,hash,sha,revision"`

	// Pre-deploy lifecycle hook (configuration)
	// When PreDeployScriptPath is set, the named script is executed in a
	// throwaway container before each deploy of the linked project. The script,
	// runner image, and execution context together act as repo-trusted code —
	// any push to the repo that changes the script will run unreviewed on the
	// next deploy. See docs for details.
	PreDeployScriptPath  *string `json:"preDeployScriptPath,omitempty" gorm:"column:pre_deploy_script_path" search:"lifecycle,hook,pre-deploy,script,path"`
	PreDeployRunnerImage *string `json:"preDeployRunnerImage,omitempty" gorm:"column:pre_deploy_runner_image"`
	PreDeployEnv         *string `json:"preDeployEnv,omitempty" gorm:"column:pre_deploy_env"`                  // KEY=VALUE lines, one per line; same format as .env files
	PreDeployExtraMounts *string `json:"preDeployExtraMounts,omitempty" gorm:"column:pre_deploy_extra_mounts"` // docker -v style "src:tgt[:ro|:rw]" entries, one per line

	// Pre-deploy lifecycle hook (last-run state)
	PreDeployLastRunAt     *time.Time `json:"preDeployLastRunAt,omitempty" gorm:"column:pre_deploy_last_run_at" sortable:"true"`
	PreDeployLastRunStatus *string    `json:"preDeployLastRunStatus,omitempty" gorm:"column:pre_deploy_last_run_status" sortable:"true"` // "success" | "failed" | "timeout"
	PreDeployLastRunOutput *string    `json:"preDeployLastRunOutput,omitempty" gorm:"column:pre_deploy_last_run_output"`                 // truncated stdout+stderr
	Name                   string     `json:"name" sortable:"true" search:"sync,gitops,automation,deploy,deployment,continuous"`
	EnvironmentID          string     `json:"environmentId" sortable:"true"`
	RepositoryID           string     `json:"repositoryId" sortable:"true"`
	Branch                 string     `json:"branch" sortable:"true" search:"branch,main,master,develop,feature,release"`
	ComposePath            string     `json:"composePath" sortable:"true" search:"compose,docker-compose,path,file,yaml,yml"`
	TargetType             string     `json:"targetType" gorm:"column:target_type;default:'project'"`                      // "project" or "swarm_stack"
	ProjectName            string     `json:"projectName" sortable:"true" search:"project,name,stack,application,service"` // Name of project to create/update
	// Docker network mode for the runner: "none" denies access; "bridge", "host", or a named network enables it.
	PreDeployNetworkMode string `json:"preDeployNetworkMode" gorm:"column:pre_deploy_network_mode;default:'none'"`
	SyncInterval         int    `json:"syncInterval" sortable:"true" search:"interval,frequency,schedule,cron,minutes"` // in minutes
	MaxSyncFiles         int    `json:"maxSyncFiles" gorm:"column:max_sync_files;default:500"`                          // 0 = unlimited; env var overrides take precedence
	MaxSyncTotalSize     int64  `json:"maxSyncTotalSize" gorm:"column:max_sync_total_size;default:52428800"`            // bytes; 0 = unlimited; env var overrides take precedence
	MaxSyncBinarySize    int64  `json:"maxSyncBinarySize" gorm:"column:max_sync_binary_size;default:10485760"`          // bytes; 0 = unlimited; env var overrides take precedence
	PreDeployTimeoutSec  int    `json:"preDeployTimeoutSec" gorm:"column:pre_deploy_timeout_sec;default:60"`
	AutoSync             bool   `json:"autoSync" sortable:"true" search:"auto,automatic,sync,continuous,scheduled"`
	SyncDirectory        bool   `json:"syncDirectory" gorm:"column:sync_directory"` // Sync entire directory containing compose file
	PullImageAfterSync   bool   `json:"pullImageAfterSync" gorm:"column:pull_image_after_sync;default:false"`
	RedeployAfterSync    bool   `json:"redeployAfterSync" gorm:"column:redeploy_after_sync;default:false"`

	// Backup mode ("backup" commits saved project files to the repository;
	// "deploy" is the original pull direction).
	Mode                string               `json:"mode" gorm:"column:mode;default:'deploy'" sortable:"true" search:"mode,backup,deploy,direction"`
	BackupDirectory     string               `json:"backupDirectory" gorm:"column:backup_directory" sortable:"true" search:"backup,directory,destination,folder"`
	BackupPaths         database.StringSlice `json:"backupPaths" gorm:"column:backup_paths;type:text"`
	BackupOnSave        bool                 `json:"backupOnSave" gorm:"column:backup_on_save;default:true"`
	BackupPending       bool                 `json:"backupPending" gorm:"column:backup_pending;default:false"`
	BackupPendingSince  *time.Time           `json:"backupPendingSince,omitempty" gorm:"column:backup_pending_since"`
	BackupConflict      bool                 `json:"backupConflict" gorm:"column:backup_conflict;default:false"`
	BackupFailureReason *string              `json:"backupFailureReason,omitempty" gorm:"column:backup_failure_reason"`
	LastBackupAt        *time.Time           `json:"lastBackupAt,omitempty" gorm:"column:last_backup_at" sortable:"true"`
	LastBackupSnapshot  *string              `json:"-" gorm:"column:last_backup_snapshot"`
}

func (GitOpsSync) BackupSnapshot added in v2.15.0

func (s GitOpsSync) BackupSnapshot() map[string]string

BackupSnapshot decodes the file hashes recorded by the last backup push.

func (GitOpsSync) BackupState added in v2.12.0

func (s GitOpsSync) BackupState() string

BackupState derives the persisted backup lifecycle state.

func (GitOpsSync) SyncedFileList added in v2.15.0

func (s GitOpsSync) SyncedFileList() []string

SyncedFileList decodes the tracked synced-file paths.

func (GitOpsSync) TableName added in v2.8.1

func (GitOpsSync) TableName() string

type LifecycleService added in v2.8.1

type LifecycleService struct {
	// contains filtered or unexported fields
}

LifecycleService runs a GitOps sync's pre-deploy script in a throwaway container. The script is trusted like the repo's compose.yaml; configuring its path is the trust event.

func NewLifecycleService added in v2.8.1

func NewLifecycleService(
	db *database.DB,
	settingsService *settings.SettingsService,
	eventService *event.EventService,
	dockerService *dockerInternal.DockerClientService,
	imageService *image.ImageService,
) *LifecycleService

NewLifecycleService constructs a LifecycleService wired against shared infrastructure. The Docker client is obtained lazily on each hook run via dockerService.GetClient so reconnects are transparent. Runner image pulls go through imageService so configured registry credentials apply.

type ListProjectReferencesInput added in v2.15.1

type ListProjectReferencesInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
}

ListProjectReferencesInput identifies the environment whose project references are requested.

type ListProjectTagsInput

type ListProjectTagsInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
}

ListProjectTagsInput identifies the environment whose tag catalog is requested.

type ListProjectsInput

type ListProjectsInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	Search        string `query:"search" doc:"Search query"`
	Sort          string `query:"sort" doc:"Column to sort by"`
	Order         string `query:"order" default:"asc" doc:"Sort direction (asc or desc)"`
	Start         int    `query:"start" default:"0" doc:"Start index for pagination"`
	Limit         int    `query:"limit" default:"20" doc:"Number of items per page"`
	Status        string `query:"status" doc:"Filter by status (comma-separated: running,stopped,partially running)"`
	Updates       string `query:"updates" doc:"Filter by update status (has_update, up_to_date, error, unknown)"`
	Archived      string `query:"archived" doc:"Archived filter: 'true' (only archived), 'all' (include archived). Default excludes archived."`
	Tags          string `query:"tags" doc:"Filter by tag names (comma-separated, OR semantics)"`
	Label         string `query:"label" doc:"Filter by container label key or key=value on any running service"`
}

type Module

type Module struct {
	// contains filtered or unexported fields
}

func New

func New(service *ProjectService, activityService *activity.ActivityService) *Module

func (*Module) RegisterRoutes

func (m *Module) RegisterRoutes(api huma.API, appCtx handlerutil.ActivityAppContext)

func (*Module) Service

func (m *Module) Service() *ProjectService

type Project added in v2.8.1

type Project struct {
	database.BaseModel

	Name               string        `json:"name" sortable:"true" gorm:"index:idx_projects_name"`
	DirName            *string       `json:"dir_name"`
	Path               string        `json:"path" sortable:"true" gorm:"uniqueIndex"`
	Status             ProjectStatus `json:"status" sortable:"true"`
	StatusReason       *string       `json:"status_reason"`
	ServiceCount       int           `json:"service_count" sortable:"true"`
	RunningCount       int           `json:"running_count" sortable:"true"`
	GitOpsManagedBy    *string       `json:"gitops_managed_by,omitempty" gorm:"column:gitops_managed_by"`
	ComposeProjectName *string       `json:"compose_project_name,omitempty" gorm:"column:compose_project_name"`
	ImageRefsJSON      string        `json:"image_refs_json,omitempty" gorm:"column:image_refs_json"`
	BuildImageRefsJSON *string       `json:"-" gorm:"column:build_image_refs_json"`
	IsArchived         bool          `json:"is_archived" gorm:"column:is_archived;default:false;index"`
	ArchivedAt         *time.Time    `json:"archived_at,omitempty" gorm:"column:archived_at"`
}

func LockProjectForSync added in v2.15.0

func LockProjectForSync(tx *gorm.DB, projectID string) (*Project, error)

LockProjectForSync row-locks the project so the one-Git-relationship check and the insert are atomic.

func (Project) TableName added in v2.8.1

func (Project) TableName() string

type ProjectHandler

type ProjectHandler struct {
	// contains filtered or unexported fields
}

ProjectHandler provides Huma-based project management endpoints.

func (*ProjectHandler) ArchiveProject

func (*ProjectHandler) BuildProjectImages

func (h *ProjectHandler) BuildProjectImages(ctx context.Context, input *BuildProjectInput) (*huma.StreamResponse, error)

BuildProjectImages builds compose services with build directives.

func (*ProjectHandler) CreateProject

CreateProject creates a new Docker Compose project.

func (*ProjectHandler) DeployProject

func (h *ProjectHandler) DeployProject(ctx context.Context, input *DeployProjectInput) (*huma.StreamResponse, error)

func (*ProjectHandler) DestroyProject

DestroyProject destroys a Docker Compose project.

func (*ProjectHandler) DownProject

DownProject brings down a Docker Compose project.

func (*ProjectHandler) DownloadProjectWorkspaceFile

func (h *ProjectHandler) DownloadProjectWorkspaceFile(ctx context.Context, input *GetProjectWorkspaceFileInput) (*huma.StreamResponse, error)

func (*ProjectHandler) GetProject

GetProject returns a project by ID.

func (*ProjectHandler) GetProjectCompose

func (h *ProjectHandler) GetProjectCompose(ctx context.Context, input *GetProjectInput) (*handlerutil.Out[project.Details], error)

func (*ProjectHandler) GetProjectRuntime

func (h *ProjectHandler) GetProjectRuntime(ctx context.Context, input *GetProjectInput) (*handlerutil.Out[project.Details], error)

func (*ProjectHandler) GetProjectStatusCounts

GetProjectStatusCounts returns counts of projects by status.

func (*ProjectHandler) GetProjectUpdates

func (h *ProjectHandler) GetProjectUpdates(ctx context.Context, input *GetProjectInput) (*handlerutil.Out[project.Details], error)

func (*ProjectHandler) GetProjectWorkspace

func (*ProjectHandler) GetProjectWorkspaceFile

func (*ProjectHandler) ListProjectReferences added in v2.15.1

ListProjectReferences returns the ID and name of every project in an environment.

func (*ProjectHandler) ListProjectTags

ListProjectTags returns the reusable project tag catalog for an environment.

func (*ProjectHandler) ListProjects

ListProjects returns a paginated list of projects.

func (*ProjectHandler) PullProjectImages

func (h *ProjectHandler) PullProjectImages(ctx context.Context, input *PullProjectImagesInput) (*huma.StreamResponse, error)

PullProjectImages pulls all images for a project with streaming progress.

func (*ProjectHandler) RedeployProject

func (h *ProjectHandler) RedeployProject(ctx context.Context, input *RedeployProjectInput) (*huma.StreamResponse, error)

RedeployProject redeploys a Docker Compose project. RedeployProject pulls project images and re-deploys, streaming the raw docker CLI output as NDJSON like DeployProject.

func (*ProjectHandler) RestartProject

RestartProject restarts the given services in a project (all services when none are specified).

func (*ProjectHandler) UnarchiveProject

func (*ProjectHandler) UpdateProject

UpdateProject updates a Docker Compose project.

func (*ProjectHandler) UpdateProjectServices

UpdateProjectServices pulls the latest images for the given services and recreates them.

func (*ProjectHandler) UpdateProjectTag

UpdateProjectTag applies one UI-managed project tag association change.

func (*ProjectHandler) UpdateProjectWorkspace

type ProjectService

type ProjectService struct {
	RegistryCredentialsProvider func(context.Context) ([]containerregistry.Credential, error)

	// FilesChanged fires with the project ID after project files are saved
	// through Arcane, so Git backups can react without polling.
	FilesChanged *concurrency.Signal[string]
	// contains filtered or unexported fields
}

func NewProjectService

func NewProjectService(
	db *database.DB,
	settingsService *settings.SettingsService,
	eventService *event.EventService,
	imageService *image.ImageService,
	dockerService *dockerInternal.DockerClientService,
	buildService builder,
	lifecycleService *LifecycleService,
	containerRegistryService *registry.ContainerRegistryService,
	cfg *config.Config,
	kvService *kv.KVService,
	registryCredentialsProvider func(context.Context) ([]containerregistry.Credential, error),
) *ProjectService

func (*ProjectService) AggregateProjectCounts added in v2.16.1

func (s *ProjectService) AggregateProjectCounts(ctx context.Context) (base.ApiResponse[projecttypes.StatusCounts], error)

func (*ProjectService) AggregateProjectTags added in v2.16.1

func (s *ProjectService) AggregateProjectTags(ctx context.Context) (base.ApiResponse[[]projecttypes.TagOption], error)

func (*ProjectService) AggregateProjects added in v2.16.1

func (*ProjectService) ApplyGitSyncEnvToDirectory

func (s *ProjectService) ApplyGitSyncEnvToDirectory(ctx context.Context, projectPath, projectsDirectory string, gitEnvContent *string) (before, after string, err error)

ApplyGitSyncEnvToDirectory applies the same managed three-file environment merge used by single-file project syncs and returns the effective content before and after the update.

func (*ProjectService) ApplyGitSyncProjectFiles

func (s *ProjectService) ApplyGitSyncProjectFiles(
	ctx context.Context,
	projectID, composeContent string,
	gitEnvContent, gitOverrideContent *string,
	gitOverrideFileName string,
	user usertypes.Actor,
) (*Project, bool, error)

func (*ProjectService) ArchiveProject

func (s *ProjectService) ArchiveProject(ctx context.Context, projectID string, user usertypes.Actor) error

func (*ProjectService) BackfillProjectImageRefs

func (s *ProjectService) BackfillProjectImageRefs(ctx context.Context) (int, error)

func (*ProjectService) BuildProjectServices

func (s *ProjectService) BuildProjectServices(ctx context.Context, projectID string, options projecttypes.BuildOptions, progressWriter io.Writer, user *usertypes.Actor) error

func (*ProjectService) ComposeServiceImage added in v2.15.1

func (s *ProjectService) ComposeServiceImage(ctx context.Context, composeName, serviceName string) (projectID, imageRef string, err error)

ComposeServiceImage returns the effective image of serviceName in the Arcane project deployed as composeName.

func (*ProjectService) CountProjectsWithPendingUpdates

func (s *ProjectService) CountProjectsWithPendingUpdates(ctx context.Context, allContainers []container.Summary) (int, error)

CountProjectsWithPendingUpdates counts active projects and untracked compose projects with a pending update, without the full list pipeline. A nil allContainers is fetched here.

func (*ProjectService) CountServicesFromCompose

func (s *ProjectService) CountServicesFromCompose(ctx context.Context, p Project) (int, error)

func (*ProjectService) CreateGitOpsManagedProject

func (s *ProjectService) CreateGitOpsManagedProject(ctx context.Context, gitOpsSync *GitOpsSync, project *Project, actor usertypes.Actor, logEventOptions ...bool) error

CreateGitOpsManagedProject persists a promoted GitOps project, links both records, updates the compose-name cache, and records the creation event.

func (*ProjectService) CreateProject

func (s *ProjectService) CreateProject(
	ctx context.Context,
	name, composeContent string,
	envContent *string,
	manifest projecttypes.CreateProjectWorkspaceManifest,
	uploads map[int][]byte,
	uiTags []string,
	uiTagColors map[string]projecttypes.TagColor,
	user usertypes.Actor,
	allowNameSuffixOptions ...bool,
) (*Project, error)

CreateProject creates a project's directory, files, and DB row. A directory collision appends "-N" unless allowNameSuffix is false, which returns projects.ErrProjectDirExists.

func (*ProjectService) DeployProject

func (s *ProjectService) DeployProject(ctx context.Context, projectID string, user usertypes.Actor, options *projecttypes.DeployOptions) error

func (*ProjectService) DestroyProject

func (s *ProjectService) DestroyProject(ctx context.Context, projectID string, removeFiles, removeVolumes bool, user usertypes.Actor) error

func (*ProjectService) DownProject

func (s *ProjectService) DownProject(ctx context.Context, projectID string, user usertypes.Actor) error

func (*ProjectService) DownloadProjectWorkspaceFile

func (s *ProjectService) DownloadProjectWorkspaceFile(ctx context.Context, projectID, relativePath string) (io.ReadCloser, int64, string, error)

func (*ProjectService) EnsureGitOpsProjectLinked

func (s *ProjectService) EnsureGitOpsProjectLinked(ctx context.Context, gitOpsSync *GitOpsSync, project *Project) error

EnsureGitOpsProjectLinked persists the bidirectional GitOps/project binding and refreshes the compose-name cache as one domain operation.

func (*ProjectService) EnsureProjectPathUnderRoot

func (s *ProjectService) EnsureProjectPathUnderRoot(ctx context.Context, proj *Project, persist bool) error

EnsureProjectPathUnderRoot normalizes a path outside the projects root to `<projectsRoot>/<dirName or sanitized name>`. When persist=true, it saves the updated project path to the database.

func (*ProjectService) FindProjectByID added in v2.15.0

func (s *ProjectService) FindProjectByID(ctx context.Context, projectID string) (*Project, bool, error)

FindProjectByID reports a missing project as found=false instead of an error.

func (*ProjectService) GetProjectByComposeName

func (s *ProjectService) GetProjectByComposeName(ctx context.Context, name string) (*Project, error)

func (*ProjectService) GetProjectDetails

func (s *ProjectService) GetProjectDetails(ctx context.Context, projectID string, opts projecttypes.DetailsOptions) (projecttypes.Details, error)

func (*ProjectService) GetProjectFromDatabaseByID

func (s *ProjectService) GetProjectFromDatabaseByID(ctx context.Context, id string) (*Project, error)

func (*ProjectService) GetProjectRelativePath

func (s *ProjectService) GetProjectRelativePath(ctx context.Context, projectPath string) string

func (*ProjectService) GetProjectStatusCounts

func (s *ProjectService) GetProjectStatusCounts(ctx context.Context) (projecttypes.StatusCounts, error)

func (*ProjectService) GetProjectTags

func (s *ProjectService) GetProjectTags(ctx context.Context, projectID string) ([]projecttypes.Tag, error)

GetProjectTags returns the effective UI and Compose tag associations for a project.

func (*ProjectService) GetProjectWorkspace

func (s *ProjectService) GetProjectWorkspace(ctx context.Context, projectID string) (*workspacetypes.Workspace, error)

func (*ProjectService) GetProjectWorkspaceFile

func (s *ProjectService) GetProjectWorkspaceFile(ctx context.Context, projectID, relativePath string) (*workspacetypes.FileContent, error)

func (*ProjectService) GetProjectsDirectory

func (s *ProjectService) GetProjectsDirectory(ctx context.Context) (string, error)

func (*ProjectService) HandleProjectFilesChanged

func (s *ProjectService) HandleProjectFilesChanged(ctx context.Context, paths []string)

func (*ProjectService) ListAllProjects

func (s *ProjectService) ListAllProjects(ctx context.Context) ([]Project, error)

func (*ProjectService) ListProjectReferences added in v2.15.1

func (s *ProjectService) ListProjectReferences(ctx context.Context) ([]projecttypes.Reference, error)

ListProjectReferences returns the ID and name of every project, including archived ones, without runtime state.

func (*ProjectService) ListProjectTagOptions

func (s *ProjectService) ListProjectTagOptions(ctx context.Context) ([]projecttypes.TagOption, error)

ListProjectTagOptions returns the distinct tag names and colors available in the current environment.

func (*ProjectService) ListProjects

func (*ProjectService) ProjectMetadata

func (s *ProjectService) ProjectMetadata(ctx context.Context, p Project, env *projectMetadataEnv) projects.ArcaneComposeMetadata

ProjectMetadata resolves a project's icon sets and service URLs, cached until a merged compose or env file changes. A nil env resolves the shared inputs here.

func (*ProjectService) PullProjectImages

func (s *ProjectService) PullProjectImages(ctx context.Context, projectID string, progressWriter io.Writer, user usertypes.Actor, credentials []containerregistry.Credential) error

func (*ProjectService) RecoverProjectRenameJournals

func (s *ProjectService) RecoverProjectRenameJournals(ctx context.Context) error

RecoverProjectRenameJournals replays renames interrupted by a restart.

func (*ProjectService) RedeployProject

func (s *ProjectService) RedeployProject(ctx context.Context, projectID string, user usertypes.Actor, options *projecttypes.DeployOptions) error

func (*ProjectService) ResolveProjectComposeFile

func (s *ProjectService) ResolveProjectComposeFile(ctx context.Context, proj *Project) (string, error)

ResolveProjectComposeFile returns the base compose file for a project, mirroring `docker compose`: COMPOSE_FILE in the merged environment wins, then a GitOps sync's configured compose path, then standard detection.

func (*ProjectService) ResolveRegistryCredentials

func (s *ProjectService) ResolveRegistryCredentials(ctx context.Context) ([]containerregistry.Credential, error)

func (*ProjectService) RestartProject

func (s *ProjectService) RestartProject(ctx context.Context, projectID string, services []string, user usertypes.Actor) error

func (*ProjectService) SaveProjectServiceImages added in v2.15.1

func (s *ProjectService) SaveProjectServiceImages(ctx context.Context, projectID string, changes map[string]updatertypes.ServiceImageChange) ([]string, error)

SaveProjectServiceImages persists selected service image tags without deploying them and returns the changed services.

func (*ProjectService) StreamProjectLogs

func (s *ProjectService) StreamProjectLogs(ctx context.Context, projectID string, logsChan chan<- string, follow bool, tail, since string, timestamps bool) error

func (*ProjectService) SyncProjectsFromFileSystem

func (s *ProjectService) SyncProjectsFromFileSystem(ctx context.Context) error

func (*ProjectService) UnarchiveProject

func (s *ProjectService) UnarchiveProject(ctx context.Context, projectID string, user usertypes.Actor) error

func (*ProjectService) UpdateProject

func (s *ProjectService) UpdateProject(ctx context.Context, projectID string, name, composeContent, envContent, overrideContent *string, user usertypes.Actor) (*Project, error)

func (*ProjectService) UpdateProjectServiceImages added in v2.11.0

func (s *ProjectService) UpdateProjectServiceImages(ctx context.Context, projectID string, changes map[string]updatertypes.ServiceImageChange, user usertypes.Actor) error

UpdateProjectServiceImages persists selected service image tags before recreating them.

func (*ProjectService) UpdateProjectServices

func (s *ProjectService) UpdateProjectServices(ctx context.Context, projectID string, servicesToUpdate []string, user usertypes.Actor, discoverTags bool) error

func (*ProjectService) UpdateProjectTag

func (s *ProjectService) UpdateProjectTag(ctx context.Context, projectID, name string, color projecttypes.TagColor, attached bool, user usertypes.Actor) ([]projecttypes.Tag, error)

UpdateProjectTag attaches or detaches a UI-managed tag and rejects Compose-owned names.

func (*ProjectService) UpdateProjectWorkspace

func (s *ProjectService) UpdateProjectWorkspace(
	ctx context.Context,
	projectID string,
	manifest projecttypes.WorkspaceUpdateManifest,
	uploads map[int][]byte,
	user usertypes.Actor,
) (*workspacetypes.Workspace, error)

func (*ProjectService) ValidateComposeDirectory

func (s *ProjectService) ValidateComposeDirectory(ctx context.Context, projectName, projectPath, composeFileName string) (int, error)

ValidateComposeDirectory loads a staged compose tree with the same settings, Docker path mapping, and validation rules used by managed projects.

type ProjectStatus added in v2.8.1

type ProjectStatus string
const (
	ProjectStatusRunning          ProjectStatus = projecttypes.StatusRunning
	ProjectStatusStopped          ProjectStatus = projecttypes.StatusStopped
	ProjectStatusPartiallyRunning ProjectStatus = projecttypes.StatusPartiallyRunning
	ProjectStatusUnknown          ProjectStatus = projecttypes.StatusUnknown
	ProjectStatusDeploying        ProjectStatus = projecttypes.StatusDeploying
	ProjectStatusStopping         ProjectStatus = projecttypes.StatusStopping
	ProjectStatusRestarting       ProjectStatus = projecttypes.StatusRestarting
)

type ProjectTag added in v2.8.1

type ProjectTag struct {
	ProjectID string `json:"projectId" gorm:"column:project_id;primaryKey"`
	Name      string `json:"name" gorm:"column:name;primaryKey"`
	Source    string `json:"source" gorm:"column:source;primaryKey"`
	Color     string `json:"color" gorm:"column:color;not null;default:gray"`
}

ProjectTag stores one normalized tag association and its management source.

func (ProjectTag) TableName added in v2.8.1

func (ProjectTag) TableName() string

TableName returns the database table used for project tag associations.

type PullProjectImagesInput

type PullProjectImagesInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	ProjectID     string `path:"projectId" doc:"Project ID"`
}

type RedeployProjectInput

type RedeployProjectInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	ProjectID     string `path:"projectId" doc:"Project ID"`
	Body          *project.DeployOptions
}

type RestartProjectInput

type RestartProjectInput struct {
	EnvironmentID string   `path:"id" doc:"Environment ID"`
	ProjectID     string   `path:"projectId" doc:"Project ID"`
	Services      []string `query:"services" doc:"Service names to restart; empty restarts all services"`
}

type UnarchiveProjectInput

type UnarchiveProjectInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	ProjectID     string `path:"projectId" doc:"Project ID"`
}

type UpdateProjectInput

type UpdateProjectInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	ProjectID     string `path:"projectId" doc:"Project ID"`
	Body          project.UpdateProject
}

type UpdateProjectServicesInput

type UpdateProjectServicesInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	ProjectID     string `path:"projectId" doc:"Project ID"`
	Body          *project.UpdateServicesRequest
}

type UpdateProjectTagInput

type UpdateProjectTagInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	ProjectID     string `path:"projectId" doc:"Project ID"`
	Body          project.UpdateTag
}

UpdateProjectTagInput identifies a project and the UI tag mutation to apply.

type UpdateProjectWorkspaceInput

type UpdateProjectWorkspaceInput struct {
	EnvironmentID string         `path:"id" doc:"Environment ID"`
	ProjectID     string         `path:"projectId" doc:"Project ID"`
	RawBody       multipart.Form `contentType:"multipart/form-data"`
}

Directories

Path Synopsis
children
deployment
Package deployment runs the image and bind-directory side of project deployments: pulls, builds, update reconciliation and dependents.
Package deployment runs the image and bind-directory side of project deployments: pulls, builds, update reconciliation and dependents.
details
Package details derives project runtime state: service status from Compose and containers, include files, logs and image update checks.
Package details derives project runtime state: service status from Compose and containers, include files, logs and image update checks.
lifecycle
Package lifecycle runs pre-deploy hook scripts in isolated runner containers and captures their output.
Package lifecycle runs pre-deploy hook scripts in isolated runner containers and captures their output.
listing
Package listing projects stored projects and live Compose containers into paginated list rows, status counts and untracked-project update rows.
Package listing projects stored projects and live Compose containers into paginated list rows, status counts and untracked-project update rows.
sync
Package sync manages the project env files a git sync writes (the git source, the Arcane override and the merged effective .env) and persists submitted project file updates.
Package sync manages the project env files a git sync writes (the git source, the Arcane override and the merged effective .env) and persists submitted project file updates.
tags
Package tags owns project tag rules: UI and Compose sources, colors, per-project limits and the effective tag view.
Package tags owns project tag rules: UI and Compose sources, colors, per-project limits and the effective tag view.
update
Package update owns project content updates: compose image edits and the rename journal that makes project renames recoverable.
Package update owns project content updates: compose image edits and the rename journal that makes project renames recoverable.
workspace
Package workspace reads and edits project directories as bounded, revision-checked workspaces.
Package workspace reads and edits project directories as bounded, revision-checked workspaces.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL