diff --git a/src/common/models/config.go b/src/common/models/config.go index 844796ed9..60da3996e 100644 --- a/src/common/models/config.go +++ b/src/common/models/config.go @@ -72,36 +72,6 @@ type HTTPAuthProxy struct { AlwaysOnBoard bool `json:"always_onboard"` } -/* -// Registry ... -type Registry struct { - URL string `json:"url"` -} - -// TokenService ... -type TokenService struct { - URL string `json:"url"` -} - -// SystemCfg holds all configurations of system -type SystemCfg struct { - DomainName string `json:"domain_name"` // Harbor external URL: protocol://host:port - Authentication *Authentication `json:"authentication"` - Database *Database `json:"database"` - TokenService *TokenService `json:"token_service"` - Registry *Registry `json:"registry"` - Email *Email `json:"email"` - VerifyRemoteCert bool `json:"verify_remote_cert"` - ProjectCreationRestriction string `json:"project_creation_restriction"` - MaxJobWorkers int `json:"max_job_workers"` - JobLogDir string `json:"job_log_dir"` - InitialAdminPwd string `json:"initial_admin_pwd,omitempty"` - TokenExpiration int `json:"token_expiration"` // in minute - SecretKey string `json:"secret_key,omitempty"` - CfgExpiration int `json:"cfg_expiration"` -} -*/ - // ConfigEntry ... type ConfigEntry struct { ID int64 `orm:"pk;auto;column(id)" json:"-"` diff --git a/src/core/auth/db/db_test.go b/src/core/auth/db/db_test.go index 161cf4823..3ca0c81c4 100644 --- a/src/core/auth/db/db_test.go +++ b/src/core/auth/db/db_test.go @@ -30,38 +30,23 @@ import ( ) var adminServerTestConfig = map[string]interface{}{ - common.ExtEndpoint: "host01.com", - common.AUTHMode: "db_auth", - common.DatabaseType: "postgresql", - common.PostGreSQLHOST: "127.0.0.1", - common.PostGreSQLPort: 5432, - common.PostGreSQLUsername: "postgres", - common.PostGreSQLPassword: "root123", - common.PostGreSQLDatabase: "registry", - // config.SelfRegistration: true, - common.LDAPURL: "ldap://127.0.0.1", - common.LDAPSearchDN: "cn=admin,dc=example,dc=com", - common.LDAPSearchPwd: "admin", - common.LDAPBaseDN: "dc=example,dc=com", - common.LDAPUID: "uid", - common.LDAPFilter: "", - common.LDAPScope: 3, - common.LDAPTimeout: 30, - // config.TokenServiceURL: "", - // config.RegistryURL: "", - // config.EmailHost: "", - // config.EmailPort: 25, - // config.EmailUsername: "", - // config.EmailPassword: "password", - // config.EmailFrom: "from", - // config.EmailSSL: true, - // config.EmailIdentity: "", - // config.ProjectCreationRestriction: config.ProCrtRestrAdmOnly, - // config.VerifyRemoteCert: false, - // config.MaxJobWorkers: 3, - // config.TokenExpiration: 30, - common.CfgExpiration: 5, - // config.JobLogDir: "/var/log/jobs", + common.ExtEndpoint: "host01.com", + common.AUTHMode: "db_auth", + common.DatabaseType: "postgresql", + common.PostGreSQLHOST: "127.0.0.1", + common.PostGreSQLPort: 5432, + common.PostGreSQLUsername: "postgres", + common.PostGreSQLPassword: "root123", + common.PostGreSQLDatabase: "registry", + common.LDAPURL: "ldap://127.0.0.1", + common.LDAPSearchDN: "cn=admin,dc=example,dc=com", + common.LDAPSearchPwd: "admin", + common.LDAPBaseDN: "dc=example,dc=com", + common.LDAPUID: "uid", + common.LDAPFilter: "", + common.LDAPScope: 3, + common.LDAPTimeout: 30, + common.CfgExpiration: 5, common.AdminInitialPassword: "password", } diff --git a/src/core/auth/ldap/ldap_test.go b/src/core/auth/ldap/ldap_test.go index 210795e97..566fd93f9 100644 --- a/src/core/auth/ldap/ldap_test.go +++ b/src/core/auth/ldap/ldap_test.go @@ -42,29 +42,15 @@ var ldapTestConfig = map[string]interface{}{ common.PostGreSQLPassword: "root123", common.PostGreSQLDatabase: "registry", // config.SelfRegistration: true, - common.LDAPURL: "ldap://127.0.0.1", - common.LDAPSearchDN: "cn=admin,dc=example,dc=com", - common.LDAPSearchPwd: "admin", - common.LDAPBaseDN: "dc=example,dc=com", - common.LDAPUID: "uid", - common.LDAPFilter: "", - common.LDAPScope: 2, - common.LDAPTimeout: 30, - // config.TokenServiceURL: "", - // config.RegistryURL: "", - // config.EmailHost: "", - // config.EmailPort: 25, - // config.EmailUsername: "", - // config.EmailPassword: "password", - // config.EmailFrom: "from", - // config.EmailSSL: true, - // config.EmailIdentity: "", - // config.ProjectCreationRestriction: config.ProCrtRestrAdmOnly, - // config.VerifyRemoteCert: false, - // config.MaxJobWorkers: 3, - // config.TokenExpiration: 30, - common.CfgExpiration: 5, - // config.JobLogDir: "/var/log/jobs", + common.LDAPURL: "ldap://127.0.0.1", + common.LDAPSearchDN: "cn=admin,dc=example,dc=com", + common.LDAPSearchPwd: "admin", + common.LDAPBaseDN: "dc=example,dc=com", + common.LDAPUID: "uid", + common.LDAPFilter: "", + common.LDAPScope: 2, + common.LDAPTimeout: 30, + common.CfgExpiration: 5, common.AdminInitialPassword: "password", common.LDAPGroupSearchFilter: "objectclass=groupOfNames", common.LDAPGroupBaseDN: "dc=example,dc=com",