From c31bbf36a4f347ad081ceea6a84bc4f43ef66bb5 Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Wed, 29 Dec 2021 15:26:55 +0100 Subject: [PATCH] added transmission-blocklist ci script --- .drone.yml | 23 +++++++++++++++++++++++ blocklist-build.sh | 8 ++++++++ 2 files changed, 31 insertions(+) create mode 100644 .drone.yml create mode 100755 blocklist-build.sh diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..5139cda --- /dev/null +++ b/.drone.yml @@ -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 diff --git a/blocklist-build.sh b/blocklist-build.sh new file mode 100755 index 0000000..11fdf47 --- /dev/null +++ b/blocklist-build.sh @@ -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