hplush / slowreader

Web app to combine feeds from social networks and RSS and to help read more meaningful and deep content
https://dev.slowreader.app
GNU Affero General Public License v3.0
161 stars 37 forks source link

Improve proxy security (#100) #134

Closed toplenboren closed 7 months ago

toplenboren commented 7 months ago

Fixes #100

I added some small improvements to proxy.ts service

I've implemented:

I asked a few questions in #100. Let's use issue to discuss planned changes

Motivation

We do not want our proxy to be abused and banned, thus all the security stuff. Check #100 for details

Deps

I needed a package to check whether IP is reserved or not. Thought that we do not want to bloat our code with this stuff. I found three packages: isMartianPacket, bogon and isReservedIp

I found is-reserved-ip code to be strange and bogon to have one more dependency đź‘Ť

I decided to pick isMartianPacket.Package seems to be maintained, and I found the lack of types (Can implement this myself 🥨) and lack of adoption as main drawback (thou need to say that many people just introduce code for this task in their projects).

Checklist (Gonna be checked once we are out of draft state)

toplenboren commented 7 months ago

Hey, @ai I've done some cool stuff! Can you please re-review my PR?

Done:

Questions:

Left to do:

  1. Debounce
  2. Hide client IP
  3. Limit size of response
  4. Introduce partial return for optimizations
ai commented 7 months ago

I am merging this because I need it for other task