v2

package
v0.4.98 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrComposeAppIDNotProvided = errors.New("compose AppID (compose project name) is not provided")
View Source
var Features = []string{"labels"}

Features is what GET /info says this build can do beyond the first release of the API.

Functions

func DefaultQuery

func DefaultQuery(ctx echo.Context, key string, defaultValue string) string

func FilterCatalogByAppStoreID

func FilterCatalogByAppStoreID(catalog map[string]*service.ComposeApp, appStoreIDs []string) map[string]*service.ComposeApp

func FilterCatalogByArchitecture

func FilterCatalogByArchitecture(catalog map[string]*service.ComposeApp, arch string) map[string]*service.ComposeApp

func FilterCatalogByAuthorType

func FilterCatalogByAuthorType(catalog map[string]*service.ComposeApp, authorType codegen.StoreAppAuthorType) map[string]*service.ComposeApp

func FilterCatalogByCategory

func FilterCatalogByCategory(catalog map[string]*service.ComposeApp, category string) map[string]*service.ComposeApp

func NewAppManagement

func NewAppManagement() codegen.ServerInterface

func PropertiesFromQueryParams

func PropertiesFromQueryParams(httpCtx echo.Context) map[string]string

func WebAppGridItemAdapterContainer

func WebAppGridItemAdapterContainer(container *model.MyAppList) (*codegen.WebAppGridItem, error)

func WebAppGridItemAdapterV1

func WebAppGridItemAdapterV1(app *model.MyAppList) (*codegen.WebAppGridItem, error)

func WebAppGridItemAdapterV2

func WebAppGridItemAdapterV2(composeAppWithStoreInfo *codegen.ComposeAppWithStoreInfo) (*codegen.WebAppGridItem, error)

func YAMLfromRequest

func YAMLfromRequest(ctx echo.Context) ([]byte, error)

Types

type AppManagement

type AppManagement struct{}

func (*AppManagement) AppOperations added in v0.4.65

func (a *AppManagement) AppOperations(ctx echo.Context) error

AppOperations answers what runs on each app right now. The core asks before it updates the box by itself, as an internal request.

func (*AppManagement) AppStoreList

func (a *AppManagement) AppStoreList(ctx echo.Context) error

func (*AppManagement) ApplyComposeAppEnv

func (a *AppManagement) ApplyComposeAppEnv(ctx echo.Context, id codegen.ComposeAppID, params codegen.ApplyComposeAppEnvParams) error

func (*AppManagement) ApplyComposeAppSettings

func (a *AppManagement) ApplyComposeAppSettings(ctx echo.Context, id codegen.ComposeAppID, params codegen.ApplyComposeAppSettingsParams) error

func (*AppManagement) BackupComposeApp added in v0.4.37

func (a *AppManagement) BackupComposeApp(ctx echo.Context, id codegen.ComposeAppID) error

BackupComposeApp starts a backup and returns.

A copy takes as long as it takes, so nothing waits for it here. What the caller gets back is that it started, and where it is going; the rest arrives on the message bus, like every other long operation in this service.

func (*AppManagement) BackupDestinationRestic added in v0.4.78

func (a *AppManagement) BackupDestinationRestic(ctx echo.Context, name codegen.BackupDestinationName) error

BackupDestinationRestic says whether a destination keeps its backups with restic.

func (*AppManagement) BackupDestinationResticPassword added in v0.4.87

func (a *AppManagement) BackupDestinationResticPassword(ctx echo.Context, name codegen.BackupDestinationName) error

BackupDestinationResticPassword reads back the password of a destination's repository, for its owner to keep away from this box.

func (*AppManagement) BackupDestinationRuns added in v0.4.43

func (a *AppManagement) BackupDestinationRuns(ctx echo.Context, name codegen.BackupDestinationName) error

BackupDestinationRuns is what a destination holds: the apps it has backups of, their runs newest first, and whether this box runs each app now.

func (*AppManagement) BackupDestinations added in v0.4.37

func (a *AppManagement) BackupDestinations(ctx echo.Context) error

BackupDestinations lists the destinations, by name.

Names only. What a destination needs to be reached is rclone's to keep, and a secret that is never read back out through an API is a secret that cannot leak through one.

func (*AppManagement) BackupRunning added in v0.4.93

func (a *AppManagement) BackupRunning(ctx echo.Context) error

BackupRunning answers what runs and how far it has got, without an envelope, as /operations.

func (*AppManagement) BackupRuns added in v0.4.37

func (a *AppManagement) BackupRuns(ctx echo.Context) error

BackupRuns is what happened, newest first, failures included.

func (*AppManagement) BackupSchedules added in v0.4.37

func (a *AppManagement) BackupSchedules(ctx echo.Context) error

BackupSchedules lists the standing arrangements.

func (*AppManagement) BackupSignIn added in v0.4.84

func (a *AppManagement) BackupSignIn(ctx echo.Context) error

BackupSignIn starts a sign-in to a cloud drive and returns the address to open.

func (*AppManagement) BackupSignInFinish added in v0.4.84

func (a *AppManagement) BackupSignInFinish(ctx echo.Context) error

BackupSignInFinish trades the page the provider redirected to for a token.

func (*AppManagement) BackupSystem added in v0.4.45

func (a *AppManagement) BackupSystem(ctx echo.Context) error

BackupSystem backs the box itself up, in the background.

func (*AppManagement) BackupVerificationSchedule added in v0.4.92

func (a *AppManagement) BackupVerificationSchedule(ctx echo.Context) error

BackupVerificationSchedule says when the newest backups are read back by themselves.

func (*AppManagement) BackupVerifications added in v0.4.92

func (a *AppManagement) BackupVerifications(ctx echo.Context) error

func (*AppManagement) BrowseBackup added in v0.4.83

BrowseBackup lists one level inside a backup, to choose what to put back.

func (*AppManagement) CancelBackupVerification added in v0.4.92

func (a *AppManagement) CancelBackupVerification(ctx echo.Context, verificationId string) error

func (*AppManagement) CategoryList

func (a *AppManagement) CategoryList(ctx echo.Context) error

func (*AppManagement) CheckBackupDestination added in v0.4.37

func (a *AppManagement) CheckBackupDestination(ctx echo.Context, name codegen.BackupDestinationName) error

CheckBackupDestination asks a destination whether it is reachable.

func (*AppManagement) CheckBackupDestinationRestic added in v0.4.82

func (a *AppManagement) CheckBackupDestinationRestic(ctx echo.Context, name codegen.BackupDestinationName) error

CheckBackupDestinationRestic starts a check of the repository now and returns; the answer is the destination's restic state once it is over.

func (*AppManagement) CheckComposeAppHealthByID

func (a *AppManagement) CheckComposeAppHealthByID(ctx echo.Context, id codegen.ComposeAppID) error

func (*AppManagement) CheckContainerHealthByID

func (a *AppManagement) CheckContainerHealthByID(ctx echo.Context, id codegen.ContainerID) error

func (*AppManagement) CheckGitApp added in v0.4.57

func (a *AppManagement) CheckGitApp(ctx echo.Context, app codegen.GitAppName) error

func (*AppManagement) CheckImageUpdates

func (a *AppManagement) CheckImageUpdates(ctx echo.Context) error

func (*AppManagement) CheckWebFrame added in v0.4.93

func (a *AppManagement) CheckWebFrame(ctx echo.Context, params codegen.CheckWebFrameParams) error

CheckWebFrame answers whether the browser will render an app's web interface in a frame on the dashboard.

A browser that refuses a frame says so to nobody: the page holding it gets no error and no event, only an empty frame. NiFi was the case that showed it: `X-Frame-Options: SAMEORIGIN` on https://<box>:8443 under a dashboard on http://<box>, and a self-signed certificate that a frame offers no way to accept. The dashboard cannot read another origin's headers, so this does.

func (*AppManagement) ComposeApp

func (a *AppManagement) ComposeApp(ctx echo.Context, id codegen.StoreAppIDString) error

func (*AppManagement) ComposeAppContainerStats added in v0.4.37

func (a *AppManagement) ComposeAppContainerStats(ctx echo.Context, id codegen.ComposeAppID) error

ComposeAppContainerStats reports what an app's running containers are using.

Only running ones: a stopped container uses nothing, and the daemon has no sample to give for it. The caller matches these back to the rows it already has by container id, so a container missing from this answer keeps whatever the row already said rather than being redrawn as idle.

func (*AppManagement) ComposeAppContainers

func (a *AppManagement) ComposeAppContainers(ctx echo.Context, id codegen.ComposeAppID) error

func (*AppManagement) ComposeAppEnv

func (a *AppManagement) ComposeAppEnv(ctx echo.Context, id codegen.ComposeAppID) error

func (*AppManagement) ComposeAppLogs

func (a *AppManagement) ComposeAppLogs(ctx echo.Context, id codegen.ComposeAppID, params codegen.ComposeAppLogsParams) error

func (*AppManagement) ComposeAppMainStableTag

func (a *AppManagement) ComposeAppMainStableTag(ctx echo.Context, id codegen.StoreAppIDString) error

func (*AppManagement) ComposeAppServiceStableTag

func (a *AppManagement) ComposeAppServiceStableTag(ctx echo.Context, id codegen.StoreAppIDString, serviceName string) error

func (*AppManagement) ComposeAppStoreInfo

func (a *AppManagement) ComposeAppStoreInfo(ctx echo.Context, id codegen.StoreAppIDString) error

func (*AppManagement) ComposeAppStoreInfoList

func (a *AppManagement) ComposeAppStoreInfoList(ctx echo.Context, params codegen.ComposeAppStoreInfoListParams) error

func (*AppManagement) ComposeAppUpdatePlan added in v0.4.52

func (a *AppManagement) ComposeAppUpdatePlan(ctx echo.Context, params codegen.ComposeAppUpdatePlanParams) error

func (*AppManagement) ComposeAppUpdateRun added in v0.4.52

func (a *AppManagement) ComposeAppUpdateRun(ctx echo.Context) error

func (*AppManagement) ContainerDetail added in v0.4.38

func (a *AppManagement) ContainerDetail(ctx echo.Context, id codegen.ContainerID) error

ContainerDetail describes one container.

func (*AppManagement) Convert

func (a *AppManagement) Convert(ctx echo.Context, params codegen.ConvertParams) error

func (*AppManagement) CreateGitApp added in v0.4.57

func (a *AppManagement) CreateGitApp(ctx echo.Context) error

func (*AppManagement) DanglingImages

func (a *AppManagement) DanglingImages(ctx echo.Context) error

func (*AppManagement) DeleteBackupDestination added in v0.4.37

func (a *AppManagement) DeleteBackupDestination(ctx echo.Context, name codegen.BackupDestinationName) error

DeleteBackupDestination forgets one. What was copied there stays there.

func (*AppManagement) DeleteBackupRun added in v0.4.44

DeleteBackupRun removes one backup from a destination. The run log keeps its record: that a backup was taken and later deleted is history worth keeping.

func (*AppManagement) DeleteContainer added in v0.4.38

func (a *AppManagement) DeleteContainer(ctx echo.Context, id codegen.ContainerID) error

DeleteContainer removes a container and, if asked and if allowed, some of its named volumes.

func (*AppManagement) DeleteGitApp added in v0.4.57

func (a *AppManagement) DeleteGitApp(ctx echo.Context, app codegen.GitAppName) error

func (*AppManagement) DeleteGlobalSetting

func (a *AppManagement) DeleteGlobalSetting(ctx echo.Context, key codegen.GlobalSettingKey) error

func (*AppManagement) DeployGitApp added in v0.4.57

func (a *AppManagement) DeployGitApp(ctx echo.Context, app codegen.GitAppName) error

func (*AppManagement) DisableBackupDestinationRestic added in v0.4.83

func (a *AppManagement) DisableBackupDestinationRestic(ctx echo.Context, name codegen.BackupDestinationName) error

DisableBackupDestinationRestic sends the next backups of a destination back to rclone. Nothing is deleted: the repository and its key stay, and it can be taken up again.

func (*AppManagement) EnableBackupDestinationRestic added in v0.4.78

func (a *AppManagement) EnableBackupDestinationRestic(ctx echo.Context, name codegen.BackupDestinationName) error

EnableBackupDestinationRestic switches a destination to restic and hands back the password of its repository (read back later by BackupDestinationResticPassword).

func (*AppManagement) ForceBackupSchedules added in v0.4.92

func (a *AppManagement) ForceBackupSchedules(ctx echo.Context) error

ForceBackupSchedules runs the enabled schedules now, or those the body narrows to, and answers once they have started: 202 when one did, 409 when none could, 404 when none matched.

func (*AppManagement) GetAppGrid

func (a *AppManagement) GetAppGrid(ctx echo.Context) error

func (*AppManagement) GetGitApp added in v0.4.57

func (a *AppManagement) GetGitApp(ctx echo.Context, app codegen.GitAppName) error

func (*AppManagement) GetGitAppTags added in v0.4.62

func (a *AppManagement) GetGitAppTags(ctx echo.Context, app codegen.GitAppName) error

func (*AppManagement) GetGlobalSetting

func (a *AppManagement) GetGlobalSetting(ctx echo.Context, key codegen.GlobalSettingKey) error

func (*AppManagement) GetGlobalSettings

func (a *AppManagement) GetGlobalSettings(ctx echo.Context) error

func (*AppManagement) GetLogsSettings added in v0.4.85

func (a *AppManagement) GetLogsSettings(ctx echo.Context) error

GetLogsSettings returns the retention, the size cap, the use and where the logs are kept.

func (*AppManagement) Info

func (a *AppManagement) Info(ctx echo.Context) error

func (*AppManagement) InstallComposeApp

func (a *AppManagement) InstallComposeApp(ctx echo.Context, params codegen.InstallComposeAppParams) error

func (*AppManagement) IsNewComposeUncontrolled

func (a *AppManagement) IsNewComposeUncontrolled(newComposeApp *service.ComposeApp) (bool, error)

func (*AppManagement) LogsApps added in v0.4.85

func (a *AppManagement) LogsApps(ctx echo.Context) error

LogsApps lists the apps with logs on disk, with their title and icon when installed.

func (*AppManagement) LogsEvents added in v0.4.85

func (a *AppManagement) LogsEvents(ctx echo.Context, params codegen.LogsEventsParams) error

LogsEvents returns the matching events, newest first.

func (*AppManagement) LogsExport added in v0.4.85

func (a *AppManagement) LogsExport(ctx echo.Context, params codegen.LogsExportParams) error

LogsExport streams the matching lines oldest first, as kept on disk, page by page.

func (*AppManagement) LogsQuery added in v0.4.85

func (a *AppManagement) LogsQuery(ctx echo.Context, params codegen.LogsQueryParams) error

LogsQuery returns one page of history and the events of its window.

func (*AppManagement) LogsStream added in v0.4.85

func (a *AppManagement) LogsStream(ctx echo.Context, _ codegen.LogsStreamParams) error

LogsStream sends the new lines and events as they come, one JSON message each, until the client goes.

func (*AppManagement) MyComposeApp

func (a *AppManagement) MyComposeApp(ctx echo.Context, id codegen.ComposeAppID) error

func (*AppManagement) MyComposeAppList

func (a *AppManagement) MyComposeAppList(ctx echo.Context) error

func (*AppManagement) PruneDanglingImages

func (a *AppManagement) PruneDanglingImages(ctx echo.Context) error

Synchronous, unlike the recreate and pull endpoints that hand work to a goroutine and report progress over the message bus. Those have no answer to give back; this one's whole point is the number of bytes freed, and dangling-only bounds the work to what the GET just measured -- a handful of layers on this kind of box. The request's context carries the cancellation, so navigating away stops it.

func (*AppManagement) PullImages

func (a *AppManagement) PullImages(ctx echo.Context, params codegen.PullImagesParams) error

func (*AppManagement) ReceiveGitWebhook added in v0.4.61

func (a *AppManagement) ReceiveGitWebhook(ctx echo.Context, app codegen.GitAppName) error

ReceiveGitWebhook is a forge's delivery. It carries no token: route/v2.go lets this method and path through, and the service checks the signature instead.

func (*AppManagement) RecreateContainerByID

func (a *AppManagement) RecreateContainerByID(ctx echo.Context, id codegen.ContainerID, params codegen.RecreateContainerByIDParams) error

func (*AppManagement) RegisterAppStore

func (a *AppManagement) RegisterAppStore(ctx echo.Context, params codegen.RegisterAppStoreParams) error

the method should be deprecated but it be used by CasaOS

func (*AppManagement) RegisterAppStoreSync

func (a *AppManagement) RegisterAppStoreSync(ctx echo.Context, params codegen.RegisterAppStoreSyncParams) error

func (*AppManagement) RestoreBackup added in v0.4.41

func (a *AppManagement) RestoreBackup(ctx echo.Context) error

RestoreBackup puts an app back from a backup, in the background.

func (*AppManagement) SetBackupDestination added in v0.4.37

func (a *AppManagement) SetBackupDestination(ctx echo.Context, name codegen.BackupDestinationName) error

SetBackupDestination adds or replaces one.

func (*AppManagement) SetBackupSchedules added in v0.4.37

func (a *AppManagement) SetBackupSchedules(ctx echo.Context) error

SetBackupSchedules replaces the lot.

Every schedule is checked before any is saved. A list saved half-valid is a box where some backups run and some silently never will, and nothing on the screen tells the two apart.

func (*AppManagement) SetBackupVerificationSchedule added in v0.4.92

func (a *AppManagement) SetBackupVerificationSchedule(ctx echo.Context) error

SetBackupVerificationSchedule saves it. The body is read strictly: a misspelt field would otherwise save a default nobody chose. A last_run sent is the box's to keep and is ignored.

func (*AppManagement) SetComposeAppContainerStatus added in v0.4.37

func (a *AppManagement) SetComposeAppContainerStatus(ctx echo.Context, id codegen.ComposeAppID, containerID codegen.ComposeContainerID) error

SetComposeAppContainerStatus starts, stops or restarts ONE container of a compose app.

The app-level route next to this one acts on every service at once, which is the wrong tool for most of what goes wrong on a multi-service stack: a database that wedged, a sidecar that needs its config re-read. Taking the whole stack down to fix one of its parts is a bigger outage than the fault.

This runs synchronously, unlike the app-level status change. One container is quick, the caller redraws the row as soon as it answers, and an error worth showing arrives as an error rather than as a row that silently never changes.

func (*AppManagement) SetComposeAppStatus

func (a *AppManagement) SetComposeAppStatus(ctx echo.Context, id codegen.ComposeAppID) error

func (*AppManagement) SetLogsSettings added in v0.4.85

func (a *AppManagement) SetLogsSettings(ctx echo.Context) error

SetLogsSettings saves the retention and size cap.

func (*AppManagement) SetStatsAlerts added in v0.4.70

func (a *AppManagement) SetStatsAlerts(ctx echo.Context, id codegen.StatsItemID) error

SetStatsAlerts replaces the rules of a container. The request validator skips this route (route/v2.go): every malformed body, whatever its fault, is bad_rules naming the field, and the body is bounded before it is read.

func (*AppManagement) StartBackupVerification added in v0.4.92

func (a *AppManagement) StartBackupVerification(ctx echo.Context) error

func (*AppManagement) StatsAlerts added in v0.4.70

func (a *AppManagement) StatsAlerts(ctx echo.Context, id codegen.StatsItemID) error

StatsAlerts returns the rules of a container and its firing alerts.

func (*AppManagement) StatsList added in v0.4.70

func (a *AppManagement) StatsList(ctx echo.Context) error

StatsList lists the containers with their latest use. The body is bare, as the contract asks.

func (*AppManagement) StatsSeries added in v0.4.70

StatsSeries returns one container's history over range (live when absent).

func (*AppManagement) StopRunningBackup added in v0.4.93

func (a *AppManagement) StopRunningBackup(ctx echo.Context, backupID string) error

StopRunningBackup stops one backup; the pass it belongs to goes on.

func (*AppManagement) UninstallComposeApp

func (a *AppManagement) UninstallComposeApp(ctx echo.Context, id codegen.ComposeAppID, params codegen.UninstallComposeAppParams) error

func (*AppManagement) UnregisterAppStore

func (a *AppManagement) UnregisterAppStore(ctx echo.Context, id codegen.AppStoreID) error

func (*AppManagement) UpdateComposeApp

func (a *AppManagement) UpdateComposeApp(ctx echo.Context, id codegen.ComposeAppID, params codegen.UpdateComposeAppParams) error

func (*AppManagement) UpdateComposeApps added in v0.4.52

func (a *AppManagement) UpdateComposeApps(ctx echo.Context) error

func (*AppManagement) UpdateGitApp added in v0.4.57

func (a *AppManagement) UpdateGitApp(ctx echo.Context, app codegen.GitAppName) error

func (*AppManagement) UpdateGlobalSetting

func (a *AppManagement) UpdateGlobalSetting(ctx echo.Context, key codegen.GlobalSettingKey) error

func (*AppManagement) UpgradableAppList

func (a *AppManagement) UpgradableAppList(ctx echo.Context) error

Jump to

Keyboard shortcuts

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