mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-04-25 06:16:58 +00:00
try each default branch instead of 'pages' only
This commit is contained in:
parent
dc634287aa
commit
9c412966fc
2 changed files with 33 additions and 23 deletions
|
@ -48,6 +48,7 @@ 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"), " ", ""), ",")
|
||||
rawInfoPage := ctx.String("raw-info-page")
|
||||
listeningAddress := fmt.Sprintf("%s:%s", ctx.String("host"), ctx.String("port"))
|
||||
enableHTTPServer := ctx.Bool("enable-http-server")
|
||||
|
@ -73,6 +74,10 @@ func Serve(ctx *cli.Context) error {
|
|||
mainDomainSuffix = append([]byte{'.'}, mainDomainSuffix...)
|
||||
}
|
||||
|
||||
if len(defaultBranches) == 0 {
|
||||
defaultBranches = []string{"pages"}
|
||||
}
|
||||
|
||||
keyCache := cache.NewKeyValueCache()
|
||||
challengeCache := cache.NewKeyValueCache()
|
||||
// canonicalDomainCache stores canonical domains
|
||||
|
@ -95,7 +100,9 @@ func Serve(ctx *cli.Context) error {
|
|||
giteaClient,
|
||||
giteaRoot, rawInfoPage,
|
||||
BlacklistedPaths, allowedCorsDomains,
|
||||
dnsLookupCache, canonicalDomainCache, branchTimestampCache, fileResponseCache)
|
||||
dnsLookupCache, canonicalDomainCache, branchTimestampCache, fileResponseCache,
|
||||
defaultBranches,
|
||||
)
|
||||
|
||||
fastServer := server.SetupServer(handler)
|
||||
httpServer := server.SetupHTTPACMEChallengeServer(challengeCache)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue