2
2
3
3
# ------------------------------------------------------------------------------
4
4
# -
5
- # IP Filter Updater & Generator -
5
+ # IP Filter Updater & Generator (ipfilter) -
6
6
# -
7
7
# Created by Fonic (https://github.com/fonic) -
8
- # Date: 04/15/19 - 08/10 /23 -
8
+ # Date: 04/15/19 - 08/25 /23 -
9
9
# -
10
10
# ------------------------------------------------------------------------------
11
11
16
16
VERBOSE_OUTPUT="false"
17
17
18
18
# Path of file to log output to (folder + filename)
19
- # NOTE: ${SCRIPT_DIR}: directory of 'ipfilter.sh' script , ${SCRIPT_NAME}: filename of 'ipfilter.sh' script without extension
19
+ # NOTE: ${SCRIPT_DIR}: directory where 'ipfilter.sh' is stored , ${SCRIPT_NAME}: name of file 'ipfilter.sh' without extension
20
20
# Format: String
21
21
# Example: LOG_FILE="/var/log/ipfilter.log"
22
22
# Default: LOG_FILE="${SCRIPT_DIR}/${SCRIPT_NAME}.log"
@@ -37,58 +37,59 @@ LOG_COLORS="false"
37
37
38
38
# Options to pass to curl when downloading files
39
39
# NOTE: To debug download issues, temporarily remove option '--fail' and check contents of downloaded files for server messages
40
- # Format: Bash array of strings
40
+ # Format: Array of strings
41
41
# Example: CURL_OPTS=("--fail" "--location" "--silent" "--show-error" "--retry" "8" "--connect-timeout" "120" "--proxy" "<protocol>://<host>:<port>")
42
42
# Default: CURL_OPTS=("--fail" "--location" "--silent" "--show-error" "--retry" "2" "--connect-timeout" "60")
43
43
CURL_OPTS=("--fail" "--location" "--silent" "--show-error" "--retry" "2" "--connect-timeout" "60")
44
44
45
45
# Options to pass to wget when downloading files
46
46
# NOTE: wget is used only if curl is not available; do not add option '--quiet' here as this will also suppress error messages
47
- # Format: Bash array of strings
47
+ # Format: Array of strings
48
48
# Example: WGET_OPTS=("--no-verbose" "--tries=9" "--timeout=120" "--execute" "use_proxy=yes" "--execute" "http_proxy=<host>:<port>")
49
49
# Default: WGET_OPTS=("--no-verbose" "--tries=3" "--timeout=60")
50
50
WGET_OPTS=("--no-verbose" "--tries=3" "--timeout=60")
51
51
52
- # List of blocklists to download from I-Blocklist (https://www.iblocklist.com/lists )
53
- # NOTE: For possible ids, inspect link targets on page ' https://www.iblocklist.com/lists', e.g.
54
- # 'level1' -> 'https://www.iblocklist.com/list?list=ydxerpxkpcfqjaybcssw' -> id is 'ydxerpxkpcfqjaybcssw'
55
- # Format: Bash dictionary of name-id-pairs (string-string-pairs)
52
+ # List of blocklists to download from I-Blocklist (https://www.iblocklist.com)
53
+ # NOTE: To identify valid ids, inspect hyperlink targets or column 'Update URL' on this web page: https://www.iblocklist.com/lists
54
+ # e.g. 'level1' -> 'https://www.iblocklist.com/list?list=ydxerpxkpcfqjaybcssw' -> id is 'ydxerpxkpcfqjaybcssw' -> ["level1"]="ydxerpxkpcfqjaybcssw"
55
+ # Format: Array of name-id-pairs (i.e. string-string-pairs)
56
56
# Example: IBL_LISTS=(["badpeers"]="cwworuawihqvocglcoss" ["adservers"]="zhogegszwduurnvsyhdf")
57
57
# Default: IBL_LISTS=(["level1"]="ydxerpxkpcfqjaybcssw" ["level2"]="gyisgnzbhppbvsphucsw" ["level3"]="uwnukjqktoggdknzrhgh")
58
58
IBL_LISTS=(["level1"]="ydxerpxkpcfqjaybcssw" ["level2"]="gyisgnzbhppbvsphucsw" ["level3"]="uwnukjqktoggdknzrhgh")
59
59
60
- # License key to use to download GeoLite2 country blocks database
61
- # NOTE: See 'https://blog.maxmind.com/2019/12/18/significant-changes-to-accessing-and-using-geolite2-databases/' for details
62
- # License key is required in order to use the GeoLite2 feature
60
+ # License key to use to download GeoLite2 country blocks database (https://dev.maxmind.com/geoip)
61
+ # NOTE: A valid license key is required to use the GeoLite2 feature, see URL below for details:
62
+ # https://blog.maxmind.com/2019/12/18/significant-changes-to-accessing-and-using-geolite2-databases/
63
63
# Format: String
64
64
# Example: GL2_LICENSE="1a2b3c4d5e6f7g8h"
65
65
# Default: GL2_LICENSE=""
66
66
GL2_LICENSE=""
67
67
68
- # List of countries to block using GeoLite2 country blocks
69
- # NOTE: For a list of country names, download ZIP archive from URL below and inspect file 'geolite2-country-locations-en.csv':
70
- # ' https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country-CSV&license_key=<your-gl2-license-key>&suffix=zip'
71
- # Format: Bash array of strings
72
- # Example: GL2_COUNTRIES=("Tomorrowland" "Middle-earth ")
68
+ # List of countries to block using GeoLite2 country blocks (https://dev.maxmind.com/geoip)
69
+ # NOTE: For a list of valid country names, download ZIP archive from URL below and inspect file 'geolite2-country-locations-en.csv':
70
+ # https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country-CSV&license_key=<your-gl2-license-key>&suffix=zip
71
+ # Format: Array of strings
72
+ # Example: GL2_COUNTRIES=("Tomorrowland" "Soldier Island" "Wonderland ")
73
73
# Default: GL2_COUNTRIES=()
74
74
GL2_COUNTRIES=()
75
75
76
- # IP protocol versions to process for GeoLite2 country blocks
77
- # Format: Bash array of strings
76
+ # IP protocol versions to process for GeoLite2 country blocks (https://dev.maxmind.com/geoip)
77
+ # NOTE: Only few applications actually support and recognize IPv6 ranges in .p2p files
78
+ # Format: Array of strings
78
79
# Example: GL2_IPVERS=("IPv4") | GL2_IPVERS=("IPv6") | GL2_IPVERS=("IPv4" "IPv6")
79
80
# Default: GL2_IPVERS=("IPv4")
80
81
GL2_IPVERS=("IPv4")
81
82
82
83
# Path to install final output file to (folder + filename)
83
- # NOTE: ${SCRIPT_DIR}: directory of 'ipfilter.sh' script , ${SCRIPT_NAME}: filename of 'ipfilter.sh' script without extension
84
- # Correct file extension will be determined automatically, there is no need to modify this when changing COMP_TYPE
84
+ # NOTE: ${SCRIPT_DIR}: directory where 'ipfilter.sh' is stored , ${SCRIPT_NAME}: name of file 'ipfilter.sh' without extension
85
+ # Correct file extension will be determined automatically, there is no need to modify this when changing ' COMP_TYPE'
85
86
# Format: String
86
87
# Example: INSTALL_DST="/tmp/blocklist.p2p"
87
88
# Default: INSTALL_DST="${SCRIPT_DIR}/${SCRIPT_NAME}.p2p"
88
89
INSTALL_DST="${SCRIPT_DIR}/${SCRIPT_NAME}.p2p"
89
90
90
91
# Type of compression to apply to final output file (in-place)
91
- # NOTE: Correct file extension will be determined automatically, there is no need to modify INSTALL_DST when changing this
92
+ # NOTE: Correct file extension will be determined automatically, there is no need to modify ' INSTALL_DST' when changing this
92
93
# Format: String
93
94
# Example: COMP_TYPE="none" | COMP_TYPE="gzip" | COMP_TYPE="bzip2" | COMP_TYPE="xz" | COMP_TYPE="zip"
94
95
# Default: COMP_TYPE="none"
0 commit comments