rimgo/pages/frontpage.go

20 lines
562 B
Go
Raw Normal View History

2022-01-18 00:07:07 +00:00
package pages
2022-01-28 01:41:10 +00:00
import (
2023-06-10 16:27:20 +00:00
"codeberg.org/rimgo/rimgo/utils"
2022-01-28 01:41:10 +00:00
"github.com/gofiber/fiber/v2"
)
2022-01-18 00:07:07 +00:00
2023-06-10 16:04:29 +00:00
var VersionInfo string
func HandleFrontpage(c *fiber.Ctx) error {
2022-01-28 01:41:10 +00:00
utils.SetHeaders(c)
2022-07-16 20:02:59 +00:00
c.Set("X-Frame-Options", "DENY")
2022-01-28 01:41:10 +00:00
c.Set("Cache-Control", "public,max-age=31557600")
c.Set("Content-Security-Policy", "default-src 'none'; frame-ancestors 'none'; base-uri 'none'; form-action 'self'; style-src 'self'; img-src 'self'; manifest-src 'self'; block-all-mixed-content")
2022-01-18 00:07:07 +00:00
2022-02-02 15:53:33 +00:00
return c.Render("frontpage", fiber.Map{
2023-06-10 16:04:29 +00:00
"config": utils.Config,
"version": VersionInfo,
2022-02-02 15:53:33 +00:00
})
2022-01-18 00:07:07 +00:00
}