systembackup

package
v2.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: BSD-3-Clause Imports: 57 Imported by: 0

Documentation

Overview

Package systembackup owns Arcane system-recovery backup orchestration and its HTTP surface.

Index

Constants

This section is empty.

Variables

View Source
var ErrSystemBackupAlreadyRunning = errors.New("an Arcane system backup is already running")

Functions

func RegisterSystemBackups

func RegisterSystemBackups(api huma.API, service *SystemBackupService, activityService *activity.ActivityService, appCtx handlerutil.ActivityAppContext)

Types

type BrowseSystemBackupFilesInput added in v2.10.0

type BrowseSystemBackupFilesInput struct {
	ID     string `path:"id"`
	Path   string `query:"path" doc:"Folder path relative to the backup root"`
	Search string `query:"search" doc:"Case-insensitive full-path search"`
	Start  int    `query:"start" default:"0" doc:"Start index for the page"`
	Limit  int    `query:"limit" default:"20" doc:"Requested page size"`
	Body   backuptypes.SystemBackupRecoveryKey
}

BrowseSystemBackupFilesInput selects one page of a system backup tree.

type CreateSystemBackupInput

type CreateSystemBackupInput struct {
	Body backuptypes.CreateSystemBackupRequest
}

type DeleteSystemBackupInput

type DeleteSystemBackupInput struct {
	ID   string `path:"id"`
	Body backuptypes.DeleteSystemBackupRequest
}

type DiscoverSystemBackupsInput

type DiscoverSystemBackupsInput struct {
	Body backuptypes.DiscoverSystemBackupsRequest
}

type GenerateSystemBackupRecoveryKeyOutput

type GenerateSystemBackupRecoveryKeyOutput struct {
	Body backuptypes.SystemBackupRecoveryKey
}

type ListBackupHistoryInput added in v2.10.0

type ListBackupHistoryInput struct {
	Search string `query:"search"`
	Sort   string `query:"sort" default:"createdAt"`
	Order  string `query:"order" default:"desc"`
	Start  int    `query:"start" default:"0"`
	Limit  int    `query:"limit" default:"20"`
	Type   string `query:"type"`
}

type ListSystemBackupsInput

type ListSystemBackupsInput struct {
	Search string `query:"search"`
	Sort   string `query:"sort" default:"createdAt"`
	Order  string `query:"order" default:"desc"`
	Start  int    `query:"start" default:"0"`
	Limit  int    `query:"limit" default:"20"`
}

type Module

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

func New

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

func (*Module) RegisterRoutes

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

func (*Module) Service

func (m *Module) Service() *SystemBackupService

type RestoreSystemBackupFilesInput added in v2.10.0

type RestoreSystemBackupFilesInput struct {
	ID   string `path:"id"`
	Body backuptypes.RestoreSystemBackupFilesRequest
}

RestoreSystemBackupFilesInput selects project files to restore from a system backup.

type RestoreSystemBackupInput

type RestoreSystemBackupInput struct {
	ID   string `path:"id"`
	Body backuptypes.RestoreSystemBackupRequest
}

type RunSystemVolumeBackupsInput added in v2.10.0

type RunSystemVolumeBackupsInput struct {
	Body *backuptypes.RunSystemVolumeBackupsRequest `json:"body,omitempty"`
}

type SetSystemBackupRecoveryKeyInput

type SetSystemBackupRecoveryKeyInput struct {
	Body backuptypes.SystemBackupRecoveryKey
}

type SystemBackupHandler

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

func (*SystemBackupHandler) BrowseFiles added in v2.10.0

BrowseFiles returns one lazy-loaded project tree page.

func (*SystemBackupHandler) Create

func (*SystemBackupHandler) Delete

func (*SystemBackupHandler) Discover

func (*SystemBackupHandler) GenerateRecoveryKey

func (h *SystemBackupHandler) GenerateRecoveryKey(_ context.Context, _ *struct{}) (*GenerateSystemBackupRecoveryKeyOutput, error)

func (*SystemBackupHandler) GetPolicies

func (h *SystemBackupHandler) GetPolicies(ctx context.Context, _ *struct{}) (*SystemBackupPoliciesOutput, error)

func (*SystemBackupHandler) GetSystemVolumeConfig added in v2.10.0

func (h *SystemBackupHandler) GetSystemVolumeConfig(ctx context.Context, _ *struct{}) (*SystemVolumeBackupConfigOutput, error)

func (*SystemBackupHandler) List

func (*SystemBackupHandler) ListHistory added in v2.10.0

func (*SystemBackupHandler) ListSystemVolumeOptions added in v2.10.0

func (h *SystemBackupHandler) ListSystemVolumeOptions(ctx context.Context, _ *struct{}) (*SystemVolumeBackupOptionsOutput, error)

func (*SystemBackupHandler) Restore

func (*SystemBackupHandler) RestoreFiles added in v2.10.0

RestoreFiles restores selected project files from a system backup.

func (*SystemBackupHandler) RunSystemVolumeBackups added in v2.10.0

func (*SystemBackupHandler) SetRecoveryKey

func (*SystemBackupHandler) UpdatePolicies

func (*SystemBackupHandler) UpdateSystemVolumeConfig added in v2.10.0

func (*SystemBackupHandler) Upload

type SystemBackupOutput

type SystemBackupOutput struct{ Body backuptypes.SystemBackupRun }

type SystemBackupPoliciesOutput

type SystemBackupPoliciesOutput struct {
	Body backuptypes.SystemBackupPolicyCollection
}

type SystemBackupPolicy

type SystemBackupPolicy struct {
	database.BaseModel

	Enabled         bool   `gorm:"column:enabled;not null;default:false"`
	Schedule        string `gorm:"column:schedule;type:text;not null"`
	RetentionCount  int    `gorm:"column:retention_count;not null;default:7"`
	LocalEnabled    bool   `gorm:"column:local_enabled;not null;default:true"`
	S3Enabled       bool   `gorm:"column:s3_enabled;not null;default:false"`
	S3DestinationID string `gorm:"column:s3_destination_id;type:text;index"`
}

func (SystemBackupPolicy) TableName

func (SystemBackupPolicy) TableName() string

func (SystemBackupPolicy) ToDTO

type SystemBackupRecoveryConfig

type SystemBackupRecoveryConfig struct {
	database.BaseModel

	EncryptedRecoveryKey string `gorm:"column:encrypted_recovery_key;type:text;not null"`
}

func (SystemBackupRecoveryConfig) TableName

func (SystemBackupRecoveryConfig) TableName() string

type SystemBackupRecoveryKeyOutput

type SystemBackupRecoveryKeyOutput struct {
	Body backuptypes.SystemBackupRecoveryKeyStatus
}

type SystemBackupRun

type SystemBackupRun struct {
	database.BaseModel

	Size              int64                               `json:"size" gorm:"column:size" sortable:"true"`
	CreatedAt         time.Time                           `json:"createdAt" gorm:"column:created_at" sortable:"true"`
	Status            SystemBackupStatus                  `json:"status" gorm:"column:status;type:text;not null" sortable:"true"`
	Trigger           SystemBackupTrigger                 `json:"trigger" gorm:"column:trigger;type:text;not null" sortable:"true"`
	Destination       backuptypes.SystemBackupDestination `json:"destination" gorm:"column:destination;type:text;not null" sortable:"true"`
	LocalSnapshotID   string                              `json:"localSnapshotId,omitempty" gorm:"column:local_snapshot_id;type:text"`
	RemoteSnapshotID  string                              `json:"remoteSnapshotId,omitempty" gorm:"column:remote_snapshot_id;type:text"`
	S3DestinationID   string                              `json:"s3DestinationId,omitempty" gorm:"column:s3_destination_id;type:text;index"`
	S3DestinationName string                              `json:"s3DestinationName,omitempty" gorm:"-"`
	PolicyID          string                              `json:"policyId,omitempty" gorm:"column:policy_id;type:text;index"`
	Error             string                              `json:"error,omitempty" gorm:"column:error;type:text"`
}

func (SystemBackupRun) TableName

func (SystemBackupRun) TableName() string

func (SystemBackupRun) ToDTO

type SystemBackupService

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

func NewSystemBackupService

func NewSystemBackupService(db *database.DB, dockerService *docker.DockerClientService, volumeService *volume.VolumeService, engine *backup.Engine, s3Destinations *s3domain.S3DestinationService, activityService *activity.ActivityService, settingsService *settings.SettingsService, cfg *config.Config) *SystemBackupService

func (*SystemBackupService) BrowseBackupFiles added in v2.10.0

func (s *SystemBackupService) BrowseBackupFiles(ctx context.Context, id, recoveryKey, requestedPath string, params pagination.QueryParams) ([]backuptypes.BackupFileEntry, pagination.Response, error)

BrowseBackupFiles returns one page from the backup's logical project tree.

func (*SystemBackupService) CreateBackup

func (*SystemBackupService) DeleteBackup

func (s *SystemBackupService) DeleteBackup(ctx context.Context, id, recoveryKey string) error

func (*SystemBackupService) DiscoverRemoteBackups

func (s *SystemBackupService) DiscoverRemoteBackups(ctx context.Context, request backuptypes.DiscoverSystemBackupsRequest) (int, error)

func (*SystemBackupService) GenerateRecoveryKey

func (s *SystemBackupService) GenerateRecoveryKey() (*backuptypes.SystemBackupRecoveryKey, error)

func (*SystemBackupService) GetPolicies

func (*SystemBackupService) GetSystemVolumeBackupConfig added in v2.10.0

func (*SystemBackupService) ListBackupHistory added in v2.10.0

ListBackupHistory returns a unified, server-paginated view of local backup records.

func (*SystemBackupService) ListBackups

func (*SystemBackupService) ListSystemVolumeBackupOptions added in v2.10.0

func (s *SystemBackupService) ListSystemVolumeBackupOptions(ctx context.Context) ([]backuptypes.SystemVolumeBackupOption, error)

ListSystemVolumeBackupOptions returns live choices plus configured names that are currently unavailable.

func (*SystemBackupService) RegisterBackupJobOnStartup

func (s *SystemBackupService) RegisterBackupJobOnStartup(ctx context.Context)

func (*SystemBackupService) RestoreBackup

func (s *SystemBackupService) RestoreBackup(ctx context.Context, id, recoveryKey string, user common.User) error

func (*SystemBackupService) RestoreBackupFiles added in v2.10.0

RestoreBackupFiles restores selected project files after creating a safety snapshot.

func (*SystemBackupService) RunSystemVolumeBackups added in v2.10.0

func (*SystemBackupService) SetRecoveryKey

func (*SystemBackupService) SetScheduler

func (s *SystemBackupService) SetScheduler(ctx context.Context, scheduler schedulertypes.DynamicScheduler, admissionGate *actors.Gate[actors.AdmissionKey]) error

SetScheduler injects the dynamic scheduler and admission gate for per-policy system backup jobs. Agent mode leaves them unset.

func (*SystemBackupService) SupportedDatabaseProvider

func (s *SystemBackupService) SupportedDatabaseProvider() bool

SupportedDatabaseProvider reports whether system recovery works on the configured database. Recovery is currently SQLite-only.

func (*SystemBackupService) UpdateSystemVolumeBackupConfig added in v2.10.0

func (*SystemBackupService) UploadBackup

type SystemBackupStatus

type SystemBackupStatus string
const (
	SystemBackupStatusRunning   SystemBackupStatus = "running"
	SystemBackupStatusSucceeded SystemBackupStatus = "succeeded"
	SystemBackupStatusFailed    SystemBackupStatus = "failed"
)

type SystemBackupTrigger

type SystemBackupTrigger string
const (
	SystemBackupTriggerManual    SystemBackupTrigger = "manual"
	SystemBackupTriggerScheduled SystemBackupTrigger = "scheduled"
	SystemBackupTriggerSafety    SystemBackupTrigger = "safety"
)

type SystemVolumeBackupConfigOutput added in v2.10.0

type SystemVolumeBackupConfigOutput struct {
	Body backuptypes.SystemVolumeBackupPolicyCollection
}

type SystemVolumeBackupOptionsOutput added in v2.10.0

type SystemVolumeBackupOptionsOutput struct {
	Body []backuptypes.SystemVolumeBackupOption
}

type SystemVolumeBackupRunOutput added in v2.10.0

type SystemVolumeBackupRunOutput struct {
	Body backuptypes.SystemVolumeBackupRunResult
}

type UpdateSystemBackupPoliciesInput

type UpdateSystemBackupPoliciesInput struct {
	Body backuptypes.UpdateSystemBackupPolicies
}

type UpdateSystemVolumeBackupConfigInput added in v2.10.0

type UpdateSystemVolumeBackupConfigInput struct {
	Body backuptypes.UpdateSystemVolumeBackupPolicies
}

type UploadSystemBackupInput

type UploadSystemBackupInput struct {
	ID   string `path:"id"`
	Body backuptypes.UploadSystemBackupRequest
}

Jump to

Keyboard shortcuts

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