From 57c3e9f1b2c1d685472670b8ba2660144d2ae316 Mon Sep 17 00:00:00 2001 From: Henri Vasserman Date: Fri, 28 Mar 2025 19:38:34 +0200 Subject: Change how to make Anubis work without a reverse proxy (#86) * Change how to make Anubis work without a reverse proxy * Apply suggestions from code review Co-authored-by: Xe Iaso Signed-off-by: Henri Vasserman * add support for unix sockets. * add env var docs * lib: fix tests Signed-off-by: Xe Iaso --------- Signed-off-by: Henri Vasserman Signed-off-by: Xe Iaso Co-authored-by: Xe Iaso --- lib/anubis_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/anubis_test.go b/lib/anubis_test.go index 90d2cdf..58c8834 100644 --- a/lib/anubis_test.go +++ b/lib/anubis_test.go @@ -47,7 +47,7 @@ func TestCookieSettings(t *testing.T) { CookieName: t.Name(), }) - ts := httptest.NewServer(internal.DefaultXRealIP("127.0.0.1", srv)) + ts := httptest.NewServer(internal.RemoteXRealIP(true, "tcp", srv)) defer ts.Close() cli := &http.Client{ -- cgit v1.2.3 From 38d62eeb5676d010a08c439fdcedb4741c021bff Mon Sep 17 00:00:00 2001 From: Henri Vasserman Date: Fri, 28 Mar 2025 19:52:14 +0200 Subject: Hide directory browsing on the static content (#85) * Hide directory browsing on the static content * update changelog --- lib/anubis.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/anubis.go b/lib/anubis.go index 83e04dd..8d5dac1 100644 --- a/lib/anubis.go +++ b/lib/anubis.go @@ -119,7 +119,7 @@ func New(opts Options) (*Server, error) { mux := http.NewServeMux() xess.Mount(mux) - mux.Handle(anubis.StaticPath, internal.UnchangingCache(http.StripPrefix(anubis.StaticPath, http.FileServerFS(web.Static)))) + mux.Handle(anubis.StaticPath, internal.UnchangingCache(internal.NoBrowsing(http.StripPrefix(anubis.StaticPath, http.FileServerFS(web.Static))))) if opts.ServeRobotsTXT { mux.HandleFunc("/robots.txt", func(w http.ResponseWriter, r *http.Request) { -- cgit v1.2.3