easy_whitelist 1.0.45__py3-none-any.whl → 1.0.51__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,5 @@
1
- r"""Easy_whitelist is a smart tool that detects the local Internet IP address and automatically updates the local Internet IP address to the cloud security group whitelist. The tool is written in Python.
2
- """
3
- __version__ = '1.0.45'
1
+
2
+ #__version__ = '1.0.48'
4
3
  # __author__ = 'qiqileleabaobao <qiqilelebaobao@163.com>'
5
4
 
6
5
  __all__ = []
@@ -12,7 +12,7 @@ def init_arg():
12
12
  parser.add_argument('-p', '-P', '--proxy', action='store', default=None, type=int, help ='local HTTP proxy port')
13
13
  parser.add_argument('-v', '--verbose', action='count', default=0)
14
14
 
15
- parser.add_argument('target', help='template or rule_id', choices=['template', 'rule_id'])
15
+ parser.add_argument('target', help='template or rule', choices=['template', 'rule'])
16
16
  parser.add_argument('action', help='list', choices=['list', 'set', 'create'])
17
17
  parser.add_argument('target_id', help='template id or rule id', nargs='?')
18
18
 
@@ -2,3 +2,4 @@
2
2
  IFCONFIG_ME_PATTERN = r'(.+)'
3
3
  CIP_CC_PATTERN = r'URL\s+?:\s+?http://www.cip.cc/(.+)'
4
4
  TOOL_LU_PATTERN = r'<p>你的外网IP地址是:\s*?(.+)</p>'
5
+ IP_SB_PATTERN = r'(.+)'
easy_whitelist/ip/url.py CHANGED
@@ -12,5 +12,6 @@ def parse_ip_from_response(response, patt):
12
12
  detect_url = [
13
13
  ['https://ifconfig.me', IFCONFIG_ME_PATTERN, random.choice(curl_user_agent), 'enable'],
14
14
  ['http://cip.cc', CIP_CC_PATTERN, random.choice(chrome_user_agent), 'DISABLE'],
15
- ['https://tool.lu/ip/', TOOL_LU_PATTERN, random.choice(chrome_user_agent), 'enable']
15
+ ['https://tool.lu/ip/', TOOL_LU_PATTERN, random.choice(chrome_user_agent), 'enable'],
16
+ ['http://ip.sb/', IP_SB_PATTERN, random.choice(curl_user_agent), 'enable']
16
17
  ]
@@ -111,7 +111,9 @@ def set_template(common_client, target_id, proxy=None):
111
111
  if target_id.startswith('ipm-'):
112
112
  addresses_extra = get_local_ip_and_format_addressesextra(proxy)
113
113
  if modify_template_address(common_client, addresses_extra, target_id):
114
- logging.info(f'Successfully set {{{target_id}}} to {{{addresses_extra}}}')
114
+ # logging.info(f'Successfully set {{{target_id}}} to {{{addresses_extra}}}')
115
+ # print(f'Successfully set ({target_id}) to ({addresses_extra})')
116
+ print(f'成功将IP模版:{target_id} 设置为:({addresses_extra})')
115
117
  else:
116
118
  logging.warning('Wrong template id.')
117
119
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: easy_whitelist
3
- Version: 1.0.45
3
+ Version: 1.0.51
4
4
  Summary: Easy_whitelist is a smart tool that detects the local Internet IP address and automatically updates the local Internet IP address to the cloud security group whitelist. The tool is written in Python.
5
5
  Keywords: automation,whitelist,acl,security-groups,alibaba-cloud,tencent-cloud,security-tools,security-group-rule
6
6
  Author: qiqilelebaobao
@@ -36,11 +36,13 @@ Easy_whitelist 是一个探测本机互联网 IP 地址,将并本机互联网I
36
36
  Easy_whitelist is a smart tool that detects the local Internet IP address and automatically updates the local Internet IP address to the cloud security group whitelist. The tool is written in Python.
37
37
 
38
38
  主要功能包括:
39
+
39
40
  * 自动探测本机互联网 IP 地址
40
41
  * 支持阿里云、腾讯云的安全组白名单更新
41
42
  * 腾讯云支持地址模板更新
42
43
 
43
44
  Main functions include:
45
+
44
46
  * Automatically detect the local Internet IP address
45
47
  * Support security group whitelist updates for Alibaba Cloud and Tencent Cloud
46
48
  * Tencent Cloud supports address template updates
@@ -63,12 +65,14 @@ Python3 is required
63
65
  ## 使用说明 Basic Usage
64
66
 
65
67
  * 通过列表选择模版,设置白名单
68
+
66
69
  ```shell
67
- $ easy template list
70
+ easy template list
68
71
  ```
69
72
 
70
73
  * 通过新创建模版,设置白名单。需要指定关联的安全组ID
74
+
71
75
  ```shell
72
- $ easy template create rule_id
76
+ easy template create rule_id
73
77
  ```
74
78
 
@@ -1,20 +1,20 @@
1
- easy_whitelist/__init__.py,sha256=EzzJJXwF7RvhwwS3xT8baXNXNSZV4-thxAoeZxt2JCI,303
1
+ easy_whitelist/__init__.py,sha256=Z_DFVlTDd1lt8yH_tL55pV0N6A892yNRkBa5Hfqc2JI,97
2
2
  easy_whitelist/__main__.py,sha256=x5teqF_1OWhLujmBM37jYNJ9Ed1kF_xyzkYpJf4TCI0,2358
3
3
  easy_whitelist/config/__init__.py,sha256=fK-lJ3GD4u1_FGkZfPf-f7fxjMwb1t0AZcG7mfIHLks,19
4
- easy_whitelist/config/arg.py,sha256=efzlQSHK49MFhf0VAnVt6jkGxdwW3ae3yUJmDIKx9mY,1087
4
+ easy_whitelist/config/arg.py,sha256=lEet81UOfL4IhSEPC5AajrcWh9Q_tUecWkFp8Cxwr2Q,1081
5
5
  easy_whitelist/ip/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  easy_whitelist/ip/agent.py,sha256=dJDkw1mipazcOyldbBZW5Mhjr17UqDlaBn2jUo80C7I,487
7
7
  easy_whitelist/ip/ip.py,sha256=H_daXbZ67Crp9sDHdNeuIyZD3H1Z6DrPXQOMiahgxtg,2236
8
- easy_whitelist/ip/pattern.py,sha256=184XTlT0087eBZbm9LC5AB38PMLazQueW8E7l4jSwkM,149
9
- easy_whitelist/ip/url.py,sha256=xmma_JtcY7LS6fDvfH2RBXvn_3-KZktg-fQj-kxhE10,470
8
+ easy_whitelist/ip/pattern.py,sha256=mIoYall_mLpNNmUX8jYjZ8tFsD064M9h1bbbok6CLGQ,172
9
+ easy_whitelist/ip/url.py,sha256=2PYkz1ofL_VzbdIvC7IlD4TQju81dzDSYCQdIqoocBs,550
10
10
  easy_whitelist/sample/common_client_sample.py,sha256=kPde6JHuGLHapC7oSzoC_RdjS7Lxpqtp890NbGIVomc,1958
11
11
  easy_whitelist/sample/cvm_sample_detail.py,sha256=sxsDJY2YvU6uwgbGBzWrl4tFZOKjGq9YMVEKIEjUNEI,4144
12
12
  easy_whitelist/sample/cvm_sample_simple.py,sha256=g5rESUuRwcVqxemPct3QrWhZ4tnoRHh_hFkrqlHOTw0,871
13
13
  easy_whitelist/tcloud/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
14
  easy_whitelist/tcloud/client.py,sha256=eHevgHB1Y8C2Rwa8ztiIm-GkNTOJDlWU7RMNhw6oTmw,906
15
- easy_whitelist/tcloud/template.py,sha256=dLqFSunO8_wjZfCU0z5x9_G30pIDTT91qhJFYtlMRb4,6066
16
- easy_whitelist-1.0.45.dist-info/entry_points.txt,sha256=-URzXdGXqVTDQm_AhH9k0u4Qm9G0s4ZDXcnA-XQt73Q,53
17
- easy_whitelist-1.0.45.dist-info/LICENSE,sha256=sWhlh6jzXRpuhxIbCZfjCEX_YQI4mMK6iO1bfpgkfzM,11343
18
- easy_whitelist-1.0.45.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
19
- easy_whitelist-1.0.45.dist-info/METADATA,sha256=-IF-TYEk7Ijf3cKWclazm2sTKJ6mUQbTl6EEBfcCaZY,3553
20
- easy_whitelist-1.0.45.dist-info/RECORD,,
15
+ easy_whitelist/tcloud/template.py,sha256=V36vppKsozsTns0uZ1Qv3f7ITrNqOzhdpNULBG7EU80,6240
16
+ easy_whitelist-1.0.51.dist-info/entry_points.txt,sha256=-URzXdGXqVTDQm_AhH9k0u4Qm9G0s4ZDXcnA-XQt73Q,53
17
+ easy_whitelist-1.0.51.dist-info/LICENSE,sha256=sWhlh6jzXRpuhxIbCZfjCEX_YQI4mMK6iO1bfpgkfzM,11343
18
+ easy_whitelist-1.0.51.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
19
+ easy_whitelist-1.0.51.dist-info/METADATA,sha256=D285MGKaKGSTRjtDkfkFidrpGFNCkT7yb0yMTa57ShE,3553
20
+ easy_whitelist-1.0.51.dist-info/RECORD,,