-
Notifications
You must be signed in to change notification settings - Fork 103
/
Copy pathconfig.py
101 lines (94 loc) · 3.27 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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
######## base ########
CNAME_BASE_URL = {
'VERCEL':'vercel-cname.xingpingcn.top.', # if you use huawei cloud, it must end with a period
'NETLIFY':'netlify-cname.xingpingcn.top.',
'VERLIFY':'verlify-cname.xingpingcn.top.' ,# conbine vercel and netlify records into one
'CF':'cf-cname.xingpingcn.top.'
}
RES_BACKUP_LENGTH = 6
CNAME_DEFAULT_RECORD = {
'VERCEL':'76.76.21.21',
'NETLIFY':'75.2.60.5',
'CF':'japan.com.'
}
CONCURRENCY = 7 # for aiohttp.TCPConnector(limit=CONCURRENCY)
NETLIFY_URL_TO_TEST = ['https://domain.com/test.html'] # for get netlify Anycast IPs
VERCEL_URL_TO_TEST = ['https://domain.com/test.html']
CF_URL_TO_TEST = ['']
CF_SELECTED_DOMAIN_LIST = ['']
FILTER_CONFIG = {
'defualt_un_code_200_limit_backup' :2,
'defualt_time_limit_backup' :2200,
'Netlify':{
'dianxin' :{
'time_limit': 900, # ms. ignore dns resolve time
'a_record_count':1,
'un_code_200_limit':1,
'time_limit_backup':2400, # 可以不写此参数 You do not need to write this parameter
'un_code_200_limit_backup' :2 # 可以不写此参数 You do not need to write this parameter
},
'liantong': {
'time_limit': 600,
'a_record_count':2,
'un_code_200_limit':1,
},
'yidong':{
'time_limit': 600,
'a_record_count':1,
'un_code_200_limit':1,
}
},
'Vercel':{
'dianxin' :{
'time_limit': 900, # ms. ignore dns resolve time
'a_record_count':1,
'un_code_200_limit':1,
},
'liantong': {
'time_limit': 600,
'a_record_count':1,
'un_code_200_limit':0,
'un_code_200_limit_backup':1,
},
'yidong':{
'time_limit': 600,
'a_record_count':1,
'un_code_200_limit':1,
}
},
'Cf':{
'dianxin' :{
'time_limit': 1100, # ms. ignore dns resolve time
'a_record_count':1,
'un_code_200_limit':2,
'un_code_200_limit_backup' :3
},
'liantong': {
'time_limit': 1100,
'a_record_count':1,
'un_code_200_limit':2,
'un_code_200_limit_backup' :3
},
'yidong':{
'time_limit': 1600,
'a_record_count':1,
'un_code_200_limit':2,
'un_code_200_limit_backup' :3
}
},
}
########### HWcloud ###############
# https://support.huaweicloud.com/api-iam/iam_30_0001.html#section4
HW_IAM_DOMAIN = ''
HW_IAM_USER = ''
HW_IAM_PWD = ''
HW_PROJECT_ID = ''
HW_HK_REGION_API_BASE_URL = 'https://dns.ap-southeast-1.myhuaweicloud.com' # replace it if needed
HW_ZONE_ID = ''
HW_ADD_ONE_RECORD_PATH = f'/v2/zones/{HW_ZONE_ID}/recordsets'
HW_UPDATE_BATCH_RECORD_WITH_LINES_PATH = F'/v2.1/zones/{HW_ZONE_ID}/recordsets'
HW_CREATE_RECORD_WITH_BATCH_LINES_PATH = F'/v2.1/zones/{HW_ZONE_ID}/recordsets/batch/lines'
########### DB ##########
RECORD_HP = 9
REVIVE = 3
REVIVE_PERIOD = 3 # if column hp_{isp} = 0 and column revive_{isp} = 3 when it has more than {REVIVE_PERIOD} days since the last revival, it will test that record