about summary refs log tree commit diff stats
path: root/server.go
diff options
context:
space:
mode:
authorAlan Pearce2024-04-19 22:13:14 +0200
committerAlan Pearce2024-04-19 22:13:42 +0200
commit0d1de2258553f16c9cd492f02f591c4d5457f958 (patch)
tree6c3055dc10983f5d7dcad75a48295a1801136879 /server.go
parentbf469bae36ebad75bfd167074f104b6b2d66a3b0 (diff)
downloadwebsite-0d1de2258553f16c9cd492f02f591c4d5457f958.tar.lz
website-0d1de2258553f16c9cd492f02f591c4d5457f958.tar.zst
website-0d1de2258553f16c9cd492f02f591c4d5457f958.zip
Brand executable with commit hash for server header
Diffstat (limited to 'server.go')
-rw-r--r--server.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/server.go b/server.go
index b34c933..69dca43 100644
--- a/server.go
+++ b/server.go
@@ -46,6 +46,8 @@ type Host struct {
 //go:embed all:public/*
 var fs embed.FS
 
+var Commit string
+
 func main() {
 	config := Config{}
 	if help, err := conf.Parse("", &config); err != nil {
@@ -92,7 +94,6 @@ func main() {
 		GETOnly:                 true,
 		ReadTimeout:             5 * time.Minute,
 		WriteTimeout:            5 * time.Minute,
-		ServerHeader:            "Fiber",
 		StrictRouting:           true,
 		UnescapePath:            true,
 	})
@@ -135,6 +136,7 @@ func main() {
 
 	toplevel := fiber.New(fiber.Config{
 		DisableStartupMessage: config.Production,
+		ServerHeader:          fmt.Sprintf("website (%s)", Commit),
 	})
 	toplevel.Get("/health", func(c *fiber.Ctx) error {
 		return c.SendStatus(fiber.StatusOK)