1
0
Fork 0
mirror of https://github.com/benbusby/farside.git synced 2025-04-29 23:20:03 +00:00

Make conn values and services path configurable at runtime

Connection values (such as redis server port and the port to run farside
on) as well as the services json file to use can now be set via
environment variables:

FARSIDE_PORT sets the port for Farside to run on
FARSIDE_REDIS_PORT sets the redis server port for Farside to use
FARSIDE_SERVICES_JSON sets the services json file for Farside to use

This partially addresses the move towards de-listing Cloudflare
instances by default by allowing different services json files to be
used with different redis servers.

See #43
This commit is contained in:
Ben Busby 2022-07-27 13:50:23 -06:00
parent 7045b62ccf
commit a6dabe8bf3
No known key found for this signature in database
GPG key ID: B9B7231E01D924A1
6 changed files with 24 additions and 13 deletions

View file

@ -1,5 +1,4 @@
defmodule FarsideTest do
@services_json Application.fetch_env!(:farside, :services_json)
use ExUnit.Case
use Plug.Test
@ -49,7 +48,8 @@ defmodule FarsideTest do
end
test "/:service" do
{:ok, file} = File.read(@services_json)
services_json = Application.fetch_env!(:farside, :services_json)
{:ok, file} = File.read(services_json)
{:ok, service_list} = Jason.decode(file)
service_names =