Files
tiny-forge/internal/api/config_export.go
T
alexei.dolgolyov 791cd4d6af
Build / build (push) Successful in 12m20s
feat: rename Docker Watcher to Tinyforge
Rebrand the project as Tinyforge to reflect its evolution from a Docker
container watcher into a self-hosted mini CI/deployment platform.

Rename covers: Go module path, Docker labels, DB/config filenames,
JWT issuer, Dockerfile binary, docker-compose, CI workflows, frontend
i18n, README with static sites docs, and all code comments.
2026-04-12 21:30:39 +03:00

24 lines
634 B
Go

package api
import (
"log/slog"
"net/http"
"github.com/alexei/tinyforge/internal/config"
)
// exportConfig handles GET /api/config/export — downloads current state as YAML.
func (s *Server) exportConfig(w http.ResponseWriter, r *http.Request) {
data, err := config.ExportConfig(s.store)
if err != nil {
slog.Error("failed to export config", "error", err)
respondError(w, http.StatusInternalServerError, "internal server error")
return
}
w.Header().Set("Content-Type", "application/x-yaml")
w.Header().Set("Content-Disposition", "attachment; filename=tinyforge.yaml")
w.WriteHeader(http.StatusOK)
w.Write(data)
}