Documentation
¶
Index ¶
- Constants
- Variables
- func CleanupInstallSecret() error
- func ConsumeInstallSecret() error
- func EnsureInstallSecret() error
- func InstallLockStatus() bool
- func InstallSecretPath() string
- func IsInstallTimeoutExceeded() bool
- func SetInstallStartupTimeForTest(start time.Time)
- func ValidateInstallSecret(secret string) error
- func ValidateSSLCertificates(sslCert, sslKey string) error
Constants ¶
const ( InstallSecretHeaderName = "X-Install-Secret" InstallSecretQueryKey = "install_secret" InstallSecretFileName = ".install_secret" InstallWindow = 10 * time.Minute )
Variables ¶
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 ¶
SetInstallStartupTimeForTest updates the setup window start time for tests.
func ValidateInstallSecret ¶
ValidateInstallSecret validates the provided setup token against the hidden file.
func ValidateSSLCertificates ¶
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.