Lasa is a stateless proxy that generates a RSS or an Atom feed from a Standard.site publication. lasa.anhgelus.world
rss atom atprotocol standard-site atproto
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(lasad): set remote addr outside of limiter if required

+13 -8
+12
cmd/lasad/run.go
··· 16 16 "tangled.org/anhgelus.world/lasa/cmd/internal" 17 17 "tangled.org/anhgelus.world/lasa/cmd/lasad/config" 18 18 "tangled.org/anhgelus.world/lasa/cmd/lasad/server" 19 + "tangled.org/anhgelus.world/ljus" 19 20 ) 20 21 21 22 func handleRunHelp() { ··· 82 83 if cfg.Listen.FastCGI { 83 84 ch <- fcgi.Serve(l, s.Handler()) 84 85 } else { 86 + s.Use(func(next ljus.Handler, w *ljus.StatusWriter, r *http.Request) { 87 + addr := r.Header.Get("X-Real-Ip") 88 + if addr == "" { 89 + addr = r.Header.Get("X-Forwarded-For") 90 + } 91 + if addr == "" { 92 + addr = r.RemoteAddr 93 + } 94 + r.RemoteAddr = addr 95 + next(w, r) 96 + }) 85 97 ch <- http.Serve(l, s.Handler()) 86 98 } 87 99 }()
+1 -8
cmd/lasad/server/limiter.go
··· 38 38 } 39 39 40 40 func (l *Limiter) handle(w *ljus.StatusWriter, r *http.Request) { 41 - addr := r.Header.Get("X-Real-Ip") 42 - if addr == "" { 43 - addr = r.Header.Get("X-Forwarded-For") 44 - } 45 - if addr == "" { 46 - addr = r.RemoteAddr 47 - } 48 - ip, _, _ := strings.Cut(addr, ":") 41 + ip, _, _ := strings.Cut(r.RemoteAddr, ":") 49 42 if w.Code != http.StatusNotFound && w.Code != http.StatusBadRequest && w.Code != http.StatusTooManyRequests { 50 43 return 51 44 }