feat(static): Add privacy policy page and route
Some checks failed
CI / Test (1.22) (push) Failing after -24m9s
CI / Test (1.23) (push) Failing after -24m10s
CI / Build (push) Successful in -26m43s
CI / Lint (push) Successful in -26m29s

- Implement ServePrivacyPolicy handler to serve the privacy policy.
- Update index.html to include a link to the privacy policy.
- Add privacy-policy.html file with content outlining data handling practices.
This commit is contained in:
Hein
2026-02-04 19:19:35 +02:00
parent 592ed24204
commit 6d7687a311
5 changed files with 205 additions and 2 deletions

View File

@@ -31,6 +31,20 @@ func (h *Handlers) ServeIndex(w http.ResponseWriter, r *http.Request) {
writeBytes(w, content)
}
// ServePrivacyPolicy serves the privacy policy page
func (h *Handlers) ServePrivacyPolicy(w http.ResponseWriter, r *http.Request) {
content, err := staticFiles.ReadFile("static/privacy-policy.html")
if err != nil {
logging.Error("Failed to read privacy-policy.html", "error", err)
http.Error(w, "Internal Server Error", http.StatusInternalServerError)
return
}
w.Header().Set("Content-Type", "text/html; charset=utf-8")
w.WriteHeader(http.StatusOK)
writeBytes(w, content)
}
// ServeStatic serves static files (logo, etc.)
func (h *Handlers) ServeStatic(w http.ResponseWriter, r *http.Request) {
// Get the file path from URL
@@ -53,6 +67,8 @@ func (h *Handlers) ServeStatic(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "image/jpeg")
case ".svg":
w.Header().Set("Content-Type", "image/svg+xml")
case ".html":
w.Header().Set("Content-Type", "text/html; charset=utf-8")
case ".css":
w.Header().Set("Content-Type", "text/css")
case ".js":