-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
23 lines (20 loc) · 1.16 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import logging
import os
class Config:
def __init__(self):
# 日志设置
self.log_file = 'log.txt'
if os.path.exists(self.log_file):
open(self.log_file, 'w').close() # 清空旧的日志内容
logging.basicConfig(filename=self.log_file, level=logging.INFO,
format='%(asctime)s - %(levelname)s - %(message)s')
# manual
self.ls_index = 1
self.enable_trie_filtering = [True, False][0] # 是否按照 domain_suffix 剔除重复的 domain
self.ls_keyword = ["little-snitch", "adobe-blocklist"] # little snitch 链接关键字
self.map_dict = {
'DOMAIN-SUFFIX': 'domain_suffix', 'HOST-SUFFIX': 'domain_suffix', 'DOMAIN': 'domain', 'HOST': 'domain', 'host': 'domain',
'DOMAIN-KEYWORD': 'domain_keyword', 'HOST-KEYWORD': 'domain_keyword', 'host-keyword': 'domain_keyword', 'IP-CIDR': 'ip_cidr',
'ip-cidr': 'ip_cidr', 'IP-CIDR6': 'ip_cidr', 'IP6-CIDR': 'ip_cidr', 'SRC-IP-CIDR': 'source_ip_cidr', 'GEOIP': 'geoip',
'DST-PORT': 'port', 'SRC-PORT': 'source_port', "URL-REGEX": "domain_regex", "DOMAIN-REGEX": "domain_regex"
}