From 71cb2bea920528b260da457409d3097151cd4a2e Mon Sep 17 00:00:00 2001 From: Wikid82 Date: Mon, 24 Nov 2025 02:41:42 +0000 Subject: [PATCH] feat: Update certificate service path to use configurable Caddy data directory --- backend/internal/api/routes/routes.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/backend/internal/api/routes/routes.go b/backend/internal/api/routes/routes.go index 37fde1ff..56fe3970 100644 --- a/backend/internal/api/routes/routes.go +++ b/backend/internal/api/routes/routes.go @@ -167,14 +167,9 @@ func Register(router *gin.Engine, db *gorm.DB, cfg config.Config) error { userHandler.RegisterRoutes(api) // Certificate routes - // Use cfg.CaddyConfigDir + "/data" for cert service - // In Docker, Caddy stores data in /data, so we should look there - // But our config might point elsewhere. - // Let's use the standard Caddy data directory which is usually /data in the container - // or respect XDG_DATA_HOME if set. - // For now, let's assume /data/caddy/certificates based on standard Caddy docker image - // or the volume mount 'caddy_data_local:/data' - caddyDataDir := "/data/caddy" + // Use cfg.CaddyConfigDir + "/data" for cert service so we scan the actual Caddy storage + // where ACME and certificates are stored (e.g. /data). + caddyDataDir := cfg.CaddyConfigDir + "/data" certService := services.NewCertificateService(caddyDataDir, db) certHandler := handlers.NewCertificateHandler(certService, notificationService) api.GET("/certificates", certHandler.List)