summaryrefslogtreecommitdiff
path: root/test/farside_test.exs
AgeCommit message (Collapse)Author
2021-11-12Fix formattingBen Busby
2021-11-12Test ip rate limiting / throttlingBen Busby
Tests the throttling feature from the previous commit
2021-11-12Throttle incoming requests to 1/sec per ipBen Busby
This introduces a way of throttling requests in a way that makes sense for the purpose of the app. The app only supports redirecting to one particular service when browsing, which would seldom be required more than once per second for normal "human" browsing. Without this, the service could easily be used to DOS multiple instances at once. That being said, anyone concerned about someone DOS-ing multiple instances at once should be aware that this would be trivial to do with a simple bash script. This is simply a preventative measure to hopefully deter people from trying to attack all public instances of private frontends using farside.link. Note that this throttling applies to all routes in the app, including the homepage. This could be updated to exclude the homepage I guess, but I'm not really sure what the use case would be for that.
2021-11-10Prevent same instance from being selected twice in a rowBen Busby
Introduces a new db key "<service>-previous" to track which instance was last selected for a particular service. This allows for filtering the list of available instances to exclude the instance that was last picked, to ensure a (slightly) more even distribution of traffic. There's still the possiblity of the following scenario, however: :service instances > 2 /:service request #1 -> instance #1 /:service request #2 -> instance #2 /:service request #3 -> instance #1 /:service request #4 -> instance #2 where there are many ignored instances for a particular service. One possible solution would be to implement the "<service>-previous" value to be a list, rather than a single value, and push to that list until only one element is left in the original "instance" array after filtering, and then delete the "<service>-previous" key.
2021-11-10Test for valid service redirectsBen Busby
Updates testing to iterate through all available services and validate that each one correctly produces a 302 redirect.
2021-11-07Refactor project to new nameBen Busby
The name of the project is being refactored from Privacy Revolver to Farside. The reasoning behind this is: 1. A shorter name is easier to remember 2. It can stand for "FOSS alternative redirecting service" (which I know doesn't encapsulate all letters from "farside", but it's close enough). This commit also includes improvements to the update script for determining how far along the script is.