add privacy-policy [skip-tests]
All checks were successful
Build Docker and Deploy / Run Unit-Tests (push) Has been skipped
Build Docker and Deploy / Build Docker Container (push) Successful in 1m9s
Build Docker and Deploy / Deploy to Server (push) Successful in 8s

This commit is contained in:
2025-11-10 15:13:13 +01:00
parent 6306555a30
commit dfb4d9d9e5
3 changed files with 77 additions and 5 deletions

View File

@@ -1,18 +1,19 @@
package handler
import (
"errors"
"net/http"
"regexp"
"strings"
"blackforestbytes.com/simplecloudnotifier/api/ginresp"
"blackforestbytes.com/simplecloudnotifier/logic"
"blackforestbytes.com/simplecloudnotifier/models"
"blackforestbytes.com/simplecloudnotifier/website"
"errors"
"git.blackforestbytes.com/BlackForestBytes/goext/ginext"
"git.blackforestbytes.com/BlackForestBytes/goext/rext"
"github.com/gin-gonic/gin"
"github.com/rs/zerolog/log"
"net/http"
"regexp"
"strings"
)
type WebsiteHandler struct {
@@ -77,6 +78,18 @@ func (h WebsiteHandler) MessageSent(pctx ginext.PreContext) ginext.HTTPResponse
})
}
func (h WebsiteHandler) PrivacyPolicy(pctx ginext.PreContext) ginext.HTTPResponse {
ctx, g, errResp := pctx.Start()
if errResp != nil {
return *errResp
}
defer ctx.Cancel()
return h.app.DoRequest(ctx, g, models.TLockNone, func(ctx *logic.AppContext, finishSuccess func(r ginext.HTTPResponse) ginext.HTTPResponse) ginext.HTTPResponse {
return h.serveAsset(g, "privacy_policy.html", true)
})
}
func (h WebsiteHandler) FaviconIco(pctx ginext.PreContext) ginext.HTTPResponse {
ctx, g, errResp := pctx.Start()
if errResp != nil {

View File

@@ -1,11 +1,12 @@
package api
import (
"errors"
"blackforestbytes.com/simplecloudnotifier/api/handler"
"blackforestbytes.com/simplecloudnotifier/logic"
"blackforestbytes.com/simplecloudnotifier/models"
"blackforestbytes.com/simplecloudnotifier/swagger"
"errors"
"git.blackforestbytes.com/BlackForestBytes/goext/ginext"
"github.com/gin-gonic/gin/binding"
"github.com/go-playground/validator/v10"
@@ -98,6 +99,10 @@ func (r *Router) Init(e *ginext.GinWrapper) error {
frontend.GET("/message_sent.php").Handle(r.websiteHandler.MessageSent)
frontend.GET("/message_sent.html").Handle(r.websiteHandler.MessageSent)
frontend.GET("/privacy_policy").Handle(r.websiteHandler.PrivacyPolicy)
frontend.GET("/privacy_policy.php").Handle(r.websiteHandler.PrivacyPolicy)
frontend.GET("/privacy_policy.html").Handle(r.websiteHandler.PrivacyPolicy)
frontend.GET("/favicon.ico").Handle(r.websiteHandler.FaviconIco)
frontend.GET("/favicon.png").Handle(r.websiteHandler.FaviconPNG)