Documentation ¶
Overview ¶
Package config provide config for core api and other modules Before accessing user settings, need to call Load() For system settings, no need to call Load()
Index ¶
- Variables
- func AdmiralEndpoint() string
- func AuthMode() (string, error)
- func ClairDB() (*models.PostGreSQL, error)
- func ClairEndpoint() string
- func CoreSecret() string
- func Database() (*models.Database, error)
- func Email() (*models.Email, error)
- func ExtEndpoint() (string, error)
- func ExtURL() (string, error)
- func GetCfgManager() *comcfg.CfgManager
- func GetChartMuseumEndpoint() (string, error)
- func GetClairHealthCheckServerURL() string
- func GetPortalURL() string
- func GetRedisOfRegURL() string
- func GetRegistryCtlURL() string
- func GetSystemCfg() (map[string]interface{}, error)
- func HTTPAuthProxySetting() (*models.HTTPAuthProxy, error)
- func Init() error
- func InitWithSettings(cfgs map[string]interface{}, kp ...comcfg.KeyProvider)
- func InitialAdminPassword() (string, error)
- func InternalCoreURL() string
- func InternalJobServiceURL() string
- func InternalNotaryEndpoint() string
- func InternalTokenServiceEndpoint() string
- func JobserviceSecret() string
- func LDAPConf() (*models.LdapConf, error)
- func LDAPGroupConf() (*models.LdapGroupConf, error)
- func Load() error
- func OIDCSetting() (*models.OIDCSetting, error)
- func OnlyAdminCreateProject() (bool, error)
- func ReadOnly() bool
- func RegistryURL() (string, error)
- func RobotTokenDuration() int
- func ScanAllPolicy() models.ScanAllPolicy
- func SecretKey() (string, error)
- func SelfRegistration() (bool, error)
- func TokenExpiration() (int, error)
- func TokenPrivateKeyPath() string
- func UAASettings() (*models.UAASettings, error)
- func Upload(cfg map[string]interface{}) error
- func WithAdmiral() bool
- func WithChartMuseum() bool
- func WithClair() bool
- func WithNotary() bool
Constants ¶
This section is empty.
Variables ¶
var ( // SecretStore manages secrets SecretStore *secret.Store // GlobalProjectMgr is initialized based on the deploy mode GlobalProjectMgr promgr.ProjectManager // AdmiralClient is initialized only under integration deploy mode // and can be passed to project manager as a parameter AdmiralClient *http.Client // TokenReader is used in integration mode to read token TokenReader admiral.TokenReader )
Functions ¶
func AdmiralEndpoint ¶
func AdmiralEndpoint() string
AdmiralEndpoint returns the URL of admiral, if Harbor is not deployed with admiral it should return an empty string.
func ClairEndpoint ¶
func ClairEndpoint() string
ClairEndpoint returns the end point of clair instance, by default it's the one deployed within Harbor.
func CoreSecret ¶
func CoreSecret() string
CoreSecret returns a secret to mark harbor-core when communicate with other component
func ExtEndpoint ¶
ExtEndpoint returns the external URL of Harbor: protocol://host:port
func GetCfgManager ¶ added in v1.8.0
func GetCfgManager() *comcfg.CfgManager
GetCfgManager return the current config manager
func GetChartMuseumEndpoint ¶
GetChartMuseumEndpoint returns the endpoint of the chartmuseum service otherwise an non nil error is returned
func GetClairHealthCheckServerURL ¶ added in v1.8.0
func GetClairHealthCheckServerURL() string
GetClairHealthCheckServerURL returns the URL of the health check server of Clair
func GetPortalURL ¶ added in v1.8.0
func GetPortalURL() string
GetPortalURL returns the URL of portal
func GetRedisOfRegURL ¶ added in v1.8.0
func GetRedisOfRegURL() string
GetRedisOfRegURL returns the URL of Redis used by registry
func GetRegistryCtlURL ¶ added in v1.8.0
func GetRegistryCtlURL() string
GetRegistryCtlURL returns the URL of registryctl
func GetSystemCfg ¶
GetSystemCfg returns the system configurations
func HTTPAuthProxySetting ¶ added in v1.8.0
func HTTPAuthProxySetting() (*models.HTTPAuthProxy, error)
HTTPAuthProxySetting returns the setting of HTTP Auth proxy. the settings are only meaningful when the auth_mode is set to http_auth
func InitWithSettings ¶ added in v1.8.0
func InitWithSettings(cfgs map[string]interface{}, kp ...comcfg.KeyProvider)
InitWithSettings init config with predefined configs, and optionally overwrite the keyprovider
func InitialAdminPassword ¶
InitialAdminPassword returns the initial password for administrator
func InternalCoreURL ¶
func InternalCoreURL() string
InternalCoreURL returns the local harbor core url
func InternalJobServiceURL ¶
func InternalJobServiceURL() string
InternalJobServiceURL returns jobservice URL for internal communication between Harbor containers
func InternalNotaryEndpoint ¶
func InternalNotaryEndpoint() string
InternalNotaryEndpoint returns notary server endpoint for internal communication between Harbor containers This is currently a conventional value and can be unaccessible when Harbor is not deployed with Notary.
func InternalTokenServiceEndpoint ¶
func InternalTokenServiceEndpoint() string
InternalTokenServiceEndpoint returns token service endpoint for internal communication between Harbor containers
func JobserviceSecret ¶
func JobserviceSecret() string
JobserviceSecret returns a secret to mark Jobservice when communicate with other component TODO replace it with method of SecretStore
func LDAPGroupConf ¶
func LDAPGroupConf() (*models.LdapGroupConf, error)
LDAPGroupConf returns the setting of ldap group search
func OIDCSetting ¶ added in v1.8.0
func OIDCSetting() (*models.OIDCSetting, error)
OIDCSetting returns the setting of OIDC provider, currently there's only one OIDC provider allowed for Harbor and it's only effective when auth_mode is set to oidc_auth
func OnlyAdminCreateProject ¶
OnlyAdminCreateProject returns the flag to restrict that only sys admin can create project
func ReadOnly ¶
func ReadOnly() bool
ReadOnly returns a bool to indicates if Harbor is in read only mode.
func RobotTokenDuration ¶ added in v1.8.0
func RobotTokenDuration() int
RobotTokenDuration returns the token expiration time of robot account (in minute)
func ScanAllPolicy ¶
func ScanAllPolicy() models.ScanAllPolicy
ScanAllPolicy returns the policy which controls the scan all.
func SelfRegistration ¶
SelfRegistration returns the enablement of self registration
func TokenExpiration ¶
TokenExpiration returns the token expiration time (in minute)
func TokenPrivateKeyPath ¶
func TokenPrivateKeyPath() string
TokenPrivateKeyPath returns the path to the key for signing token for registry
func UAASettings ¶
func UAASettings() (*models.UAASettings, error)
UAASettings returns the UAASettings to access UAA service.
func WithAdmiral ¶
func WithAdmiral() bool
WithAdmiral returns a bool to indicate if Harbor's deployed with admiral.
func WithChartMuseum ¶
func WithChartMuseum() bool
WithChartMuseum returns a bool to indicate if chartmuseum is deployed with Harbor.
func WithClair ¶
func WithClair() bool
WithClair returns a bool value to indicate if Harbor's deployed with Clair
func WithNotary ¶
func WithNotary() bool
WithNotary returns a bool value to indicate if Harbor's deployed with Notary
Types ¶
This section is empty.