mirror of
https://github.com/benbusby/farside.git
synced 2025-03-15 11:46:32 -04:00

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.
34 lines
657 B
Elixir
34 lines
657 B
Elixir
defmodule Farside.MixProject do
|
|
use Mix.Project
|
|
|
|
def project do
|
|
[
|
|
app: :farside,
|
|
version: "0.1.0",
|
|
elixir: "~> 1.8",
|
|
start_permanent: Mix.env() == :prod,
|
|
deps: deps()
|
|
]
|
|
end
|
|
|
|
# Run "mix help compile.app" to learn about applications.
|
|
def application do
|
|
[
|
|
extra_applications: [:logger],
|
|
mod: {Farside.Application, []}
|
|
]
|
|
end
|
|
|
|
# Run "mix help deps" to learn about dependencies.
|
|
defp deps do
|
|
[
|
|
{:httpoison, "~> 1.8"},
|
|
{:jason, "~> 1.1"},
|
|
{:plug_attack, "~> 0.4.2"},
|
|
{:plug_cowboy, "~> 2.0"},
|
|
{:poison, "~> 5.0"},
|
|
{:redix, "~> 1.1"},
|
|
]
|
|
end
|
|
end
|