2021-11-26 09:12:46 -07:00
|
|
|
on:
|
2022-01-26 16:16:59 -07:00
|
|
|
workflow_dispatch:
|
2021-11-26 09:12:46 -07:00
|
|
|
schedule:
|
|
|
|
- cron: '0 0 * * *'
|
2021-12-15 17:09:00 -07:00
|
|
|
|
2021-11-26 09:12:46 -07:00
|
|
|
jobs:
|
|
|
|
update-instances:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2022-11-01 07:30:07 +08:00
|
|
|
- uses: actions/checkout@v3
|
2021-11-26 09:12:46 -07:00
|
|
|
- name: Install dependencies
|
2023-09-14 02:55:48 +07:00
|
|
|
run: |
|
|
|
|
sudo apt-get install -y jq dnsutils
|
|
|
|
sudo curl -L https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -o /usr/local/bin/yq
|
|
|
|
sudo chmod a+rx /usr/local/bin/yq
|
2021-11-29 17:45:33 -07:00
|
|
|
|
|
|
|
- uses: webfactory/ssh-agent@v0.5.3
|
|
|
|
with:
|
|
|
|
ssh-private-key: |
|
|
|
|
${{ secrets.PRIMARY_REPO_KEY }}
|
|
|
|
|
2021-11-26 09:12:46 -07:00
|
|
|
- name: Fetch instances
|
|
|
|
run: |
|
|
|
|
function apply_update() {
|
2022-07-27 16:36:31 -06:00
|
|
|
mv services-tmp.json services-full.json
|
2021-11-26 09:12:46 -07:00
|
|
|
rm -f *-tmp.json
|
|
|
|
|
|
|
|
# Ensure no trailing slashes for any instance
|
2022-07-27 16:36:31 -06:00
|
|
|
sed -i 's/\/"/"/g' services-full.json
|
2021-11-26 09:12:46 -07:00
|
|
|
}
|
2021-12-15 17:09:00 -07:00
|
|
|
|
2021-11-26 09:12:46 -07:00
|
|
|
# ==============================================================
|
|
|
|
# Git config
|
|
|
|
# ==============================================================
|
|
|
|
git config --global user.name github-actions
|
|
|
|
git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com
|
|
|
|
git remote set-url origin git@github.com:benbusby/farside.git
|
|
|
|
git checkout main
|
2021-12-15 17:09:00 -07:00
|
|
|
|
2022-08-01 12:04:53 -06:00
|
|
|
# ==============================================================
|
|
|
|
# Bibliogram update
|
2022-09-15 11:19:18 -06:00
|
|
|
# NOTE: Bibliogram has been discontinued and the official instance
|
|
|
|
# at bibliogram.art is no longer around. Unless a new "official"
|
|
|
|
# instance pops up, Bibliogram will likely be removed from farside
|
2022-08-01 12:04:53 -06:00
|
|
|
# ==============================================================
|
2022-09-15 11:19:18 -06:00
|
|
|
#curl -s https://bibliogram.art/api/instances | \
|
|
|
|
#jq '[
|
|
|
|
#.data |
|
|
|
|
#.[] |
|
|
|
|
#select(.onion_site | not) |
|
|
|
|
#.address
|
|
|
|
#] | sort' > bibliogram-tmp.json
|
|
|
|
#jq --slurpfile bibliogram bibliogram-tmp.json \
|
|
|
|
#'( .[] | select(.type == "bibliogram") )
|
|
|
|
#.instances |= $bibliogram[0]' services-full.json > services-tmp.json
|
|
|
|
|
|
|
|
#apply_update
|
2022-08-01 12:04:53 -06:00
|
|
|
|
2021-11-26 09:12:46 -07:00
|
|
|
# ==============================================================
|
2022-04-05 16:06:05 -06:00
|
|
|
# searx update
|
2021-11-26 09:12:46 -07:00
|
|
|
# ==============================================================
|
2023-09-14 02:55:48 +07:00
|
|
|
curl -s https://raw.githubusercontent.com/searx/searx-instances/master/searxinstances/instances.yml | \
|
|
|
|
yq -o=json 'keys | sort' > searx-tmp.json
|
2021-11-26 09:12:46 -07:00
|
|
|
jq --slurpfile searx searx-tmp.json \
|
|
|
|
'( .[] | select(.type == "searx") )
|
2022-07-27 16:36:31 -06:00
|
|
|
.instances |= $searx[0]' services-full.json > services-tmp.json
|
2021-11-26 09:12:46 -07:00
|
|
|
|
|
|
|
apply_update
|
2021-12-15 17:09:00 -07:00
|
|
|
|
2022-03-18 13:28:45 -06:00
|
|
|
# ==============================================================
|
2022-04-05 16:06:05 -06:00
|
|
|
# SearXNG update
|
2022-03-18 13:28:45 -06:00
|
|
|
# ==============================================================
|
|
|
|
curl -s https://searx.space/data/instances.json | \
|
|
|
|
jq '[
|
|
|
|
.instances |
|
|
|
|
to_entries[] |
|
|
|
|
select(.value.network_type == "normal") |
|
2022-04-05 16:06:05 -06:00
|
|
|
select(.value.generator | . != null) |
|
|
|
|
select(.value.generator | contains("searxng")) |
|
2022-03-18 13:28:45 -06:00
|
|
|
select(.value.version | . != null) |
|
|
|
|
select(.value.network.asn_privacy == 0) |
|
|
|
|
select(.value.http.error == null) |
|
2023-04-05 13:04:17 -06:00
|
|
|
select(.value.uptime.uptimeDay >= 99) |
|
2022-03-18 13:28:45 -06:00
|
|
|
select(.value.tls.grade == "A+" or .value.tls.grade == "A") |
|
|
|
|
select(.value.http.grade == "A+" or .value.http.grade == "A") |
|
|
|
|
select(.value.html.grade == "V" or .value.html.grade == "F") |
|
2022-07-13 10:53:27 -06:00
|
|
|
select(.key | contains(".i2p") | not) |
|
2022-03-18 13:28:45 -06:00
|
|
|
.key
|
|
|
|
] | sort' > searxng-tmp.json
|
|
|
|
|
|
|
|
cat searxng-tmp.json | jq .
|
|
|
|
|
|
|
|
jq --slurpfile searxng searxng-tmp.json \
|
|
|
|
'( .[] | select(.type == "searxng") )
|
2022-07-27 16:36:31 -06:00
|
|
|
.instances |= $searxng[0]' services-full.json > services-tmp.json
|
2022-03-18 13:28:45 -06:00
|
|
|
|
|
|
|
apply_update
|
|
|
|
|
2023-08-23 13:46:51 -06:00
|
|
|
# ==============================================================
|
|
|
|
# Nitter update
|
|
|
|
# ==============================================================
|
|
|
|
curl -s https://status.d420.de/api/v1/instances | \
|
|
|
|
jq '[
|
|
|
|
.hosts |
|
|
|
|
to_entries[] |
|
|
|
|
select(.value.healthy == true) |
|
|
|
|
.value.url ] |
|
|
|
|
sort' > nitter-tmp.json
|
|
|
|
|
|
|
|
jq --slurpfile nitter nitter-tmp.json \
|
|
|
|
'( .[] | select(.type == "nitter") )
|
2023-08-24 14:55:36 -06:00
|
|
|
.instances |= $nitter[0]' services-full.json > services-tmp.json
|
2023-08-23 13:46:51 -06:00
|
|
|
|
|
|
|
apply_update
|
|
|
|
|
2021-12-15 17:09:00 -07:00
|
|
|
# ==============================================================
|
2022-02-03 17:10:48 -05:00
|
|
|
# SimplyTranslate update
|
2021-12-15 17:09:00 -07:00
|
|
|
# ==============================================================
|
2023-05-16 18:06:42 -06:00
|
|
|
curl -s https://codeberg.org/SimpleWeb/Website/raw/branch/master/config.json | jq -r '.projects | map(select(.id == "simplytranslate"))[0].instances | .[]' > st-out
|
|
|
|
sed -i -e 's/^/https:\/\//' st-out
|
|
|
|
jq -ncR '[inputs]' <<< "$(cat st-out | sort)" > st-tmp.json
|
2021-12-15 17:09:00 -07:00
|
|
|
|
2023-05-16 18:06:42 -06:00
|
|
|
jq --slurpfile simplytranslate st-tmp.json \
|
|
|
|
'( .[] | select(.type == "simplytranslate") )
|
|
|
|
.instances |= $simplytranslate[0]' services-full.json > services-tmp.json
|
2021-12-15 17:09:00 -07:00
|
|
|
|
2023-05-16 18:06:42 -06:00
|
|
|
apply_update
|
2021-12-15 17:09:00 -07:00
|
|
|
|
2021-12-23 17:33:44 -07:00
|
|
|
# ==============================================================
|
|
|
|
# Whoogle update
|
|
|
|
# ==============================================================
|
|
|
|
curl -s https://raw.githubusercontent.com/benbusby/whoogle-search/main/misc/instances.txt > whoogle-out
|
|
|
|
jq -ncR '[inputs]' <<< "$(cat whoogle-out | sort)" > whoogle-tmp.json
|
|
|
|
|
|
|
|
jq --slurpfile whoogle whoogle-tmp.json \
|
|
|
|
'( .[] | select(.type == "whoogle") )
|
2022-07-27 16:36:31 -06:00
|
|
|
.instances |= $whoogle[0]' services-full.json > services-tmp.json
|
2021-12-23 17:33:44 -07:00
|
|
|
|
|
|
|
apply_update
|
2022-02-24 17:27:34 -07:00
|
|
|
|
2022-01-26 16:11:46 -07:00
|
|
|
# ==============================================================
|
|
|
|
# Invidious update
|
|
|
|
# ==============================================================
|
|
|
|
curl -s https://api.invidious.io/instances.json | \
|
|
|
|
jq '[
|
2022-02-24 17:27:34 -07:00
|
|
|
.[] |
|
|
|
|
select(.[1].type | contains("https")) ] |
|
|
|
|
[.[][1].uri] |
|
2022-01-26 16:11:46 -07:00
|
|
|
sort' > invidious-tmp.json
|
|
|
|
jq --slurpfile invidious invidious-tmp.json \
|
|
|
|
'( .[] | select(.type == "invidious") )
|
2022-07-27 16:36:31 -06:00
|
|
|
.instances |= $invidious[0]' services-full.json > services-tmp.json
|
2022-02-24 17:27:34 -07:00
|
|
|
|
2022-01-26 16:11:46 -07:00
|
|
|
apply_update
|
2021-12-23 17:33:44 -07:00
|
|
|
|
2022-02-03 17:10:48 -05:00
|
|
|
# ==============================================================
|
|
|
|
# Scribe update
|
|
|
|
# ==============================================================
|
|
|
|
curl -s https://git.sr.ht/~edwardloveall/scribe/blob/main/docs/instances.json > scribe-tmp.json
|
|
|
|
jq --slurpfile scribe scribe-tmp.json \
|
|
|
|
'( .[] | select(.type == "scribe") )
|
2022-07-27 16:36:31 -06:00
|
|
|
.instances |= $scribe[0]' services-full.json > services-tmp.json
|
2022-02-24 17:27:34 -07:00
|
|
|
|
2022-02-03 17:10:48 -05:00
|
|
|
apply_update
|
|
|
|
|
|
|
|
# ==============================================================
|
|
|
|
# teddit update
|
2024-01-08 11:32:59 -07:00
|
|
|
# Note: no longer maintained
|
2022-02-03 17:10:48 -05:00
|
|
|
# ==============================================================
|
2024-01-08 11:32:59 -07:00
|
|
|
#curl -s https://codeberg.org/teddit/teddit/raw/branch/main/instances.json | \
|
|
|
|
#jq '[
|
|
|
|
#.[] |
|
|
|
|
#select(.url | contains("https")) |
|
|
|
|
#.url ] |
|
|
|
|
#sort' > teddit-tmp.json
|
|
|
|
#jq --slurpfile teddit teddit-tmp.json \
|
|
|
|
#'( .[] | select(.type == "teddit") )
|
|
|
|
#.instances |= $teddit[0]' services-full.json > services-tmp.json
|
2022-02-24 17:27:34 -07:00
|
|
|
|
2024-01-08 11:32:59 -07:00
|
|
|
#apply_update
|
2022-02-24 17:27:34 -07:00
|
|
|
|
|
|
|
# ==============================================================
|
|
|
|
# Wikiless update
|
2022-10-20 12:00:43 -06:00
|
|
|
# NOTE: Codeberg has removed the Wikiless repo until the maintainer
|
|
|
|
# makes changes. See https://orenom.fi for updates.
|
2022-02-24 17:27:34 -07:00
|
|
|
# ==============================================================
|
2022-10-20 12:00:43 -06:00
|
|
|
#curl -s https://codeberg.org/orenom/Wikiless/raw/branch/main/instances.json | \
|
|
|
|
#jq '[
|
|
|
|
#.[] |
|
|
|
|
#select((.url | contains(".onion") | not) and (.url | contains("https"))).url ] |
|
|
|
|
#sort' > wikiless-tmp.json
|
|
|
|
#jq --slurpfile wikiless wikiless-tmp.json \
|
|
|
|
#'( .[] | select(.type == "wikiless") )
|
|
|
|
#.instances |= $wikiless[0]' services-full.json > services-tmp.json
|
2022-02-24 17:27:34 -07:00
|
|
|
|
2022-10-20 12:00:43 -06:00
|
|
|
#apply_update
|
2022-02-03 17:10:48 -05:00
|
|
|
|
2022-12-12 03:45:13 +07:00
|
|
|
# ==============================================================
|
2024-01-08 11:32:59 -07:00
|
|
|
# libreddit + redlib update
|
2022-12-12 03:45:13 +07:00
|
|
|
# ==============================================================
|
2024-01-08 11:32:59 -07:00
|
|
|
curl -s https://raw.githubusercontent.com/redlib-org/redlib-instances/main/instances.json | \
|
2022-12-12 03:45:13 +07:00
|
|
|
jq '[
|
|
|
|
.instances[] |
|
|
|
|
select(.url) |
|
|
|
|
.url ] |
|
|
|
|
sort' > libreddit-tmp.json
|
2024-01-08 11:32:59 -07:00
|
|
|
|
2022-12-12 03:45:13 +07:00
|
|
|
jq --slurpfile libreddit libreddit-tmp.json \
|
|
|
|
'( .[] | select(.type == "libreddit") )
|
|
|
|
.instances |= $libreddit[0]' services-full.json > services-tmp.json
|
|
|
|
|
2024-01-08 11:32:59 -07:00
|
|
|
mv services-tmp.json services-full.json
|
|
|
|
|
|
|
|
jq --slurpfile redlib libreddit-tmp.json \
|
|
|
|
'( .[] | select(.type == "redlib") )
|
|
|
|
.instances |= $redlib[0]' services-full.json > services-tmp.json
|
|
|
|
|
2022-12-12 03:45:13 +07:00
|
|
|
apply_update
|
|
|
|
|
2023-05-19 10:57:43 -06:00
|
|
|
# ==============================================================
|
|
|
|
# BreezeWiki update
|
|
|
|
# ==============================================================
|
|
|
|
curl -s https://docs.breezewiki.com/files/instances.json | \
|
2023-05-19 11:01:57 -06:00
|
|
|
jq '[.[] | .instance]' > breezewiki-tmp.json
|
2023-05-19 10:57:43 -06:00
|
|
|
jq --slurpfile breezewiki breezewiki-tmp.json \
|
|
|
|
'(.[] | select(.type == "breezewiki") )
|
|
|
|
.instances |= $breezewiki[0]' services-full.json > services-tmp.json
|
|
|
|
|
|
|
|
apply_update
|
|
|
|
|
2023-07-18 02:15:51 +05:00
|
|
|
# ==============================================================
|
|
|
|
# GotHub update
|
|
|
|
# ==============================================================
|
|
|
|
|
|
|
|
curl -s https://codeberg.org/gothub/gothub-instances/raw/branch/master/instances.json | \
|
|
|
|
jq '[.[] | .link]' > gothub-tmp.json
|
2023-07-18 21:39:08 -06:00
|
|
|
jq --slurpfile gothub gothub-tmp.json \
|
2023-07-18 02:15:51 +05:00
|
|
|
'(.[] | select(.type == "gothub") )
|
|
|
|
.instances |= $gothub[0]' services-full.json > services-tmp.json
|
|
|
|
|
|
|
|
apply_update
|
|
|
|
|
2023-09-14 02:45:52 +07:00
|
|
|
# ==============================================================
|
2024-01-09 09:28:30 -07:00
|
|
|
# LibreX/LibreY update
|
2023-09-14 02:45:52 +07:00
|
|
|
# ==============================================================
|
|
|
|
curl -s https://raw.githubusercontent.com/Ahwxorg/LibreY/main/instances.json | \
|
|
|
|
jq '[
|
|
|
|
.instances |
|
|
|
|
.[] |
|
|
|
|
.clearnet] |
|
2024-01-09 09:28:30 -07:00
|
|
|
sort' > librey-tmp.json
|
2023-09-14 02:45:52 +07:00
|
|
|
|
2023-09-14 02:53:05 +07:00
|
|
|
jq --slurpfile librey librey-tmp.json \
|
|
|
|
'( .[] | select(.type == "librey") )
|
|
|
|
.instances |= $librey[0]' services-full.json > services-tmp.json
|
|
|
|
|
|
|
|
apply_update
|
|
|
|
|
2024-02-05 23:38:42 +07:00
|
|
|
# ==============================================================
|
|
|
|
# Rimgo update
|
|
|
|
# ==============================================================
|
|
|
|
|
|
|
|
curl -s https://rimgo.codeberg.page/api.json | \
|
|
|
|
jq '[
|
|
|
|
.clearnet[] |
|
|
|
|
.url] |
|
|
|
|
sort' > rimgo-tmp.json
|
|
|
|
|
|
|
|
jq --slurpfile rimgo rimgo-tmp.json \
|
|
|
|
'(.[] | select(.type == "rimgo") )
|
|
|
|
.instances |= $rimgo[0]' services-full.json > services-tmp.json
|
|
|
|
|
|
|
|
apply_update
|
|
|
|
|
2024-04-19 20:16:41 +02:00
|
|
|
# ==============================================================
|
|
|
|
# Tent update
|
|
|
|
# ==============================================================
|
|
|
|
|
|
|
|
curl -s https://forgejo.sny.sh/sun/Tent/raw/branch/main/instances.json | \
|
|
|
|
jq '[
|
|
|
|
.[] |
|
|
|
|
select(.type == "http") |
|
|
|
|
.url] |
|
|
|
|
sort' > tent-tmp.json
|
|
|
|
|
|
|
|
jq --slurpfile tent tent-tmp.json \
|
|
|
|
'(.[] | select(.type == "tent") )
|
|
|
|
.instances |= $tent[0]' services-full.json > services-tmp.json
|
|
|
|
|
|
|
|
apply_update
|
|
|
|
|
2021-11-26 09:12:46 -07:00
|
|
|
# ==============================================================
|
|
|
|
# TODO: Update instances for other services
|
|
|
|
# ==============================================================
|
2021-12-15 17:09:00 -07:00
|
|
|
|
2023-01-04 10:03:03 -07:00
|
|
|
# ==============================================================
|
|
|
|
# Filter out Cloudflared instances from services-full.json into
|
|
|
|
# services.json
|
|
|
|
# ==============================================================
|
|
|
|
./tools/un-cloudflare.sh
|
|
|
|
|
2021-11-26 09:12:46 -07:00
|
|
|
# ==============================================================
|
|
|
|
# Push changes
|
|
|
|
# ==============================================================
|
2022-07-27 16:36:31 -06:00
|
|
|
git add services.json services-full.json
|
2021-11-27 17:52:21 -07:00
|
|
|
git commit -m '[CI] Auto update instances' || exit 0
|
|
|
|
git push
|