bcmd 0.6.16__tar.gz → 0.6.17__tar.gz
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.
Potentially problematic release.
This version of bcmd might be problematic. Click here for more details.
- {bcmd-0.6.16 → bcmd-0.6.17}/PKG-INFO +1 -1
- {bcmd-0.6.16 → bcmd-0.6.17}/bcmd/tasks/__init__.py +0 -1
- {bcmd-0.6.16 → bcmd-0.6.17}/bcmd.egg-info/PKG-INFO +1 -1
- {bcmd-0.6.16 → bcmd-0.6.17}/bcmd.egg-info/SOURCES.txt +0 -2
- {bcmd-0.6.16 → bcmd-0.6.17}/pyproject.toml +1 -1
- bcmd-0.6.16/bcmd/tasks/wslProxy.py +0 -59
- {bcmd-0.6.16 → bcmd-0.6.17}/MANIFEST.in +0 -0
- {bcmd-0.6.16 → bcmd-0.6.17}/README.md +0 -0
- {bcmd-0.6.16 → bcmd-0.6.17}/bcmd/__init__.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.17}/bcmd/common/__init__.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.17}/bcmd/common/func.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.17}/bcmd/common/secret.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.17}/bcmd/resources/project/main.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.17}/bcmd/tasks/bin.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.17}/bcmd/tasks/code.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.17}/bcmd/tasks/crypto.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.17}/bcmd/tasks/docs.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.17}/bcmd/tasks/download.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.17}/bcmd/tasks/image.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.17}/bcmd/tasks/json.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.17}/bcmd/tasks/lib.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.17}/bcmd/tasks/math.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.17}/bcmd/tasks/mirror.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.17}/bcmd/tasks/pdf.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.17}/bcmd/tasks/proxy.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.17}/bcmd/tasks/time.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.17}/bcmd/tasks/upgrade.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.17}/bcmd/tasks/wasabi.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.17}/bcmd/utils/__init__.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.17}/bcmd/utils/utils.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.17}/bcmd.egg-info/dependency_links.txt +0 -0
- {bcmd-0.6.16 → bcmd-0.6.17}/bcmd.egg-info/entry_points.txt +0 -0
- {bcmd-0.6.16 → bcmd-0.6.17}/bcmd.egg-info/requires.txt +0 -0
- {bcmd-0.6.16 → bcmd-0.6.17}/bcmd.egg-info/top_level.txt +0 -0
- {bcmd-0.6.16 → bcmd-0.6.17}/setup.cfg +0 -0
- {bcmd-0.6.16 → bcmd-0.6.17}/test/__init__.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.17}/test/conftest.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.17}/test/test_pdf.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.17}/test/test_proxy.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.17}/test/test_wasabi.py +0 -0
|
@@ -22,7 +22,6 @@ pyproject.toml
|
|
|
22
22
|
./bcmd/tasks/time.py
|
|
23
23
|
./bcmd/tasks/upgrade.py
|
|
24
24
|
./bcmd/tasks/wasabi.py
|
|
25
|
-
./bcmd/tasks/wslProxy.py
|
|
26
25
|
./bcmd/utils/__init__.py
|
|
27
26
|
./bcmd/utils/utils.py
|
|
28
27
|
./test/__init__.py
|
|
@@ -57,6 +56,5 @@ bcmd/tasks/proxy.py
|
|
|
57
56
|
bcmd/tasks/time.py
|
|
58
57
|
bcmd/tasks/upgrade.py
|
|
59
58
|
bcmd/tasks/wasabi.py
|
|
60
|
-
bcmd/tasks/wslProxy.py
|
|
61
59
|
bcmd/utils/__init__.py
|
|
62
60
|
bcmd/utils/utils.py
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
from typing import Final
|
|
2
|
-
|
|
3
|
-
import pyperclip
|
|
4
|
-
import typer
|
|
5
|
-
from beni import bcolor, btask
|
|
6
|
-
from beni.bfunc import syncCall, textToAry
|
|
7
|
-
|
|
8
|
-
app: Final = btask.newSubApp('WSL2 代理服务')
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
@app.command()
|
|
12
|
-
@syncCall
|
|
13
|
-
async def linux(
|
|
14
|
-
port: int = typer.Argument(15236, help="代理服务器端口"),
|
|
15
|
-
):
|
|
16
|
-
'生成终端设置代理服务器的命令'
|
|
17
|
-
ip = "$(ip route | grep default | awk '{print $3}')"
|
|
18
|
-
lineAry = textToAry(f'''
|
|
19
|
-
export HTTP_PROXY=http://{ip}:{port}
|
|
20
|
-
export HTTPS_PROXY=http://{ip}:{port}
|
|
21
|
-
export ALL_PROXY=http://{ip}:{port}
|
|
22
|
-
curl https://google.com.hk
|
|
23
|
-
''')
|
|
24
|
-
msg = '\r\n' + '\n'.join(lineAry) + '\n'
|
|
25
|
-
pyperclip.copy(msg.strip() + '\n')
|
|
26
|
-
bcolor.printMagenta(msg)
|
|
27
|
-
bcolor.printYellow('已复制,可直接粘贴使用')
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
@app.command()
|
|
31
|
-
@syncCall
|
|
32
|
-
async def windows(
|
|
33
|
-
port: int = typer.Argument(15236, help="代理服务器端口"),
|
|
34
|
-
off: bool = typer.Option(False, '--off', help='关闭代理'),
|
|
35
|
-
):
|
|
36
|
-
'设置防火墙以及端口转发'
|
|
37
|
-
|
|
38
|
-
firewallName = 'Allow Veee from WSL'
|
|
39
|
-
|
|
40
|
-
if not off:
|
|
41
|
-
template = f'''
|
|
42
|
-
New-NetFirewallRule -DisplayName "{firewallName}" -Direction Inbound -Action Allow -Protocol TCP -LocalPort {port} -RemoteAddress 172.0.0.0/8 -Profile Any
|
|
43
|
-
netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport={port} connectaddress=127.0.0.1 connectport={port}
|
|
44
|
-
netstat -ano | findstr :{port} | findstr 0.0.0.0
|
|
45
|
-
'''
|
|
46
|
-
else:
|
|
47
|
-
template = f'''
|
|
48
|
-
netsh interface portproxy delete v4tov4 listenaddress=0.0.0.0 listenport={port}
|
|
49
|
-
Remove-NetFirewallRule -DisplayName "{firewallName}"
|
|
50
|
-
'''
|
|
51
|
-
lineAry = textToAry(template)
|
|
52
|
-
msg = '\r\n' + '\n'.join(lineAry) + '\n'
|
|
53
|
-
pyperclip.copy(msg.strip() + '\n')
|
|
54
|
-
bcolor.printMagenta(msg)
|
|
55
|
-
if not off:
|
|
56
|
-
bcolor.printYellow('开启防火墙以及端口转发')
|
|
57
|
-
else:
|
|
58
|
-
bcolor.printYellow('关闭防火墙以及端口转发')
|
|
59
|
-
bcolor.printYellow('已复制,可直接粘贴使用')
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|