PostgreSQL backup tool with Point-In-Time-Recovery and restore verification
TypeScript backupbackupsdatabasedatabase-backupdevopsdockergolangkubernetesmariadbmongodbmysqlpgpostgrespostgresqls3self-hostedsystem-administrationtoolsweb-ui
FEATURE (api): Disable cache by default behind reverse_proxy, CDN, cloudflare
Rostislav Dugin238ca4e65c4b
diff --git a/backend/cmd/main.go b/backend/cmd/main.goindex 14a1db9f..380f0597 100644--- a/backend/cmd/main.go+++ b/backend/cmd/main.go@@ -216,6 +216,8 @@ func startServerWithGracefulShutdown(log *slog.Logger, app *gin.Engine) {func setUpRoutes(r *gin.Engine) {v1 := r.Group("/api/v1")+ v1.Use(noStoreCacheControl())+// Mount Swagger UIv1.GET("/docs/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))@@ -470,6 +472,17 @@ func enableCors(ginApp *gin.Engine) {}}+// noStoreCacheControl marks every API response uncacheable. The API serves+// only dynamic, often sensitive data (backup metadata, tokens, agent binaries,+// version); a stale cached response — e.g. an outdated /system/version behind+// a CDN — must never reach a client.+func noStoreCacheControl() gin.HandlerFunc {+ return func(ctx *gin.Context) {+ ctx.Header("Cache-Control", "no-store")+ ctx.Next()+ }+}+func ginRecoveryWithLogger(log *slog.Logger) gin.HandlerFunc {return func(ctx *gin.Context) {defer func() {