system

package
v1.9.10-0...-1ccd1c0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InstallSecretHeaderName = "X-Install-Secret"
	InstallSecretQueryKey   = "install_secret"
	InstallSecretFileName   = ".install_secret"
	InstallWindow           = 10 * time.Minute
)

Variables

View Source
var (
	ErrInstalled             = e.New(40301, "Nginx UI already installed")
	ErrInstallTimeout        = e.New(40302, "installation is not allowed after 10 minutes of system startup")
	ErrInstallSecretRequired = e.New(40309, "Install secret is required")
	ErrInstallSecretInvalid  = e.New(40310, "Install secret is invalid")
	ErrInstallSecretExpired  = e.New(40311, "Install secret has expired")

	ErrSSLCertRequired     = e.New(40303, "SSL certificate path is required when HTTPS is enabled")
	ErrSSLKeyRequired      = e.New(40304, "SSL key path is required when HTTPS is enabled")
	ErrSSLCertNotFound     = e.New(40305, "SSL certificate file not found")
	ErrSSLKeyNotFound      = e.New(40306, "SSL key file not found")
	ErrSSLCertNotUnderConf = e.New(40307, "SSL certificate file must be under Nginx configuration directory: {0}")
	ErrSSLKeyNotUnderConf  = e.New(40308, "SSL key file must be under Nginx configuration directory: {0}")
	ErrSSLKeyPairInvalid   = e.New(40312, "SSL certificate and key do not form a valid pair: {0}")
)

System error definitions

Functions

func CleanupInstallSecret

func CleanupInstallSecret() error

CleanupInstallSecret removes the hidden install secret file if present.

func ConsumeInstallSecret

func ConsumeInstallSecret() error

ConsumeInstallSecret removes the current install secret after successful setup.

func EnsureInstallSecret

func EnsureInstallSecret() error

EnsureInstallSecret refreshes the install secret for a fresh, uninstalled instance.

func InstallLockStatus

func InstallLockStatus() bool

InstallLockStatus checks if the system is installed.

func InstallSecretPath

func InstallSecretPath() string

InstallSecretPath returns the hidden install secret file path in the config directory.

func IsInstallTimeoutExceeded

func IsInstallTimeoutExceeded() bool

IsInstallTimeoutExceeded checks if installation time limit is exceeded.

func SetInstallStartupTimeForTest

func SetInstallStartupTimeForTest(start time.Time)

SetInstallStartupTimeForTest updates the setup window start time for tests.

func ValidateInstallSecret

func ValidateInstallSecret(secret string) error

ValidateInstallSecret validates the provided setup token against the hidden file.

func ValidateSSLCertificates

func ValidateSSLCertificates(sslCert, sslKey string) error

ValidateSSLCertificates checks that the certificate and key are under the Nginx config directory and form a loadable TLS key pair.

Types

This section is empty.

Jump to

Keyboard shortcuts

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