mirror of
https://github.com/genuinetools/reg.git
synced 2024-09-28 11:46:20 -04:00
Add flag to trust ssl certificates signed by unknown authority (#16)
This commit is contained in:
parent
e8a0e8958a
commit
d91bf05217
2 changed files with 16 additions and 3 deletions
|
@ -29,6 +29,7 @@ GLOBAL OPTIONS:
|
||||||
--username value, -u value username for the registry
|
--username value, -u value username for the registry
|
||||||
--password value, -p value password for the registry
|
--password value, -p value password for the registry
|
||||||
--registry value, -r value URL to the private registry (ex. r.j3ss.co)
|
--registry value, -r value URL to the private registry (ex. r.j3ss.co)
|
||||||
|
--insecure, -k do not verify tls certificates of registry
|
||||||
--port value port for server to run on (default: "8080")
|
--port value port for server to run on (default: "8080")
|
||||||
--cert value path to ssl cert
|
--cert value path to ssl cert
|
||||||
--key value path to ssl key
|
--key value path to ssl key
|
||||||
|
|
|
@ -32,6 +32,7 @@ var (
|
||||||
updating = false
|
updating = false
|
||||||
wg sync.WaitGroup
|
wg sync.WaitGroup
|
||||||
tmpl *template.Template
|
tmpl *template.Template
|
||||||
|
r *registry.Registry
|
||||||
)
|
)
|
||||||
|
|
||||||
// preload initializes any global options and configuration
|
// preload initializes any global options and configuration
|
||||||
|
@ -69,6 +70,10 @@ func main() {
|
||||||
Name: "registry, r",
|
Name: "registry, r",
|
||||||
Usage: "URL to the private registry (ex. r.j3ss.co)",
|
Usage: "URL to the private registry (ex. r.j3ss.co)",
|
||||||
},
|
},
|
||||||
|
cli.BoolFlag{
|
||||||
|
Name: "insecure, k",
|
||||||
|
Usage: "do not verify tls certificates of registry",
|
||||||
|
},
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "port",
|
Name: "port",
|
||||||
Value: "8080",
|
Value: "8080",
|
||||||
|
@ -99,9 +104,16 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// create the registry client
|
// create the registry client
|
||||||
r, err := registry.New(auth, c.GlobalBool("debug"))
|
if c.GlobalBool("insecure") {
|
||||||
if err != nil {
|
r, err = registry.NewInsecure(auth, c.GlobalBool("debug"))
|
||||||
logrus.Fatal(err)
|
if err != nil {
|
||||||
|
logrus.Fatal(err)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
r, err = registry.New(auth, c.GlobalBool("debug"))
|
||||||
|
if err != nil {
|
||||||
|
logrus.Fatal(err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// get the path to the static directory
|
// get the path to the static directory
|
||||||
|
|
Loading…
Reference in a new issue