fix: ACME HTTP-01 via nginx config without HTTPS redirect

This commit is contained in:
orohi
2026-06-17 06:12:54 +03:00
parent f2c05d15ec
commit 0000a8974d
8 changed files with 239 additions and 26 deletions
+4 -2
View File
@@ -13,6 +13,7 @@ import (
"github.com/panelhosting/panel/internal/config"
"github.com/panelhosting/panel/internal/handler"
"github.com/panelhosting/panel/internal/middleware"
"github.com/panelhosting/panel/internal/nginx"
"github.com/panelhosting/panel/internal/repository"
"github.com/panelhosting/panel/internal/setup"
"github.com/panelhosting/panel/internal/sitesvc"
@@ -33,8 +34,9 @@ func New(pool *pgxpool.Pool, cfg *config.Config) (*Server, error) {
sslRepo := repository.NewSSLRepository(pool)
challengeStore := ssl.NewChallengeStore()
issuer := ssl.NewIssuer(cfg.ACMEStaging, cfg.SSLStoragePath, challengeStore)
sslService := sslsvc.NewService(sslRepo, sites, issuer, cfg)
issuer := ssl.NewIssuer(cfg.ACMEStaging, cfg.SSLStoragePath, cfg.ACMEHTTPAddr, challengeStore)
ngx := nginx.NewManager(cfg.NginxSitesDir, cfg.NginxReloadCmd, cfg.SSLStoragePath)
sslService := sslsvc.NewService(sslRepo, sites, issuer, ngx, cfg)
setupSvc := setup.NewService(users, servers, cfg)
authSvc := authsvc.NewService(users, sessions, cfg.SessionTTLHours)