mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2026-04-15 01:41:56 +00:00
@@ -61,8 +61,8 @@ var flags = []cli.Flag{
|
||||
Usage: "server fully qualified url for forge's Webhooks (<scheme>://<host>)",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
EnvVars: []string{"WOODPECKER_ROOT_URL"},
|
||||
Name: "root-url",
|
||||
EnvVars: []string{"WOODPECKER_ROOT_PATH", "WOODPECKER_ROOT_URL"},
|
||||
Name: "root-path",
|
||||
Usage: "server url root (used for statics loading when having a url path prefix)",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
|
||||
@@ -357,7 +357,11 @@ func setupEvilGlobals(c *cli.Context, v store.Store, f forge.Forge) {
|
||||
server.Config.Server.StatusContext = c.String("status-context")
|
||||
server.Config.Server.StatusContextFormat = c.String("status-context-format")
|
||||
server.Config.Server.SessionExpires = c.Duration("session-expires")
|
||||
server.Config.Server.RootURL = strings.TrimSuffix(c.String("root-url"), "/")
|
||||
rootPath := strings.TrimSuffix(c.String("root-path"), "/")
|
||||
if rootPath != "" && !strings.HasPrefix(rootPath, "/") {
|
||||
rootPath = "/" + rootPath
|
||||
}
|
||||
server.Config.Server.RootPath = rootPath
|
||||
server.Config.Server.CustomCSSFile = strings.TrimSpace(c.String("custom-css-file"))
|
||||
server.Config.Server.CustomJsFile = strings.TrimSpace(c.String("custom-js-file"))
|
||||
server.Config.Pipeline.Networks = c.StringSlice("network")
|
||||
|
||||
Reference in New Issue
Block a user