mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-23 17:17:46 +01:00
Merge pull request #7593 from reasonerjt/ext-url-systeminfo
Add Ext URL to response of systeminfo API
This commit is contained in:
commit
56c7d55c73
@ -3998,6 +3998,12 @@ definitions:
|
|||||||
admiral_endpoint:
|
admiral_endpoint:
|
||||||
type: string
|
type: string
|
||||||
description: The url of the endpoint of admiral instance.
|
description: The url of the endpoint of admiral instance.
|
||||||
|
registry_url:
|
||||||
|
type: string
|
||||||
|
description: The url of registry against which the docker command should be issued.
|
||||||
|
external_url:
|
||||||
|
type: string
|
||||||
|
description: The external URL of Harbor, with protocol.
|
||||||
auth_mode:
|
auth_mode:
|
||||||
type: string
|
type: string
|
||||||
description: The auth mode of current Harbor instance.
|
description: The auth mode of current Harbor instance.
|
||||||
|
@ -97,6 +97,7 @@ type GeneralInfo struct {
|
|||||||
AuthMode string `json:"auth_mode"`
|
AuthMode string `json:"auth_mode"`
|
||||||
AuthProxySettings *models.HTTPAuthProxy `json:"authproxy_settings,omitempty"`
|
AuthProxySettings *models.HTTPAuthProxy `json:"authproxy_settings,omitempty"`
|
||||||
RegistryURL string `json:"registry_url"`
|
RegistryURL string `json:"registry_url"`
|
||||||
|
ExtURL string `json:"external_url"`
|
||||||
ProjectCreationRestrict string `json:"project_creation_restriction"`
|
ProjectCreationRestrict string `json:"project_creation_restriction"`
|
||||||
SelfRegistration bool `json:"self_registration"`
|
SelfRegistration bool `json:"self_registration"`
|
||||||
HasCARoot bool `json:"has_ca_root"`
|
HasCARoot bool `json:"has_ca_root"`
|
||||||
@ -162,8 +163,9 @@ func (sia *SystemInfoAPI) GetGeneralInfo() {
|
|||||||
sia.SendInternalServerError(fmt.Errorf("Unexpected error: %v", err))
|
sia.SendInternalServerError(fmt.Errorf("Unexpected error: %v", err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
extURL := cfg[common.ExtEndpoint].(string)
|
||||||
var registryURL string
|
var registryURL string
|
||||||
if l := strings.Split(cfg[common.ExtEndpoint].(string), "://"); len(l) > 1 {
|
if l := strings.Split(extURL, "://"); len(l) > 1 {
|
||||||
registryURL = l[1]
|
registryURL = l[1]
|
||||||
} else {
|
} else {
|
||||||
registryURL = l[0]
|
registryURL = l[0]
|
||||||
@ -178,6 +180,7 @@ func (sia *SystemInfoAPI) GetGeneralInfo() {
|
|||||||
AuthMode: utils.SafeCastString(cfg[common.AUTHMode]),
|
AuthMode: utils.SafeCastString(cfg[common.AUTHMode]),
|
||||||
ProjectCreationRestrict: utils.SafeCastString(cfg[common.ProjectCreationRestriction]),
|
ProjectCreationRestrict: utils.SafeCastString(cfg[common.ProjectCreationRestriction]),
|
||||||
SelfRegistration: utils.SafeCastBool(cfg[common.SelfRegistration]),
|
SelfRegistration: utils.SafeCastBool(cfg[common.SelfRegistration]),
|
||||||
|
ExtURL: extURL,
|
||||||
RegistryURL: registryURL,
|
RegistryURL: registryURL,
|
||||||
HasCARoot: caStatErr == nil,
|
HasCARoot: caStatErr == nil,
|
||||||
HarborVersion: harborVersion,
|
HarborVersion: harborVersion,
|
||||||
|
Loading…
Reference in New Issue
Block a user