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
|
|
|
|
|
2022-02-23 00:06:39 +00:00
|
|
|
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")
|
2022-11-18 17:08:18 +00:00
|
|
|
c.Set("Content-Security-Policy", "default-src 'none'; frame-ancestors 'none'; base-uri 'none'; form-action 'none'; 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
|
|
|
}
|