Documentation
¶
Index ¶
- Constants
- Variables
- type ApiKeyService
- func (s *ApiKeyService) CreateApiKey(ctx context.Context, userID string, req apikey.CreateApiKey) (*apikey.ApiKeyCreatedDto, error)
- func (s *ApiKeyService) CreateEnvironmentApiKey(ctx context.Context, environmentID string, userID string) (*apikey.ApiKeyCreatedDto, error)
- func (s *ApiKeyService) DeleteApiKey(ctx context.Context, id string) error
- func (s *ApiKeyService) GetApiKey(ctx context.Context, id string) (*apikey.ApiKey, error)
- func (s *ApiKeyService) GetEnvironmentByApiKey(ctx context.Context, rawKey string) (*string, error)
- func (s *ApiKeyService) ListApiKeys(ctx context.Context, params pagination.QueryParams) ([]apikey.ApiKey, pagination.Response, error)
- func (s *ApiKeyService) UpdateApiKey(ctx context.Context, id string, req apikey.UpdateApiKey) (*apikey.ApiKey, error)
- func (s *ApiKeyService) ValidateApiKey(ctx context.Context, rawKey string) (*models.User, error)
- type ApplicationImagesService
- type AppriseNotificationPayload
- type AppriseServicedeprecated
- func (s *AppriseService) CreateOrUpdateSettings(ctx context.Context, apiURL string, enabled bool, ...) (*models.AppriseSettings, error)
- func (s *AppriseService) GetSettings(ctx context.Context) (*models.AppriseSettings, error)
- func (s *AppriseService) SendBatchImageUpdateNotification(ctx context.Context, updates map[string]*imageupdate.Response) error
- func (s *AppriseService) SendContainerUpdateNotification(ctx context.Context, containerName, imageRef, oldDigest, newDigest string) error
- func (s *AppriseService) SendImageUpdateNotification(ctx context.Context, imageRef string, updateInfo *imageupdate.Response) error
- func (s *AppriseService) SendNotification(ctx context.Context, title, body, format string, ...) error
- func (s *AppriseService) TestNotification(ctx context.Context, testType string) error
- type Argon2Params
- type AuthService
- func (s *AuthService) ChangePassword(ctx context.Context, userID, currentPassword, newPassword string) error
- func (s *AuthService) GetAutoLoginConfig(ctx context.Context) (*auth.AutoLoginConfig, error)
- func (s *AuthService) GetAutoLoginPassword() string
- func (s *AuthService) GetOidcConfig(ctx context.Context) (*models.OidcConfig, error)
- func (s *AuthService) GetOidcConfigurationStatus(ctx context.Context) (*auth.OidcStatusInfo, error)
- func (s *AuthService) GetSessionTimeout(ctx context.Context) (int, error)
- func (s *AuthService) IsLocalAuthEnabled(ctx context.Context) (bool, error)
- func (s *AuthService) IsOidcEnabled(ctx context.Context) (bool, error)
- func (s *AuthService) Login(ctx context.Context, username, password string) (*models.User, *TokenPair, error)
- func (s *AuthService) OidcLogin(ctx context.Context, userInfo auth.OidcUserInfo, ...) (*models.User, *TokenPair, error)
- func (s *AuthService) RefreshToken(ctx context.Context, refreshToken string) (*TokenPair, error)
- func (s *AuthService) VerifyToken(ctx context.Context, accessToken string) (*models.User, error)
- type AuthSettings
- type ContainerRegistryService
- func (s *ContainerRegistryService) CreateRegistry(ctx context.Context, req models.CreateContainerRegistryRequest) (*models.ContainerRegistry, error)
- func (s *ContainerRegistryService) DeleteRegistry(ctx context.Context, id string) error
- func (s *ContainerRegistryService) GetAllRegistries(ctx context.Context) ([]models.ContainerRegistry, error)
- func (s *ContainerRegistryService) GetDecryptedToken(ctx context.Context, id string) (string, error)
- func (s *ContainerRegistryService) GetEnabledRegistries(ctx context.Context) ([]models.ContainerRegistry, error)
- func (s *ContainerRegistryService) GetImageDigest(ctx context.Context, imageRef string) (string, error)
- func (s *ContainerRegistryService) GetRegistriesPaginated(ctx context.Context, params pagination.QueryParams) ([]containerregistry.ContainerRegistry, pagination.Response, error)
- func (s *ContainerRegistryService) GetRegistryByID(ctx context.Context, id string) (*models.ContainerRegistry, error)
- func (s *ContainerRegistryService) SyncRegistries(ctx context.Context, syncItems []containerregistry.Sync) error
- func (s *ContainerRegistryService) UpdateRegistry(ctx context.Context, id string, req models.UpdateContainerRegistryRequest) (*models.ContainerRegistry, error)
- type ContainerService
- func (s *ContainerService) AttachExec(ctx context.Context, containerID, execID string) (*ExecSession, error)
- func (s *ContainerService) CreateContainer(ctx context.Context, config *container.Config, ...) (*container.InspectResponse, error)
- func (s *ContainerService) CreateExec(ctx context.Context, containerID string, cmd []string) (string, error)
- func (s *ContainerService) DeleteContainer(ctx context.Context, containerID string, force bool, removeVolumes bool, ...) error
- func (s *ContainerService) GetContainerByID(ctx context.Context, id string) (*container.InspectResponse, error)
- func (s *ContainerService) ListContainersPaginated(ctx context.Context, params pagination.QueryParams, includeAll bool, ...) ([]containertypes.Summary, pagination.Response, containertypes.StatusCounts, ...)
- func (s *ContainerService) RestartContainer(ctx context.Context, containerID string, user models.User) error
- func (s *ContainerService) StartContainer(ctx context.Context, containerID string, user models.User) error
- func (s *ContainerService) StopContainer(ctx context.Context, containerID string, user models.User) error
- func (s *ContainerService) StreamLogs(ctx context.Context, containerID string, logsChan chan<- string, follow bool, ...) error
- func (s *ContainerService) StreamStats(ctx context.Context, containerID string, statsChan chan<- any) error
- type CreateEventRequest
- type CustomizeSearchService
- type DeploymentSnippets
- type DockerClientService
- func (s *DockerClientService) GetAllContainers(ctx context.Context) ([]container.Summary, int, int, int, error)
- func (s *DockerClientService) GetAllImages(ctx context.Context) ([]image.Summary, int, int, int, error)
- func (s *DockerClientService) GetAllNetworks(ctx context.Context) (_ []network.Summary, inuseNetworks int, unusedNetworks int, totalNetworks int, ...)
- func (s *DockerClientService) GetAllVolumes(ctx context.Context) ([]*volume.Volume, int, int, int, error)
- func (s *DockerClientService) GetClient() (*client.Client, error)
- type EnvironmentService
- func (s *EnvironmentService) CreateEnvironment(ctx context.Context, environment *models.Environment, userID, username *string) (*models.Environment, error)
- func (s *EnvironmentService) DeleteEnvironment(ctx context.Context, id string, userID, username *string) error
- func (s *EnvironmentService) EnsureLocalEnvironment(ctx context.Context, appUrl string) error
- func (s *EnvironmentService) GenerateDeploymentSnippets(ctx context.Context, envID string, envAddress string, apiKey string) (*DeploymentSnippets, error)
- func (s *EnvironmentService) GenerateEdgeDeploymentSnippets(ctx context.Context, envID string, managerURL string, apiKey string) (*DeploymentSnippets, error)
- func (s *EnvironmentService) GetDB() *database.DB
- func (s *EnvironmentService) GetEnabledRegistryCredentials(ctx context.Context) ([]containerregistry.Credential, error)
- func (s *EnvironmentService) GetEnvironmentByID(ctx context.Context, id string) (*models.Environment, error)
- func (s *EnvironmentService) ListEnvironmentsPaginated(ctx context.Context, params pagination.QueryParams) ([]environment.Environment, pagination.Response, error)
- func (s *EnvironmentService) ListRemoteEnvironments(ctx context.Context) ([]models.Environment, error)
- func (s *EnvironmentService) PairAgentWithBootstrap(ctx context.Context, apiUrl, bootstrapToken string) (string, error)
- func (s *EnvironmentService) PairAndPersistAgentToken(ctx context.Context, environmentID, apiUrl, bootstrapToken string) (string, error)
- func (s *EnvironmentService) ProxyRequest(ctx context.Context, envID string, method string, path string, body []byte) ([]byte, int, error)
- func (s *EnvironmentService) RegenerateEnvironmentApiKey(ctx context.Context, envID string, newApiKeyID string, encryptedKey string, ...) error
- func (s *EnvironmentService) SyncRegistriesToEnvironment(ctx context.Context, environmentID string) error
- func (s *EnvironmentService) SyncRegistriesToRemoteEnvironments(ctx context.Context) error
- func (s *EnvironmentService) SyncRepositoriesToEnvironment(ctx context.Context, environmentID string) error
- func (s *EnvironmentService) TestConnection(ctx context.Context, id string, customApiUrl *string) (string, error)
- func (s *EnvironmentService) UpdateEnvironment(ctx context.Context, id string, updates map[string]any, ...) (*models.Environment, error)
- func (s *EnvironmentService) UpdateEnvironmentHeartbeat(ctx context.Context, id string) error
- type EventService
- func (s *EventService) CreateEvent(ctx context.Context, req CreateEventRequest) (*models.Event, error)
- func (s *EventService) CreateEventFromDto(ctx context.Context, req event.CreateEvent) (*event.Event, error)
- func (s *EventService) DeleteEvent(ctx context.Context, eventID string) error
- func (s *EventService) DeleteOldEvents(ctx context.Context, olderThan time.Duration) error
- func (s *EventService) GetEventsByEnvironmentPaginated(ctx context.Context, environmentID string, params pagination.QueryParams) ([]event.Event, pagination.Response, error)
- func (s *EventService) ListEventsPaginated(ctx context.Context, params pagination.QueryParams) ([]event.Event, pagination.Response, error)
- func (s *EventService) LogContainerEvent(ctx context.Context, eventType models.EventType, ...) error
- func (s *EventService) LogErrorEvent(ctx context.Context, eventType models.EventType, ...)
- func (s *EventService) LogImageEvent(ctx context.Context, eventType models.EventType, ...) error
- func (s *EventService) LogNetworkEvent(ctx context.Context, eventType models.EventType, ...) error
- func (s *EventService) LogProjectEvent(ctx context.Context, eventType models.EventType, ...) error
- func (s *EventService) LogUserEvent(ctx context.Context, eventType models.EventType, userID, username string, ...) error
- func (s *EventService) LogVolumeEvent(ctx context.Context, eventType models.EventType, ...) error
- type ExecSession
- type FontService
- type GitOpsSyncService
- func (s *GitOpsSyncService) BrowseFiles(ctx context.Context, environmentID, id string, path string) (*gitops.BrowseResponse, error)
- func (s *GitOpsSyncService) CreateSync(ctx context.Context, environmentID string, req gitops.CreateSyncRequest) (*models.GitOpsSync, error)
- func (s *GitOpsSyncService) DeleteSync(ctx context.Context, environmentID, id string) error
- func (s *GitOpsSyncService) GetSyncByID(ctx context.Context, environmentID, id string) (*models.GitOpsSync, error)
- func (s *GitOpsSyncService) GetSyncStatus(ctx context.Context, environmentID, id string) (*gitops.SyncStatus, error)
- func (s *GitOpsSyncService) GetSyncsPaginated(ctx context.Context, environmentID string, params pagination.QueryParams) ([]gitops.GitOpsSync, pagination.Response, gitops.SyncCounts, error)
- func (s *GitOpsSyncService) ImportSyncs(ctx context.Context, environmentID string, ...) (*gitops.ImportGitOpsSyncResponse, error)
- func (s *GitOpsSyncService) ListSyncIntervalsRaw(ctx context.Context) ([]bootstraputils.IntervalMigrationItem, error)
- func (s *GitOpsSyncService) PerformSync(ctx context.Context, environmentID, id string) (*gitops.SyncResult, error)
- func (s *GitOpsSyncService) SyncAllEnabled(ctx context.Context) error
- func (s *GitOpsSyncService) UpdateSync(ctx context.Context, environmentID, id string, req gitops.UpdateSyncRequest) (*models.GitOpsSync, error)
- func (s *GitOpsSyncService) UpdateSyncIntervalMinutes(ctx context.Context, id string, minutes int) error
- type GitRepositoryService
- func (s *GitRepositoryService) BrowseFiles(ctx context.Context, id, branch, path string) (*gitops.BrowseResponse, error)
- func (s *GitRepositoryService) CreateRepository(ctx context.Context, req models.CreateGitRepositoryRequest) (*models.GitRepository, error)
- func (s *GitRepositoryService) DeleteRepository(ctx context.Context, id string) error
- func (s *GitRepositoryService) GetAuthConfig(ctx context.Context, repository *models.GitRepository) (git.AuthConfig, error)
- func (s *GitRepositoryService) GetRepositoriesPaginated(ctx context.Context, params pagination.QueryParams) ([]gitops.GitRepository, pagination.Response, error)
- func (s *GitRepositoryService) GetRepositoryByID(ctx context.Context, id string) (*models.GitRepository, error)
- func (s *GitRepositoryService) GetRepositoryByName(ctx context.Context, name string) (*models.GitRepository, error)
- func (s *GitRepositoryService) ListBranches(ctx context.Context, id string) ([]gitops.BranchInfo, error)
- func (s *GitRepositoryService) SyncRepositories(ctx context.Context, syncItems []gitops.RepositorySync) error
- func (s *GitRepositoryService) TestConnection(ctx context.Context, id string, branch string) error
- func (s *GitRepositoryService) UpdateRepository(ctx context.Context, id string, req models.UpdateGitRepositoryRequest) (*models.GitRepository, error)
- type ImageParts
- type ImageService
- func (s *ImageService) GetImageDetail(ctx context.Context, id string) (*imagetypes.DetailSummary, error)
- func (s *ImageService) GetTotalImageSize(ctx context.Context) (int64, error)
- func (s *ImageService) GetUpdateInfoByImageIDs(ctx context.Context, imageIDs []string) (map[string]*imagetypes.UpdateInfo, error)
- func (s *ImageService) ImageExistsLocally(ctx context.Context, imageName string) (bool, error)
- func (s *ImageService) ListImagesPaginated(ctx context.Context, params pagination.QueryParams) ([]imagetypes.Summary, pagination.Response, error)
- func (s *ImageService) LoadImageFromReader(ctx context.Context, reader io.Reader, fileName string, user models.User, ...) (*imagetypes.LoadResult, error)
- func (s *ImageService) PruneImages(ctx context.Context, dangling bool) (*image.PruneReport, error)
- func (s *ImageService) PullImage(ctx context.Context, imageName string, progressWriter io.Writer, ...) error
- func (s *ImageService) RemoveImage(ctx context.Context, id string, force bool, user models.User) error
- type ImageUpdateService
- func (s *ImageUpdateService) CheckAllImages(ctx context.Context, limit int, externalCreds []containerregistry.Credential) (map[string]*imageupdate.Response, error)
- func (s *ImageUpdateService) CheckImageUpdate(ctx context.Context, imageRef string) (*imageupdate.Response, error)
- func (s *ImageUpdateService) CheckImageUpdateByID(ctx context.Context, imageID string) (*imageupdate.Response, error)
- func (s *ImageUpdateService) CheckMultipleImages(ctx context.Context, imageRefs []string, ...) (map[string]*imageupdate.Response, error)
- func (s *ImageUpdateService) CleanupOrphanedRecords(ctx context.Context) error
- func (s *ImageUpdateService) GetUnnotifiedUpdates(ctx context.Context) (map[string]*models.ImageUpdateRecord, error)
- func (s *ImageUpdateService) GetUpdateSummary(ctx context.Context) (*imageupdate.Summary, error)
- func (s *ImageUpdateService) MarkUpdatesAsNotified(ctx context.Context, imageIDs []string) error
- type JobRunner
- type JobService
- func (s *JobService) GetJobSchedules(ctx context.Context) jobschedule.Config
- func (s *JobService) ListJobs(ctx context.Context) (*jobschedule.JobListResponse, error)
- func (s *JobService) RunJobNowInline(ctx context.Context, jobID string) error
- func (s *JobService) SetScheduler(scheduler JobRunner)
- func (s *JobService) UpdateJobSchedules(ctx context.Context, updates jobschedule.Update) (jobschedule.Config, error)
- type NetworkService
- func (s *NetworkService) CreateNetwork(ctx context.Context, name string, options network.CreateOptions, ...) (*network.CreateResponse, error)
- func (s *NetworkService) GetNetworkByID(ctx context.Context, id string) (*network.Inspect, error)
- func (s *NetworkService) ListNetworksPaginated(ctx context.Context, params pagination.QueryParams) ([]networktypes.Summary, pagination.Response, networktypes.UsageCounts, error)
- func (s *NetworkService) PruneNetworks(ctx context.Context) (*network.PruneReport, error)
- func (s *NetworkService) RemoveNetwork(ctx context.Context, id string, user models.User) error
- type NotificationService
- func (s *NotificationService) CreateOrUpdateSettings(ctx context.Context, provider models.NotificationProvider, enabled bool, ...) (*models.NotificationSettings, error)
- func (s *NotificationService) DeleteSettings(ctx context.Context, provider models.NotificationProvider) error
- func (s *NotificationService) GetAllSettings(ctx context.Context) ([]models.NotificationSettings, error)
- func (s *NotificationService) GetSettingsByProvider(ctx context.Context, provider models.NotificationProvider) (*models.NotificationSettings, error)
- func (s *NotificationService) MigrateDiscordWebhookUrlToFields(ctx context.Context) error
- func (s *NotificationService) SendBatchImageUpdateNotification(ctx context.Context, updates map[string]*imageupdate.Response) error
- func (s *NotificationService) SendContainerUpdateNotification(ctx context.Context, containerName, imageRef, oldDigest, newDigest string) error
- func (s *NotificationService) SendImageUpdateNotification(ctx context.Context, imageRef string, updateInfo *imageupdate.Response, ...) error
- func (s *NotificationService) SendPruneReportNotification(ctx context.Context, result *system.PruneAllResult) error
- func (s *NotificationService) SendVulnerabilityNotification(ctx context.Context, payload VulnerabilityNotificationPayload) error
- func (s *NotificationService) TestNotification(ctx context.Context, provider models.NotificationProvider, testType string) error
- type OidcService
- func (s *OidcService) ExchangeDeviceToken(ctx context.Context, deviceCode string) (*auth.OidcUserInfo, *auth.OidcTokenResponse, error)
- func (s *OidcService) GenerateAuthURL(ctx context.Context, redirectTo string, origin string) (string, string, error)
- func (s *OidcService) GetOidcRedirectURL(origin string) string
- func (s *OidcService) HandleCallback(ctx context.Context, code, state, storedState, origin string) (*auth.OidcUserInfo, *auth.OidcTokenResponse, error)
- func (s *OidcService) InitiateDeviceAuth(ctx context.Context) (*auth.OidcDeviceAuthResponse, error)
- type OidcState
- type ProjectService
- func (s *ProjectService) CreateProject(ctx context.Context, name, composeContent string, envContent *string, ...) (*models.Project, error)
- func (s *ProjectService) DeployProject(ctx context.Context, projectID string, user models.User) error
- func (s *ProjectService) DestroyProject(ctx context.Context, projectID string, removeFiles, removeVolumes bool, ...) error
- func (s *ProjectService) DownProject(ctx context.Context, projectID string, user models.User) error
- func (s *ProjectService) EnsureProjectImagesPresent(ctx context.Context, projectID string, progressWriter io.Writer, ...) error
- func (s *ProjectService) GetProjectContent(ctx context.Context, projectID string) (composeContent, envContent string, err error)
- func (s *ProjectService) GetProjectDetails(ctx context.Context, projectID string) (project.Details, error)
- func (s *ProjectService) GetProjectFromDatabaseByID(ctx context.Context, id string) (*models.Project, error)
- func (s *ProjectService) GetProjectServices(ctx context.Context, projectID string) ([]ProjectServiceInfo, error)
- func (s *ProjectService) GetProjectStatusCounts(ctx context.Context) (folderCount, runningProjects, stoppedProjects, totalProjects int, err error)
- func (s *ProjectService) ListAllProjects(ctx context.Context) ([]models.Project, error)
- func (s *ProjectService) ListProjects(ctx context.Context, params pagination.QueryParams) ([]project.Details, pagination.Response, error)
- func (s *ProjectService) PullProjectImages(ctx context.Context, projectID string, progressWriter io.Writer, ...) error
- func (s *ProjectService) RedeployProject(ctx context.Context, projectID string, user models.User) error
- func (s *ProjectService) RestartProject(ctx context.Context, projectID string, user models.User) error
- func (s *ProjectService) StreamProjectLogs(ctx context.Context, projectID string, logsChan chan<- string, follow bool, ...) error
- func (s *ProjectService) SyncProjectsFromFileSystem(ctx context.Context) error
- func (s *ProjectService) UpdateProject(ctx context.Context, projectID string, name *string, ...) (*models.Project, error)
- func (s *ProjectService) UpdateProjectIncludeFile(ctx context.Context, projectID, relativePath, content string) error
- type ProjectServiceInfo
- type SettingsSearchService
- type SettingsService
- func (s *SettingsService) EnsureDefaultSettings(ctx context.Context) error
- func (s *SettingsService) EnsureEncryptionKey(ctx context.Context) (string, error)
- func (s *SettingsService) GetBoolSetting(ctx context.Context, key string, defaultValue bool) bool
- func (s *SettingsService) GetIntSetting(ctx context.Context, key string, defaultValue int) int
- func (s *SettingsService) GetSettingType(key string) string
- func (s *SettingsService) GetSettings(ctx context.Context) (*models.Settings, error)
- func (s *SettingsService) GetSettingsConfig() *models.Settings
- func (s *SettingsService) GetStringSetting(ctx context.Context, key, defaultValue string) string
- func (s *SettingsService) ListSettings(all bool) []models.SettingVariable
- func (s *SettingsService) LoadDatabaseSettings(ctx context.Context) (err error)
- func (s *SettingsService) MigrateOidcConfigToFields(ctx context.Context) error
- func (s *SettingsService) NormalizeProjectsDirectory(ctx context.Context, projectsDirEnv string) error
- func (s *SettingsService) PersistEnvSettingsIfMissing(ctx context.Context) error
- func (s *SettingsService) PruneUnknownSettings(ctx context.Context) error
- func (s *SettingsService) SetBoolSetting(ctx context.Context, key string, value bool) error
- func (s *SettingsService) SetIntSetting(ctx context.Context, key string, value int) error
- func (s *SettingsService) SetStringSetting(ctx context.Context, key, value string) error
- func (s *SettingsService) UpdateSetting(ctx context.Context, key, value string) error
- func (s *SettingsService) UpdateSettings(ctx context.Context, updates settings.Update) ([]models.SettingVariable, error)
- type SystemService
- func (s *SystemService) ConvertToDockerCompose(parsed *models.DockerRunCommand) (string, string, string, error)
- func (s *SystemService) GetDiskUsagePath(ctx context.Context) string
- func (s *SystemService) ParseDockerRunCommand(command string) (*models.DockerRunCommand, error)
- func (s *SystemService) PruneAll(ctx context.Context, req system.PruneAllRequest) (*system.PruneAllResult, error)
- func (s *SystemService) StartAllContainers(ctx context.Context) (*containertypes.ActionResult, error)
- func (s *SystemService) StartAllStoppedContainers(ctx context.Context) (*containertypes.ActionResult, error)
- func (s *SystemService) StopAllContainers(ctx context.Context) (*containertypes.ActionResult, error)
- type SystemUpgradeService
- type TemplateService
- func (s *TemplateService) CreateRegistry(ctx context.Context, registry *models.TemplateRegistry) error
- func (s *TemplateService) CreateTemplate(ctx context.Context, template *models.ComposeTemplate) error
- func (s *TemplateService) DeleteRegistry(ctx context.Context, id string) error
- func (s *TemplateService) DeleteTemplate(ctx context.Context, id string) error
- func (s *TemplateService) DownloadTemplate(ctx context.Context, remoteTemplate *models.ComposeTemplate) (*models.ComposeTemplate, error)
- func (s *TemplateService) FetchRaw(ctx context.Context, url string) ([]byte, error)
- func (s *TemplateService) FetchTemplateContent(ctx context.Context, template *models.ComposeTemplate) (string, string, error)
- func (s *TemplateService) GetAllTemplates(ctx context.Context) ([]models.ComposeTemplate, error)
- func (s *TemplateService) GetAllTemplatesPaginated(ctx context.Context, params pagination.QueryParams) ([]tmpl.Template, pagination.Response, error)
- func (s *TemplateService) GetComposeTemplate() string
- func (s *TemplateService) GetEnvTemplate() string
- func (s *TemplateService) GetGlobalVariables(ctx context.Context) ([]env.Variable, error)
- func (s *TemplateService) GetRegistries(ctx context.Context) ([]models.TemplateRegistry, error)
- func (s *TemplateService) GetTemplate(ctx context.Context, id string) (*models.ComposeTemplate, error)
- func (s *TemplateService) GetTemplateContentWithParsedData(ctx context.Context, id string) (*tmpl.TemplateContent, error)
- func (s *TemplateService) ParseComposeServices(ctx context.Context, composeContent string) []string
- func (s *TemplateService) SaveComposeTemplate(content string) error
- func (s *TemplateService) SaveEnvTemplate(content string) error
- func (s *TemplateService) SyncLocalTemplatesFromFilesystem(ctx context.Context) error
- func (s *TemplateService) UpdateGlobalVariables(ctx context.Context, vars []env.Variable) error
- func (s *TemplateService) UpdateRegistry(ctx context.Context, id string, updates *models.TemplateRegistry) error
- func (s *TemplateService) UpdateTemplate(ctx context.Context, id string, updates *models.ComposeTemplate) error
- type TokenPair
- type UpdaterService
- func (s *UpdaterService) ApplyPending(ctx context.Context, dryRun bool) (*updater.Result, error)
- func (s *UpdaterService) GetHistory(ctx context.Context, limit int) ([]models.AutoUpdateRecord, error)
- func (s *UpdaterService) GetStatus() updater.Status
- func (s *UpdaterService) UpdateSingleContainer(ctx context.Context, containerID string) (*updater.Result, error)
- type UserClaims
- type UserService
- func (s *UserService) AttachOidcSubjectTransactional(ctx context.Context, userID string, subject string, ...) (*models.User, error)
- func (s *UserService) CreateDefaultAdmin(ctx context.Context) error
- func (s *UserService) CreateUser(ctx context.Context, user *models.User) (*models.User, error)
- func (s *UserService) DeleteUser(ctx context.Context, id string) error
- func (s *UserService) GetUser(ctx context.Context, userID string) (*models.User, error)
- func (s *UserService) GetUserByEmail(ctx context.Context, email string) (*models.User, error)
- func (s *UserService) GetUserByID(ctx context.Context, id string) (*models.User, error)
- func (s *UserService) GetUserByOidcSubjectId(ctx context.Context, subjectId string) (*models.User, error)
- func (s *UserService) GetUserByUsername(ctx context.Context, username string) (*models.User, error)
- func (s *UserService) HashPassword(password string) (string, error)
- func (s *UserService) ListUsersPaginated(ctx context.Context, params pagination.QueryParams) ([]user.User, pagination.Response, error)
- func (s *UserService) NeedsPasswordUpgrade(hash string) bool
- func (s *UserService) UpdateUser(ctx context.Context, user *models.User) (*models.User, error)
- func (s *UserService) UpgradePasswordHash(ctx context.Context, userID, password string) error
- func (s *UserService) ValidatePassword(encodedHash, password string) error
- type VersionService
- func (s *VersionService) GetAppVersionInfo(ctx context.Context) *version.Info
- func (s *VersionService) GetLatestVersion(ctx context.Context) (string, error)
- func (s *VersionService) GetVersionInformation(ctx context.Context, currentVersion string) (*version.Check, error)
- func (s *VersionService) IsNewer(latest, current string) bool
- func (s *VersionService) ReleaseURL(version string) string
- type VolumeService
- func (s *VolumeService) BackupHasPath(ctx context.Context, backupID string, filePath string) (bool, error)
- func (s *VolumeService) BackupMountWarning(ctx context.Context) string
- func (s *VolumeService) CleanupHelperContainers(ctx context.Context)
- func (s *VolumeService) CleanupOrphanedVolumeHelpers(ctx context.Context) error
- func (s *VolumeService) CreateBackup(ctx context.Context, volumeName string, user models.User) (*models.VolumeBackup, error)
- func (s *VolumeService) CreateDirectory(ctx context.Context, volumeName, dirPath string, user *models.User) error
- func (s *VolumeService) CreateVolume(ctx context.Context, options volume.CreateOptions, user models.User) (*volumetypes.Volume, error)
- func (s *VolumeService) DeleteBackup(ctx context.Context, backupID string, user *models.User) error
- func (s *VolumeService) DeleteFile(ctx context.Context, volumeName, filePath string, user *models.User) error
- func (s *VolumeService) DeleteVolume(ctx context.Context, name string, force bool, user models.User) error
- func (s *VolumeService) DownloadBackup(ctx context.Context, backupID string, user *models.User) (io.ReadCloser, int64, error)
- func (s *VolumeService) DownloadFile(ctx context.Context, volumeName, filePath string) (io.ReadCloser, int64, error)
- func (s *VolumeService) GetFileContent(ctx context.Context, volumeName, filePath string, maxBytes int64) ([]byte, string, error)
- func (s *VolumeService) GetVolumeByName(ctx context.Context, name string) (*volumetypes.Volume, error)
- func (s *VolumeService) GetVolumeSizes(ctx context.Context) (map[string]VolumeSizeData, error)
- func (s *VolumeService) GetVolumeUsage(ctx context.Context, name string) (bool, []string, error)
- func (s *VolumeService) ListBackupFiles(ctx context.Context, backupID string) ([]string, error)
- func (s *VolumeService) ListBackups(ctx context.Context, volumeName string) ([]models.VolumeBackup, error)
- func (s *VolumeService) ListBackupsPaginated(ctx context.Context, volumeName string, params pagination.QueryParams) ([]models.VolumeBackup, pagination.Response, error)
- func (s *VolumeService) ListDirectory(ctx context.Context, volumeName, dirPath string) ([]volumetypes.FileEntry, error)
- func (s *VolumeService) ListVolumesPaginated(ctx context.Context, params pagination.QueryParams, includeInternal bool) ([]volumetypes.Volume, pagination.Response, volumetypes.UsageCounts, error)
- func (s *VolumeService) PruneVolumes(ctx context.Context) (*volumetypes.PruneReport, error)
- func (s *VolumeService) PruneVolumesWithOptions(ctx context.Context, all bool) (*volumetypes.PruneReport, error)
- func (s *VolumeService) RestoreBackup(ctx context.Context, volumeName, backupID string, user models.User) error
- func (s *VolumeService) RestoreBackupFiles(ctx context.Context, volumeName, backupID string, paths []string, ...) error
- func (s *VolumeService) UploadAndRestore(ctx context.Context, volumeName string, archive io.Reader, filename string, ...) error
- func (s *VolumeService) UploadFile(ctx context.Context, volumeName, destPath string, content io.Reader, ...) error
- type VolumeSizeData
- type VulnerabilityNotificationPayload
- type VulnerabilityService
- func (s *VulnerabilityService) CleanupOrphanedScanRecords(ctx context.Context) (deleted int64, err error)
- func (s *VulnerabilityService) DeleteScanResult(ctx context.Context, imageID string) error
- func (s *VulnerabilityService) DeleteScanResultsByImageIDs(ctx context.Context, imageIDs []string) error
- func (s *VulnerabilityService) GetEnvironmentSummary(ctx context.Context) (*vulnerability.EnvironmentVulnerabilitySummary, error)
- func (s *VulnerabilityService) GetIgnoreRecordsForImage(ctx context.Context, envID string, imageID string) ([]models.VulnerabilityIgnore, error)
- func (s *VulnerabilityService) GetScanResult(ctx context.Context, imageID string) (*vulnerability.ScanResult, error)
- func (s *VulnerabilityService) GetScanSummariesByImageIDs(ctx context.Context, imageIDs []string) (map[string]*vulnerability.ScanSummary, error)
- func (s *VulnerabilityService) GetScanSummary(ctx context.Context, imageID string) (*vulnerability.ScanSummary, error)
- func (s *VulnerabilityService) GetTrivyVersion(ctx context.Context) string
- func (s *VulnerabilityService) IgnoreVulnerability(ctx context.Context, envID string, payload *vulnerability.IgnorePayload) (*models.VulnerabilityIgnore, error)
- func (s *VulnerabilityService) ListAllVulnerabilities(ctx context.Context, envID string, params pagination.QueryParams) ([]vulnerability.VulnerabilityWithImage, pagination.Response, error)
- func (s *VulnerabilityService) ListIgnoredVulnerabilities(ctx context.Context, envID string, params pagination.QueryParams) ([]vulnerability.IgnoredVulnerability, pagination.Response, error)
- func (s *VulnerabilityService) ListVulnerabilities(ctx context.Context, imageID string, params pagination.QueryParams) ([]vulnerability.Vulnerability, pagination.Response, error)
- func (s *VulnerabilityService) ScanAllImages(ctx context.Context, envID string, user models.User) (scanned, failed int, err error)
- func (s *VulnerabilityService) ScanImage(ctx context.Context, envID string, imageID string, user models.User) (*vulnerability.ScanResult, error)
- func (s *VulnerabilityService) UnignoreVulnerability(ctx context.Context, envID string, ignoreID string) error
Constants ¶
const (
DefaultTrivyImage = "ghcr.io/aquasecurity/trivy:latest"
)
Variables ¶
var ( ErrApiKeyNotFound = errors.New("API key not found") ErrApiKeyExpired = errors.New("API key has expired") ErrApiKeyInvalid = errors.New("invalid API key") )
var ( ErrInvalidCredentials = errors.New("invalid credentials") ErrUserNotFound = errors.New("user not found") ErrInvalidToken = errors.New("invalid token") ErrExpiredToken = errors.New("token expired") ErrTokenVersionMismatch = errors.New("token version mismatch") ErrLocalAuthDisabled = errors.New("local authentication is disabled") ErrOidcAuthDisabled = errors.New("OIDC authentication is disabled") )
var ( ErrNotRunningInDocker = errors.New("arcane is not running in a Docker container") ErrContainerNotFound = errors.New("could not find Arcane container") ErrUpgradeInProgress = errors.New("an upgrade is already in progress") ErrDockerSocketAccess = errors.New("docker socket is not accessible") ArcaneUpgraderImage = "ghcr.io/getarcaneapp/arcane:latest" )
var ErrTemplateNotFound = errors.New("template not found")
Functions ¶
This section is empty.
Types ¶
type ApiKeyService ¶
type ApiKeyService struct {
// contains filtered or unexported fields
}
func NewApiKeyService ¶
func NewApiKeyService(db *database.DB, userService *UserService) *ApiKeyService
func (*ApiKeyService) CreateApiKey ¶
func (s *ApiKeyService) CreateApiKey(ctx context.Context, userID string, req apikey.CreateApiKey) (*apikey.ApiKeyCreatedDto, error)
func (*ApiKeyService) CreateEnvironmentApiKey ¶
func (s *ApiKeyService) CreateEnvironmentApiKey(ctx context.Context, environmentID string, userID string) (*apikey.ApiKeyCreatedDto, error)
func (*ApiKeyService) DeleteApiKey ¶
func (s *ApiKeyService) DeleteApiKey(ctx context.Context, id string) error
func (*ApiKeyService) GetEnvironmentByApiKey ¶
func (*ApiKeyService) ListApiKeys ¶
func (s *ApiKeyService) ListApiKeys(ctx context.Context, params pagination.QueryParams) ([]apikey.ApiKey, pagination.Response, error)
func (*ApiKeyService) UpdateApiKey ¶
func (s *ApiKeyService) UpdateApiKey(ctx context.Context, id string, req apikey.UpdateApiKey) (*apikey.ApiKey, error)
func (*ApiKeyService) ValidateApiKey ¶
type ApplicationImagesService ¶
type ApplicationImagesService struct {
// contains filtered or unexported fields
}
func NewApplicationImagesService ¶
func NewApplicationImagesService(embeddedFS embed.FS, settingsService *SettingsService) *ApplicationImagesService
func (*ApplicationImagesService) GetImageWithColor ¶
type AppriseService
deprecated
type AppriseService struct {
// contains filtered or unexported fields
}
AppriseService handles sending notifications through Apprise API
Deprecated: Built-in providers (e.g., SMTP via Shoutrrr) are preferred.
func NewAppriseService ¶
func NewAppriseService(db *database.DB, cfg *config.Config) *AppriseService
func (*AppriseService) CreateOrUpdateSettings ¶
func (s *AppriseService) CreateOrUpdateSettings(ctx context.Context, apiURL string, enabled bool, imageUpdateTag, containerUpdateTag string) (*models.AppriseSettings, error)
func (*AppriseService) GetSettings ¶
func (s *AppriseService) GetSettings(ctx context.Context) (*models.AppriseSettings, error)
func (*AppriseService) SendBatchImageUpdateNotification ¶
func (s *AppriseService) SendBatchImageUpdateNotification(ctx context.Context, updates map[string]*imageupdate.Response) error
func (*AppriseService) SendContainerUpdateNotification ¶
func (s *AppriseService) SendContainerUpdateNotification(ctx context.Context, containerName, imageRef, oldDigest, newDigest string) error
func (*AppriseService) SendImageUpdateNotification ¶
func (s *AppriseService) SendImageUpdateNotification(ctx context.Context, imageRef string, updateInfo *imageupdate.Response) error
func (*AppriseService) SendNotification ¶
func (s *AppriseService) SendNotification(ctx context.Context, title, body, format string, notificationType models.NotificationEventType) error
func (*AppriseService) TestNotification ¶
func (s *AppriseService) TestNotification(ctx context.Context, testType string) error
type Argon2Params ¶
type Argon2Params struct {
// contains filtered or unexported fields
}
func DefaultArgon2Params ¶
func DefaultArgon2Params() *Argon2Params
type AuthService ¶
type AuthService struct {
// contains filtered or unexported fields
}
func NewAuthService ¶
func NewAuthService(userService *UserService, settingsService *SettingsService, eventService *EventService, jwtSecret string, cfg *config.Config) *AuthService
func (*AuthService) ChangePassword ¶
func (s *AuthService) ChangePassword(ctx context.Context, userID, currentPassword, newPassword string) error
func (*AuthService) GetAutoLoginConfig ¶
func (s *AuthService) GetAutoLoginConfig(ctx context.Context) (*auth.AutoLoginConfig, error)
GetAutoLoginConfig returns the auto-login configuration for the frontend. The password is never returned. Auto-login is disabled if local auth is disabled.
func (*AuthService) GetAutoLoginPassword ¶
func (s *AuthService) GetAutoLoginPassword() string
GetAutoLoginPassword returns the auto-login password for internal use only. This should only be called by the login handler to validate auto-login credentials. WARNING: Never expose this value through any API response!
func (*AuthService) GetOidcConfig ¶
func (s *AuthService) GetOidcConfig(ctx context.Context) (*models.OidcConfig, error)
func (*AuthService) GetOidcConfigurationStatus ¶
func (s *AuthService) GetOidcConfigurationStatus(ctx context.Context) (*auth.OidcStatusInfo, error)
func (*AuthService) GetSessionTimeout ¶
func (s *AuthService) GetSessionTimeout(ctx context.Context) (int, error)
func (*AuthService) IsLocalAuthEnabled ¶
func (s *AuthService) IsLocalAuthEnabled(ctx context.Context) (bool, error)
func (*AuthService) IsOidcEnabled ¶
func (s *AuthService) IsOidcEnabled(ctx context.Context) (bool, error)
func (*AuthService) OidcLogin ¶
func (s *AuthService) OidcLogin(ctx context.Context, userInfo auth.OidcUserInfo, tokenResp *auth.OidcTokenResponse) (*models.User, *TokenPair, error)
func (*AuthService) RefreshToken ¶
func (*AuthService) VerifyToken ¶
type AuthSettings ¶
type AuthSettings struct {
LocalAuthEnabled bool `json:"localAuthEnabled"`
OidcEnabled bool `json:"oidcEnabled"`
SessionTimeout int `json:"sessionTimeout"`
Oidc *models.OidcConfig `json:"oidc,omitempty"`
}
type ContainerRegistryService ¶
type ContainerRegistryService struct {
// contains filtered or unexported fields
}
func NewContainerRegistryService ¶
func NewContainerRegistryService(db *database.DB) *ContainerRegistryService
func (*ContainerRegistryService) CreateRegistry ¶
func (s *ContainerRegistryService) CreateRegistry(ctx context.Context, req models.CreateContainerRegistryRequest) (*models.ContainerRegistry, error)
func (*ContainerRegistryService) DeleteRegistry ¶
func (s *ContainerRegistryService) DeleteRegistry(ctx context.Context, id string) error
func (*ContainerRegistryService) GetAllRegistries ¶
func (s *ContainerRegistryService) GetAllRegistries(ctx context.Context) ([]models.ContainerRegistry, error)
func (*ContainerRegistryService) GetDecryptedToken ¶
func (s *ContainerRegistryService) GetDecryptedToken(ctx context.Context, id string) (string, error)
GetDecryptedToken returns the decrypted token for a registry
func (*ContainerRegistryService) GetEnabledRegistries ¶
func (s *ContainerRegistryService) GetEnabledRegistries(ctx context.Context) ([]models.ContainerRegistry, error)
GetEnabledRegistries returns all enabled registries
func (*ContainerRegistryService) GetImageDigest ¶
func (s *ContainerRegistryService) GetImageDigest(ctx context.Context, imageRef string) (string, error)
GetImageDigest fetches the current digest for an image:tag from the registry This is used for digest-based update detection for non-semver tags
func (*ContainerRegistryService) GetRegistriesPaginated ¶
func (s *ContainerRegistryService) GetRegistriesPaginated(ctx context.Context, params pagination.QueryParams) ([]containerregistry.ContainerRegistry, pagination.Response, error)
func (*ContainerRegistryService) GetRegistryByID ¶
func (s *ContainerRegistryService) GetRegistryByID(ctx context.Context, id string) (*models.ContainerRegistry, error)
func (*ContainerRegistryService) SyncRegistries ¶
func (s *ContainerRegistryService) SyncRegistries(ctx context.Context, syncItems []containerregistry.Sync) error
SyncRegistries syncs registries from a manager to this agent instance It creates, updates, or deletes registries to match the provided list
func (*ContainerRegistryService) UpdateRegistry ¶
func (s *ContainerRegistryService) UpdateRegistry(ctx context.Context, id string, req models.UpdateContainerRegistryRequest) (*models.ContainerRegistry, error)
type ContainerService ¶
type ContainerService struct {
// contains filtered or unexported fields
}
func NewContainerService ¶
func NewContainerService(db *database.DB, eventService *EventService, dockerService *DockerClientService, imageService *ImageService, settingsService *SettingsService) *ContainerService
func (*ContainerService) AttachExec ¶
func (s *ContainerService) AttachExec(ctx context.Context, containerID, execID string) (*ExecSession, error)
AttachExec attaches to an exec instance and returns an ExecSession for lifecycle management.
func (*ContainerService) CreateContainer ¶
func (s *ContainerService) CreateContainer(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, containerName string, user models.User, credentials []containerregistry.Credential) (*container.InspectResponse, error)
func (*ContainerService) CreateExec ¶
func (s *ContainerService) CreateExec(ctx context.Context, containerID string, cmd []string) (string, error)
CreateExec creates an exec instance in the container
func (*ContainerService) DeleteContainer ¶
func (*ContainerService) GetContainerByID ¶
func (s *ContainerService) GetContainerByID(ctx context.Context, id string) (*container.InspectResponse, error)
func (*ContainerService) ListContainersPaginated ¶
func (s *ContainerService) ListContainersPaginated(ctx context.Context, params pagination.QueryParams, includeAll bool, includeInternal bool) ([]containertypes.Summary, pagination.Response, containertypes.StatusCounts, error)
func (*ContainerService) RestartContainer ¶
func (*ContainerService) StartContainer ¶
func (*ContainerService) StopContainer ¶
func (*ContainerService) StreamLogs ¶
func (*ContainerService) StreamStats ¶
type CreateEventRequest ¶
type CreateEventRequest struct {
Type models.EventType `json:"type"`
Severity models.EventSeverity `json:"severity,omitempty"`
Title string `json:"title"`
Description string `json:"description,omitempty"`
ResourceType *string `json:"resourceType,omitempty"`
ResourceID *string `json:"resourceId,omitempty"`
ResourceName *string `json:"resourceName,omitempty"`
UserID *string `json:"userId,omitempty"`
Username *string `json:"username,omitempty"`
EnvironmentID *string `json:"environmentId,omitempty"`
Metadata models.JSON `json:"metadata,omitempty"`
}
type CustomizeSearchService ¶
type CustomizeSearchService struct {
// contains filtered or unexported fields
}
func NewCustomizeSearchService ¶
func NewCustomizeSearchService() *CustomizeSearchService
func (*CustomizeSearchService) GetCustomizeCategories ¶
func (s *CustomizeSearchService) GetCustomizeCategories() []category.Category
GetCustomizeCategories returns all available customization categories with their metadata
type DeploymentSnippets ¶
DeploymentSnippets contains deployment configuration snippets for an environment.
type DockerClientService ¶
type DockerClientService struct {
// contains filtered or unexported fields
}
func NewDockerClientService ¶
func NewDockerClientService(db *database.DB, cfg *config.Config, settingsService *SettingsService) *DockerClientService
func (*DockerClientService) GetAllContainers ¶
func (*DockerClientService) GetAllImages ¶
func (*DockerClientService) GetAllNetworks ¶
func (*DockerClientService) GetAllVolumes ¶
type EnvironmentService ¶
type EnvironmentService struct {
// contains filtered or unexported fields
}
func NewEnvironmentService ¶
func NewEnvironmentService(db *database.DB, httpClient *http.Client, dockerService *DockerClientService, eventService *EventService, settingsService *SettingsService) *EnvironmentService
func (*EnvironmentService) CreateEnvironment ¶
func (s *EnvironmentService) CreateEnvironment(ctx context.Context, environment *models.Environment, userID, username *string) (*models.Environment, error)
func (*EnvironmentService) DeleteEnvironment ¶
func (*EnvironmentService) EnsureLocalEnvironment ¶
func (s *EnvironmentService) EnsureLocalEnvironment(ctx context.Context, appUrl string) error
func (*EnvironmentService) GenerateDeploymentSnippets ¶
func (s *EnvironmentService) GenerateDeploymentSnippets(ctx context.Context, envID string, envAddress string, apiKey string) (*DeploymentSnippets, error)
GenerateDeploymentSnippets generates Docker deployment snippets for an environment.
func (*EnvironmentService) GenerateEdgeDeploymentSnippets ¶
func (s *EnvironmentService) GenerateEdgeDeploymentSnippets(ctx context.Context, envID string, managerURL string, apiKey string) (*DeploymentSnippets, error)
GenerateEdgeDeploymentSnippets generates Docker deployment snippets for an edge agent. Edge agents connect outbound to the manager and don't require exposed ports.
func (*EnvironmentService) GetDB ¶
func (s *EnvironmentService) GetDB() *database.DB
func (*EnvironmentService) GetEnabledRegistryCredentials ¶
func (s *EnvironmentService) GetEnabledRegistryCredentials(ctx context.Context) ([]containerregistry.Credential, error)
func (*EnvironmentService) GetEnvironmentByID ¶
func (s *EnvironmentService) GetEnvironmentByID(ctx context.Context, id string) (*models.Environment, error)
func (*EnvironmentService) ListEnvironmentsPaginated ¶
func (s *EnvironmentService) ListEnvironmentsPaginated(ctx context.Context, params pagination.QueryParams) ([]environment.Environment, pagination.Response, error)
func (*EnvironmentService) ListRemoteEnvironments ¶
func (s *EnvironmentService) ListRemoteEnvironments(ctx context.Context) ([]models.Environment, error)
ListRemoteEnvironments returns all non-local, enabled environments for syncing purposes.
func (*EnvironmentService) PairAgentWithBootstrap ¶
func (s *EnvironmentService) PairAgentWithBootstrap(ctx context.Context, apiUrl, bootstrapToken string) (string, error)
Deprecated - Use the Api Key flow
func (*EnvironmentService) PairAndPersistAgentToken ¶
func (*EnvironmentService) ProxyRequest ¶
func (s *EnvironmentService) ProxyRequest(ctx context.Context, envID string, method string, path string, body []byte) ([]byte, int, error)
ProxyRequest sends a request to a remote environment's API.
func (*EnvironmentService) RegenerateEnvironmentApiKey ¶
func (*EnvironmentService) SyncRegistriesToEnvironment ¶
func (s *EnvironmentService) SyncRegistriesToEnvironment(ctx context.Context, environmentID string) error
SyncRegistriesToEnvironment syncs all registries from this manager to a remote environment
func (*EnvironmentService) SyncRegistriesToRemoteEnvironments ¶
func (s *EnvironmentService) SyncRegistriesToRemoteEnvironments(ctx context.Context) error
SyncRegistriesToRemoteEnvironments syncs container registries to all eligible remote environments. Eligibility requires a non-local, enabled environment with a configured access token.
func (*EnvironmentService) SyncRepositoriesToEnvironment ¶
func (s *EnvironmentService) SyncRepositoriesToEnvironment(ctx context.Context, environmentID string) error
SyncRepositoriesToEnvironment syncs all git repositories from this manager to a remote environment
func (*EnvironmentService) TestConnection ¶
func (*EnvironmentService) UpdateEnvironment ¶
func (s *EnvironmentService) UpdateEnvironment(ctx context.Context, id string, updates map[string]any, userID, username *string) (*models.Environment, error)
func (*EnvironmentService) UpdateEnvironmentHeartbeat ¶
func (s *EnvironmentService) UpdateEnvironmentHeartbeat(ctx context.Context, id string) error
type EventService ¶
type EventService struct {
// contains filtered or unexported fields
}
func NewEventService ¶
func NewEventService(db *database.DB) *EventService
func (*EventService) CreateEvent ¶
func (s *EventService) CreateEvent(ctx context.Context, req CreateEventRequest) (*models.Event, error)
func (*EventService) CreateEventFromDto ¶
func (s *EventService) CreateEventFromDto(ctx context.Context, req event.CreateEvent) (*event.Event, error)
func (*EventService) DeleteEvent ¶
func (s *EventService) DeleteEvent(ctx context.Context, eventID string) error
func (*EventService) DeleteOldEvents ¶
func (*EventService) GetEventsByEnvironmentPaginated ¶
func (s *EventService) GetEventsByEnvironmentPaginated(ctx context.Context, environmentID string, params pagination.QueryParams) ([]event.Event, pagination.Response, error)
func (*EventService) ListEventsPaginated ¶
func (s *EventService) ListEventsPaginated(ctx context.Context, params pagination.QueryParams) ([]event.Event, pagination.Response, error)
func (*EventService) LogContainerEvent ¶
func (*EventService) LogErrorEvent ¶
func (*EventService) LogImageEvent ¶
func (*EventService) LogNetworkEvent ¶
func (*EventService) LogProjectEvent ¶
func (*EventService) LogUserEvent ¶
type ExecSession ¶
type ExecSession struct {
// contains filtered or unexported fields
}
ExecSession manages the lifecycle of a Docker exec session.
func (*ExecSession) Close ¶
func (e *ExecSession) Close(ctx context.Context) error
Close terminates the exec session and kills the process if still running.
func (*ExecSession) Stdin ¶
func (e *ExecSession) Stdin() io.WriteCloser
func (*ExecSession) Stdout ¶
func (e *ExecSession) Stdout() io.Reader
type FontService ¶
type FontService struct {
// contains filtered or unexported fields
}
func NewFontService ¶
func NewFontService(embeddedFS embed.FS) *FontService
func (*FontService) GetFont ¶
func (s *FontService) GetFont(fontPath string) ([]byte, string, error)
func (*FontService) GetMonoFont ¶
func (s *FontService) GetMonoFont() ([]byte, string, error)
func (*FontService) GetSansFont ¶
func (s *FontService) GetSansFont() ([]byte, string, error)
func (*FontService) GetSerifFont ¶
func (s *FontService) GetSerifFont() ([]byte, string, error)
type GitOpsSyncService ¶
type GitOpsSyncService struct {
// contains filtered or unexported fields
}
func NewGitOpsSyncService ¶
func NewGitOpsSyncService(db *database.DB, repoService *GitRepositoryService, projectService *ProjectService, eventService *EventService) *GitOpsSyncService
func (*GitOpsSyncService) BrowseFiles ¶
func (s *GitOpsSyncService) BrowseFiles(ctx context.Context, environmentID, id string, path string) (*gitops.BrowseResponse, error)
func (*GitOpsSyncService) CreateSync ¶
func (s *GitOpsSyncService) CreateSync(ctx context.Context, environmentID string, req gitops.CreateSyncRequest) (*models.GitOpsSync, error)
func (*GitOpsSyncService) DeleteSync ¶
func (s *GitOpsSyncService) DeleteSync(ctx context.Context, environmentID, id string) error
func (*GitOpsSyncService) GetSyncByID ¶
func (s *GitOpsSyncService) GetSyncByID(ctx context.Context, environmentID, id string) (*models.GitOpsSync, error)
func (*GitOpsSyncService) GetSyncStatus ¶
func (s *GitOpsSyncService) GetSyncStatus(ctx context.Context, environmentID, id string) (*gitops.SyncStatus, error)
func (*GitOpsSyncService) GetSyncsPaginated ¶
func (s *GitOpsSyncService) GetSyncsPaginated(ctx context.Context, environmentID string, params pagination.QueryParams) ([]gitops.GitOpsSync, pagination.Response, gitops.SyncCounts, error)
func (*GitOpsSyncService) ImportSyncs ¶
func (s *GitOpsSyncService) ImportSyncs(ctx context.Context, environmentID string, req []gitops.ImportGitOpsSyncRequest) (*gitops.ImportGitOpsSyncResponse, error)
func (*GitOpsSyncService) ListSyncIntervalsRaw ¶
func (s *GitOpsSyncService) ListSyncIntervalsRaw(ctx context.Context) ([]bootstraputils.IntervalMigrationItem, error)
func (*GitOpsSyncService) PerformSync ¶
func (s *GitOpsSyncService) PerformSync(ctx context.Context, environmentID, id string) (*gitops.SyncResult, error)
func (*GitOpsSyncService) SyncAllEnabled ¶
func (s *GitOpsSyncService) SyncAllEnabled(ctx context.Context) error
func (*GitOpsSyncService) UpdateSync ¶
func (s *GitOpsSyncService) UpdateSync(ctx context.Context, environmentID, id string, req gitops.UpdateSyncRequest) (*models.GitOpsSync, error)
func (*GitOpsSyncService) UpdateSyncIntervalMinutes ¶
type GitRepositoryService ¶
type GitRepositoryService struct {
// contains filtered or unexported fields
}
func NewGitRepositoryService ¶
func NewGitRepositoryService(db *database.DB, workDir string, eventService *EventService, settingsService *SettingsService) *GitRepositoryService
func (*GitRepositoryService) BrowseFiles ¶
func (s *GitRepositoryService) BrowseFiles(ctx context.Context, id, branch, path string) (*gitops.BrowseResponse, error)
func (*GitRepositoryService) CreateRepository ¶
func (s *GitRepositoryService) CreateRepository(ctx context.Context, req models.CreateGitRepositoryRequest) (*models.GitRepository, error)
func (*GitRepositoryService) DeleteRepository ¶
func (s *GitRepositoryService) DeleteRepository(ctx context.Context, id string) error
func (*GitRepositoryService) GetAuthConfig ¶
func (s *GitRepositoryService) GetAuthConfig(ctx context.Context, repository *models.GitRepository) (git.AuthConfig, error)
func (*GitRepositoryService) GetRepositoriesPaginated ¶
func (s *GitRepositoryService) GetRepositoriesPaginated(ctx context.Context, params pagination.QueryParams) ([]gitops.GitRepository, pagination.Response, error)
func (*GitRepositoryService) GetRepositoryByID ¶
func (s *GitRepositoryService) GetRepositoryByID(ctx context.Context, id string) (*models.GitRepository, error)
func (*GitRepositoryService) GetRepositoryByName ¶
func (s *GitRepositoryService) GetRepositoryByName(ctx context.Context, name string) (*models.GitRepository, error)
func (*GitRepositoryService) ListBranches ¶
func (s *GitRepositoryService) ListBranches(ctx context.Context, id string) ([]gitops.BranchInfo, error)
func (*GitRepositoryService) SyncRepositories ¶
func (s *GitRepositoryService) SyncRepositories(ctx context.Context, syncItems []gitops.RepositorySync) error
SyncRepositories syncs repositories from a manager to this agent instance. It creates, updates, or deletes repositories to match the provided list.
func (*GitRepositoryService) TestConnection ¶
func (*GitRepositoryService) UpdateRepository ¶
func (s *GitRepositoryService) UpdateRepository(ctx context.Context, id string, req models.UpdateGitRepositoryRequest) (*models.GitRepository, error)
type ImageParts ¶
type ImageService ¶
type ImageService struct {
// contains filtered or unexported fields
}
func NewImageService ¶
func NewImageService(db *database.DB, dockerService *DockerClientService, registryService *ContainerRegistryService, imageUpdateService *ImageUpdateService, vulnerabilityService *VulnerabilityService, eventService *EventService) *ImageService
func (*ImageService) GetImageDetail ¶
func (s *ImageService) GetImageDetail(ctx context.Context, id string) (*imagetypes.DetailSummary, error)
GetImageDetail returns a DetailSummary for the given image ID. It fetches ImageInspect and ImageList concurrently so the size field reflects the same metric shown in the image table (docker image ls / docker system df).
func (*ImageService) GetTotalImageSize ¶
func (s *ImageService) GetTotalImageSize(ctx context.Context) (int64, error)
func (*ImageService) GetUpdateInfoByImageIDs ¶
func (s *ImageService) GetUpdateInfoByImageIDs(ctx context.Context, imageIDs []string) (map[string]*imagetypes.UpdateInfo, error)
GetUpdateInfoByImageIDs returns a map of image ID to UpdateInfo for the given image IDs. This is used by the container service to populate update info for containers.
func (*ImageService) ImageExistsLocally ¶
func (*ImageService) ListImagesPaginated ¶
func (s *ImageService) ListImagesPaginated(ctx context.Context, params pagination.QueryParams) ([]imagetypes.Summary, pagination.Response, error)
func (*ImageService) LoadImageFromReader ¶
func (s *ImageService) LoadImageFromReader(ctx context.Context, reader io.Reader, fileName string, user models.User, maxSizeBytes int64) (*imagetypes.LoadResult, error)
func (*ImageService) PruneImages ¶
func (s *ImageService) PruneImages(ctx context.Context, dangling bool) (*image.PruneReport, error)
func (*ImageService) PullImage ¶
func (s *ImageService) PullImage(ctx context.Context, imageName string, progressWriter io.Writer, user models.User, externalCreds []containerregistry.Credential) error
func (*ImageService) RemoveImage ¶
type ImageUpdateService ¶
type ImageUpdateService struct {
// contains filtered or unexported fields
}
func NewImageUpdateService ¶
func NewImageUpdateService(db *database.DB, settingsService *SettingsService, registryService *ContainerRegistryService, dockerService *DockerClientService, eventService *EventService, notificationService *NotificationService) *ImageUpdateService
func (*ImageUpdateService) CheckAllImages ¶
func (s *ImageUpdateService) CheckAllImages(ctx context.Context, limit int, externalCreds []containerregistry.Credential) (map[string]*imageupdate.Response, error)
func (*ImageUpdateService) CheckImageUpdate ¶
func (s *ImageUpdateService) CheckImageUpdate(ctx context.Context, imageRef string) (*imageupdate.Response, error)
func (*ImageUpdateService) CheckImageUpdateByID ¶
func (s *ImageUpdateService) CheckImageUpdateByID(ctx context.Context, imageID string) (*imageupdate.Response, error)
func (*ImageUpdateService) CheckMultipleImages ¶
func (s *ImageUpdateService) CheckMultipleImages(ctx context.Context, imageRefs []string, externalCreds []containerregistry.Credential) (map[string]*imageupdate.Response, error)
func (*ImageUpdateService) CleanupOrphanedRecords ¶
func (s *ImageUpdateService) CleanupOrphanedRecords(ctx context.Context) error
func (*ImageUpdateService) GetUnnotifiedUpdates ¶
func (s *ImageUpdateService) GetUnnotifiedUpdates(ctx context.Context) (map[string]*models.ImageUpdateRecord, error)
GetUnnotifiedUpdates returns a map of image IDs that have updates but haven't been notified yet
func (*ImageUpdateService) GetUpdateSummary ¶
func (s *ImageUpdateService) GetUpdateSummary(ctx context.Context) (*imageupdate.Summary, error)
func (*ImageUpdateService) MarkUpdatesAsNotified ¶
func (s *ImageUpdateService) MarkUpdatesAsNotified(ctx context.Context, imageIDs []string) error
MarkUpdatesAsNotified marks the given image IDs as having been notified
type JobService ¶
type JobService struct {
OnJobSchedulesChanged func(ctx context.Context, changedKeys []string)
// contains filtered or unexported fields
}
JobService manages configuration for background job schedules.
Intervals are persisted in the existing settings table as individual keys. After updates, the SettingsService cache is reloaded and a callback can be triggered so the running scheduler can reschedule active jobs.
NOTE: This is intentionally separate from SettingsService to keep the API surface job-focused and to centralize schedule validation/rescheduling.
func NewJobService ¶
func NewJobService(db *database.DB, settings *SettingsService, cfg *config.Config) *JobService
func (*JobService) GetJobSchedules ¶
func (s *JobService) GetJobSchedules(ctx context.Context) jobschedule.Config
func (*JobService) ListJobs ¶
func (s *JobService) ListJobs(ctx context.Context) (*jobschedule.JobListResponse, error)
func (*JobService) RunJobNowInline ¶
func (s *JobService) RunJobNowInline(ctx context.Context, jobID string) error
func (*JobService) SetScheduler ¶
func (s *JobService) SetScheduler(scheduler JobRunner)
func (*JobService) UpdateJobSchedules ¶
func (s *JobService) UpdateJobSchedules(ctx context.Context, updates jobschedule.Update) (jobschedule.Config, error)
type NetworkService ¶
type NetworkService struct {
// contains filtered or unexported fields
}
func NewNetworkService ¶
func NewNetworkService(db *database.DB, dockerService *DockerClientService, eventService *EventService) *NetworkService
func (*NetworkService) CreateNetwork ¶
func (s *NetworkService) CreateNetwork(ctx context.Context, name string, options network.CreateOptions, user models.User) (*network.CreateResponse, error)
func (*NetworkService) GetNetworkByID ¶
func (*NetworkService) ListNetworksPaginated ¶
func (s *NetworkService) ListNetworksPaginated(ctx context.Context, params pagination.QueryParams) ([]networktypes.Summary, pagination.Response, networktypes.UsageCounts, error)
func (*NetworkService) PruneNetworks ¶
func (s *NetworkService) PruneNetworks(ctx context.Context) (*network.PruneReport, error)
func (*NetworkService) RemoveNetwork ¶
type NotificationService ¶
type NotificationService struct {
// contains filtered or unexported fields
}
func NewNotificationService ¶
func NewNotificationService(db *database.DB, cfg *config.Config) *NotificationService
func (*NotificationService) CreateOrUpdateSettings ¶
func (s *NotificationService) CreateOrUpdateSettings(ctx context.Context, provider models.NotificationProvider, enabled bool, config models.JSON) (*models.NotificationSettings, error)
func (*NotificationService) DeleteSettings ¶
func (s *NotificationService) DeleteSettings(ctx context.Context, provider models.NotificationProvider) error
func (*NotificationService) GetAllSettings ¶
func (s *NotificationService) GetAllSettings(ctx context.Context) ([]models.NotificationSettings, error)
func (*NotificationService) GetSettingsByProvider ¶
func (s *NotificationService) GetSettingsByProvider(ctx context.Context, provider models.NotificationProvider) (*models.NotificationSettings, error)
func (*NotificationService) MigrateDiscordWebhookUrlToFields ¶
func (s *NotificationService) MigrateDiscordWebhookUrlToFields(ctx context.Context) error
MigrateDiscordWebhookUrlToFields migrates legacy Discord webhookUrl to separate webhookId and token fields. This should be called during bootstrap to ensure existing Discord configurations are preserved.
func (*NotificationService) SendBatchImageUpdateNotification ¶
func (s *NotificationService) SendBatchImageUpdateNotification(ctx context.Context, updates map[string]*imageupdate.Response) error
func (*NotificationService) SendContainerUpdateNotification ¶
func (s *NotificationService) SendContainerUpdateNotification(ctx context.Context, containerName, imageRef, oldDigest, newDigest string) error
func (*NotificationService) SendImageUpdateNotification ¶
func (s *NotificationService) SendImageUpdateNotification(ctx context.Context, imageRef string, updateInfo *imageupdate.Response, eventType models.NotificationEventType) error
func (*NotificationService) SendPruneReportNotification ¶
func (s *NotificationService) SendPruneReportNotification(ctx context.Context, result *system.PruneAllResult) error
func (*NotificationService) SendVulnerabilityNotification ¶
func (s *NotificationService) SendVulnerabilityNotification(ctx context.Context, payload VulnerabilityNotificationPayload) error
SendVulnerabilityNotification notifies all enabled providers that have vulnerability_found event enabled. Only daily summary payloads are sent; legacy per-CVE payloads are ignored.
func (*NotificationService) TestNotification ¶
func (s *NotificationService) TestNotification(ctx context.Context, provider models.NotificationProvider, testType string) error
type OidcService ¶
type OidcService struct {
// contains filtered or unexported fields
}
func NewOidcService ¶
func NewOidcService(authService *AuthService, cfg *config.Config, httpClient *http.Client) *OidcService
func (*OidcService) ExchangeDeviceToken ¶
func (s *OidcService) ExchangeDeviceToken(ctx context.Context, deviceCode string) (*auth.OidcUserInfo, *auth.OidcTokenResponse, error)
ExchangeDeviceToken exchanges a device code for tokens.
func (*OidcService) GenerateAuthURL ¶
func (*OidcService) GetOidcRedirectURL ¶
func (s *OidcService) GetOidcRedirectURL(origin string) string
func (*OidcService) HandleCallback ¶
func (s *OidcService) HandleCallback(ctx context.Context, code, state, storedState, origin string) (*auth.OidcUserInfo, *auth.OidcTokenResponse, error)
func (*OidcService) InitiateDeviceAuth ¶
func (s *OidcService) InitiateDeviceAuth(ctx context.Context) (*auth.OidcDeviceAuthResponse, error)
InitiateDeviceAuth initiates the OIDC device authorization flow.
type ProjectService ¶
type ProjectService struct {
// contains filtered or unexported fields
}
func NewProjectService ¶
func NewProjectService(db *database.DB, settingsService *SettingsService, eventService *EventService, imageService *ImageService, dockerService *DockerClientService) *ProjectService
func (*ProjectService) CreateProject ¶
func (*ProjectService) DeployProject ¶
func (*ProjectService) DestroyProject ¶
func (*ProjectService) DownProject ¶
func (*ProjectService) EnsureProjectImagesPresent ¶
func (s *ProjectService) EnsureProjectImagesPresent(ctx context.Context, projectID string, progressWriter io.Writer, credentials []containerregistry.Credential) error
EnsureProjectImagesPresent checks all compose service images for the project and pulls based on service pull policy: - always/refresh: always pull - missing/if_not_present/default: pull only if local image is missing - never: never pull (fails early if image is missing locally)
func (*ProjectService) GetProjectContent ¶
func (*ProjectService) GetProjectDetails ¶
func (*ProjectService) GetProjectFromDatabaseByID ¶
func (*ProjectService) GetProjectServices ¶
func (s *ProjectService) GetProjectServices(ctx context.Context, projectID string) ([]ProjectServiceInfo, error)
func (*ProjectService) GetProjectStatusCounts ¶
func (s *ProjectService) GetProjectStatusCounts(ctx context.Context) (folderCount, runningProjects, stoppedProjects, totalProjects int, err error)
func (*ProjectService) ListAllProjects ¶
func (*ProjectService) ListProjects ¶
func (s *ProjectService) ListProjects(ctx context.Context, params pagination.QueryParams) ([]project.Details, pagination.Response, error)
func (*ProjectService) PullProjectImages ¶
func (s *ProjectService) PullProjectImages(ctx context.Context, projectID string, progressWriter io.Writer, credentials []containerregistry.Credential) error
func (*ProjectService) RedeployProject ¶
func (*ProjectService) RestartProject ¶
func (*ProjectService) StreamProjectLogs ¶
func (*ProjectService) SyncProjectsFromFileSystem ¶
func (s *ProjectService) SyncProjectsFromFileSystem(ctx context.Context) error
func (*ProjectService) UpdateProject ¶
func (*ProjectService) UpdateProjectIncludeFile ¶
func (s *ProjectService) UpdateProjectIncludeFile(ctx context.Context, projectID, relativePath, content string) error
type ProjectServiceInfo ¶
type ProjectServiceInfo struct {
Name string `json:"name"`
Image string `json:"image"`
Status string `json:"status"`
ContainerID string `json:"container_id"`
ContainerName string `json:"container_name"`
Ports []string `json:"ports"`
Health *string `json:"health,omitempty"`
IconURL string `json:"icon_url,omitempty"`
ServiceConfig *composetypes.ServiceConfig `json:"service_config,omitempty"`
}
type SettingsSearchService ¶
type SettingsSearchService struct {
// contains filtered or unexported fields
}
func NewSettingsSearchService ¶
func NewSettingsSearchService() *SettingsSearchService
func (*SettingsSearchService) GetSettingsCategories ¶
func (s *SettingsSearchService) GetSettingsCategories() []category.Category
GetSettingsCategories returns all available settings categories with their metadata
type SettingsService ¶
type SettingsService struct {
OnImagePollingSettingsChanged func(ctx context.Context)
OnAutoUpdateSettingsChanged func(ctx context.Context)
OnProjectsDirectoryChanged func(ctx context.Context)
OnScheduledPruneSettingsChanged func(ctx context.Context)
OnVulnerabilityScanSettingsChanged func(ctx context.Context)
OnTimeoutSettingsChanged func(ctx context.Context, timeoutSettings map[string]string)
// contains filtered or unexported fields
}
func NewSettingsService ¶
func (*SettingsService) EnsureDefaultSettings ¶
func (s *SettingsService) EnsureDefaultSettings(ctx context.Context) error
func (*SettingsService) EnsureEncryptionKey ¶
func (s *SettingsService) EnsureEncryptionKey(ctx context.Context) (string, error)
func (*SettingsService) GetBoolSetting ¶
func (*SettingsService) GetIntSetting ¶
func (*SettingsService) GetSettingType ¶
func (s *SettingsService) GetSettingType(key string) string
GetSettingType returns the type from the setting metadata
func (*SettingsService) GetSettings ¶
func (*SettingsService) GetSettingsConfig ¶
func (s *SettingsService) GetSettingsConfig() *models.Settings
func (*SettingsService) GetStringSetting ¶
func (s *SettingsService) GetStringSetting(ctx context.Context, key, defaultValue string) string
func (*SettingsService) ListSettings ¶
func (s *SettingsService) ListSettings(all bool) []models.SettingVariable
func (*SettingsService) LoadDatabaseSettings ¶
func (s *SettingsService) LoadDatabaseSettings(ctx context.Context) (err error)
func (*SettingsService) MigrateOidcConfigToFields ¶
func (s *SettingsService) MigrateOidcConfigToFields(ctx context.Context) error
MigrateOidcConfigToFields migrates the legacy JSON authOidcConfig to individual fields, and renames legacy auth* keys to their new oidc* names. This should be called during bootstrap to ensure existing configurations are preserved.
func (*SettingsService) NormalizeProjectsDirectory ¶
func (s *SettingsService) NormalizeProjectsDirectory(ctx context.Context, projectsDirEnv string) error
func (*SettingsService) PersistEnvSettingsIfMissing ¶
func (s *SettingsService) PersistEnvSettingsIfMissing(ctx context.Context) error
func (*SettingsService) PruneUnknownSettings ¶
func (s *SettingsService) PruneUnknownSettings(ctx context.Context) error
func (*SettingsService) SetBoolSetting ¶
func (*SettingsService) SetIntSetting ¶
func (*SettingsService) SetStringSetting ¶
func (s *SettingsService) SetStringSetting(ctx context.Context, key, value string) error
func (*SettingsService) UpdateSetting ¶
func (s *SettingsService) UpdateSetting(ctx context.Context, key, value string) error
func (*SettingsService) UpdateSettings ¶
func (s *SettingsService) UpdateSettings(ctx context.Context, updates settings.Update) ([]models.SettingVariable, error)
type SystemService ¶
type SystemService struct {
// contains filtered or unexported fields
}
func NewSystemService ¶
func NewSystemService( db *database.DB, dockerService *DockerClientService, containerService *ContainerService, imageService *ImageService, volumeService *VolumeService, networkService *NetworkService, settingsService *SettingsService, ) *SystemService
func (*SystemService) ConvertToDockerCompose ¶
func (s *SystemService) ConvertToDockerCompose(parsed *models.DockerRunCommand) (string, string, string, error)
func (*SystemService) GetDiskUsagePath ¶
func (s *SystemService) GetDiskUsagePath(ctx context.Context) string
func (*SystemService) ParseDockerRunCommand ¶
func (s *SystemService) ParseDockerRunCommand(command string) (*models.DockerRunCommand, error)
func (*SystemService) PruneAll ¶
func (s *SystemService) PruneAll(ctx context.Context, req system.PruneAllRequest) (*system.PruneAllResult, error)
func (*SystemService) StartAllContainers ¶
func (s *SystemService) StartAllContainers(ctx context.Context) (*containertypes.ActionResult, error)
func (*SystemService) StartAllStoppedContainers ¶
func (s *SystemService) StartAllStoppedContainers(ctx context.Context) (*containertypes.ActionResult, error)
func (*SystemService) StopAllContainers ¶
func (s *SystemService) StopAllContainers(ctx context.Context) (*containertypes.ActionResult, error)
type SystemUpgradeService ¶
type SystemUpgradeService struct {
// contains filtered or unexported fields
}
func NewSystemUpgradeService ¶
func NewSystemUpgradeService( dockerService *DockerClientService, versionService *VersionService, eventService *EventService, settingsService *SettingsService, ) *SystemUpgradeService
func (*SystemUpgradeService) CanUpgrade ¶
func (s *SystemUpgradeService) CanUpgrade(ctx context.Context) (bool, error)
CanUpgrade checks if self-upgrade is possible
func (*SystemUpgradeService) TriggerUpgradeViaCLI ¶
TriggerUpgradeViaCLI spawns the upgrade CLI command in a separate container This avoids self-termination issues by running the upgrade from outside
type TemplateService ¶
type TemplateService struct {
// contains filtered or unexported fields
}
func NewTemplateService ¶
func NewTemplateService(ctx context.Context, db *database.DB, httpClient *http.Client, settingsService *SettingsService) *TemplateService
func (*TemplateService) CreateRegistry ¶
func (s *TemplateService) CreateRegistry(ctx context.Context, registry *models.TemplateRegistry) error
func (*TemplateService) CreateTemplate ¶
func (s *TemplateService) CreateTemplate(ctx context.Context, template *models.ComposeTemplate) error
func (*TemplateService) DeleteRegistry ¶
func (s *TemplateService) DeleteRegistry(ctx context.Context, id string) error
func (*TemplateService) DeleteTemplate ¶
func (s *TemplateService) DeleteTemplate(ctx context.Context, id string) error
func (*TemplateService) DownloadTemplate ¶
func (s *TemplateService) DownloadTemplate(ctx context.Context, remoteTemplate *models.ComposeTemplate) (*models.ComposeTemplate, error)
func (*TemplateService) FetchTemplateContent ¶
func (s *TemplateService) FetchTemplateContent(ctx context.Context, template *models.ComposeTemplate) (string, string, error)
func (*TemplateService) GetAllTemplates ¶
func (s *TemplateService) GetAllTemplates(ctx context.Context) ([]models.ComposeTemplate, error)
func (*TemplateService) GetAllTemplatesPaginated ¶
func (s *TemplateService) GetAllTemplatesPaginated(ctx context.Context, params pagination.QueryParams) ([]tmpl.Template, pagination.Response, error)
func (*TemplateService) GetComposeTemplate ¶
func (s *TemplateService) GetComposeTemplate() string
func (*TemplateService) GetEnvTemplate ¶
func (s *TemplateService) GetEnvTemplate() string
func (*TemplateService) GetGlobalVariables ¶
func (*TemplateService) GetRegistries ¶
func (s *TemplateService) GetRegistries(ctx context.Context) ([]models.TemplateRegistry, error)
func (*TemplateService) GetTemplate ¶
func (s *TemplateService) GetTemplate(ctx context.Context, id string) (*models.ComposeTemplate, error)
func (*TemplateService) GetTemplateContentWithParsedData ¶
func (s *TemplateService) GetTemplateContentWithParsedData(ctx context.Context, id string) (*tmpl.TemplateContent, error)
GetTemplateContentWithParsedData returns template content along with parsed metadata
func (*TemplateService) ParseComposeServices ¶
func (s *TemplateService) ParseComposeServices(ctx context.Context, composeContent string) []string
ParseComposeServices extracts service names from a compose file content using compose-go
func (*TemplateService) SaveComposeTemplate ¶
func (s *TemplateService) SaveComposeTemplate(content string) error
func (*TemplateService) SaveEnvTemplate ¶
func (s *TemplateService) SaveEnvTemplate(content string) error
func (*TemplateService) SyncLocalTemplatesFromFilesystem ¶
func (s *TemplateService) SyncLocalTemplatesFromFilesystem(ctx context.Context) error
func (*TemplateService) UpdateGlobalVariables ¶
func (*TemplateService) UpdateRegistry ¶
func (s *TemplateService) UpdateRegistry(ctx context.Context, id string, updates *models.TemplateRegistry) error
func (*TemplateService) UpdateTemplate ¶
func (s *TemplateService) UpdateTemplate(ctx context.Context, id string, updates *models.ComposeTemplate) error
type UpdaterService ¶
type UpdaterService struct {
// contains filtered or unexported fields
}
func NewUpdaterService ¶
func NewUpdaterService( db *database.DB, settings *SettingsService, docker *DockerClientService, projects *ProjectService, imageUpdates *ImageUpdateService, registries *ContainerRegistryService, events *EventService, imageSvc *ImageService, notifications *NotificationService, upgrade *SystemUpgradeService, ) *UpdaterService
func (*UpdaterService) ApplyPending ¶
func (*UpdaterService) GetHistory ¶
func (s *UpdaterService) GetHistory(ctx context.Context, limit int) ([]models.AutoUpdateRecord, error)
func (*UpdaterService) GetStatus ¶
func (s *UpdaterService) GetStatus() updater.Status
func (*UpdaterService) UpdateSingleContainer ¶
func (s *UpdaterService) UpdateSingleContainer(ctx context.Context, containerID string) (*updater.Result, error)
UpdateSingleContainer updates a single container by ID to the latest available image. It pulls the new image, stops the container, removes it, and recreates it with the new image.
type UserClaims ¶
type UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
func NewUserService ¶
func NewUserService(db *database.DB) *UserService
func (*UserService) AttachOidcSubjectTransactional ¶
func (s *UserService) AttachOidcSubjectTransactional(ctx context.Context, userID string, subject string, updateFn func(u *models.User)) (*models.User, error)
AttachOidcSubjectTransactional safely links an OIDC subject to the given user inside a DB transaction. It uses a row lock (FOR UPDATE) to prevent concurrent merges from racing and validates that the user isn't already linked to a different subject. The provided updateFn can mutate the user (e.g., roles, display name, tokens, last login) before persisting.
Note: The clause.Locking{Strength: "UPDATE"} statement is used to acquire a row-level lock. This MUST be done inside a transaction to ensure the lock is held until the update is committed.
func (*UserService) CreateDefaultAdmin ¶
func (s *UserService) CreateDefaultAdmin(ctx context.Context) error
func (*UserService) CreateUser ¶
func (*UserService) DeleteUser ¶
func (s *UserService) DeleteUser(ctx context.Context, id string) error
func (*UserService) GetUserByEmail ¶
func (*UserService) GetUserByID ¶
func (*UserService) GetUserByOidcSubjectId ¶
func (*UserService) GetUserByUsername ¶
func (*UserService) HashPassword ¶
func (s *UserService) HashPassword(password string) (string, error)
func (*UserService) ListUsersPaginated ¶
func (s *UserService) ListUsersPaginated(ctx context.Context, params pagination.QueryParams) ([]user.User, pagination.Response, error)
func (*UserService) NeedsPasswordUpgrade ¶
func (s *UserService) NeedsPasswordUpgrade(hash string) bool
func (*UserService) UpdateUser ¶
func (*UserService) UpgradePasswordHash ¶
func (s *UserService) UpgradePasswordHash(ctx context.Context, userID, password string) error
func (*UserService) ValidatePassword ¶
func (s *UserService) ValidatePassword(encodedHash, password string) error
type VersionService ¶
type VersionService struct {
// contains filtered or unexported fields
}
func NewVersionService ¶
func NewVersionService(httpClient *http.Client, disabled bool, version string, revision string, containerRegistryService *ContainerRegistryService, dockerService *DockerClientService) *VersionService
func (*VersionService) GetAppVersionInfo ¶
func (s *VersionService) GetAppVersionInfo(ctx context.Context) *version.Info
GetAppVersionInfo returns application version information including display version
func (*VersionService) GetLatestVersion ¶
func (s *VersionService) GetLatestVersion(ctx context.Context) (string, error)
func (*VersionService) GetVersionInformation ¶
func (*VersionService) IsNewer ¶
func (s *VersionService) IsNewer(latest, current string) bool
func (*VersionService) ReleaseURL ¶
func (s *VersionService) ReleaseURL(version string) string
type VolumeService ¶
type VolumeService struct {
// contains filtered or unexported fields
}
func NewVolumeService ¶
func NewVolumeService(db *database.DB, dockerService *DockerClientService, eventService *EventService, settingsService *SettingsService, containerService *ContainerService, imageService *ImageService, backupVolumeName string) *VolumeService
func (*VolumeService) BackupHasPath ¶
func (*VolumeService) BackupMountWarning ¶
func (s *VolumeService) BackupMountWarning(ctx context.Context) string
func (*VolumeService) CleanupHelperContainers ¶
func (s *VolumeService) CleanupHelperContainers(ctx context.Context)
func (*VolumeService) CleanupOrphanedVolumeHelpers ¶
func (s *VolumeService) CleanupOrphanedVolumeHelpers(ctx context.Context) error
func (*VolumeService) CreateBackup ¶
func (s *VolumeService) CreateBackup(ctx context.Context, volumeName string, user models.User) (*models.VolumeBackup, error)
func (*VolumeService) CreateDirectory ¶
func (*VolumeService) CreateVolume ¶
func (s *VolumeService) CreateVolume(ctx context.Context, options volume.CreateOptions, user models.User) (*volumetypes.Volume, error)
func (*VolumeService) DeleteBackup ¶
func (*VolumeService) DeleteFile ¶
func (*VolumeService) DeleteVolume ¶
func (*VolumeService) DownloadBackup ¶
func (s *VolumeService) DownloadBackup(ctx context.Context, backupID string, user *models.User) (io.ReadCloser, int64, error)
func (*VolumeService) DownloadFile ¶
func (s *VolumeService) DownloadFile(ctx context.Context, volumeName, filePath string) (io.ReadCloser, int64, error)
func (*VolumeService) GetFileContent ¶
func (*VolumeService) GetVolumeByName ¶
func (s *VolumeService) GetVolumeByName(ctx context.Context, name string) (*volumetypes.Volume, error)
func (*VolumeService) GetVolumeSizes ¶
func (s *VolumeService) GetVolumeSizes(ctx context.Context) (map[string]VolumeSizeData, error)
GetVolumeSizes returns disk usage data for all volumes. This is a slow operation as it calls Docker's DiskUsage API.
func (*VolumeService) GetVolumeUsage ¶
func (*VolumeService) ListBackupFiles ¶
func (*VolumeService) ListBackups ¶
func (s *VolumeService) ListBackups(ctx context.Context, volumeName string) ([]models.VolumeBackup, error)
func (*VolumeService) ListBackupsPaginated ¶
func (s *VolumeService) ListBackupsPaginated(ctx context.Context, volumeName string, params pagination.QueryParams) ([]models.VolumeBackup, pagination.Response, error)
func (*VolumeService) ListDirectory ¶
func (s *VolumeService) ListDirectory(ctx context.Context, volumeName, dirPath string) ([]volumetypes.FileEntry, error)
func (*VolumeService) ListVolumesPaginated ¶
func (s *VolumeService) ListVolumesPaginated(ctx context.Context, params pagination.QueryParams, includeInternal bool) ([]volumetypes.Volume, pagination.Response, volumetypes.UsageCounts, error)
func (*VolumeService) PruneVolumes ¶
func (s *VolumeService) PruneVolumes(ctx context.Context) (*volumetypes.PruneReport, error)
func (*VolumeService) PruneVolumesWithOptions ¶
func (s *VolumeService) PruneVolumesWithOptions(ctx context.Context, all bool) (*volumetypes.PruneReport, error)
func (*VolumeService) RestoreBackup ¶
func (*VolumeService) RestoreBackupFiles ¶
func (*VolumeService) UploadAndRestore ¶
type VolumeSizeData ¶
VolumeSizeData holds size information for a volume.
type VulnerabilityNotificationPayload ¶
type VulnerabilityNotificationPayload struct {
CVEID string // e.g. CVE-2024-1234
CVELink string // e.g. https://nvd.nist.gov/vuln/detail/CVE-2024-1234
Severity string // CRITICAL, HIGH, MEDIUM, LOW, UNKNOWN
ImageName string // e.g. nginx:latest
FixedVersion string
PkgName string // optional
InstalledVersion string // optional
}
VulnerabilityNotificationPayload is the data sent to all providers for vulnerability_found events. Only vulnerabilities with a fixed version should trigger this notification.
type VulnerabilityService ¶
type VulnerabilityService struct {
// contains filtered or unexported fields
}
VulnerabilityService handles vulnerability scanning of container images
func NewVulnerabilityService ¶
func NewVulnerabilityService(db *database.DB, dockerService *DockerClientService, eventService *EventService, settingsService *SettingsService, notificationService *NotificationService) *VulnerabilityService
NewVulnerabilityService creates a new VulnerabilityService instance
func (*VulnerabilityService) CleanupOrphanedScanRecords ¶
func (s *VulnerabilityService) CleanupOrphanedScanRecords(ctx context.Context) (deleted int64, err error)
CleanupOrphanedScanRecords removes vulnerability scan records for images that no longer exist in Docker. This keeps "images scanned" counts in sync (e.g. avoids "5/3" when images were deleted after being scanned). Safe to call even when no images exist; returns the number of records deleted.
func (*VulnerabilityService) DeleteScanResult ¶
func (s *VulnerabilityService) DeleteScanResult(ctx context.Context, imageID string) error
DeleteScanResult deletes the scan result for an image
func (*VulnerabilityService) DeleteScanResultsByImageIDs ¶
func (s *VulnerabilityService) DeleteScanResultsByImageIDs(ctx context.Context, imageIDs []string) error
DeleteScanResultsByImageIDs deletes scan results for multiple images in one query.
func (*VulnerabilityService) GetEnvironmentSummary ¶
func (s *VulnerabilityService) GetEnvironmentSummary(ctx context.Context) (*vulnerability.EnvironmentVulnerabilitySummary, error)
GetEnvironmentSummary returns aggregated vulnerability counts across all images.
func (*VulnerabilityService) GetIgnoreRecordsForImage ¶
func (s *VulnerabilityService) GetIgnoreRecordsForImage(ctx context.Context, envID string, imageID string) ([]models.VulnerabilityIgnore, error)
GetIgnoreRecordsForImage retrieves all ignore records for a specific image
func (*VulnerabilityService) GetScanResult ¶
func (s *VulnerabilityService) GetScanResult(ctx context.Context, imageID string) (*vulnerability.ScanResult, error)
GetScanResult retrieves the most recent scan result for an image
func (*VulnerabilityService) GetScanSummariesByImageIDs ¶
func (s *VulnerabilityService) GetScanSummariesByImageIDs(ctx context.Context, imageIDs []string) (map[string]*vulnerability.ScanSummary, error)
GetScanSummariesByImageIDs retrieves scan summaries for multiple images
func (*VulnerabilityService) GetScanSummary ¶
func (s *VulnerabilityService) GetScanSummary(ctx context.Context, imageID string) (*vulnerability.ScanSummary, error)
GetScanSummary retrieves just the summary for an image (for list views)
func (*VulnerabilityService) GetTrivyVersion ¶
func (s *VulnerabilityService) GetTrivyVersion(ctx context.Context) string
GetTrivyVersion returns the Trivy version from the Trivy container image
func (*VulnerabilityService) IgnoreVulnerability ¶
func (s *VulnerabilityService) IgnoreVulnerability(ctx context.Context, envID string, payload *vulnerability.IgnorePayload) (*models.VulnerabilityIgnore, error)
IgnoreVulnerability creates a new ignore record for a vulnerability
func (*VulnerabilityService) ListAllVulnerabilities ¶
func (s *VulnerabilityService) ListAllVulnerabilities(ctx context.Context, envID string, params pagination.QueryParams) ([]vulnerability.VulnerabilityWithImage, pagination.Response, error)
ListAllVulnerabilities returns a paginated list of vulnerabilities across all scanned images.
func (*VulnerabilityService) ListIgnoredVulnerabilities ¶
func (s *VulnerabilityService) ListIgnoredVulnerabilities(ctx context.Context, envID string, params pagination.QueryParams) ([]vulnerability.IgnoredVulnerability, pagination.Response, error)
ListIgnoredVulnerabilities returns a list of ignored vulnerabilities for an environment
func (*VulnerabilityService) ListVulnerabilities ¶
func (s *VulnerabilityService) ListVulnerabilities(ctx context.Context, imageID string, params pagination.QueryParams) ([]vulnerability.Vulnerability, pagination.Response, error)
ListVulnerabilities returns a paginated, filtered list of vulnerabilities for an image.
func (*VulnerabilityService) ScanAllImages ¶
func (s *VulnerabilityService) ScanAllImages(ctx context.Context, envID string, user models.User) (scanned, failed int, err error)
ScanAllImages scans all Docker images for vulnerabilities. It is intended for use by the scheduled vulnerability scan job. A single long-running Trivy container is created and reused for every image via docker exec, which avoids the overhead of creating/destroying a container per scan. The caller-supplied user is recorded in the event log.
func (*VulnerabilityService) ScanImage ¶
func (s *VulnerabilityService) ScanImage(ctx context.Context, envID string, imageID string, user models.User) (*vulnerability.ScanResult, error)
ScanImage scans an image for vulnerabilities using Trivy
func (*VulnerabilityService) UnignoreVulnerability ¶
func (s *VulnerabilityService) UnignoreVulnerability(ctx context.Context, envID string, ignoreID string) error
UnignoreVulnerability removes an ignore record
Source Files
¶
- api_key_service.go
- app_images_service.go
- apprise_service.go
- auth_service.go
- container_registry_service.go
- container_service.go
- customize_search_service.go
- docker_client_service.go
- environment_service.go
- event_service.go
- font_service.go
- git_repository_service.go
- gitops_sync_service.go
- image_service.go
- image_update_service.go
- job_service.go
- network_service.go
- notification_service.go
- oidc_service.go
- project_service.go
- settings_search_service.go
- settings_service.go
- system_service.go
- system_upgrade_service.go
- template_service.go
- updater_service.go
- user_service.go
- version_service.go
- volume_service.go
- vulnerability_service.go