From cf8dfc5a85a7d655fef36ce735472a16635d8b7a Mon Sep 17 00:00:00 2001 From: Ben Busby Date: Thu, 21 Oct 2021 17:07:43 -0600 Subject: Initialize update script My initial thought for this: create a simple redis db for storing key value pairs of instance -> list of live instances for each privacy front end (libreddit, bibliogram, etc). A script executed on a certain schedule would (in the background) check each instance to make sure it isn't down or unreasonably slow. If the instance is available, add it to a list of available instances in the db. When a user navigates to the revolver url (something like //<...>), the app would pick a random value from the list returned by redis.get('') and forward the user to that instance. As a side note, this could instead load the instances json from a remote source (like github or something) so that changes to instances don't need to involve a redeploy of the entire app. --- mix.exs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 mix.exs (limited to 'mix.exs') diff --git a/mix.exs b/mix.exs new file mode 100644 index 0000000..0d0c8d0 --- /dev/null +++ b/mix.exs @@ -0,0 +1,30 @@ +defmodule RouterExample.MixProject do + use Mix.Project + + def project do + [ + app: :router_example, + 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: {RouterExample.Application, []} + ] + end + + # Run "mix help deps" to learn about dependencies. + defp deps do + [ + {:jason, "~> 1.1"}, + {:plug_cowboy, "~> 2.0"}, + {:poison, "~> 5.0"} + ] + end +end -- cgit v1.2.3