Switch to modernc.org/sqlite and update dockerfile

This commit is contained in:
2026-05-06 19:00:28 +02:00
parent b28b9b127b
commit e5fd59f3ed
16 changed files with 162 additions and 127 deletions
+14 -1
View File
@@ -10,9 +10,22 @@ import (
"github.com/gofiber/fiber/v3"
)
func NewStaticHandler(storagePath string, siteRepo repository.SiteRepository) fiber.Handler {
func NewStaticHandler(storagePath string, siteRepo repository.SiteRepository, staticDashboardPath, dashboardHost string) fiber.Handler {
return func(c fiber.Ctx) error {
domain := c.Hostname()
if staticDashboardPath != "" && domain == dashboardHost {
urlPath := c.Path()
filePath := filepath.Join(staticDashboardPath, filepath.Clean(urlPath))
info, err := os.Stat(filePath)
if err == nil && !info.IsDir() {
return c.SendFile(filePath)
}
return c.SendFile(filepath.Join(staticDashboardPath, "index.html"))
}
site, err := siteRepo.GetSiteByDomain(domain)
if err != nil {
return c.Status(fiber.StatusInternalServerError).SendString("Failed to resolve site")