aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorXe Iaso <me@xeiaso.net>2024-02-24 17:19:56 -0500
committerXe Iaso <me@xeiaso.net>2024-02-24 17:19:56 -0500
commite1556f80d2e015171b97270d029f09b0867c4b82 (patch)
tree8eb5678d9e1c54080f0bce8c0e6dd74e6b673c40 /cmd
parent3d26d38d144c974ae9ae39f86fee6c5447740f25 (diff)
downloadx-1.9.0.tar.xz
x-1.9.0.zip
cmd/xedn: prepare for tigris servingv1.9.0
Signed-off-by: Xe Iaso <me@xeiaso.net>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/xedn/fly.toml5
-rw-r--r--cmd/xedn/main.go8
2 files changed, 13 insertions, 0 deletions
diff --git a/cmd/xedn/fly.toml b/cmd/xedn/fly.toml
index c96fd08..e6cceda 100644
--- a/cmd/xedn/fly.toml
+++ b/cmd/xedn/fly.toml
@@ -23,6 +23,11 @@ auto_extend_size_threshold = 80
auto_extend_size_increment = "1GB"
auto_extend_size_limit = "100GB"
+#[[statics]]
+#url_prefix = "/file/christine-static"
+#guest_path = "/unused"
+#tigris_bucket = "xedn"
+#
[[services]]
protocol = "tcp"
internal_port = 8080
diff --git a/cmd/xedn/main.go b/cmd/xedn/main.go
index ffdcd02..5ede100 100644
--- a/cmd/xedn/main.go
+++ b/cmd/xedn/main.go
@@ -260,11 +260,19 @@ func main() {
h = xffMW.Handler(h)
h = cors.Default().Handler(h)
h = FlyRegionAnnotation(h)
+ h = XeDNAnnotation(h)
slog.Info("starting up", "addr", *addr)
http.ListenAndServe(*addr, h)
}
+func XeDNAnnotation(next http.Handler) http.Handler {
+ return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ w.Header().Set("XeDN", "true")
+ next.ServeHTTP(w, r)
+ })
+}
+
func FlyRegionAnnotation(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Fly-Region", os.Getenv("FLY_REGION"))