added transmission-blocklist ci script

This commit is contained in:
Paul 2021-12-29 15:26:55 +01:00
commit c31bbf36a4
2 changed files with 31 additions and 0 deletions

23
.drone.yml Normal file
View File

@ -0,0 +1,23 @@
---
kind: pipeline
type: docker
name: default
steps:
- name: Download GeoLite.mmdb
image: ubuntu:latest
commands:
- ./blocklist-build.sh
- cp -v blocklist.gz upload/
environment:
LICENSE_KEY:
from_secret: LICENSE_KEY
- name: Release databases
image: plugins/gitea-release
settings:
base_url: https://git.paulbsd.com
api_key:
from_secret: gitea_token
files: "upload/*"
when:
event: tag

8
blocklist-build.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
curl -s https://www.iblocklist.com/lists.json | \
jq -r '.lists[] | .name as $n | select((.subscription == "false") and ($n | startswith("iana-") | not) and (["fornonlancomputers", "bogon", "The Onion Router"] | index($n) | not)) | .list' | \
awk 'length($0) > 2 { print "http://list.iblocklist.com/?fileformat=p2p&archiveformat=gz&list=" $0 }' | \
xargs wget -O - | \
gunzip | \
egrep -v '^#' | \
gzip > blocklist.gz