aboutsummaryrefslogtreecommitdiff
path: root/cmd/anubis/main.go
diff options
context:
space:
mode:
authorXe Iaso <me@xeiaso.net>2025-03-28 14:45:22 -0400
committerGitHub <noreply@github.com>2025-03-28 14:45:22 -0400
commitdfd4d42d17400e0291bcbf2a6373a32b35462350 (patch)
tree7ff7052a1d3721970abb655dcec191a510b28b5b /cmd/anubis/main.go
parent236e32ee9557cda24e8a20b5da0a904c8cd2ebd1 (diff)
parentbb4f49cfd94783111e2fbed99b4ea7a2077fa0bf (diff)
downloadanubis-Xe/deblob.tar.xz
anubis-Xe/deblob.zip
Merge branch 'main' into Xe/deblobXe/deblob
Signed-off-by: Xe Iaso <me@xeiaso.net>
Diffstat (limited to 'cmd/anubis/main.go')
-rw-r--r--cmd/anubis/main.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd/anubis/main.go b/cmd/anubis/main.go
index 7f98e7b..b634676 100644
--- a/cmd/anubis/main.go
+++ b/cmd/anubis/main.go
@@ -45,7 +45,7 @@ var (
slogLevel = flag.String("slog-level", "INFO", "logging level (see https://pkg.go.dev/log/slog#hdr-Levels)")
target = flag.String("target", "http://localhost:3923", "target to reverse proxy to")
healthcheck = flag.Bool("healthcheck", false, "run a health check against Anubis")
- debugXRealIPDefault = flag.String("debug-x-real-ip-default", "", "If set, replace empty X-Real-Ip headers with this value, useful only for debugging Anubis and running it locally")
+ useRemoteAddress = flag.Bool("use-remote-address", false, "read the client's IP address from the network request, useful for debugging and running Anubis on bare metal")
)
func keyFromHex(value string) (ed25519.PrivateKey, error) {
@@ -214,7 +214,7 @@ func main() {
var h http.Handler
h = s
- h = internal.DefaultXRealIP(*debugXRealIPDefault, h)
+ h = internal.RemoteXRealIP(*useRemoteAddress, *bindNetwork, h)
h = internal.XForwardedForToXRealIP(h)
srv := http.Server{Handler: h}
@@ -226,7 +226,7 @@ func main() {
"serveRobotsTXT", *robotsTxt,
"target", *target,
"version", anubis.Version,
- "debug-x-real-ip-default", *debugXRealIPDefault,
+ "use-remote-address", *useRemoteAddress,
)
go func() {