mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-04-24 22:06:57 +00:00
usage of ctx.StringSlice and cli.StringSliceFlag
rename param pages-branches with pages-branch
This commit is contained in:
parent
06bde50161
commit
5db46e99fe
2 changed files with 7 additions and 6 deletions
|
@ -15,11 +15,11 @@ var ServeFlags = []cli.Flag{
|
|||
Value: "codeberg.page",
|
||||
},
|
||||
// Default branches to fetch assets from
|
||||
&cli.StringFlag{
|
||||
Name: "pages-branches",
|
||||
Usage: "defines branches to fetch assets from",
|
||||
&cli.StringSliceFlag{
|
||||
Name: "pages-branch",
|
||||
Usage: "define a branch to fetch assets from",
|
||||
EnvVars: []string{"PAGES_BRANCHES"},
|
||||
Value: "pages",
|
||||
Value: &cli.StringSlice{},
|
||||
},
|
||||
// GiteaRoot specifies the root URL of the Gitea instance, without a trailing slash.
|
||||
&cli.StringFlag{
|
||||
|
|
|
@ -48,11 +48,10 @@ func Serve(ctx *cli.Context) error {
|
|||
giteaAPIToken := ctx.String("gitea-api-token")
|
||||
rawDomain := ctx.String("raw-domain")
|
||||
mainDomainSuffix := []byte(ctx.String("pages-domain"))
|
||||
defaultBranches := strings.Split(strings.ReplaceAll(ctx.String("pages-branches"), " ", ""), ",")
|
||||
defaultBranches := ctx.StringSlice("pages-branch")
|
||||
rawInfoPage := ctx.String("raw-info-page")
|
||||
listeningAddress := fmt.Sprintf("%s:%s", ctx.String("host"), ctx.String("port"))
|
||||
enableHTTPServer := ctx.Bool("enable-http-server")
|
||||
|
||||
acmeAPI := ctx.String("acme-api-endpoint")
|
||||
acmeMail := ctx.String("acme-email")
|
||||
acmeUseRateLimits := ctx.Bool("acme-use-rate-limits")
|
||||
|
@ -78,6 +77,8 @@ func Serve(ctx *cli.Context) error {
|
|||
defaultBranches = []string{"pages"}
|
||||
}
|
||||
|
||||
fmt.Printf("%+v\n", defaultBranches)
|
||||
|
||||
keyCache := cache.NewKeyValueCache()
|
||||
challengeCache := cache.NewKeyValueCache()
|
||||
// canonicalDomainCache stores canonical domains
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue