feat: Move the CNAME into the rio.json

This commit is contained in:
2024-02-03 15:39:31 +01:00
parent cf85380ddb
commit e3032c8233
7 changed files with 120 additions and 82 deletions

View File

@@ -56,7 +56,7 @@ func handleSubdomain(ctx *context.GlobalContext, domain, cname, path string, req
domain,
cname,
path,
ctx.Gitea,
ctx,
)
if err != nil {
log.Errorf("Failed to get repo: %s", err)
@@ -209,6 +209,20 @@ func runServer(ctx *cli.Context) error {
return err
}
// Prepare the context
cacheCtx := context.CacheContext{
RepositoryInformationCache: context.MakeRepoInfoCache(),
RepositoryPathCache: context.MakeRepoPathCache(),
UsernameCache: context.MakeUsernameCache(),
}
globalCtx := &context.GlobalContext{
DefaultCSP: defaultCsp,
PagesDomain: domain,
Gitea: &giteaClient,
MetricConfig: &lokiConfig,
Cache: &cacheCtx,
}
if !acmeDisable {
if acmeEmail == "" || acmeFile == "" || certsFile == "" || acmeDnsProvider == "" {
return errors.New("The options acme-dns-provider, acme-file, acme-email, and certs-file are required")
@@ -262,23 +276,11 @@ func runServer(ctx *cli.Context) error {
certsFile,
&cache,
acmeClient,
&giteaClient,
globalCtx,
)
listener = tls.NewListener(listener, tlsConfig)
}
// Prepare the context
cacheCtx := context.CacheContext{
RepositoryInformationCache: context.MakeRepoInfoCache(),
}
globalCtx := &context.GlobalContext{
DefaultCSP: defaultCsp,
PagesDomain: domain,
Gitea: &giteaClient,
MetricConfig: &lokiConfig,
Cache: &cacheCtx,
}
var waitGroup sync.WaitGroup
servers := 2
if acmeDisable {