mirror of
https://github.com/goharbor/harbor.git
synced 2025-02-16 11:51:47 +01:00
refine
This commit is contained in:
parent
9d103d3b09
commit
dae7881088
@ -15,12 +15,10 @@ http {
|
||||
|
||||
upstream registry {
|
||||
server registry:5000;
|
||||
# check interval=2000 rise=1 fall=1 timeout=5000 type=tcp;
|
||||
}
|
||||
|
||||
upstream ui {
|
||||
server ui:80;
|
||||
# check interval=2000 rise=1 fall=1 timeout=5000 type=tcp;
|
||||
}
|
||||
|
||||
|
||||
|
@ -39,8 +39,8 @@ ui:
|
||||
- ./config/ui/app.conf:/etc/ui/app.conf
|
||||
- ./config/ui/private_key.pem:/etc/ui/private_key.pem
|
||||
links:
|
||||
- registry:registry
|
||||
- mysql:mysql
|
||||
- registry
|
||||
- mysql
|
||||
- log
|
||||
log_driver: "syslog"
|
||||
log_opt:
|
||||
@ -51,8 +51,8 @@ proxy:
|
||||
volumes:
|
||||
- ./config/nginx/nginx.conf:/etc/nginx/nginx.conf
|
||||
links:
|
||||
- ui:ui
|
||||
- registry:registry
|
||||
- ui
|
||||
- registry
|
||||
- log
|
||||
ports:
|
||||
- 80:80
|
||||
|
34
dao/base.go
34
dao/base.go
@ -1,16 +1,16 @@
|
||||
/*
|
||||
Copyright (c) 2016 VMware, Inc. All Rights Reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
Copyright (c) 2016 VMware, Inc. All Rights Reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
package dao
|
||||
|
||||
@ -50,12 +50,12 @@ func isContainIllegalChar(s string, illegalChar []string) bool {
|
||||
|
||||
func GenerateRandomString() (string, error) {
|
||||
o := orm.NewOrm()
|
||||
var salt string
|
||||
err := o.Raw(`select uuid() as uuid`).QueryRow(&salt)
|
||||
var uuid string
|
||||
err := o.Raw(`select uuid() as uuid`).QueryRow(&uuid)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return salt, nil
|
||||
return uuid, nil
|
||||
|
||||
}
|
||||
|
||||
@ -112,8 +112,8 @@ func init() {
|
||||
}()
|
||||
select {
|
||||
case <-ch:
|
||||
case <-time.After(30 * time.Second):
|
||||
panic("Failed to connect to DB after 30 seconds")
|
||||
case <-time.After(60 * time.Second):
|
||||
panic("Failed to connect to DB after 60 seconds")
|
||||
}
|
||||
orm.RegisterDataBase("default", "mysql", db_str)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user