From 8e3455a7901aad415eded19218edbed826a2fca5 Mon Sep 17 00:00:00 2001 From: Ben Busby Date: Fri, 26 Nov 2021 09:12:46 -0700 Subject: Automate updates for list of searx instances (#3) * Create nightly update workflow for instances A nightly GitHub Actions CI workflow has been added to fetch new instances of supported services within Farside. Currently only Searx is supported, but obviously others could be added if there are similarly easy ways to fetch and filter instances programmatically. services.json has also been updated with the initial results of the workflow script. * Set headers for every HTTPoison request This serves as a workaround for bot blocking via filtron. * Expand filtering of searx instances New filter enforces: - No Cloudflare - Good TLS config - Good HTTP header config - Vanilla instances or forks - Instances with 100% search success --- lib/farside/instances.ex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/farside/instances.ex b/lib/farside/instances.ex index 203ddfa..a451026 100644 --- a/lib/farside/instances.ex +++ b/lib/farside/instances.ex @@ -3,6 +3,7 @@ defmodule Farside.Instances do @update_file Application.fetch_env!(:farside, :update_file) @services_json Application.fetch_env!(:farside, :services_json) @service_prefix Application.fetch_env!(:farside, :service_prefix) + @headers Application.fetch_env!(:farside, :headers) def sync() do File.rename(@update_file, "#{@update_file}-prev") @@ -21,7 +22,7 @@ defmodule Farside.Instances do System.get_env("FARSIDE_TEST") -> :good true -> - case HTTPoison.get(url) do + case HTTPoison.get(url, @headers) do {:ok, %HTTPoison.Response{status_code: 200}} -> # TODO: Add validation of results, not just status code :good -- cgit v1.2.3