From 9104650cfecfb7f6aea42fc755b565f19c79d370 Mon Sep 17 00:00:00 2001 From: NoPlagiarism <37241775+NoPlagiarism@users.noreply.github.com> Date: Tue, 18 Jul 2023 02:15:51 +0500 Subject: [PATCH] Add GotHub support (#116) Adds support for GotHub, an alternative frontend for GitHub --------- Co-authored-by: Ben Busby --- .github/workflows/update-instances.yml | 12 ++++++++++++ lib/farside.ex | 2 ++ services-full.json | 14 ++++++++++++++ services.json | 13 +++++++++++++ 4 files changed, 41 insertions(+) diff --git a/.github/workflows/update-instances.yml b/.github/workflows/update-instances.yml index 2c043ab..829583b 100644 --- a/.github/workflows/update-instances.yml +++ b/.github/workflows/update-instances.yml @@ -216,6 +216,18 @@ jobs: apply_update + # ============================================================== + # GotHub update + # ============================================================== + + curl -s https://codeberg.org/gothub/gothub-instances/raw/branch/master/instances.json | \ + jq '[.[] | .link]' > gothub-tmp.json + jq --slurpfile gothub-tmp.json \ + '(.[] | select(.type == "gothub") ) + .instances |= $gothub[0]' services-full.json > services-tmp.json + + apply_update + # ============================================================== # TODO: Update instances for other services # ============================================================== diff --git a/lib/farside.ex b/lib/farside.ex index e92db93..ca96a4a 100644 --- a/lib/farside.ex +++ b/lib/farside.ex @@ -20,6 +20,7 @@ defmodule Farside do @quora_regex ~r/quora.com|quetre/ @gsearch_regex ~r/google.com\/search|whoogle/ @fandom_regex ~r/fandom.com|breezewiki/ + @github_regex ~r/github.com|gothub/ @stackoverflow_regex ~r/stackoverflow.com|anonymousoverflow/ @parent_services %{ @@ -37,6 +38,7 @@ defmodule Farside do @quora_regex => ["quetre"], @gsearch_regex => ["whoogle"], @fandom_regex => ["breezewiki"], + @github_regex => ["gothub"], @stackoverflow_regex => ["anonymousoverflow"] } diff --git a/services-full.json b/services-full.json index 85d9a8d..928ec9f 100644 --- a/services-full.json +++ b/services-full.json @@ -564,6 +564,20 @@ "https://breeze.whateveritworks.org" ] }, + { + "type": "gothub", + "test_url": "/benbusby/farside", + "fallback": "https://gothub.projectsegfau.lt", + "instances": [ + "https://gh.bloatcat.tk", + "https://gothub.lunar.icu", + "https://gothub.no-logs.com", + "https://gh.owo.si", + "https://gothub.projectsegfau.lt", + "https://gh.whateveritworks.org", + "https://gothub.dev.projectsegfau.lt" + ] + }, { "type": "anonymousoverflow", "test_url": "/questions/6591213/how-do-i-rename-a-local-git-branch", diff --git a/services.json b/services.json index e58bd84..a015306 100644 --- a/services.json +++ b/services.json @@ -520,6 +520,19 @@ "https://breeze.nohost.network" ] }, + { + "type": "gothub", + "test_url": "/benbusby/farside", + "fallback": "https://gothub.projectsegfau.lt", + "instances": [ + "https://gh.bloatcat.tk", + "https://gothub.lunar.icu", + "https://gothub.no-logs.com", + "https://gh.owo.si", + "https://gothub.projectsegfau.lt", + "https://gothub.dev.projectsegfau.lt" + ] + }, { "type": "anonymousoverflow", "test_url": "/questions/6591213/how-do-i-rename-a-local-git-branch",