summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorsian1468 <58017832+sian1468@users.noreply.github.com>2023-09-14 02:55:48 +0700
committerGitHub <noreply@github.com>2023-09-13 13:55:48 -0600
commit21c15528a530ddefb252831f0cb64465eee4726e (patch)
tree346704913a0d578bd8d22ef2ad5870f4a3035318 /.github
parent4a655c75803b0c53406d130773c4c4ef7d19d42a (diff)
downloadfarside-21c15528a530ddefb252831f0cb64465eee4726e.tar.gz
Change auto-update procedure for SearX instances (#134)
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/update-instances.yml24
1 files changed, 6 insertions, 18 deletions
diff --git a/.github/workflows/update-instances.yml b/.github/workflows/update-instances.yml
index 3590c1c..5fd4593 100644
--- a/.github/workflows/update-instances.yml
+++ b/.github/workflows/update-instances.yml
@@ -10,7 +10,10 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Install dependencies
- run: sudo apt-get install -y jq dnsutils
+ 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
- uses: webfactory/ssh-agent@v0.5.3
with:
@@ -57,23 +60,8 @@ jobs:
# ==============================================================
# searx update
# ==============================================================
- curl -s https://searx.space/data/instances.json | \
- jq '[
- .instances |
- to_entries[] |
- select(.value.network_type == "normal") |
- select(.value.version | . != null) |
- select(.value.network.asn_privacy == 0) |
- select(.value.http.error == null) |
- 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") |
- select(.key | contains(".i2p") | not) |
- .key
- ] | sort' > searx-tmp.json
-
- cat searx-tmp.json | jq .
-
+ curl -s https://raw.githubusercontent.com/searx/searx-instances/master/searxinstances/instances.yml | \
+ yq -o=json 'keys | sort' > searx-tmp.json
jq --slurpfile searx searx-tmp.json \
'( .[] | select(.type == "searx") )
.instances |= $searx[0]' services-full.json > services-tmp.json