Files
OpenFlare/internal/apps/openflare/pages/errs.go
T

67 lines
5.6 KiB
Go

// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
// Package pages provides logics and management for OpenFlare static page deployments.
package pages
const (
errPagesProjectNotFound = "pages project was not found"
errPagesSlugExists = "pages project slug already exists"
errPagesNameRequired = "pages project name must not be empty"
errPagesSlugInvalid = "pages project slug may only contain lowercase letters, digits and hyphens"
errPagesDeleteReferenced = "pages project is referenced by rules and cannot be deleted"
errPagesDeploymentNotFound = "pages deployment was not found"
errPagesDeploymentMismatch = "pages deployment does not belong to this project"
errPagesDeleteActiveDeploy = "the active Pages deployment cannot be deleted"
errPagesPackageMissing = "missing Pages deployment archive"
errPagesPackageURLRequired = "enter the deployment archive download URL"
errPagesPackageURLInvalid = "invalid deployment archive URL; only HTTP and HTTPS are supported"
errPagesPackageURLDownloadFailed = "Failed to download deployment archive from URL"
errPagesPackageURLTooLarge = "Deployment archive at the URL exceeds the size limit"
errPagesPackageNotZip = "Pages deployment archive must be a .zip file" // legacy alias kept for tests
errPagesPackageUnsupported = "pages archives support zip, tar.gz, tar.xz, tar.bz2, tar and 7z formats only"
errPagesPackageInvalidZip = "Pages deployment archive is not a valid ZIP file" // legacy alias
errPagesPackageInvalid = "pages deployment archive is not a valid compressed archive"
errPagesPackageEmpty = "pages deployment archive must not be empty"
errPagesPackageExtractedTooLarge = "extracted Pages deployment exceeds the size limit"
errPagesPackageFileTooLarge = "a file in the Pages deployment archive exceeds the size limit"
errPagesAPIProxyPathRequired = "match path is required when the API reverse proxy is enabled"
errPagesAPIProxyPathPrefix = "API reverse proxy match path must start with '/'"
errPagesAPIProxyPassRequired = "backend URL is required when the API reverse proxy is enabled" //nolint:gosec // false positive: this is an error message, not hardcoded credentials
errPagesAPIProxyPassInvalid = "API reverse proxy backend must be a valid HTTP/HTTPS URL" //nolint:gosec // false positive: this is an error message, not hardcoded credentials
errPagesPackagePathEmpty = "Pages deployment archive path is empty"
errPagesPackageUploadMissing = "pages deployment archive upload record was not found"
errPagesPackageNotInActiveConfig = "pages deployment is not included in the active configuration"
errPagesDeploymentHashMissing = "pages deployment archive hash is missing"
errPagesInvalidSnapshotFormat = "invalid configuration snapshot format"
errPagesActorMissing = "Unable to identify the current user"
errPagesEntryFileMissing = "The specified entry file does not exist in the active deployment"
errPagesSourceNotFound = "pages deployment source was not found"
errPagesSourceTypeRequired = "select a Pages deployment source type"
errPagesSourceTypeUnsupported = "unsupported Pages deployment source type"
errPagesSourceRemoteFields = "remote URL sources must not include GitHub or automatic update configuration"
errPagesSourceRemoteURLRequired = "provide the remote deployment archive URL"
errPagesSourceRemoteURLInvalid = "invalid remote archive URL; use HTTP/HTTPS without user information or fragments"
errPagesSourceGitHubFields = "GitHub Release sources must not include remote URL configuration"
errPagesSourceRepositoryInvalid = "invalid GitHub repository URL; use https://github.com/{owner}/{repo}"
errPagesSourceSelectorInvalid = "invalid GitHub Release selection mode"
errPagesSourceAssetNameInvalid = "GitHub Release asset name must be a safe filename"
errPagesSourceCheckInterval = "GitHub latest check interval must be between 5 and 1440 minutes"
errPagesSourceAutoNotAvailable = "Automatic updates will be available in a later stage and must remain disabled for now"
errPagesSourceReleaseNotFound = "no GitHub Release asset matches the configuration"
errPagesSourceDigestInvalid = "invalid GitHub Release asset digest format"
errPagesSourceDigestMismatch = "GitHub Release asset digest verification failed"
errPagesSourceConfirmationNeeded = "an asset in the same release was replaced; refresh and confirm the current version"
errPagesSourceConfirmationStale = "the confirmed version has changed; refresh and confirm again"
errPagesSourceInitialCheckWarning = "Deployment source saved, but the initial check could not be enqueued; run a manual check later"
errPagesSourceCheckUnsupported = "remote URL sources do not support update checks; use Sync now"
errPagesSourceActionBusy = "a Pages deployment source task is already running"
errPagesSourceActionInvalid = "invalid Pages deployment source task parameters"
errPagesSourceActionStale = "Pages deployment source configuration changed; task skipped"
errPagesSourceLeaseLost = "pages deployment source task ownership is no longer valid"
errPagesSourceLeaseExpired = "Previous Pages deployment source task lease expired"
errPagesSourceSyncFailed = "pages deployment source synchronization failed"
errPagesSourceTaskDispatchFailed = "failed to enqueue Pages deployment source task"
errPagesSourceInternal = "Pages deployment source operation failed; please try again later"
)