models

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EventTypeContainerStart and the constants below enumerate Arcane event types.
	EventTypeContainerStart   EventType = "container.start"
	EventTypeContainerStop    EventType = "container.stop"
	EventTypeContainerRestart EventType = "container.restart"
	EventTypeContainerDelete  EventType = "container.delete"
	EventTypeContainerCreate  EventType = "container.create"
	EventTypeContainerScan    EventType = "container.scan"
	EventTypeContainerUpdate  EventType = "container.update"
	EventTypeContainerDeploy  EventType = "container.deploy"
	EventTypeContainerError   EventType = "container.error"

	EventTypeImagePull              EventType = "image.pull"
	EventTypeImageLoad              EventType = "image.load"
	EventTypeImageDelete            EventType = "image.delete"
	EventTypeImageScan              EventType = "image.scan"
	EventTypeImageError             EventType = "image.error"
	EventTypeImageVulnerabilityScan EventType = "image.vulnerability_scan"

	EventTypeProjectDeploy EventType = "project.deploy"
	EventTypeProjectDelete EventType = "project.delete"
	EventTypeProjectStart  EventType = "project.start"
	EventTypeProjectStop   EventType = "project.stop"
	EventTypeProjectCreate EventType = "project.create"
	EventTypeProjectUpdate EventType = "project.update"
	EventTypeProjectError  EventType = "project.error"

	EventTypeGitRepositoryCreate EventType = "git.repository.create"
	EventTypeGitRepositoryUpdate EventType = "git.repository.update"
	EventTypeGitRepositoryDelete EventType = "git.repository.delete"
	EventTypeGitRepositoryTest   EventType = "git.repository.test"
	EventTypeGitRepositoryError  EventType = "git.repository.error"

	EventTypeGitSyncCreate EventType = "git.sync.create"
	EventTypeGitSyncUpdate EventType = "git.sync.update"
	EventTypeGitSyncDelete EventType = "git.sync.delete"
	EventTypeGitSyncRun    EventType = "git.sync.run"
	EventTypeGitSyncError  EventType = "git.sync.error"

	EventTypeVolumeCreate EventType = "volume.create"
	EventTypeVolumeDelete EventType = "volume.delete"
	EventTypeVolumeError  EventType = "volume.error"

	EventTypeVolumeFileCreate EventType = "volume.file.create"
	EventTypeVolumeFileDelete EventType = "volume.file.delete"
	EventTypeVolumeFileUpload EventType = "volume.file.upload"

	EventTypeVolumeBackupCreate       EventType = "volume.backup.create"
	EventTypeVolumeBackupDelete       EventType = "volume.backup.delete"
	EventTypeVolumeBackupRestore      EventType = "volume.backup.restore"
	EventTypeVolumeBackupRestoreFiles EventType = "volume.backup.restore_files"
	EventTypeVolumeBackupDownload     EventType = "volume.backup.download"

	EventTypeNetworkCreate EventType = "network.create"
	EventTypeNetworkDelete EventType = "network.delete"
	EventTypeNetworkError  EventType = "network.error"

	EventTypeSystemPrune       EventType = "system.prune"
	EventTypeUserLogin         EventType = "user.login"
	EventTypeUserLogout        EventType = "user.logout"
	EventTypeFederatedExchange EventType = "federated.exchange"
	EventTypeSystemAutoUpdate  EventType = "system.auto_update"
	EventTypeSystemUpgrade     EventType = "system.upgrade"

	EventTypeEnvironmentCreate            EventType = "environment.create"
	EventTypeEnvironmentConnect           EventType = "environment.connect"
	EventTypeEnvironmentDisconnect        EventType = "environment.disconnect"
	EventTypeEnvironmentUpdate            EventType = "environment.update"
	EventTypeEnvironmentDelete            EventType = "environment.delete"
	EventTypeEnvironmentApiKeyRegenerated EventType = "environment.api_key.regenerated"
	EventTypeEnvironmentMTLSCAGenerated   EventType = "environment.mtls.ca_generated"
	EventTypeEnvironmentMTLSCertIssued    EventType = "environment.mtls.cert_issued"
	EventTypeEnvironmentMTLSEnroll        EventType = "environment.mtls.enroll"
	EventTypeEnvironmentMTLSDownload      EventType = "environment.mtls.download"

	EventTypeWebhookCreate  EventType = "webhook.create"
	EventTypeWebhookUpdate  EventType = "webhook.update"
	EventTypeWebhookDelete  EventType = "webhook.delete"
	EventTypeWebhookTrigger EventType = "webhook.trigger"

	// EventSeverityInfo and the constants below enumerate event severities.
	EventSeverityInfo    EventSeverity = "info"
	EventSeverityWarning EventSeverity = "warning"
	EventSeverityError   EventSeverity = "error"
	EventSeveritySuccess EventSeverity = "success"
)
View Source
const (
	FederatedCredentialMatchExact = "exact"
	FederatedCredentialMatchGlob  = "glob"
)
View Source
const (
	UpdateTypeDigest = "digest"
	UpdateTypeTag    = "tag"
)
View Source
const (
	RoleAssignmentSourceManual = "manual"
	RoleAssignmentSourceOidc   = "oidc"
)

Assignment source values stored in UserRoleAssignment.Source.

View Source
const (
	OidcMappingSourceManual = "manual"
	OidcMappingSourceEnv    = "env"
)
View Source
const (
	UserSessionSourceLocal     = "local"
	UserSessionSourceOidc      = "oidc"
	UserSessionSourceFederated = "federated"
)
View Source
const (
	ScanStatusPending   = "pending"
	ScanStatusScanning  = "scanning"
	ScanStatusCompleted = "completed"
	ScanStatusFailed    = "failed"
)

Scan status constants

View Source
const (
	WebhookTargetTypeContainer = "container"
	WebhookTargetTypeProject   = "project"
	WebhookTargetTypeUpdater   = "updater"
	WebhookTargetTypeGitOps    = "gitops"

	WebhookActionTypeUpdate   = "update"
	WebhookActionTypeStart    = "start"
	WebhookActionTypeStop     = "stop"
	WebhookActionTypeRestart  = "restart"
	WebhookActionTypeRedeploy = "redeploy"
	WebhookActionTypeUp       = "up"
	WebhookActionTypeDown     = "down"
	WebhookActionTypeRun      = "run"
	WebhookActionTypeSync     = "sync"
)

Variables

This section is empty.

Functions

func IsValidNotificationProvider

func IsValidNotificationProvider(provider NotificationProvider) bool

Types

type APIError

type APIError struct {
	Message    string       `json:"message"`
	Code       APIErrorCode `json:"code"`
	StatusCode int          `json:"statusCode"`
	Details    any          `json:"details,omitempty"`
}

func NewAPIError

func NewAPIError(message string, code APIErrorCode, statusCode int) *APIError

NewAPIError creates a new APIError

func NewAPIErrorWithDetails

func NewAPIErrorWithDetails(message string, code APIErrorCode, statusCode int, details any) *APIError

func NewConflictError

func NewConflictError(message string) *APIError

func NewInternalServerError

func NewInternalServerError(message string) *APIError

func NewNotFoundError

func NewNotFoundError(message string) *APIError

func NewValidationError

func NewValidationError(message string, details any) *APIError

func ToAPIError

func ToAPIError(err error) *APIError

func (*APIError) Error

func (e *APIError) Error() string

func (*APIError) HTTPStatus

func (e *APIError) HTTPStatus() int

type APIErrorCode

type APIErrorCode string
const (
	APIErrorCodeBadRequest          APIErrorCode = "BAD_REQUEST"
	APIErrorCodeUnauthorized        APIErrorCode = "UNAUTHORIZED"
	APIErrorCodeForbidden           APIErrorCode = "FORBIDDEN"
	APIErrorCodeNotFound            APIErrorCode = "NOT_FOUND"
	APIErrorCodeConflict            APIErrorCode = "CONFLICT"
	APIErrorCodeInternalServerError APIErrorCode = "INTERNAL_SERVER_ERROR"
	APIErrorCodeDockerAPIError      APIErrorCode = "DOCKER_API_ERROR"
	APIErrorCodeValidationError     APIErrorCode = "VALIDATION_ERROR"
	APIErrorCodeTimeout             APIErrorCode = "TIMEOUT"
)

type APIErrorResponse

type APIErrorResponse struct {
	Success bool         `json:"success"`
	Error   string       `json:"error"`
	Code    APIErrorCode `json:"code"`
	Details any          `json:"details,omitempty"`
}

type APISuccessResponse

type APISuccessResponse struct {
	Success bool   `json:"success"`
	Data    any    `json:"data,omitempty"`
	Message string `json:"message,omitempty"`
}

type Activity

type Activity struct {
	BaseModel

	EnvironmentID        string         `json:"environmentId" gorm:"column:environment_id;not null;index" sortable:"true"`
	Type                 ActivityType   `json:"type" gorm:"column:type;not null;index" sortable:"true"`
	Status               ActivityStatus `json:"status" gorm:"column:status;not null;index" sortable:"true"`
	ResourceType         *string        `json:"resourceType,omitempty" gorm:"column:resource_type;index" sortable:"true"`
	ResourceID           *string        `json:"resourceId,omitempty" gorm:"column:resource_id;index"`
	ResourceName         *string        `json:"resourceName,omitempty" gorm:"column:resource_name" sortable:"true"`
	Progress             *int           `json:"progress,omitempty" gorm:"column:progress"`
	Step                 string         `json:"step,omitempty" gorm:"column:step"`
	LatestMessage        string         `json:"latestMessage,omitempty" gorm:"column:latest_message"`
	StartedByUserID      *string        `json:"startedByUserId,omitempty" gorm:"column:started_by_user_id;index"`
	StartedByUsername    *string        `json:"startedByUsername,omitempty" gorm:"column:started_by_username"`
	StartedByDisplayName *string        `json:"startedByDisplayName,omitempty" gorm:"column:started_by_display_name"`
	StartedAt            time.Time      `json:"startedAt" gorm:"column:started_at;not null" sortable:"true"`
	EndedAt              *time.Time     `json:"endedAt,omitempty" gorm:"column:ended_at" sortable:"true"`
	DurationMs           *int64         `json:"durationMs,omitempty" gorm:"column:duration_ms" sortable:"true"`
	Error                *string        `json:"error,omitempty" gorm:"column:error"`
	Metadata             JSON           `json:"metadata,omitempty" gorm:"type:text"`
}

func (Activity) TableName

func (Activity) TableName() string

type ActivityMessage

type ActivityMessage struct {
	BaseModel

	ActivityID string               `json:"activityId" gorm:"column:activity_id;not null;index"`
	Level      ActivityMessageLevel `json:"level" gorm:"column:level;not null"`
	Message    string               `json:"message" gorm:"column:message;not null"`
	Payload    JSON                 `json:"payload,omitempty" gorm:"type:text"`
	Activity   *Activity            `json:"-" gorm:"foreignKey:ActivityID;constraint:OnDelete:CASCADE"`
}

func (ActivityMessage) TableName

func (ActivityMessage) TableName() string

type ActivityMessageLevel

type ActivityMessageLevel string
const (
	ActivityMessageLevelInfo    ActivityMessageLevel = "info"
	ActivityMessageLevelWarning ActivityMessageLevel = "warning"
	ActivityMessageLevelError   ActivityMessageLevel = "error"
	ActivityMessageLevelSuccess ActivityMessageLevel = "success"
)

type ActivityStatus

type ActivityStatus string
const (
	ActivityStatusQueued    ActivityStatus = "queued"
	ActivityStatusRunning   ActivityStatus = "running"
	ActivityStatusSuccess   ActivityStatus = "success"
	ActivityStatusFailed    ActivityStatus = "failed"
	ActivityStatusCancelled ActivityStatus = "cancelled"
)

type ActivityType

type ActivityType string
const (
	ActivityTypeImagePull         ActivityType = "image_pull"
	ActivityTypeImageBuild        ActivityType = "image_build"
	ActivityTypeImageUpdateCheck  ActivityType = "image_update_check"
	ActivityTypeProjectPull       ActivityType = "project_pull"
	ActivityTypeProjectBuild      ActivityType = "project_build"
	ActivityTypeProjectDeploy     ActivityType = "project_deploy"
	ActivityTypeProjectRedeploy   ActivityType = "project_redeploy"
	ActivityTypeProjectDown       ActivityType = "project_down"
	ActivityTypeProjectRestart    ActivityType = "project_restart"
	ActivityTypeProjectDestroy    ActivityType = "project_destroy"
	ActivityTypeContainerStart    ActivityType = "container_start"
	ActivityTypeContainerStop     ActivityType = "container_stop"
	ActivityTypeContainerRestart  ActivityType = "container_restart"
	ActivityTypeContainerRedeploy ActivityType = "container_redeploy"
	ActivityTypeContainerDelete   ActivityType = "container_delete"
	ActivityTypeVulnerabilityScan ActivityType = "vulnerability_scan"
	ActivityTypeAutoUpdate        ActivityType = "auto_update"
	ActivityTypeSystemPrune       ActivityType = "system_prune"
	ActivityTypeResourceAction    ActivityType = "resource_action"
)

type ApiKey

type ApiKey struct {
	BaseModel

	Name          string     `json:"name" gorm:"column:name;not null" sortable:"true"`
	Description   *string    `json:"description,omitempty" gorm:"column:description"`
	KeyHash       string     `json:"-" gorm:"column:key_hash;not null"`
	KeyPrefix     string     `json:"keyPrefix" gorm:"column:key_prefix;not null"`
	ManagedBy     *string    `json:"-" gorm:"column:managed_by"`
	UserID        *string    `json:"userId,omitempty" gorm:"column:user_id"`
	EnvironmentID *string    `json:"environmentId,omitempty" gorm:"column:environment_id"`
	ExpiresAt     *time.Time `json:"expiresAt,omitempty" gorm:"column:expires_at" sortable:"true"`
	LastUsedAt    *time.Time `json:"lastUsedAt,omitempty" gorm:"column:last_used_at" sortable:"true"`
}

func (ApiKey) TableName

func (ApiKey) TableName() string

type ApiKeyPermission

type ApiKeyPermission struct {
	BaseModel

	ApiKeyID      string  `json:"apiKeyId" gorm:"column:api_key_id;not null;index"`
	Permission    string  `json:"permission" gorm:"column:permission;not null"`
	EnvironmentID *string `json:"environmentId,omitempty" gorm:"column:environment_id"`
}

ApiKeyPermission is one permission grant on an API key, optionally scoped to a single environment. Permissions are stored per-row (rather than as a JSON column on api_keys) so we can index by (api_key_id, permission) for fast lookups in the auth bridge.

func (ApiKeyPermission) TableName

func (ApiKeyPermission) TableName() string

type AutoUpdateRecord

type AutoUpdateRecord struct {
	BaseModel

	ResourceID       string           `json:"resourceId"`
	ResourceType     string           `json:"resourceType"`
	ResourceName     string           `json:"resourceName"`
	Status           AutoUpdateStatus `json:"status"`
	StartTime        time.Time        `json:"startTime"`
	EndTime          *time.Time       `json:"endTime,omitempty"`
	UpdateAvailable  bool             `json:"updateAvailable"`
	UpdateApplied    bool             `json:"updateApplied"`
	OldImageVersions JSON             `json:"oldImageVersions,omitempty" gorm:"type:text"`
	NewImageVersions JSON             `json:"newImageVersions,omitempty" gorm:"type:text"`
	Error            *string          `json:"error,omitempty"`
	Details          JSON             `json:"details,omitempty" gorm:"type:text"`
}

func (AutoUpdateRecord) TableName

func (AutoUpdateRecord) TableName() string

type AutoUpdateStatus

type AutoUpdateStatus string
const (
	AutoUpdateStatusPending   AutoUpdateStatus = "pending"
	AutoUpdateStatusChecking  AutoUpdateStatus = "checking"
	AutoUpdateStatusUpdating  AutoUpdateStatus = "updating"
	AutoUpdateStatusCompleted AutoUpdateStatus = "completed"
	AutoUpdateStatusFailed    AutoUpdateStatus = "failed"
	AutoUpdateStatusSkipped   AutoUpdateStatus = "skipped"
	AutoUpdateStatusRestarted AutoUpdateStatus = "restarted"
)

type BaseModel

type BaseModel struct {
	ID        string     `json:"id" gorm:"primaryKey;type:text"`
	CreatedAt time.Time  `json:"createdAt" gorm:"column:created_at" sortable:"true"`
	UpdatedAt *time.Time `json:"updatedAt,omitempty" gorm:"column:updated_at"`
}

func (*BaseModel) BeforeCreate

func (m *BaseModel) BeforeCreate(_ *gorm.DB) (err error)

func (*BaseModel) BeforeUpdate

func (m *BaseModel) BeforeUpdate(_ *gorm.DB) (err error)

type ComposeTemplate

type ComposeTemplate struct {
	BaseModel

	Name        string                   `json:"name"`
	Description string                   `json:"description"`
	Content     string                   `json:"content" gorm:"type:text"`
	EnvContent  *string                  `json:"envContent,omitempty" gorm:"type:text"`
	IsCustom    bool                     `json:"isCustom"`
	IsRemote    bool                     `json:"isRemote"`
	RegistryID  *string                  `json:"registryId,omitempty"`
	Registry    *TemplateRegistry        `json:"registry,omitempty" gorm:"foreignKey:RegistryID;references:ID"`
	Metadata    *ComposeTemplateMetadata `json:"metadata,omitempty" gorm:"embedded;embeddedPrefix:meta_"`
}

func (ComposeTemplate) TableName

func (ComposeTemplate) TableName() string

type ComposeTemplateMetadata

type ComposeTemplateMetadata struct {
	Version          *string  `json:"version,omitempty"`
	Author           *string  `json:"author,omitempty"`
	Tags             []string `json:"tags,omitempty" gorm:"serializer:json"`
	RemoteURL        *string  `json:"remoteUrl,omitempty"`
	EnvURL           *string  `json:"envUrl,omitempty"`
	DocumentationURL *string  `json:"documentationUrl,omitempty"`
	IconURL          *string  `json:"iconUrl,omitempty"`
}

type ConflictError

type ConflictError struct {
	Message string
}

func (*ConflictError) Error

func (e *ConflictError) Error() string

type ContainerRegistry

type ContainerRegistry struct {
	BaseModel

	URL                 string     `json:"url" sortable:"true"`
	Username            string     `json:"username" sortable:"true"`
	Token               string     `json:"token"`
	Description         *string    `json:"description,omitempty" sortable:"true"`
	Insecure            bool       `json:"insecure" sortable:"true"`
	Enabled             bool       `json:"enabled" sortable:"true"`
	RegistryType        string     `json:"registryType" sortable:"true"`
	AWSAccessKeyID      string     `json:"awsAccessKeyId"`
	AWSSecretAccessKey  string     `json:"awsSecretAccessKey"`
	AWSRegion           string     `json:"awsRegion"`
	ECRToken            string     `json:"ecrToken"`
	ECRTokenGeneratedAt *time.Time `json:"ecrTokenGeneratedAt"`
	CreatedAt           time.Time  `json:"createdAt" sortable:"true"`
	UpdatedAt           time.Time  `json:"updatedAt" sortable:"true"`
}

func (ContainerRegistry) TableName

func (ContainerRegistry) TableName() string

type CreateContainerRegistryRequest

type CreateContainerRegistryRequest struct {
	URL                string  `json:"url" binding:"required"`
	Username           string  `json:"username"`
	Token              string  `json:"token"`
	Description        *string `json:"description"`
	Insecure           *bool   `json:"insecure"`
	Enabled            *bool   `json:"enabled"`
	RegistryType       string  `json:"registryType"`
	AWSAccessKeyID     string  `json:"awsAccessKeyId"`
	AWSSecretAccessKey string  `json:"awsSecretAccessKey"`
	AWSRegion          string  `json:"awsRegion"`
}

type CreateGitRepositoryRequest

type CreateGitRepositoryRequest struct {
	Name                   string  `json:"name" binding:"required"`
	URL                    string  `json:"url" binding:"required"`
	AuthType               string  `json:"authType" binding:"required,oneof=none http ssh"`
	Username               string  `json:"username,omitempty"`
	Token                  string  `json:"token,omitempty"`
	SSHKey                 string  `json:"sshKey,omitempty"`
	SSHHostKeyVerification string  `json:"sshHostKeyVerification,omitempty" binding:"omitempty,oneof=strict accept_new skip"`
	Description            *string `json:"description,omitempty"`
	Enabled                *bool   `json:"enabled,omitempty"`
}

type CustomizeItem

type CustomizeItem struct {
	// Defaults category
	DefaultProjectTemplate   CustomizeVariable `` /* 213-byte string literal not displayed */
	DefaultContainerSettings CustomizeVariable `` /* 222-byte string literal not displayed */
	DefaultNetworkMode       CustomizeVariable `` /* 201-byte string literal not displayed */

	// Templates category
	CustomTemplates    CustomizeVariable `` /* 346-byte string literal not displayed */
	TemplateCategories CustomizeVariable `` /* 196-byte string literal not displayed */
	TemplateValidation CustomizeVariable `` /* 190-byte string literal not displayed */

	// Registries category
	ContainerRegistries CustomizeVariable `` /* 363-byte string literal not displayed */
	RegistryCredentials CustomizeVariable `` /* 218-byte string literal not displayed */
	RegistryMirrors     CustomizeVariable `` /* 187-byte string literal not displayed */

	// Variables category
	GlobalVariables   CustomizeVariable `` /* 346-byte string literal not displayed */
	SecretVariables   CustomizeVariable `` /* 196-byte string literal not displayed */
	VariableTemplates CustomizeVariable `` /* 202-byte string literal not displayed */

	// Git repositories category
	GitRepositories        CustomizeVariable `` /* 398-byte string literal not displayed */
	GitRepositoryDefaults  CustomizeVariable `` /* 220-byte string literal not displayed */
	GitRepositoryTemplates CustomizeVariable `` /* 205-byte string literal not displayed */
}

CustomizeItem represents a customization configuration item This struct uses reflection tags to define customization categories and metadata Categories must be grouped together and use `catmeta` tag for category-level metadata

type CustomizeVariable

type CustomizeVariable struct {
	Value string
}

type DiscordConfig

type DiscordConfig struct {
	WebhookID string                         `json:"webhookId"`
	Token     string                         `json:"token"`
	Username  string                         `json:"username,omitempty"`
	AvatarURL string                         `json:"avatarUrl,omitempty"`
	Events    map[NotificationEventType]bool `json:"events,omitempty"`
}

type DockerAPIError

type DockerAPIError struct {
	Message    string
	StatusCode int
	Details    any
}

func (*DockerAPIError) Error

func (e *DockerAPIError) Error() string

func (*DockerAPIError) HTTPStatus

func (e *DockerAPIError) HTTPStatus() int

type EmailAuthMode

type EmailAuthMode string
const (
	EmailAuthModeAuto    EmailAuthMode = "auto"
	EmailAuthModePlain   EmailAuthMode = "plain"
	EmailAuthModeLogin   EmailAuthMode = "login"
	EmailAuthModeCRAMMD5 EmailAuthMode = "crammd5"
)

type EmailConfig

type EmailConfig struct {
	SMTPHost     string                         `json:"smtpHost"`
	SMTPPort     int                            `json:"smtpPort"`
	SMTPUsername string                         `json:"smtpUsername"`
	SMTPPassword string                         `json:"smtpPassword"`
	FromAddress  string                         `json:"fromAddress"`
	ToAddresses  []string                       `json:"toAddresses"`
	TLSMode      EmailTLSMode                   `json:"tlsMode"`
	AuthMode     EmailAuthMode                  `json:"authMode,omitempty"`
	Events       map[NotificationEventType]bool `json:"events,omitempty"`
}

type EmailTLSMode

type EmailTLSMode string
const (
	EmailTLSModeNone     EmailTLSMode = "none"
	EmailTLSModeStartTLS EmailTLSMode = "starttls"
	EmailTLSModeSSL      EmailTLSMode = "ssl"
)

type Environment

type Environment struct {
	BaseModel

	Name                string     `json:"name" sortable:"true"`
	ApiUrl              string     `json:"apiUrl" gorm:"column:api_url" sortable:"true"`
	Status              string     `json:"status" sortable:"true"`
	Enabled             bool       `json:"enabled" sortable:"true"`
	IsEdge              bool       `json:"isEdge" gorm:"column:is_edge;default:false"`
	Hidden              bool       `json:"hidden" gorm:"column:hidden;default:false"`
	LastSeen            *time.Time `json:"lastSeen" gorm:"column:last_seen"`
	AccessToken         *string    `json:"-" gorm:"column:access_token"`
	ApiKeyID            *string    `json:"-" gorm:"column:api_key_id"`
	ParentEnvironmentID *string    `json:"-" gorm:"column:parent_environment_id"`
	SwarmNodeID         *string    `json:"-" gorm:"column:swarm_node_id"`
}

func (Environment) TableName

func (Environment) TableName() string

type EnvironmentStatus

type EnvironmentStatus string
const (
	EnvironmentStatusOnline  EnvironmentStatus = "online"
	EnvironmentStatusStandby EnvironmentStatus = "standby"
	EnvironmentStatusOffline EnvironmentStatus = "offline"
	EnvironmentStatusError   EnvironmentStatus = "error"
	EnvironmentStatusPending EnvironmentStatus = "pending"
)

type Event

type Event struct {
	BaseModel

	Type          EventType     `json:"type" sortable:"true"`
	Severity      EventSeverity `json:"severity" sortable:"true"`
	Title         string        `json:"title" sortable:"true"`
	Description   string        `json:"description"`
	ResourceType  *string       `json:"resourceType,omitempty" sortable:"true"`
	ResourceID    *string       `json:"resourceId,omitempty" sortable:"true"`
	ResourceName  *string       `json:"resourceName,omitempty" sortable:"true"`
	UserID        *string       `json:"userId,omitempty" sortable:"true"`
	Username      *string       `json:"username,omitempty" sortable:"true"`
	EnvironmentID *string       `json:"environmentId,omitempty"`
	Metadata      JSON          `json:"metadata,omitempty" gorm:"type:text"`
	Timestamp     time.Time     `json:"timestamp" sortable:"true"`
}

func (Event) TableName

func (Event) TableName() string

type EventSeverity

type EventSeverity string

type EventType

type EventType string

type FederatedCredential

type FederatedCredential struct {
	BaseModel

	Name            string       `json:"name" gorm:"column:name;not null" sortable:"true"`
	Description     *string      `json:"description,omitempty" gorm:"column:description"`
	Enabled         bool         `json:"enabled" gorm:"column:enabled;not null;default:false;index" sortable:"true"`
	IssuerURL       string       `json:"issuerUrl" gorm:"column:issuer_url;not null;index" sortable:"true"`
	Audiences       StringSlice  `json:"audiences" gorm:"column:audiences;type:text;not null"`
	SubjectClaim    string       `json:"subjectClaim" gorm:"column:subject_claim;not null;default:'sub'"`
	SubjectMatch    string       `json:"subjectMatch" gorm:"column:subject_match;not null"`
	MatchType       string       `json:"matchType" gorm:"column:match_type;not null;default:'exact'"`
	RoleID          string       `json:"roleId" gorm:"column:role_id;not null;index"`
	EnvironmentID   *string      `json:"environmentId,omitempty" gorm:"column:environment_id;index"`
	IdentityUserID  string       `json:"identityUserId" gorm:"column:identity_user_id;not null;index"`
	TokenTTLSeconds int          `json:"tokenTtlSeconds" gorm:"column:token_ttl_seconds;not null;default:900"`
	LastUsedAt      *time.Time   `json:"lastUsedAt,omitempty" gorm:"column:last_used_at" sortable:"true"`
	ExpiresAt       *time.Time   `json:"expiresAt,omitempty" gorm:"column:expires_at" sortable:"true"`
	IdentityUser    *User        `json:"identityUser,omitempty" gorm:"foreignKey:IdentityUserID;constraint:OnDelete:CASCADE"`
	Role            *Role        `json:"role,omitempty" gorm:"foreignKey:RoleID;constraint:OnDelete:RESTRICT"`
	Environment     *Environment `json:"environment,omitempty" gorm:"foreignKey:EnvironmentID;constraint:OnDelete:SET NULL"`
}

func (FederatedCredential) TableName

func (FederatedCredential) TableName() string

type FederatedTokenReplay

type FederatedTokenReplay struct {
	BaseModel

	TokenHash string    `json:"-" gorm:"column:token_hash;not null;uniqueIndex"`
	IssuerURL string    `json:"issuerUrl" gorm:"column:issuer_url;not null;index"`
	ExpiresAt time.Time `json:"expiresAt" gorm:"column:expires_at;not null;index"`
}

func (FederatedTokenReplay) TableName

func (FederatedTokenReplay) TableName() string

type GenericConfig

type GenericConfig struct {
	WebhookURL    string                         `json:"webhookUrl"`
	Method        string                         `json:"method,omitempty"`
	ContentType   string                         `json:"contentType,omitempty"`
	TitleKey      string                         `json:"titleKey,omitempty"`
	MessageKey    string                         `json:"messageKey,omitempty"`
	CustomHeaders map[string]string              `json:"customHeaders,omitempty"`
	DisableTLS    bool                           `json:"disableTls"`
	Events        map[NotificationEventType]bool `json:"events,omitempty"`
	// SuccessBodyContains is an optional substring that must appear in the
	// response body for the send to be considered successful. Useful for
	// providers that always return HTTP 200 but embed a status indicator in
	// the JSON body (e.g. PushPlus returns {"code":200,...} on success and
	// {"code":900,...} on failure). When empty, only the HTTP status code is
	// checked (existing behaviour).
	SuccessBodyContains string `json:"successBodyContains,omitempty"`
}

type GitOpsSync

type GitOpsSync struct {
	BaseModel

	Name              string         `json:"name" sortable:"true" search:"sync,gitops,automation,deploy,deployment,continuous"`
	EnvironmentID     string         `json:"environmentId" sortable:"true"`
	Environment       *Environment   `json:"environment,omitempty" gorm:"foreignKey:EnvironmentID"`
	RepositoryID      string         `json:"repositoryId" sortable:"true"`
	Repository        *GitRepository `json:"repository,omitempty" gorm:"foreignKey:RepositoryID"`
	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
	ProjectID         *string        `json:"projectId,omitempty" sortable:"true"`                                         // Set after project is created
	Project           *Project       `json:"project,omitempty" gorm:"foreignKey:ProjectID"`
	AutoSync          bool           `json:"autoSync" sortable:"true" search:"auto,automatic,sync,continuous,scheduled"`
	SyncInterval      int            `json:"syncInterval" sortable:"true" search:"interval,frequency,schedule,cron,minutes"` // in minutes
	SyncDirectory     bool           `json:"syncDirectory" gorm:"column:sync_directory"`                                     // Sync entire directory containing compose file
	SyncedFiles       *string        `json:"syncedFiles,omitempty" gorm:"column:synced_files"`                               // JSON array of synced file paths
	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
	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"`
}

func (GitOpsSync) TableName

func (GitOpsSync) TableName() string

type GitRepository

type GitRepository struct {
	BaseModel

	Name                   string  `json:"name" sortable:"true" search:"git,repository,repo,source,version,control,github,gitlab,bitbucket"`
	URL                    string  `json:"url" sortable:"true" search:"url,git,clone,remote,https,ssh"`
	AuthType               string  `json:"authType" sortable:"true" search:"auth,authentication,credentials,token,ssh,http"` // none, http, ssh
	Username               string  `json:"username" sortable:"true" search:"username,user,login,account"`
	Token                  string  `json:"token" search:"token,password,credentials,secret,auth"` // encrypted
	SSHKey                 string  `json:"sshKey" search:"ssh,key,private,public,certificate"`    // encrypted
	SSHHostKeyVerification string  `json:"sshHostKeyVerification" gorm:"default:accept_new"`      // strict, accept_new, skip
	Description            *string `json:"description,omitempty" sortable:"true"`
	Enabled                bool    `json:"enabled" sortable:"true" search:"enabled,active,disabled"`
}

func (GitRepository) TableName

func (GitRepository) TableName() string

type GotifyConfig

type GotifyConfig struct {
	Host       string                         `json:"host"`
	Port       int                            `json:"port,omitempty"`
	Token      string                         `json:"token"`
	Path       string                         `json:"path,omitempty"`
	Priority   int                            `json:"priority,omitempty"`
	Title      string                         `json:"title,omitempty"`
	DisableTLS bool                           `json:"disableTls"`
	Events     map[NotificationEventType]bool `json:"events,omitempty"`
}

type ImageBuild

type ImageBuild struct {
	BaseModel

	EnvironmentID   string           `json:"environmentId" gorm:"column:environment_id;index"`
	UserID          *string          `json:"userId,omitempty" gorm:"column:user_id"`
	Username        *string          `json:"username,omitempty" gorm:"column:username"`
	Status          ImageBuildStatus `json:"status" gorm:"column:status;index" sortable:"true"`
	Provider        string           `json:"provider,omitempty" gorm:"column:provider"`
	ContextDir      string           `json:"contextDir" gorm:"column:context_dir"`
	Dockerfile      string           `json:"dockerfile,omitempty" gorm:"column:dockerfile"`
	Target          string           `json:"target,omitempty" gorm:"column:target"`
	Tags            StringSlice      `json:"tags,omitempty" gorm:"column:tags;type:text"`
	Platforms       StringSlice      `json:"platforms,omitempty" gorm:"column:platforms;type:text"`
	BuildArgs       JSON             `json:"buildArgs,omitempty" gorm:"column:build_args;type:text"`
	Labels          JSON             `json:"labels,omitempty" gorm:"column:labels;type:text"`
	CacheFrom       StringSlice      `json:"cacheFrom,omitempty" gorm:"column:cache_from;type:text"`
	CacheTo         StringSlice      `json:"cacheTo,omitempty" gorm:"column:cache_to;type:text"`
	NoCache         bool             `json:"noCache" gorm:"column:no_cache;default:false"`
	Pull            bool             `json:"pull" gorm:"column:pull;default:false"`
	BuildNetwork    string           `json:"network,omitempty" gorm:"column:build_network"`
	Isolation       string           `json:"isolation,omitempty" gorm:"column:isolation"`
	ShmSize         int64            `json:"shmSize,omitempty" gorm:"column:shm_size"`
	Ulimits         JSON             `json:"ulimits,omitempty" gorm:"column:ulimits;type:text"`
	Entitlements    StringSlice      `json:"entitlements,omitempty" gorm:"column:entitlements;type:text"`
	Privileged      bool             `json:"privileged" gorm:"column:privileged;default:false"`
	ExtraHosts      StringSlice      `json:"extraHosts,omitempty" gorm:"column:extra_hosts;type:text"`
	Push            bool             `json:"push" gorm:"column:push"`
	Load            bool             `json:"load" gorm:"column:load"`
	Digest          *string          `json:"digest,omitempty" gorm:"column:digest"`
	ErrorMessage    *string          `json:"errorMessage,omitempty" gorm:"column:error_message"`
	Output          *string          `json:"output,omitempty" gorm:"column:output;type:text"`
	OutputTruncated bool             `json:"outputTruncated" gorm:"column:output_truncated;default:false"`
	CompletedAt     *time.Time       `json:"completedAt,omitempty" gorm:"column:completed_at" sortable:"true"`
	DurationMs      *int64           `json:"durationMs,omitempty" gorm:"column:duration_ms"`
}

func (ImageBuild) TableName

func (ImageBuild) TableName() string

type ImageBuildStatus

type ImageBuildStatus string
const (
	ImageBuildStatusRunning ImageBuildStatus = "running"
	ImageBuildStatusSuccess ImageBuildStatus = "success"
	ImageBuildStatusFailed  ImageBuildStatus = "failed"
)

type ImageUpdate

type ImageUpdate struct {
	HasUpdate      bool   `json:"hasUpdate"`
	UpdateType     string `json:"updateType"`
	CurrentVersion string `json:"currentVersion"`
	LatestVersion  string `json:"latestVersion,omitempty"`
	CheckTime      string `json:"checkTime"`
}

type ImageUpdateRecord

type ImageUpdateRecord struct {
	BaseModel

	ID             string    `json:"id" gorm:"primaryKey;type:text"`
	Repository     string    `json:"repository"`
	Tag            string    `json:"tag"`
	HasUpdate      bool      `json:"hasUpdate" gorm:"column:has_update"`
	UpdateType     string    `json:"updateType" gorm:"column:update_type"`
	CurrentVersion string    `json:"currentVersion" gorm:"column:current_version"`
	LatestVersion  *string   `json:"latestVersion,omitempty" gorm:"column:latest_version"`
	CurrentDigest  *string   `json:"currentDigest,omitempty" gorm:"column:current_digest"`
	LatestDigest   *string   `json:"latestDigest,omitempty" gorm:"column:latest_digest"`
	CheckTime      time.Time `json:"checkTime" gorm:"column:check_time"`
	ResponseTimeMs int       `json:"responseTimeMs" gorm:"column:response_time_ms"`
	LastError      *string   `json:"lastError,omitempty" gorm:"column:last_error"`

	AuthMethod     *string `json:"authMethod,omitempty" gorm:"column:auth_method"`
	AuthUsername   *string `json:"authUsername,omitempty" gorm:"column:auth_username"`
	AuthRegistry   *string `json:"authRegistry,omitempty" gorm:"column:auth_registry"`
	UsedCredential bool    `json:"usedCredential,omitempty" gorm:"column:used_credential"`

	NotificationSent bool `json:"notificationSent" gorm:"column:notification_sent;default:false"`
}

func (*ImageUpdateRecord) IsDigestUpdate

func (i *ImageUpdateRecord) IsDigestUpdate() bool

func (*ImageUpdateRecord) IsTagUpdate

func (i *ImageUpdateRecord) IsTagUpdate() bool

func (*ImageUpdateRecord) NeedsUpdate

func (i *ImageUpdateRecord) NeedsUpdate() bool

func (*ImageUpdateRecord) TableName

func (i *ImageUpdateRecord) TableName() string

type JSON

type JSON map[string]any

func (*JSON) Scan

func (j *JSON) Scan(value any) error

func (JSON) Value

func (j JSON) Value() (driver.Value, error)

type KVEntry

type KVEntry struct {
	Key       string     `gorm:"column:key;primaryKey"`
	Value     string     `gorm:"column:value"`
	CreatedAt time.Time  `gorm:"column:created_at;autoCreateTime"`
	UpdatedAt *time.Time `gorm:"column:updated_at;autoUpdateTime"`
}

KVEntry stores lightweight application state as arbitrary key/value pairs.

func (KVEntry) TableName

func (KVEntry) TableName() string

type MatrixConfig

type MatrixConfig struct {
	Host                   string                         `json:"host"`
	Port                   int                            `json:"port,omitempty"`
	Rooms                  string                         `json:"rooms"`
	Username               string                         `json:"username,omitempty"`
	Password               string                         `json:"password,omitempty"`
	DisableTLSVerification bool                           `json:"disableTlsVerification"`
	Events                 map[NotificationEventType]bool `json:"events,omitempty"`
}

type NotFoundError

type NotFoundError struct {
	Message string
}

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

type NotificationEventType

type NotificationEventType string
const (
	NotificationEventImageUpdate        NotificationEventType = "image_update"
	NotificationEventContainerUpdate    NotificationEventType = "container_update"
	NotificationEventVulnerabilityFound NotificationEventType = "vulnerability_found"
	NotificationEventPruneReport        NotificationEventType = "prune_report"
	NotificationEventAutoHeal           NotificationEventType = "auto_heal"
)

type NotificationLog

type NotificationLog struct {
	ID        uint                 `json:"id" gorm:"primaryKey"`
	Provider  NotificationProvider `json:"provider" gorm:"not null;index;type:varchar(50)"`
	ImageRef  string               `json:"imageRef" gorm:"not null;type:text"`
	Status    string               `json:"status" gorm:"not null"`
	Error     *string              `json:"error,omitempty"`
	Metadata  JSON                 `json:"metadata" gorm:"type:jsonb"`
	SentAt    time.Time            `json:"sentAt" gorm:"not null;index"`
	CreatedAt time.Time            `json:"createdAt"`
	UpdatedAt time.Time            `json:"updatedAt"`
}

func (NotificationLog) TableName

func (NotificationLog) TableName() string

type NotificationProvider

type NotificationProvider string
const (
	NotificationProviderDiscord  NotificationProvider = "discord"
	NotificationProviderEmail    NotificationProvider = "email"
	NotificationProviderTelegram NotificationProvider = "telegram"
	NotificationProviderSignal   NotificationProvider = "signal"
	NotificationProviderSlack    NotificationProvider = "slack"
	NotificationProviderNtfy     NotificationProvider = "ntfy"
	NotificationProviderPushover NotificationProvider = "pushover"
	NotificationProviderGotify   NotificationProvider = "gotify"
	NotificationProviderMatrix   NotificationProvider = "matrix"
	NotificationProviderGeneric  NotificationProvider = "generic"
)

type NotificationSettings

type NotificationSettings struct {
	ID        uint                 `json:"id" gorm:"primaryKey"`
	Provider  NotificationProvider `json:"provider" gorm:"not null;index;type:varchar(50)"`
	Enabled   bool                 `json:"enabled" gorm:"default:false"`
	Config    JSON                 `json:"config" gorm:"type:jsonb"`
	CreatedAt time.Time            `json:"createdAt"`
	UpdatedAt time.Time            `json:"updatedAt"`
}

func (NotificationSettings) TableName

func (NotificationSettings) TableName() string

type NtfyConfig

type NtfyConfig struct {
	Host                   string                         `json:"host"`
	Port                   int                            `json:"port"`
	Topic                  string                         `json:"topic"`
	Username               string                         `json:"username,omitempty"`
	Password               string                         `json:"password,omitempty"`
	Title                  string                         `json:"title,omitempty"`
	Priority               string                         `json:"priority,omitempty"`
	Tags                   []string                       `json:"tags,omitempty"`
	Icon                   string                         `json:"icon,omitempty"`
	Cache                  bool                           `json:"cache"`
	Firebase               bool                           `json:"firebase"`
	DisableTLSVerification bool                           `json:"disableTlsVerification"`
	Events                 map[NotificationEventType]bool `json:"events,omitempty"`
}

type OidcConfig

type OidcConfig struct {
	ClientID     string `json:"clientId"`
	ClientSecret string `json:"clientSecret"`
	IssuerURL    string `json:"issuerUrl"`
	Scopes       string `json:"scopes"`

	AuthorizationEndpoint       string `json:"authorizationEndpoint,omitempty"`
	TokenEndpoint               string `json:"tokenEndpoint,omitempty"`
	UserinfoEndpoint            string `json:"userinfoEndpoint,omitempty"`
	JwksURI                     string `json:"jwksUri,omitempty"`
	DeviceAuthorizationEndpoint string `json:"deviceAuthorizationEndpoint,omitempty"`

	// GroupsClaim is the claim path Arcane reads group memberships from on
	// every OIDC login. Matched against oidc_role_mappings to produce role
	// assignments. Default: "groups".
	GroupsClaim string `json:"groupsClaim,omitempty"`

	SkipTlsVerify bool `json:"skipTlsVerify"`
}

type OidcRoleMapping

type OidcRoleMapping struct {
	BaseModel

	ClaimValue    string  `json:"claimValue" gorm:"column:claim_value;not null;index"`
	RoleID        string  `json:"roleId" gorm:"column:role_id;not null;index"`
	EnvironmentID *string `json:"environmentId,omitempty" gorm:"column:environment_id"`
	Source        string  `json:"source" gorm:"column:source;not null;default:'manual'"`
}

OidcRoleMapping maps an OIDC group/claim value to a role assignment. On every OIDC login, the auth service replaces all source='oidc' rows on the user with assignments derived from the mappings whose ClaimValue matches a claim returned by the IdP.

Source distinguishes UI/API-managed rows (the default) from env-declared rows reconciled at boot from OIDC_ROLE_MAPPINGS. Env-managed rows are read-only via the API — they can only be changed by editing the env var and restarting.

func (OidcRoleMapping) TableName

func (OidcRoleMapping) TableName() string

type Project

type Project struct {
	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"`
	IsArchived         bool          `json:"is_archived" gorm:"column:is_archived;default:false;index"`
	ArchivedAt         *time.Time    `json:"archived_at,omitempty" gorm:"column:archived_at"`
}

func (Project) TableName

func (Project) TableName() string

type ProjectStatus

type ProjectStatus string
const (
	ProjectStatusRunning          ProjectStatus = "running"
	ProjectStatusStopped          ProjectStatus = "stopped"
	ProjectStatusPartiallyRunning ProjectStatus = "partially running"
	ProjectStatusUnknown          ProjectStatus = "unknown"
	ProjectStatusDeploying        ProjectStatus = "deploying"
	ProjectStatusStopping         ProjectStatus = "stopping"
	ProjectStatusRestarting       ProjectStatus = "restarting"
)

type PushoverConfig

type PushoverConfig struct {
	Token    string                         `json:"token"`
	User     string                         `json:"user"`
	Devices  []string                       `json:"devices,omitempty"`
	Priority int8                           `json:"priority"`
	Title    string                         `json:"title,omitempty"`
	Events   map[NotificationEventType]bool `json:"events,omitempty"`
}

type Role

type Role struct {
	BaseModel

	Name        string      `json:"name" gorm:"column:name;not null;uniqueIndex" sortable:"true"`
	Description *string     `json:"description,omitempty" gorm:"column:description"`
	Permissions StringSlice `json:"permissions" gorm:"column:permissions;type:text;not null"`
	BuiltIn     bool        `json:"builtIn" gorm:"column:built_in;not null;default:false" sortable:"true"`
}

Role is a named permission set. Built-in roles (Admin, Editor, Deployer, Viewer) are seeded by migration 054 and cannot be edited or deleted.

func (Role) TableName

func (Role) TableName() string

type SettingKeyNotFoundError

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

func (SettingKeyNotFoundError) Error

func (e SettingKeyNotFoundError) Error() string

func (SettingKeyNotFoundError) Is

func (e SettingKeyNotFoundError) Is(target error) bool

type SettingSensitiveForbiddenError

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

func (SettingSensitiveForbiddenError) Error

func (SettingSensitiveForbiddenError) Is

type SettingVariable

type SettingVariable struct {
	Key   string `gorm:"primaryKey"`
	Value string
}

func (SettingVariable) AsDurationSeconds

func (s SettingVariable) AsDurationSeconds() time.Duration

AsDurationSeconds returns the value as a time.Duration in seconds

func (SettingVariable) AsInt

func (s SettingVariable) AsInt() int

AsInt returns the value as an integer

func (SettingVariable) IsTrue

func (s SettingVariable) IsTrue() bool

IsTrue returns true if the value is a truthy string

func (SettingVariable) TableName

func (SettingVariable) TableName() string

type SettingVisibility

type SettingVisibility int
const (
	SettingVisibilityPublic SettingVisibility = iota
	SettingVisibilityNonAdmin
	SettingVisibilityAll
)

type Settings

type Settings struct {
	// General category
	ProjectsDirectory          SettingVariable `` /* 234-byte string literal not displayed */
	TemplatesDirectory         SettingVariable `` /* 252-byte string literal not displayed */
	FollowProjectSymlinks      SettingVariable `` /* 287-byte string literal not displayed */
	SwarmStackSourcesDirectory SettingVariable `` /* 273-byte string literal not displayed */
	DiskUsagePath              SettingVariable `` /* 171-byte string literal not displayed */
	BaseServerURL              SettingVariable `` /* 183-byte string literal not displayed */
	EnableGravatar             SettingVariable `` /* 205-byte string literal not displayed */
	DefaultShell               SettingVariable `` /* 162-byte string literal not displayed */
	EnvironmentHealthInterval  SettingVariable `` /* 396-byte string literal not displayed */
	ApplicationTheme           SettingVariable `` /* 233-byte string literal not displayed */
	IconCatalog                SettingVariable `` /* 243-byte string literal not displayed */
	AccentColor                SettingVariable `` /* 169-byte string literal not displayed */
	OledMode                   SettingVariable `` /* 221-byte string literal not displayed */

	// Docker category
	AutoUpdate                          SettingVariable `` /* 208-byte string literal not displayed */
	AutoUpdateInterval                  SettingVariable `` /* 223-byte string literal not displayed */
	AutoUpdateExcludedContainers        SettingVariable `` /* 210-byte string literal not displayed */
	AutoUpdateComposeStandaloneFallback SettingVariable `` /* 342-byte string literal not displayed */
	PollingEnabled                      SettingVariable `` /* 197-byte string literal not displayed */
	PollingInterval                     SettingVariable `` /* 209-byte string literal not displayed */
	DockerClientRefreshInterval         SettingVariable `` /* 274-byte string literal not displayed */
	EventCleanupInterval                SettingVariable `` /* 213-byte string literal not displayed */
	ExpiredSessionsCleanupInterval      SettingVariable `` /* 266-byte string literal not displayed */
	ActivityHistoryRetentionDays        SettingVariable `` /* 418-byte string literal not displayed */
	ActivityHistoryMaxEntries           SettingVariable `` /* 285-byte string literal not displayed */
	AutoInjectEnv                       SettingVariable `` /* 243-byte string literal not displayed */
	DefaultDeployPullPolicy             SettingVariable `` /* 215-byte string literal not displayed */
	ScheduledPruneEnabled               SettingVariable `` /* 213-byte string literal not displayed */
	ScheduledPruneInterval              SettingVariable `` /* 207-byte string literal not displayed */
	PruneContainerMode                  SettingVariable `` /* 234-byte string literal not displayed */
	PruneContainerUntil                 SettingVariable `` /* 238-byte string literal not displayed */
	PruneImageMode                      SettingVariable `` /* 223-byte string literal not displayed */
	PruneImageUntil                     SettingVariable `` /* 222-byte string literal not displayed */
	PruneVolumeMode                     SettingVariable `` /* 224-byte string literal not displayed */
	PruneNetworkMode                    SettingVariable `` /* 225-byte string literal not displayed */
	PruneNetworkUntil                   SettingVariable `` /* 230-byte string literal not displayed */
	PruneBuildCacheMode                 SettingVariable `` /* 241-byte string literal not displayed */
	PruneBuildCacheUntil                SettingVariable `` /* 244-byte string literal not displayed */
	AutoHealEnabled                     SettingVariable `` /* 217-byte string literal not displayed */
	AutoHealInterval                    SettingVariable `` /* 214-byte string literal not displayed */
	AutoHealExcludedContainers          SettingVariable `` /* 233-byte string literal not displayed */
	AutoHealMaxRestarts                 SettingVariable `` /* 237-byte string literal not displayed */
	AutoHealRestartWindow               SettingVariable `` /* 238-byte string literal not displayed */
	VolumeBrowserHelperIdleTimeout      SettingVariable `` /* 292-byte string literal not displayed */
	MaxImageUploadSize                  SettingVariable `` /* 232-byte string literal not displayed */
	GitSyncMaxFiles                     SettingVariable `` /* 275-byte string literal not displayed */
	GitSyncMaxTotalSizeMb               SettingVariable `` /* 295-byte string literal not displayed */
	GitSyncMaxBinarySizeMb              SettingVariable `` /* 310-byte string literal not displayed */
	DockerHost                          SettingVariable `` /* 175-byte string literal not displayed */
	BuildProvider                       SettingVariable `` /* 308-byte string literal not displayed */
	BuildsDirectory                     SettingVariable `` /* 192-byte string literal not displayed */
	BuildTimeout                        SettingVariable `` /* 204-byte string literal not displayed */
	DepotProjectId                      SettingVariable `` /* 165-byte string literal not displayed */
	DepotToken                          SettingVariable `` /* 167-byte string literal not displayed */

	// Authentication and security categories
	AuthLocalEnabled                SettingVariable `` /* 400-byte string literal not displayed */
	AuthSessionTimeout              SettingVariable `` /* 203-byte string literal not displayed */
	AuthPasswordPolicy              SettingVariable `` /* 209-byte string literal not displayed */
	VulnerabilityScanEnabled        SettingVariable `` /* 389-byte string literal not displayed */
	VulnerabilityScanInterval       SettingVariable `` /* 243-byte string literal not displayed */
	TrivyImage                      SettingVariable `` /* 216-byte string literal not displayed */
	TrivyNetwork                    SettingVariable `` /* 293-byte string literal not displayed */
	TrivySecurityOpts               SettingVariable `` /* 319-byte string literal not displayed */
	TrivyPrivileged                 SettingVariable `` /* 244-byte string literal not displayed */
	TrivyPreserveCacheOnVolumePrune SettingVariable `` /* 287-byte string literal not displayed */
	TrivyResourceLimitsEnabled      SettingVariable `` /* 238-byte string literal not displayed */
	TrivyCpuLimit                   SettingVariable `` /* 261-byte string literal not displayed */
	TrivyMemoryLimitMb              SettingVariable `` /* 246-byte string literal not displayed */
	TrivyConcurrentScanContainers   SettingVariable `` /* 302-byte string literal not displayed */
	TrivyConfig                     SettingVariable `` /* 200-byte string literal not displayed */
	TrivyIgnore                     SettingVariable `` /* 216-byte string literal not displayed */
	OidcEnabled                     SettingVariable `` /* 230-byte string literal not displayed */
	OidcClientId                    SettingVariable `` /* 178-byte string literal not displayed */
	OidcClientSecret                SettingVariable `` /* 195-byte string literal not displayed */
	OidcIssuerUrl                   SettingVariable `` /* 191-byte string literal not displayed */
	OidcAuthorizationEndpoint       SettingVariable `` /* 217-byte string literal not displayed */
	OidcTokenEndpoint               SettingVariable `` /* 185-byte string literal not displayed */
	OidcUserinfoEndpoint            SettingVariable `` /* 197-byte string literal not displayed */
	OidcJwksEndpoint                SettingVariable `` /* 186-byte string literal not displayed */
	OidcDeviceAuthorizationEndpoint SettingVariable `` /* 271-byte string literal not displayed */
	OidcScopes                      SettingVariable `` /* 181-byte string literal not displayed */
	OidcGroupsClaim                 SettingVariable `` /* 245-byte string literal not displayed */
	OidcSkipTlsVerify               SettingVariable `` /* 210-byte string literal not displayed */
	OidcAutoRedirectToProvider      SettingVariable `` /* 243-byte string literal not displayed */
	OidcMergeAccounts               SettingVariable `` /* 259-byte string literal not displayed */
	OidcProviderName                SettingVariable `` /* 227-byte string literal not displayed */
	OidcProviderLogoUrl             SettingVariable `` /* 211-byte string literal not displayed */
	OidcMobileRedirectUris          SettingVariable `` /* 286-byte string literal not displayed */

	// Appearance category
	MobileNavigationMode       SettingVariable `` /* 408-byte string literal not displayed */
	MobileNavigationShowLabels SettingVariable `` /* 261-byte string literal not displayed */
	SidebarHoverExpansion      SettingVariable `` /* 355-byte string literal not displayed */
	KeyboardShortcutsEnabled   SettingVariable `` /* 279-byte string literal not displayed */

	// Notifications category (placeholder for category metadata only - actual settings managed via notification service)
	NotificationsCategoryPlaceholder SettingVariable `` /* 396-byte string literal not displayed */

	AgentToken SettingVariable `key:"agentToken,internal,sensitive"`
	InstanceID SettingVariable `key:"instanceId,internal"`

	// Users category (admin management page - no actual settings)
	UsersCategoryPlaceholder SettingVariable `` /* 304-byte string literal not displayed */

	// API Keys category (admin management page - no actual settings)
	ApiKeysCategoryPlaceholder SettingVariable `` /* 351-byte string literal not displayed */

	FederatedCredentialsCategoryPlaceholder SettingVariable `` /* 262-byte string literal not displayed */

	// Webhooks category (management page - no actual settings)
	WebhooksCategoryPlaceholder SettingVariable `` /* 392-byte string literal not displayed */

	// Timeout category
	DockerAPITimeout       SettingVariable `` /* 362-byte string literal not displayed */
	DockerImagePullTimeout SettingVariable `` /* 243-byte string literal not displayed */
	TrivyScanTimeout       SettingVariable `` /* 231-byte string literal not displayed */
	GitOperationTimeout    SettingVariable `` /* 237-byte string literal not displayed */
	HTTPClientTimeout      SettingVariable `` /* 218-byte string literal not displayed */
	RegistryTimeout        SettingVariable `` /* 218-byte string literal not displayed */
	ProxyRequestTimeout    SettingVariable `` /* 215-byte string literal not displayed */
}

func (*Settings) Clone

func (s *Settings) Clone() *Settings

func (*Settings) FieldByKey

func (s *Settings) FieldByKey(key string) (defaultValue string, isPublic bool, isSensitive bool, err error)

func (*Settings) IsLocalSetting

func (s *Settings) IsLocalSetting(key string) bool

func (*Settings) ToSettingVariableSlice

func (s *Settings) ToSettingVariableSlice(visibility SettingVisibility, redactSensitiveValues bool) []SettingVariable

func (*Settings) UpdateField

func (s *Settings) UpdateField(key string, value string, noSensitive bool) error

type SignalConfig

type SignalConfig struct {
	Host       string                         `json:"host"`
	Port       int                            `json:"port"`
	User       string                         `json:"user,omitempty"`
	Password   string                         `json:"password,omitempty"`
	Token      string                         `json:"token,omitempty"`
	Source     string                         `json:"source"`
	Recipients []string                       `json:"recipients"`
	DisableTLS bool                           `json:"disableTls"`
	Events     map[NotificationEventType]bool `json:"events,omitempty"`
}

type SlackConfig

type SlackConfig struct {
	Token    string                         `json:"token"`
	BotName  string                         `json:"botName,omitempty"`
	Icon     string                         `json:"icon,omitempty"`
	Color    string                         `json:"color,omitempty"`
	Title    string                         `json:"title,omitempty"`
	Channel  string                         `json:"channel,omitempty"`
	ThreadTS string                         `json:"threadTs,omitempty"`
	Events   map[NotificationEventType]bool `json:"events,omitempty"`
}

type StringSlice

type StringSlice []string

func (*StringSlice) Scan

func (s *StringSlice) Scan(value any) error

func (StringSlice) Value

func (s StringSlice) Value() (driver.Value, error)

type TelegramConfig

type TelegramConfig struct {
	BotToken     string                         `json:"botToken"`
	ChatIDs      []string                       `json:"chatIds"`
	Preview      bool                           `json:"preview"`
	Notification bool                           `json:"notification"`
	ParseMode    string                         `json:"parseMode,omitempty"`
	Title        string                         `json:"title,omitempty"`
	Events       map[NotificationEventType]bool `json:"events,omitempty"`
}

type TemplateRegistry

type TemplateRegistry struct {
	BaseModel

	Name        string `json:"name"`
	URL         string `json:"url"`
	Enabled     bool   `json:"enabled"`
	Description string `json:"description"`
}

func (TemplateRegistry) TableName

func (TemplateRegistry) TableName() string

type UpdateContainerRegistryRequest

type UpdateContainerRegistryRequest struct {
	URL                *string `json:"url"`
	Username           *string `json:"username"`
	Token              *string `json:"token"`
	Description        *string `json:"description"`
	Insecure           *bool   `json:"insecure"`
	Enabled            *bool   `json:"enabled"`
	RegistryType       *string `json:"registryType"`
	AWSAccessKeyID     *string `json:"awsAccessKeyId"`
	AWSSecretAccessKey *string `json:"awsSecretAccessKey"`
	AWSRegion          *string `json:"awsRegion"`
}

type UpdateGitRepositoryRequest

type UpdateGitRepositoryRequest struct {
	Name                   *string `json:"name,omitempty"`
	URL                    *string `json:"url,omitempty"`
	AuthType               *string `json:"authType,omitempty" binding:"omitempty,oneof=none http ssh"`
	Username               *string `json:"username,omitempty"`
	Token                  *string `json:"token,omitempty"`
	SSHKey                 *string `json:"sshKey,omitempty"`
	SSHHostKeyVerification *string `json:"sshHostKeyVerification,omitempty" binding:"omitempty,oneof=strict accept_new skip"`
	Description            *string `json:"description,omitempty"`
	Enabled                *bool   `json:"enabled,omitempty"`
}

type User

type User struct {
	BaseModel

	Username               string     `json:"username" sortable:"true"`
	PasswordHash           string     `json:"-" gorm:"column:password_hash"`
	DisplayName            *string    `json:"displayName,omitempty" gorm:"column:display_name" sortable:"true"`
	Email                  *string    `json:"email,omitempty" sortable:"true"`
	OidcSubjectId          *string    `json:"oidcSubjectId,omitempty" gorm:"column:oidc_subject_id"`
	LastLogin              *time.Time `json:"lastLogin,omitempty" gorm:"column:last_login" sortable:"true"`
	Locale                 *string    `json:"locale,omitempty" gorm:"column:locale"`
	FontSize               *int       `json:"fontSize,omitempty" gorm:"column:font_size"`
	RequiresPasswordChange bool       `json:"requiresPasswordChange" gorm:"column:requires_password_change"`
	IsServiceAccount       bool       `json:"isServiceAccount" gorm:"column:is_service_account;not null;default:false"`

	// OIDC provider tokens
	OidcAccessToken          *string    `json:"-" gorm:"type:text"`
	OidcRefreshToken         *string    `json:"-" gorm:"type:text"`
	OidcAccessTokenExpiresAt *time.Time `json:"-"`
}

func (User) TableName

func (User) TableName() string

type UserRoleAssignment

type UserRoleAssignment struct {
	BaseModel

	UserID        string  `json:"userId" gorm:"column:user_id;not null;index"`
	RoleID        string  `json:"roleId" gorm:"column:role_id;not null;index"`
	EnvironmentID *string `json:"environmentId,omitempty" gorm:"column:environment_id;index"`
	Source        string  `json:"source" gorm:"column:source;not null;default:'manual'"`
}

UserRoleAssignment binds a user to a role, optionally scoped to one environment. EnvironmentID == nil means "global" — the role's permissions apply across all environments AND to org-level resources.

Source distinguishes manual assignments (managed by admins via the UI) from assignments synthesized from OIDC group mappings on every login.

func (UserRoleAssignment) TableName

func (UserRoleAssignment) TableName() string

type UserSession

type UserSession struct {
	BaseModel

	UserID                string               `json:"userId" gorm:"column:user_id;not null;index"`
	User                  *User                `json:"user,omitempty" gorm:"foreignKey:UserID;constraint:OnDelete:CASCADE"`
	RefreshTokenHash      string               `json:"-" gorm:"column:refresh_token_hash;not null;uniqueIndex"`
	UserAgent             *string              `json:"userAgent,omitempty" gorm:"column:user_agent"`
	IPAddress             *string              `json:"ipAddress,omitempty" gorm:"column:ip_address"`
	Source                string               `json:"source,omitempty" gorm:"column:source"`
	FederatedCredentialID *string              `json:"federatedCredentialId,omitempty" gorm:"column:federated_credential_id;index"`
	FederatedCredential   *FederatedCredential `json:"federatedCredential,omitempty" gorm:"foreignKey:FederatedCredentialID;constraint:OnDelete:SET NULL"`
	LastUsedAt            time.Time            `json:"lastUsedAt" gorm:"column:last_used_at;not null"`
	ExpiresAt             time.Time            `json:"expiresAt" gorm:"column:expires_at;not null;index"`
	RevokedAt             *time.Time           `json:"revokedAt,omitempty" gorm:"column:revoked_at"`
}

func (UserSession) TableName

func (UserSession) TableName() string

type ValidationError

type ValidationError struct {
	Message string
	Field   string
}

func (*ValidationError) Error

func (e *ValidationError) Error() string

type VolumeBackup

type VolumeBackup struct {
	BaseModel

	VolumeName string    `json:"volumeName" gorm:"column:volume_name;index"`
	Size       int64     `json:"size" gorm:"column:size"`
	CreatedAt  time.Time `json:"createdAt" gorm:"column:created_at"`
	ActivityID *string   `json:"activityId,omitempty" gorm:"-"`
}

func (*VolumeBackup) TableName

func (*VolumeBackup) TableName() string

func (*VolumeBackup) ToDTO

func (b *VolumeBackup) ToDTO() volume.BackupEntry

type VulnerabilityIgnore

type VulnerabilityIgnore struct {
	// ID is the unique identifier for this ignore record
	ID string `json:"id" gorm:"primaryKey;type:text"`

	// EnvironmentID is the environment where this ignore applies
	EnvironmentID string `json:"environmentId" gorm:"column:environment_id;index"`

	// ImageID is the Docker image ID
	ImageID string `json:"imageId" gorm:"column:image_id;index"`

	// VulnerabilityID is the CVE or vulnerability identifier (e.g., CVE-2023-1234)
	VulnerabilityID string `json:"vulnerabilityId" gorm:"column:vulnerability_id;index"`

	// PkgName is the package name containing the vulnerability
	PkgName string `json:"pkgName" gorm:"column:pkg_name"`

	// InstalledVersion is the version of the package with the vulnerability
	InstalledVersion string `json:"installedVersion" gorm:"column:installed_version"`

	// Reason is an optional reason for ignoring this vulnerability
	Reason *string `json:"reason,omitempty" gorm:"column:reason"`

	// CreatedBy is the user ID who created this ignore record
	CreatedBy string `json:"createdBy" gorm:"column:created_by"`

	// CreatedAt is when this ignore record was created
	CreatedAt time.Time `json:"createdAt" gorm:"column:created_at"`
}

VulnerabilityIgnore stores ignored vulnerability records

func (*VulnerabilityIgnore) BeforeCreate

func (v *VulnerabilityIgnore) BeforeCreate(db *gorm.DB) error

BeforeCreate sets the ID and CreatedAt before inserting

func (*VulnerabilityIgnore) CompositeKey

func (v *VulnerabilityIgnore) CompositeKey() string

CompositeKey generates a composite key for deduplication. This helps prevent duplicate ignore records for the same vulnerability.

func (*VulnerabilityIgnore) TableName

func (v *VulnerabilityIgnore) TableName() string

type VulnerabilityScanRecord

type VulnerabilityScanRecord struct {
	BaseModel

	// ImageID is the Docker image ID (primary key)
	ID string `json:"id" gorm:"primaryKey;type:text"`

	// ImageName is the image name with tag (e.g., nginx:latest)
	ImageName string `json:"imageName" gorm:"column:image_name"`

	// Status is the status of the scan (pending, scanning, completed, failed)
	Status string `json:"status" gorm:"column:status"`

	// ScanTime is the timestamp when the scan was performed
	ScanTime time.Time `json:"scanTime" gorm:"column:scan_time"`

	// Duration is the duration of the scan in milliseconds
	Duration int64 `json:"duration" gorm:"column:duration"`

	// Total vulnerability counts by severity
	CriticalCount int `json:"criticalCount" gorm:"column:critical_count"`
	HighCount     int `json:"highCount" gorm:"column:high_count"`
	MediumCount   int `json:"mediumCount" gorm:"column:medium_count"`
	LowCount      int `json:"lowCount" gorm:"column:low_count"`
	UnknownCount  int `json:"unknownCount" gorm:"column:unknown_count"`
	TotalCount    int `json:"totalCount" gorm:"column:total_count"`

	// Vulnerabilities stores the JSON encoded vulnerabilities list
	Vulnerabilities StringSlice `json:"vulnerabilities" gorm:"column:vulnerabilities;type:text"`

	// Error contains the error message if the scan failed
	Error *string `json:"error,omitempty" gorm:"column:error"`

	// ScannerVersion is the version of the scanner used
	ScannerVersion string `json:"scannerVersion" gorm:"column:scanner_version"`
}

VulnerabilityScanRecord stores vulnerability scan results for images

func (*VulnerabilityScanRecord) GetHighestSeverity

func (v *VulnerabilityScanRecord) GetHighestSeverity() string

GetHighestSeverity returns the highest severity level found

func (*VulnerabilityScanRecord) GetTotalVulnerabilities

func (v *VulnerabilityScanRecord) GetTotalVulnerabilities() int

GetTotalVulnerabilities returns the total count of vulnerabilities

func (*VulnerabilityScanRecord) IsCompleted

func (v *VulnerabilityScanRecord) IsCompleted() bool

IsCompleted returns true if the scan has completed

func (*VulnerabilityScanRecord) IsFailed

func (v *VulnerabilityScanRecord) IsFailed() bool

IsFailed returns true if the scan has failed

func (*VulnerabilityScanRecord) IsScanning

func (v *VulnerabilityScanRecord) IsScanning() bool

IsScanning returns true if the scan is in progress

func (*VulnerabilityScanRecord) TableName

func (v *VulnerabilityScanRecord) TableName() string

type Webhook

type Webhook struct {
	BaseModel

	Name            string     `json:"name" gorm:"column:name;not null"`
	TokenHash       string     `json:"-" gorm:"column:token_hash;not null;uniqueIndex"`
	TokenPrefix     string     `json:"tokenPrefix" gorm:"column:token_prefix;not null"`
	TargetType      string     `json:"targetType" gorm:"column:target_type;not null"`
	ActionType      string     `json:"actionType" gorm:"column:action_type;not null;default:''"`
	TargetID        string     `json:"targetId" gorm:"column:target_id;not null"`
	TargetRef       string     `json:"-" gorm:"column:target_ref;not null;default:''"`
	EnvironmentID   string     `json:"environmentId" gorm:"column:environment_id;not null;default:''"`
	Enabled         bool       `json:"enabled" gorm:"column:enabled;not null;default:true"`
	LastTriggeredAt *time.Time `json:"lastTriggeredAt,omitempty" gorm:"column:last_triggered_at"`
}

func (Webhook) TableName

func (Webhook) TableName() string

Jump to

Keyboard shortcuts

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