Allow configuring the URL to user documentation

This commit is contained in:
Alex Eftimie 2021-05-27 06:58:30 +02:00
parent f694d6f2e4
commit 943a308afe
3 changed files with 8 additions and 1 deletions

View file

@ -118,6 +118,12 @@ var flags = []cli.Flag{
Usage: "file path for the drone config",
Value: ".drone.yml",
},
cli.StringFlag{
EnvVar: "DRONE_DOCS,WOODPECKER_DOCS",
Name: "docs",
Usage: "link to user documentation",
Value: "https://woodpecker.laszlo.cloud",
},
cli.DurationFlag{
EnvVar: "DRONE_SESSION_EXPIRES,WOODPECKER_SESSION_EXPIRES",
Name: "session-expires",

View file

@ -203,6 +203,7 @@ func setupTree(c *cli.Context) *httptreemux.ContextMux {
web.New(
web.WithDir(c.String("www")),
web.WithSync(time.Hour*72),
web.WithDocs(c.String("docs"))
).Register(tree)
return tree
}

View file

@ -172,7 +172,7 @@ const LOGO = (
<br />
<span>
<a
href="https://woodpecker.laszlo.cloud"
href={window.DRONE_DOCS}
target="_blank"
rel="noopener noreferrer"
>