Change auto-update procedure for SearX instances (#134)

This commit is contained in:
sian1468 2023-09-14 02:55:48 +07:00 committed by GitHub
parent 4a655c7580
commit 21c15528a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 18 deletions

View File

@ -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