mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-24 08:02:18 +02:00
enable redirect for http to https when certs provided
This commit is contained in:
parent
c22dc6e5fa
commit
99b10537ba
@ -508,12 +508,18 @@ func server(c *cli.Context) error {
|
||||
|
||||
// start the server with tls enabled
|
||||
if c.String("server-cert") != "" {
|
||||
return http.ListenAndServeTLS(
|
||||
c.String("server-addr"),
|
||||
c.String("server-cert"),
|
||||
c.String("server-key"),
|
||||
handler,
|
||||
)
|
||||
g.Go(func() error {
|
||||
return http.ListenAndServe(":http", handler)
|
||||
})
|
||||
g.Go(func() error {
|
||||
return http.ListenAndServeTLS(
|
||||
":https",
|
||||
c.String("server-cert"),
|
||||
c.String("server-key"),
|
||||
handler,
|
||||
)
|
||||
})
|
||||
return g.Wait()
|
||||
}
|
||||
|
||||
// start the server without tls enabled
|
||||
|
Loading…
Reference in New Issue
Block a user