mirror of
https://github.com/benbusby/farside.git
synced 2025-04-25 13:10:02 +00:00
Remove cloudflare filter from update workflow
The cloudflare filter, when performed as part of the github action workflow, doesn't seem to work nearly as reliably when run on an actual machine. The farside server will instead run the un-cloudflare script whenever it pulls in new changes to services-full.json, which should be a much more reliable approach to filtering out cloudflare instances.
This commit is contained in:
parent
e16d4bb330
commit
e1e46dcd92
3 changed files with 14 additions and 95 deletions
32
.github/workflows/update-instances.yml
vendored
32
.github/workflows/update-instances.yml
vendored
|
@ -27,33 +27,6 @@ jobs:
|
|||
sed -i 's/\/"/"/g' services-full.json
|
||||
}
|
||||
|
||||
function remove_cf_instances() {
|
||||
rm -f out.json
|
||||
file="services-full.json"
|
||||
|
||||
while read -r line; do
|
||||
if [[ "$line" == "\"https://"* ]]; then
|
||||
domain=$(echo "$line" | sed -e "s/^\"https:\/\///" -e "s/\",//" -e "s/\"//")
|
||||
ns=$(dig ns "$domain" || true)
|
||||
if [[ "$ns" == *"cloudflare"* ]]; then
|
||||
echo "\"$domain\" using cloudflare, skipping..."
|
||||
elif [[ "$ns" != *"NOERROR"* ]]; then
|
||||
echo "Unable to verify records for \"$domain\", skipping..."
|
||||
else
|
||||
echo "$line" >> out.json
|
||||
fi
|
||||
else
|
||||
echo "$line" >> out.json
|
||||
fi
|
||||
done <$file
|
||||
|
||||
# Remove any trailing commas from new instance lists
|
||||
sed -i -e ':begin' -e '$!N' -e 's/,\n]/\n]/g' -e 'tbegin' -e 'P' -e 'D' out.json
|
||||
|
||||
cat out.json | jq --indent 2 . > services.json
|
||||
rm -f out.json
|
||||
}
|
||||
|
||||
# ==============================================================
|
||||
# Git config
|
||||
# ==============================================================
|
||||
|
@ -216,11 +189,6 @@ jobs:
|
|||
# TODO: Update instances for other services
|
||||
# ==============================================================
|
||||
|
||||
# ==============================================================
|
||||
# Remove cloudflare instances
|
||||
# ==============================================================
|
||||
remove_cf_instances
|
||||
|
||||
# ==============================================================
|
||||
# Push changes
|
||||
# ==============================================================
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue