mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-23 02:11:01 +00:00
Trim last "/" from WOODPECKER_HOST config (#2538)
https://youtu.be/dGwC_AxaWLo?t=770 ( https://youtu.be/dGwC_AxaWLo?t=1020 )
This commit is contained in:
parent
4e0b0bd9b6
commit
bb17d25963
1 changed files with 2 additions and 8 deletions
|
@ -83,12 +83,6 @@ func run(c *cli.Context) error {
|
|||
)
|
||||
}
|
||||
|
||||
if strings.HasSuffix(c.String("server-host"), "/") {
|
||||
log.Fatal().Msg(
|
||||
"WOODPECKER_HOST must not have trailing slash",
|
||||
)
|
||||
}
|
||||
|
||||
_forge, err := setupForge(c)
|
||||
if err != nil {
|
||||
log.Fatal().Err(err).Msg("")
|
||||
|
@ -226,7 +220,7 @@ func run(c *cli.Context) error {
|
|||
certmagic.DefaultACME.Email = c.String("lets-encrypt-email")
|
||||
certmagic.DefaultACME.Agreed = true
|
||||
|
||||
address, err := url.Parse(c.String("server-host"))
|
||||
address, err := url.Parse(strings.TrimSuffix(c.String("server-host"), "/"))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -328,7 +322,7 @@ func setupEvilGlobals(c *cli.Context, v store.Store, f forge.Forge) {
|
|||
server.Config.Server.Cert = c.String("server-cert")
|
||||
server.Config.Server.Key = c.String("server-key")
|
||||
server.Config.Server.AgentToken = c.String("agent-secret")
|
||||
serverHost := c.String("server-host")
|
||||
serverHost := strings.TrimSuffix(c.String("server-host"), "/")
|
||||
server.Config.Server.Host = serverHost
|
||||
if c.IsSet("server-webhook-host") {
|
||||
server.Config.Server.WebhookHost = c.String("server-webhook-host")
|
||||
|
|
Loading…
Reference in a new issue