constant

package
v1.10.24-lts Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AlertEnable      = "Enable"
	AlertDisable     = "Disable"
	AlertSuccess     = "Success"
	AlertError       = "Error"
	AlertSyncError   = "SyncError"
	AlertPushError   = "PushError"
	AlertPushSuccess = "PushSuccess"
)
View Source
const (
	Running     = "Running"
	UnHealthy   = "UnHealthy"
	Error       = "Error"
	Stopped     = "Stopped"
	Installing  = "Installing"
	DownloadErr = "DownloadErr"
	Upgrading   = "Upgrading"
	UpgradeErr  = "UpgradeErr"
	Rebuilding  = "Rebuilding"
	Syncing     = "Syncing"
	SyncSuccess = "SyncSuccess"
	Paused      = "Paused"
	UpErr       = "UpErr"
	SyncFailed  = "SyncFailed"

	ContainerPrefix = "1Panel-"

	AppNormal   = "Normal"
	AppTakeDown = "TakeDown"

	AppOpenresty  = "openresty"
	AppMysql      = "mysql"
	AppMariaDB    = "mariadb"
	AppPostgresql = "postgresql"
	AppRedis      = "redis"
	AppPostgres   = "postgres"
	AppMongodb    = "mongodb"
	AppMemcached  = "memcached"

	AppResourceLocal  = "local"
	AppResourceRemote = "remote"

	CPUS          = "CPUS"
	MemoryLimit   = "MEMORY_LIMIT"
	HostIP        = "HOST_IP"
	ContainerName = "CONTAINER_NAME"
)
View Source
const (
	Valid        = "VALID"
	DisConnect   = "DISCONNECT"
	VerifyFailed = "VERIFYFAILED"
	S3           = "S3"
	OSS          = "OSS"
	Sftp         = "SFTP"
	OneDrive     = "OneDrive"
	MinIo        = "MINIO"
	Cos          = "COS"
	Kodo         = "KODO"
	WebDAV       = "WebDAV"
	Local        = "LOCAL"

	OneDriveRedirectURI = "http://localhost/login/authorized"
)
View Source
const (
	DB DBContext = "db"

	SystemRestart = "systemRestart"

	TypeWebsite = "website"
	TypePhp     = "php"
	TypeSSL     = "ssl"
	TypeSystem  = "system"
)
View Source
const (
	TimeOut5s  = 5
	TimeOut20s = 20
	TimeOut5m  = 300

	DateLayout         = "2006-01-02" // or use time.DateOnly while go version >= 1.20
	DefaultDate        = "1970-01-01"
	DateTimeLayout     = "2006-01-02 15:04:05" // or use time.DateTime while go version >= 1.20
	DateTimeSlimLayout = "20060102150405"
)
View Source
const (
	ContainerOpStart   = "start"
	ContainerOpStop    = "stop"
	ContainerOpRestart = "restart"
	ContainerOpKill    = "kill"
	ContainerOpPause   = "pause"
	ContainerOpUnpause = "unpause"
	ContainerOpRename  = "rename"
	ContainerOpRemove  = "remove"

	ComposeOpStop    = "stop"
	ComposeOpRestart = "restart"
	ComposeOpRemove  = "remove"

	DaemonJsonPath = "/etc/docker/daemon.json"
)
View Source
const (
	CodeSuccess           = 200
	CodeErrBadRequest     = 400
	CodeErrUnauthorized   = 401
	CodeErrNotFound       = 404
	CodeAuth              = 406
	CodeGlobalLoading     = 407
	CodeErrInternalServer = 500

	CodeErrIP           = 310
	CodeErrDomain       = 311
	CodeErrEntrance     = 312
	CodePasswordExpired = 313

	CodeErrXpack = 410
)
View Source
const (
	Supervisord           = "supervisord"
	Supervisor            = "supervisor"
	SupervisorConfigPath  = "SupervisorConfigPath"
	SupervisorServiceName = "SupervisorServiceName"
)
View Source
const (
	NginxScopeServer = "server"
	NginxScopeHttp   = "http"
	NginxScopeOut    = "out"

	NginxReload  = "reload"
	NginxCheck   = "check"
	NginxRestart = "restart"

	ConfigNew    = "add"
	ConfigUpdate = "update"
	ConfigDel    = "delete"
)
View Source
const (
	ResourceLocal    = "local"
	ResourceAppstore = "appstore"

	RuntimeNormal     = "normal"
	RuntimeError      = "error"
	RuntimeBuildIng   = "building"
	RuntimeStarting   = "starting"
	RuntimeRunning    = "running"
	RuntimeReCreating = "recreating"
	RuntimeStopped    = "stopped"
	RuntimeUnhealthy  = "unhealthy"
	RuntimeCreating   = "creating"

	RuntimePHP    = "php"
	RuntimeNode   = "node"
	RuntimeJava   = "java"
	RuntimeGo     = "go"
	RuntimePython = "python"
	RuntimeDotNet = "dotnet"

	RuntimeProxyUnix = "unix"
	RuntimeProxyTcp  = "tcp"

	RuntimeUp      = "up"
	RuntimeDown    = "down"
	RuntimeRestart = "restart"

	RuntimeInstall   = "install"
	RuntimeUninstall = "uninstall"
	RuntimeUpdate    = "update"

	RuntimeNpm  = "npm"
	RuntimeYarn = "yarn"
)
View Source
const (
	AuthMethodSession = "session"
	SessionName       = "psession"

	AuthMethodJWT = "jwt"
	JWTHeaderName = "PanelAuthorization"
	JWTBufferTime = 3600
	JWTIssuer     = "1Panel"

	PasswordExpiredName = "expired"
)
View Source
const (
	StatusRunning   = "Running"
	StatusDone      = "Done"
	StatusWaiting   = "Waiting"
	StatusSuccess   = "Success"
	StatusFailed    = "Failed"
	StatusUploading = "Uploading"
	StatusEnable    = "Enable"
	StatusDisable   = "Disable"
	StatusNone      = "None"
	StatusOnRetry   = "OnRetry"
	StatusLost      = "Lost"

	OrderDesc = "descending"
	OrderAsc  = "ascending"
)
View Source
const (
	WebRunning = "Running"
	WebStopped = "Stopped"

	ProtocolHTTP  = "HTTP"
	ProtocolHTTPS = "HTTPS"

	NewApp       = "new"
	InstalledApp = "installed"

	Deployment = "deployment"
	Static     = "static"
	Proxy      = "proxy"
	Runtime    = "runtime"

	SSLExisted = "existed"
	SSLAuto    = "auto"
	SSLManual  = "manual"

	DNSAccount = "dnsAccount"
	DnsManual  = "dnsManual"
	Http       = "http"
	Manual     = "manual"
	SelfSigned = "selfSigned"

	StartWeb = "start"
	StopWeb  = "stop"

	HTTPSOnly   = "HTTPSOnly"
	HTTPAlso    = "HTTPAlso"
	HTTPToHTTPS = "HTTPToHTTPS"

	GetLog     = "get"
	DisableLog = "disable"
	EnableLog  = "enable"
	DeleteLog  = "delete"

	AccessLog = "access.log"
	ErrorLog  = "error.log"

	ConfigPHP = "php"
	ConfigFPM = "fpm"

	SSLInit       = "init"
	SSLError      = "error"
	SSLReady      = "ready"
	SSLApply      = "applying"
	SSLApplyError = "applyError"
)

Variables

View Source
var (
	DataDir              = global.CONF.System.DataDir
	ResourceDir          = path.Join(DataDir, "resource")
	AppResourceDir       = path.Join(ResourceDir, "apps")
	AppInstallDir        = path.Join(DataDir, "apps")
	LocalAppResourceDir  = path.Join(AppResourceDir, "local")
	LocalAppInstallDir   = path.Join(AppInstallDir, "local")
	RemoteAppResourceDir = path.Join(AppResourceDir, "remote")
	RuntimeDir           = path.Join(DataDir, "runtime")
	RecycleBinDir        = "/.1panel_clash"
	SSLLogDir            = path.Join(global.CONF.System.DataDir, "log", "ssl")
)
View Source
var (
	ErrCaptchaCode     = errors.New("ErrCaptchaCode")
	ErrAuth            = errors.New("ErrAuth")
	ErrRecordExist     = errors.New("ErrRecordExist")
	ErrRecordNotFound  = errors.New("ErrRecordNotFound")
	ErrStructTransform = errors.New("ErrStructTransform")
	ErrInitialPassword = errors.New("ErrInitialPassword")
	ErrNotSupportType  = errors.New("ErrNotSupportType")
	ErrInvalidParams   = errors.New("ErrInvalidParams")

	ErrTokenParse = errors.New("ErrTokenParse")
)

internal

View Source
var (
	ErrTypeInternalServer      = "ErrInternalServer"
	ErrTypeInvalidParams       = "ErrInvalidParams"
	ErrTypeNotLogin            = "ErrNotLogin"
	ErrTypePasswordExpired     = "ErrPasswordExpired"
	ErrNameIsExist             = "ErrNameIsExist"
	ErrDemoEnvironment         = "ErrDemoEnvironment"
	ErrCmdIllegal              = "ErrCmdIllegal"
	ErrXpackNotFound           = "ErrXpackNotFound"
	ErrXpackNotActive          = "ErrXpackNotActive"
	ErrXpackLost               = "ErrXpackLost"
	ErrXpackTimeout            = "ErrXpackTimeout"
	ErrXpackOutOfDate          = "ErrXpackOutOfDate"
	ErrApiConfigStatusInvalid  = "ErrApiConfigStatusInvalid"
	ErrApiConfigKeyInvalid     = "ErrApiConfigKeyInvalid"
	ErrApiConfigIPInvalid      = "ErrApiConfigIPInvalid"
	ErrApiConfigDisable        = "ErrApiConfigDisable"
	ErrApiConfigKeyTimeInvalid = "ErrApiConfigKeyTimeInvalid"
)

api

View Source
var (
	ErrPortInUsed          = "ErrPortInUsed"
	ErrAppLimit            = "ErrAppLimit"
	ErrFileCanNotRead      = "ErrFileCanNotRead"
	ErrNotInstall          = "ErrNotInstall"
	ErrPortInOtherApp      = "ErrPortInOtherApp"
	ErrDbUserNotValid      = "ErrDbUserNotValid"
	ErrUpdateBuWebsite     = "ErrUpdateBuWebsite"
	Err1PanelNetworkFailed = "Err1PanelNetworkFailed"
	ErrCmdTimeout          = "ErrCmdTimeout"
	ErrFileParse           = "ErrFileParse"
	ErrInstallDirNotFound  = "ErrInstallDirNotFound"
	ErrContainerName       = "ErrContainerName"
	ErrAppNameExist        = "ErrAppNameExist"
	ErrFileNotFound        = "ErrFileNotFound"
	ErrFileParseApp        = "ErrFileParseApp"
	ErrAppParamKey         = "ErrAppParamKey"
)

app

View Source
var (
	ErrDomainIsExist      = "ErrDomainIsExist"
	ErrAliasIsExist       = "ErrAliasIsExist"
	ErrGroupIsUsed        = "ErrGroupIsUsed"
	ErrUsernameIsExist    = "ErrUsernameIsExist"
	ErrUsernameIsNotExist = "ErrUsernameIsNotExist"
	ErrBackupMatch        = "ErrBackupMatch"
	ErrBackupExist        = "ErrBackupExist"
	ErrDomainIsUsed       = "ErrDomainIsUsed"
)

website

View Source
var (
	ErrSSLCannotDelete               = "ErrSSLCannotDelete"
	ErrAccountCannotDelete           = "ErrAccountCannotDelete"
	ErrSSLApply                      = "ErrSSLApply"
	ErrEmailIsExist                  = "ErrEmailIsExist"
	ErrEabKidOrEabHmacKeyCannotBlank = "ErrEabKidOrEabHmacKeyCannotBlank"
)

ssl

View Source
var (
	ErrPathNotFound     = "ErrPathNotFound"
	ErrMovePathFailed   = "ErrMovePathFailed"
	ErrLinkPathNotFound = "ErrLinkPathNotFound"
	ErrFileIsExist      = "ErrFileIsExist"
	ErrFileUpload       = "ErrFileUpload"
	ErrFileDownloadDir  = "ErrFileDownloadDir"
	ErrCmdNotFound      = "ErrCmdNotFound"
	ErrFavoriteExist    = "ErrFavoriteExist"
	ErrPathNotDelete    = "ErrPathNotDelete"
)

file

View Source
var (
	ErrUserIsExist     = "ErrUserIsExist"
	ErrDatabaseIsExist = "ErrDatabaseIsExist"
	ErrExecTimeOut     = "ErrExecTimeOut"
	ErrRemoteExist     = "ErrRemoteExist"
	ErrLocalExist      = "ErrLocalExist"
)

mysql

View Source
var (
	ErrInUsed            = "ErrInUsed"
	ErrObjectInUsed      = "ErrObjectInUsed"
	ErrObjectBeDependent = "ErrObjectBeDependent"
	ErrPortRules         = "ErrPortRules"
	ErrPgImagePull       = "ErrPgImagePull"
)

container

View Source
var (
	ErrDirNotFound         = "ErrDirNotFound"
	ErrFileNotExist        = "ErrFileNotExist"
	ErrImageBuildErr       = "ErrImageBuildErr"
	ErrImageExist          = "ErrImageExist"
	ErrDelWithWebsite      = "ErrDelWithWebsite"
	ErrRuntimeStart        = "ErrRuntimeStart"
	ErrPackageJsonNotFound = "ErrPackageJsonNotFound"
	ErrScriptsNotFound     = "ErrScriptsNotFound"
)

runtime

View Source
var (
	ErrBackupInUsed = "ErrBackupInUsed"
	ErrOSSConn      = "ErrOSSConn"
	ErrEntrance     = "ErrEntrance"
)
View Source
var (
	ErrFirewallNone = "ErrFirewallNone"
	ErrFirewallBoth = "ErrFirewallBoth"
)
View Source
var (
	ErrLicense      = "ErrLicense"
	ErrLicenseCheck = "ErrLicenseCheck"
	ErrXpackVersion = "ErrXpackVersion"
	ErrLicenseSave  = "ErrLicenseSave"
	ErrLicenseSync  = "ErrLicenseSync"
)

license

View Source
var (
	ErrAlert       = "ErrAlert"
	ErrAlertPush   = "ErrAlertPush"
	ErrAlertSave   = "ErrAlertSave"
	ErrAlertSync   = "ErrAlertSync"
	ErrAlertRemote = "ErrAlertRemote"
)

alert

View Source
var CertStore atomic.Value
View Source
var DynamicRoutes = []string{
	`^/containers/composeDetail/[^/]+$`,
	`^/databases/mysql/setting/[^/]+/[^/]+$`,
	`^/databases/postgresql/setting/[^/]+/[^/]+$`,
	`^/websites/[^/]+/config/[^/]+$`,
}
View Source
var (
	ErrBashExecute = "ErrBashExecute"
)

cronjob

View Source
var (
	ErrNotExistUser = "ErrNotExistUser"
)
View Source
var (
	ErrTypeOfRedis = "ErrTypeOfRedis"
)

redis

View Source
var WebUrlMap = map[string]struct{}{
	"/apps":           {},
	"/apps/all":       {},
	"/apps/installed": {},
	"/apps/upgrade":   {},

	"/containers":           {},
	"/containers/container": {},
	"/containers/image":     {},
	"/containers/network":   {},
	"/containers/volume":    {},
	"/containers/repo":      {},
	"/containers/compose":   {},
	"/containers/template":  {},
	"/containers/setting":   {},

	"/cronjobs": {},

	"/databases":                   {},
	"/databases/mysql":             {},
	"/databases/mysql/remote":      {},
	"/databases/postgresql":        {},
	"/databases/postgresql/remote": {},
	"/databases/redis":             {},
	"/databases/redis/remote":      {},

	"/hosts":                  {},
	"/hosts/files":            {},
	"/hosts/monitor/monitor":  {},
	"/hosts/monitor/setting":  {},
	"/hosts/terminal":         {},
	"/hosts/firewall/port":    {},
	"/hosts/firewall/forward": {},
	"/hosts/firewall/ip":      {},
	"/hosts/process/process":  {},
	"/hosts/process/network":  {},
	"/hosts/ssh/ssh":          {},
	"/hosts/ssh/log":          {},
	"/hosts/ssh/session":      {},

	"/logs":           {},
	"/logs/operation": {},
	"/logs/login":     {},
	"/logs/website":   {},
	"/logs/system":    {},
	"/logs/ssh":       {},

	"/settings":               {},
	"/settings/panel":         {},
	"/settings/backupaccount": {},
	"/settings/license":       {},
	"/settings/about":         {},
	"/settings/safe":          {},
	"/settings/snapshot":      {},
	"/settings/expired":       {},

	"/toolbox":              {},
	"/toolbox/device":       {},
	"/toolbox/supervisor":   {},
	"/toolbox/clam":         {},
	"/toolbox/clam/setting": {},
	"/toolbox/ftp":          {},
	"/toolbox/fail2ban":     {},
	"/toolbox/clean":        {},

	"/websites":                 {},
	"/websites/ssl":             {},
	"/websites/runtimes/php":    {},
	"/websites/runtimes/node":   {},
	"/websites/runtimes/java":   {},
	"/websites/runtimes/go":     {},
	"/websites/runtimes/python": {},
	"/websites/runtimes/dotnet": {},

	"/login": {},

	"/xpack":                   {},
	"/xpack/waf/dashboard":     {},
	"/xpack/waf/global":        {},
	"/xpack/waf/websites":      {},
	"/xpack/waf/log":           {},
	"/xpack/waf/block":         {},
	"/xpack/monitor/dashboard": {},
	"/xpack/monitor/setting":   {},
	"/xpack/monitor/rank":      {},
	"/xpack/monitor/log":       {},
	"/xpack/tamper":            {},
	"/xpack/gpu":               {},
	"/xpack/alert/dashboard":   {},
	"/xpack/alert/log":         {},
	"/xpack/alert/setting":     {},
	"/xpack/setting":           {},
}

Functions

This section is empty.

Types

type AppOperate

type AppOperate string
var (
	Start   AppOperate = "start"
	Stop    AppOperate = "stop"
	Restart AppOperate = "restart"
	Delete  AppOperate = "delete"
	Sync    AppOperate = "sync"
	Backup  AppOperate = "backup"
	Update  AppOperate = "update"
	Rebuild AppOperate = "rebuild"
	Upgrade AppOperate = "upgrade"
	Reload  AppOperate = "reload"
)

type DBContext

type DBContext string

Jump to

Keyboard shortcuts

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