Compare commits
9 Commits
2023111520
...
master
Author | SHA1 | Date | |
---|---|---|---|
eecb11a423 | |||
066f5207b7 | |||
285b619f73 | |||
68286e9f11 | |||
7db6bdaf3d | |||
bc7e16c009 | |||
d8e8e891dc | |||
ef10f37224 | |||
215e4d554d |
10
.drone.yml
10
.drone.yml
@ -6,16 +6,16 @@ steps:
|
||||
- name: generate
|
||||
image: golang:1.19-alpine
|
||||
commands:
|
||||
- apk add --no-cache curl grep libidn sipcalc gawk git patch bash python3
|
||||
- bash generate.sh
|
||||
- apk add --no-cache make curl grep libidn sipcalc gawk git patch bash python3
|
||||
- make all
|
||||
- name: create release tag
|
||||
image: alpine:latest
|
||||
environment:
|
||||
GITEA_API_KEY:
|
||||
from_secret: gitea_api_key
|
||||
commands:
|
||||
- apk add --no-cache curl
|
||||
- sh tag.sh
|
||||
- apk add --no-cache make curl bash
|
||||
- make release
|
||||
when:
|
||||
branch:
|
||||
- master
|
||||
@ -25,7 +25,7 @@ steps:
|
||||
api_key:
|
||||
from_secret: gitea_api_key
|
||||
base_url: https://gitea.neur0tx.site
|
||||
files: .temp/result/*
|
||||
files: .build/*
|
||||
checksum:
|
||||
- sha256
|
||||
when:
|
||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +1,2 @@
|
||||
.temp
|
||||
.build
|
||||
.tool-versions
|
||||
|
9
.gitmodules
vendored
Normal file
9
.gitmodules
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
[submodule "antizapret-pac-generator-light"]
|
||||
path = antizapret-pac-generator-light
|
||||
url = https://bitbucket.org/anticensority/antizapret-pac-generator-light.git
|
||||
[submodule "geoip"]
|
||||
path = geoip
|
||||
url = https://github.com/v2fly/geoip.git
|
||||
[submodule "domain-list-community"]
|
||||
path = domain-list-community
|
||||
url = https://github.com/v2fly/domain-list-community.git
|
57
Makefile
Normal file
57
Makefile
Normal file
@ -0,0 +1,57 @@
|
||||
SHELL = /bin/bash -o pipefail
|
||||
export PATH := $(shell go env GOPATH)/bin:$(PATH)
|
||||
ROOT_DIR=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
||||
BUILD_DIR=$(ROOT_DIR)/.build
|
||||
AZ_DIR=$(ROOT_DIR)/antizapret-pac-generator-light
|
||||
GEOIP_DIR=$(ROOT_DIR)/geoip
|
||||
GEOSITE_DIR=$(ROOT_DIR)/domain-list-community
|
||||
DATA_DIR=$(ROOT_DIR)/data
|
||||
|
||||
.PHONY: all submodules az geoip geosite release
|
||||
|
||||
all: submodules az geoip geosite
|
||||
@echo Done.
|
||||
|
||||
submodules:
|
||||
@git submodule update --init --recursive
|
||||
|
||||
builddir:
|
||||
ifeq (,$(wildcard $(BUILD_DIR)))
|
||||
@mkdir -p $(BUILD_DIR)
|
||||
endif
|
||||
|
||||
az: builddir
|
||||
@bash -c 'set -euo pipefail; \
|
||||
cd $(AZ_DIR) && \
|
||||
patch --forward < $(DATA_DIR)/az-cyrillic-idn-fix.patch || true && \
|
||||
./update.sh && \
|
||||
./parse.sh'
|
||||
@echo Antizapret data has been processed.
|
||||
|
||||
geoip: builddir
|
||||
@cat $(DATA_DIR)/geoip-generator-config.json > $(GEOIP_DIR)/config.json
|
||||
@mkdir -p $(GEOIP_DIR)/data
|
||||
@cp $(AZ_DIR)/result/iplist_all.txt $(GEOIP_DIR)/data/ru-blocked-ips-all
|
||||
@cp $(AZ_DIR)/result/iplist_blockedbyip.txt $(GEOIP_DIR)/data/ru-blocked-ips-directblock
|
||||
@cp $(AZ_DIR)/result/iplist_blockedbyip_noid2971.txt $(GEOIP_DIR)/data/ru-blocked-ips-noid2971
|
||||
ifeq (,$(wildcard $(GEOIP_DIR)/geoip-src.dat))
|
||||
@curl -fsSL https://github.com/v2fly/geoip/releases/latest/download/geoip.dat -o $(GEOIP_DIR)/geoip-src.dat
|
||||
endif
|
||||
@cd $(GEOIP_DIR) && go run ./
|
||||
@mv $(GEOIP_DIR)/output/dat/geoip.dat $(BUILD_DIR)/geoip.dat
|
||||
@echo Built fresh geoip.dat
|
||||
|
||||
geosite: builddir
|
||||
@cp $(AZ_DIR)/result/hostlist_zones.txt $(GEOSITE_DIR)/data/category-ru-blocked-zones
|
||||
@cp $(AZ_DIR)/result/hostlist_original.txt $(GEOSITE_DIR)/data/category-ru-blocked-domains
|
||||
@cd $(GEOSITE_DIR) && go run ./ --outputdir=$(BUILD_DIR) --outputname=geosite.dat
|
||||
@echo Built fresh geosite.dat
|
||||
|
||||
VERSION := $(shell date +%Y%m%d%H%M%S)
|
||||
release:
|
||||
@echo Tagging as $(VERSION)
|
||||
@curl -X POST \
|
||||
https://gitea.neur0tx.site/api/v1/repos/xray-addons/geoip-geosite-with-ru-blocklist/tags?token=${GITEA_API_KEY} \
|
||||
-H "Accept: application/json" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"message": "$(VERSION): daily release from ci","tag_name": "$(VERSION)","target": "master"}'
|
1
antizapret-pac-generator-light
Submodule
1
antizapret-pac-generator-light
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit f14aa53cc0b67fd5d7eac8b7dc6d7f3d75e8c0c9
|
1
domain-list-community
Submodule
1
domain-list-community
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit ea255cb1730b4f29f5a226f234243493fa143cd4
|
28
generate.sh
28
generate.sh
@ -1,28 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -euxo pipefail
|
||||
mkdir -p .temp/result
|
||||
[ ! -d .temp/az ] && \
|
||||
git clone --depth=1 https://bitbucket.org/anticensority/antizapret-pac-generator-light.git .temp/az && \
|
||||
cd .temp/az && \
|
||||
patch < ../../data/az-cyrillic-idn-fix.patch && \
|
||||
bash update.sh && \
|
||||
bash parse.sh && \
|
||||
cd ../..
|
||||
[ ! -d .temp/geoip ] && \
|
||||
git clone --depth=1 https://github.com/v2fly/geoip.git .temp/geoip && \
|
||||
cat data/geoip-generator-config.json > .temp/geoip/config.json && \
|
||||
cd .temp/geoip && \
|
||||
([ ! -f geoip-src.dat ] && curl -fsSL https://github.com/v2fly/geoip/releases/latest/download/geoip.dat -o geoip-src.dat) && \
|
||||
mkdir -p data && \
|
||||
cp ../az/result/iplist_all.txt data/ru-blocked-ips-all && \
|
||||
cp ../az/result/iplist_blockedbyip.txt data/ru-blocked-ips-directblock && \
|
||||
cp ../az/result/iplist_blockedbyip_noid2971.txt data/ru-blocked-ips-noid2971 && \
|
||||
go run ./ && \
|
||||
mv output/dat/geoip.dat ../result/ && \
|
||||
cd ../..
|
||||
[ ! -d .temp/geosite ] && \
|
||||
git clone --depth=1 https://github.com/v2fly/domain-list-community.git .temp/geosite && \
|
||||
cd .temp/geosite && \
|
||||
cp ../az/result/hostlist_zones.txt data/category-ru-blocked-zones && \
|
||||
cp ../az/result/hostlist_original.txt data/category-ru-blocked-domains && \
|
||||
go run ./ --outputdir=../result --outputname=geosite.dat
|
1
geoip
Submodule
1
geoip
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 3182dda7b38c900f28505b91a44b09ec486e6f36
|
12
tag.sh
12
tag.sh
@ -1,12 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -eux
|
||||
export VERSION=`date +%Y%m%d%H%M%S`
|
||||
curl -X 'POST' \
|
||||
'https://gitea.neur0tx.site/api/v1/repos/xray-addons/geoip-geosite-with-ru-blocklist/tags?token='"$GITEA_API_KEY"'' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d '{
|
||||
"message": "'"$VERSION"': daily release from ci",
|
||||
"tag_name": "'"$VERSION"'",
|
||||
"target": "master"
|
||||
}'
|
@ -1,5 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -euxo pipefail;
|
||||
cd "$(dirname "$0")"
|
||||
current=`curl 'https://gitea.neur0tx.site/api/v1/repos/xray-addons/geoip-geosite-with-ru-blocklist/releases/latest'`
|
||||
geoipUrl=`echo "$current" | jq -r '.assets | map( { (.name|tostring): . } ) | add | ."geoip.dat".browser_download_url'`
|
||||
geositeUrl=`echo "$current" | jq -r '.assets | map( { (.name|tostring): . } ) | add | ."geosite.dat".browser_download_url'`
|
||||
|
Loading…
Reference in New Issue
Block a user