mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-04-25 06:16:58 +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",
|
Value: "codeberg.page",
|
||||||
},
|
},
|
||||||
// Default branches to fetch assets from
|
// Default branches to fetch assets from
|
||||||
&cli.StringFlag{
|
&cli.StringSliceFlag{
|
||||||
Name: "pages-branches",
|
Name: "pages-branch",
|
||||||
Usage: "defines branches to fetch assets from",
|
Usage: "define a branch to fetch assets from",
|
||||||
EnvVars: []string{"PAGES_BRANCHES"},
|
EnvVars: []string{"PAGES_BRANCHES"},
|
||||||
Value: "pages",
|
Value: &cli.StringSlice{},
|
||||||
},
|
},
|
||||||
// GiteaRoot specifies the root URL of the Gitea instance, without a trailing slash.
|
// GiteaRoot specifies the root URL of the Gitea instance, without a trailing slash.
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
|
|
|
@ -48,11 +48,10 @@ func Serve(ctx *cli.Context) error {
|
||||||
giteaAPIToken := ctx.String("gitea-api-token")
|
giteaAPIToken := ctx.String("gitea-api-token")
|
||||||
rawDomain := ctx.String("raw-domain")
|
rawDomain := ctx.String("raw-domain")
|
||||||
mainDomainSuffix := []byte(ctx.String("pages-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")
|
rawInfoPage := ctx.String("raw-info-page")
|
||||||
listeningAddress := fmt.Sprintf("%s:%s", ctx.String("host"), ctx.String("port"))
|
listeningAddress := fmt.Sprintf("%s:%s", ctx.String("host"), ctx.String("port"))
|
||||||
enableHTTPServer := ctx.Bool("enable-http-server")
|
enableHTTPServer := ctx.Bool("enable-http-server")
|
||||||
|
|
||||||
acmeAPI := ctx.String("acme-api-endpoint")
|
acmeAPI := ctx.String("acme-api-endpoint")
|
||||||
acmeMail := ctx.String("acme-email")
|
acmeMail := ctx.String("acme-email")
|
||||||
acmeUseRateLimits := ctx.Bool("acme-use-rate-limits")
|
acmeUseRateLimits := ctx.Bool("acme-use-rate-limits")
|
||||||
|
@ -78,6 +77,8 @@ func Serve(ctx *cli.Context) error {
|
||||||
defaultBranches = []string{"pages"}
|
defaultBranches = []string{"pages"}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fmt.Printf("%+v\n", defaultBranches)
|
||||||
|
|
||||||
keyCache := cache.NewKeyValueCache()
|
keyCache := cache.NewKeyValueCache()
|
||||||
challengeCache := cache.NewKeyValueCache()
|
challengeCache := cache.NewKeyValueCache()
|
||||||
// canonicalDomainCache stores canonical domains
|
// canonicalDomainCache stores canonical domains
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue