~netlandish/links

34e72bdd08ba007bdfdaecf2fb8d65c8cffcae19 — Peter Sanchez 2 months ago 9a34422
Fixing Remote IP extraction.
4 files changed, 4 insertions(+), 20 deletions(-)

M cmd/api/main.go
M cmd/links/main.go
M cmd/list/main.go
M cmd/short/main.go
M cmd/api/main.go => cmd/api/main.go +1 -5
@@ 100,11 100,7 @@ func run() error {
	e := echo.New()
	// https://echo.labstack.com/docs/ip-address
	// Deployed via Caddy at the moment which uses X-Forwarded-For header by default
	e.IPExtractor = echo.ExtractIPFromXFFHeader(
		echo.TrustLoopback(false),
		echo.TrustLinkLocal(false),
		echo.TrustPrivateNet(false),
	)
	e.IPExtractor = echo.ExtractIPFromXFFHeader()

	// email work queue and service, general task queue
	eq := email.NewQueue()

M cmd/links/main.go => cmd/links/main.go +1 -5
@@ 170,11 170,7 @@ func run() error {
	e := echo.New()
	// https://echo.labstack.com/docs/ip-address
	// Deployed via Caddy at the moment which uses X-Forwarded-For header by default
	e.IPExtractor = echo.ExtractIPFromXFFHeader(
		echo.TrustLoopback(false),
		echo.TrustLinkLocal(false),
		echo.TrustPrivateNet(false),
	)
	e.IPExtractor = echo.ExtractIPFromXFFHeader()

	// email work queue and service, general task queue
	eq := email.NewQueue()

M cmd/list/main.go => cmd/list/main.go +1 -5
@@ 68,11 68,7 @@ func run() error {
	e := echo.New()
	// https://echo.labstack.com/docs/ip-address
	// Deployed via Caddy at the moment which uses X-Forwarded-For header by default
	e.IPExtractor = echo.ExtractIPFromXFFHeader(
		echo.TrustLoopback(false),
		echo.TrustLinkLocal(false),
		echo.TrustPrivateNet(false),
	)
	e.IPExtractor = echo.ExtractIPFromXFFHeader()

	eq := email.NewQueue()
	wq := work.NewQueue("general")

M cmd/short/main.go => cmd/short/main.go +1 -5
@@ 66,11 66,7 @@ func run() error {
	e := echo.New()
	// https://echo.labstack.com/docs/ip-address
	// Deployed via Caddy at the moment which uses X-Forwarded-For header by default
	e.IPExtractor = echo.ExtractIPFromXFFHeader(
		echo.TrustLoopback(false),
		echo.TrustLinkLocal(false),
		echo.TrustPrivateNet(false),
	)
	e.IPExtractor = echo.ExtractIPFromXFFHeader()

	eq := email.NewQueue()
	wq := work.NewQueue("general")