proxy2vpn 0.2.0__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.
- proxy2vpn-0.2.0/LICENSE +22 -0
- proxy2vpn-0.2.0/PKG-INFO +163 -0
- proxy2vpn-0.2.0/README.md +143 -0
- proxy2vpn-0.2.0/pyproject.toml +63 -0
- proxy2vpn-0.2.0/setup.cfg +4 -0
- proxy2vpn-0.2.0/src/proxy2vpn/__init__.py +20 -0
- proxy2vpn-0.2.0/src/proxy2vpn/__main__.py +12 -0
- proxy2vpn-0.2.0/src/proxy2vpn/cli.py +483 -0
- proxy2vpn-0.2.0/src/proxy2vpn/compose_manager.py +149 -0
- proxy2vpn-0.2.0/src/proxy2vpn/compose_utils.py +38 -0
- proxy2vpn-0.2.0/src/proxy2vpn/compose_validator.py +147 -0
- proxy2vpn-0.2.0/src/proxy2vpn/config.py +34 -0
- proxy2vpn-0.2.0/src/proxy2vpn/docker_ops.py +170 -0
- proxy2vpn-0.2.0/src/proxy2vpn/models.py +98 -0
- proxy2vpn-0.2.0/src/proxy2vpn/preset_manager.py +59 -0
- proxy2vpn-0.2.0/src/proxy2vpn/server_manager.py +111 -0
- proxy2vpn-0.2.0/src/proxy2vpn/typer_ext.py +382 -0
- proxy2vpn-0.2.0/src/proxy2vpn.egg-info/PKG-INFO +163 -0
- proxy2vpn-0.2.0/src/proxy2vpn.egg-info/SOURCES.txt +29 -0
- proxy2vpn-0.2.0/src/proxy2vpn.egg-info/dependency_links.txt +1 -0
- proxy2vpn-0.2.0/src/proxy2vpn.egg-info/entry_points.txt +2 -0
- proxy2vpn-0.2.0/src/proxy2vpn.egg-info/requires.txt +7 -0
- proxy2vpn-0.2.0/src/proxy2vpn.egg-info/top_level.txt +1 -0
- proxy2vpn-0.2.0/tests/test_cli_entrypoint.py +18 -0
- proxy2vpn-0.2.0/tests/test_compose_manager.py +65 -0
- proxy2vpn-0.2.0/tests/test_compose_utils.py +18 -0
- proxy2vpn-0.2.0/tests/test_compose_validator.py +136 -0
- proxy2vpn-0.2.0/tests/test_docker_ops.py +48 -0
- proxy2vpn-0.2.0/tests/test_init_command.py +41 -0
- proxy2vpn-0.2.0/tests/test_preset_manager.py +34 -0
- proxy2vpn-0.2.0/tests/test_server_manager.py +55 -0
proxy2vpn-0.2.0/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Serhii Khalymon
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
proxy2vpn-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: proxy2vpn
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Proxy2VPN Python utilities
|
|
5
|
+
Author-email: Serhii Khalymon <serhii.khalymon@pm.me>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Keywords: vpn,proxy,utilities
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Requires-Python: >=3.10
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Requires-Dist: typer
|
|
14
|
+
Requires-Dist: ruamel.yaml
|
|
15
|
+
Requires-Dist: docker
|
|
16
|
+
Requires-Dist: requests
|
|
17
|
+
Provides-Extra: dev
|
|
18
|
+
Requires-Dist: towncrier; extra == "dev"
|
|
19
|
+
Dynamic: license-file
|
|
20
|
+
|
|
21
|
+
# Proxy2VPN
|
|
22
|
+
|
|
23
|
+
Python command-line interface for managing multiple VPN containers with Docker.
|
|
24
|
+
|
|
25
|
+
## Features
|
|
26
|
+
- Manage VPN credentials as reusable profiles
|
|
27
|
+
- Create and control VPN services
|
|
28
|
+
- Bulk start/stop operations
|
|
29
|
+
- Query and validate provider server locations
|
|
30
|
+
- Apply predefined presets for common setups
|
|
31
|
+
|
|
32
|
+
## Installation
|
|
33
|
+
|
|
34
|
+
Install `proxy2vpn` from [PyPI](https://pypi.org/project/proxy2vpn/) using your
|
|
35
|
+
preferred Python tool:
|
|
36
|
+
|
|
37
|
+
### pip
|
|
38
|
+
```bash
|
|
39
|
+
pip install proxy2vpn
|
|
40
|
+
proxy2vpn --help
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### uv
|
|
44
|
+
```bash
|
|
45
|
+
uv tool install proxy2vpn
|
|
46
|
+
proxy2vpn --help
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### uvx
|
|
50
|
+
Run the CLI without installing it:
|
|
51
|
+
```bash
|
|
52
|
+
uvx proxy2vpn --help
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### pipx
|
|
56
|
+
```bash
|
|
57
|
+
pipx install proxy2vpn
|
|
58
|
+
proxy2vpn --help
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Quick Start
|
|
62
|
+
1. Initialize the compose file:
|
|
63
|
+
```bash
|
|
64
|
+
proxy2vpn init
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
2. Create a profile file with your VPN credentials:
|
|
68
|
+
```bash
|
|
69
|
+
mkdir -p profiles
|
|
70
|
+
cat <<'EOF' > profiles/myprofile.env
|
|
71
|
+
OPENVPN_USER=your_username
|
|
72
|
+
OPENVPN_PASSWORD=your_password
|
|
73
|
+
EOF
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
3. Register the profile:
|
|
77
|
+
```bash
|
|
78
|
+
proxy2vpn profile create myprofile profiles/myprofile.env
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
4. Create and start a VPN service:
|
|
82
|
+
```bash
|
|
83
|
+
proxy2vpn vpn create vpn1 myprofile --port 8888 --provider protonvpn --location "New York"
|
|
84
|
+
proxy2vpn vpn start vpn1
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
5. View status and test connectivity:
|
|
88
|
+
```bash
|
|
89
|
+
proxy2vpn vpn list
|
|
90
|
+
proxy2vpn test vpn1
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Command overview
|
|
94
|
+
|
|
95
|
+
### Initialization
|
|
96
|
+
- `proxy2vpn init [--force]`
|
|
97
|
+
|
|
98
|
+
### Profiles
|
|
99
|
+
- `proxy2vpn profile create NAME ENV_FILE`
|
|
100
|
+
- `proxy2vpn profile list`
|
|
101
|
+
- `proxy2vpn profile delete NAME`
|
|
102
|
+
|
|
103
|
+
### VPN services
|
|
104
|
+
- `proxy2vpn vpn create NAME PROFILE [--port PORT] [--provider PROVIDER] [--location LOCATION]`
|
|
105
|
+
- `proxy2vpn vpn list`
|
|
106
|
+
- `proxy2vpn vpn start NAME`
|
|
107
|
+
- `proxy2vpn vpn stop NAME`
|
|
108
|
+
- `proxy2vpn vpn restart NAME`
|
|
109
|
+
- `proxy2vpn vpn logs NAME [--lines N] [--follow]`
|
|
110
|
+
- `proxy2vpn vpn delete NAME`
|
|
111
|
+
|
|
112
|
+
### Bulk operations
|
|
113
|
+
- `proxy2vpn bulk up`
|
|
114
|
+
- `proxy2vpn bulk down`
|
|
115
|
+
- `proxy2vpn bulk status`
|
|
116
|
+
- `proxy2vpn bulk ips`
|
|
117
|
+
|
|
118
|
+
### Server database
|
|
119
|
+
- `proxy2vpn servers update`
|
|
120
|
+
- `proxy2vpn servers list-providers`
|
|
121
|
+
- `proxy2vpn servers list-countries PROVIDER`
|
|
122
|
+
- `proxy2vpn servers list-cities PROVIDER COUNTRY`
|
|
123
|
+
- `proxy2vpn servers validate-location PROVIDER LOCATION`
|
|
124
|
+
|
|
125
|
+
### Presets
|
|
126
|
+
- `proxy2vpn preset list`
|
|
127
|
+
- `proxy2vpn preset apply PRESET SERVICE [--port PORT]`
|
|
128
|
+
|
|
129
|
+
### Testing
|
|
130
|
+
- `proxy2vpn test SERVICE` – verify that a proxy container is reachable
|
|
131
|
+
|
|
132
|
+
## Development
|
|
133
|
+
|
|
134
|
+
### Setup
|
|
135
|
+
```bash
|
|
136
|
+
# Install with development dependencies
|
|
137
|
+
uv sync
|
|
138
|
+
# or
|
|
139
|
+
pip install -e ".[dev]"
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Testing
|
|
143
|
+
```bash
|
|
144
|
+
# Run tests (if available)
|
|
145
|
+
pytest
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Changelog Management
|
|
149
|
+
This project uses [Towncrier](https://towncrier.readthedocs.io/) for changelog management:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
# Add a news fragment for your changes
|
|
153
|
+
echo "Your feature description" > news/<PR_NUMBER>.feature.md
|
|
154
|
+
|
|
155
|
+
# Preview the changelog
|
|
156
|
+
make changelog-draft
|
|
157
|
+
|
|
158
|
+
# Build the changelog (maintainers)
|
|
159
|
+
make changelog VERSION=x.y.z
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## License
|
|
163
|
+
MIT
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# Proxy2VPN
|
|
2
|
+
|
|
3
|
+
Python command-line interface for managing multiple VPN containers with Docker.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
- Manage VPN credentials as reusable profiles
|
|
7
|
+
- Create and control VPN services
|
|
8
|
+
- Bulk start/stop operations
|
|
9
|
+
- Query and validate provider server locations
|
|
10
|
+
- Apply predefined presets for common setups
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
Install `proxy2vpn` from [PyPI](https://pypi.org/project/proxy2vpn/) using your
|
|
15
|
+
preferred Python tool:
|
|
16
|
+
|
|
17
|
+
### pip
|
|
18
|
+
```bash
|
|
19
|
+
pip install proxy2vpn
|
|
20
|
+
proxy2vpn --help
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### uv
|
|
24
|
+
```bash
|
|
25
|
+
uv tool install proxy2vpn
|
|
26
|
+
proxy2vpn --help
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### uvx
|
|
30
|
+
Run the CLI without installing it:
|
|
31
|
+
```bash
|
|
32
|
+
uvx proxy2vpn --help
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### pipx
|
|
36
|
+
```bash
|
|
37
|
+
pipx install proxy2vpn
|
|
38
|
+
proxy2vpn --help
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Quick Start
|
|
42
|
+
1. Initialize the compose file:
|
|
43
|
+
```bash
|
|
44
|
+
proxy2vpn init
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
2. Create a profile file with your VPN credentials:
|
|
48
|
+
```bash
|
|
49
|
+
mkdir -p profiles
|
|
50
|
+
cat <<'EOF' > profiles/myprofile.env
|
|
51
|
+
OPENVPN_USER=your_username
|
|
52
|
+
OPENVPN_PASSWORD=your_password
|
|
53
|
+
EOF
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
3. Register the profile:
|
|
57
|
+
```bash
|
|
58
|
+
proxy2vpn profile create myprofile profiles/myprofile.env
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
4. Create and start a VPN service:
|
|
62
|
+
```bash
|
|
63
|
+
proxy2vpn vpn create vpn1 myprofile --port 8888 --provider protonvpn --location "New York"
|
|
64
|
+
proxy2vpn vpn start vpn1
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
5. View status and test connectivity:
|
|
68
|
+
```bash
|
|
69
|
+
proxy2vpn vpn list
|
|
70
|
+
proxy2vpn test vpn1
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Command overview
|
|
74
|
+
|
|
75
|
+
### Initialization
|
|
76
|
+
- `proxy2vpn init [--force]`
|
|
77
|
+
|
|
78
|
+
### Profiles
|
|
79
|
+
- `proxy2vpn profile create NAME ENV_FILE`
|
|
80
|
+
- `proxy2vpn profile list`
|
|
81
|
+
- `proxy2vpn profile delete NAME`
|
|
82
|
+
|
|
83
|
+
### VPN services
|
|
84
|
+
- `proxy2vpn vpn create NAME PROFILE [--port PORT] [--provider PROVIDER] [--location LOCATION]`
|
|
85
|
+
- `proxy2vpn vpn list`
|
|
86
|
+
- `proxy2vpn vpn start NAME`
|
|
87
|
+
- `proxy2vpn vpn stop NAME`
|
|
88
|
+
- `proxy2vpn vpn restart NAME`
|
|
89
|
+
- `proxy2vpn vpn logs NAME [--lines N] [--follow]`
|
|
90
|
+
- `proxy2vpn vpn delete NAME`
|
|
91
|
+
|
|
92
|
+
### Bulk operations
|
|
93
|
+
- `proxy2vpn bulk up`
|
|
94
|
+
- `proxy2vpn bulk down`
|
|
95
|
+
- `proxy2vpn bulk status`
|
|
96
|
+
- `proxy2vpn bulk ips`
|
|
97
|
+
|
|
98
|
+
### Server database
|
|
99
|
+
- `proxy2vpn servers update`
|
|
100
|
+
- `proxy2vpn servers list-providers`
|
|
101
|
+
- `proxy2vpn servers list-countries PROVIDER`
|
|
102
|
+
- `proxy2vpn servers list-cities PROVIDER COUNTRY`
|
|
103
|
+
- `proxy2vpn servers validate-location PROVIDER LOCATION`
|
|
104
|
+
|
|
105
|
+
### Presets
|
|
106
|
+
- `proxy2vpn preset list`
|
|
107
|
+
- `proxy2vpn preset apply PRESET SERVICE [--port PORT]`
|
|
108
|
+
|
|
109
|
+
### Testing
|
|
110
|
+
- `proxy2vpn test SERVICE` – verify that a proxy container is reachable
|
|
111
|
+
|
|
112
|
+
## Development
|
|
113
|
+
|
|
114
|
+
### Setup
|
|
115
|
+
```bash
|
|
116
|
+
# Install with development dependencies
|
|
117
|
+
uv sync
|
|
118
|
+
# or
|
|
119
|
+
pip install -e ".[dev]"
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Testing
|
|
123
|
+
```bash
|
|
124
|
+
# Run tests (if available)
|
|
125
|
+
pytest
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Changelog Management
|
|
129
|
+
This project uses [Towncrier](https://towncrier.readthedocs.io/) for changelog management:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
# Add a news fragment for your changes
|
|
133
|
+
echo "Your feature description" > news/<PR_NUMBER>.feature.md
|
|
134
|
+
|
|
135
|
+
# Preview the changelog
|
|
136
|
+
make changelog-draft
|
|
137
|
+
|
|
138
|
+
# Build the changelog (maintainers)
|
|
139
|
+
make changelog VERSION=x.y.z
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## License
|
|
143
|
+
MIT
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "proxy2vpn"
|
|
7
|
+
version = "0.2.0"
|
|
8
|
+
description = "Proxy2VPN Python utilities"
|
|
9
|
+
authors = [{ name = "Serhii Khalymon", email = "serhii.khalymon@pm.me" }]
|
|
10
|
+
readme = "README.md"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
license-files = ["LICENSE"]
|
|
13
|
+
requires-python = ">=3.10"
|
|
14
|
+
keywords = ["vpn", "proxy", "utilities"]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Programming Language :: Python :: 3",
|
|
17
|
+
"Operating System :: OS Independent",
|
|
18
|
+
]
|
|
19
|
+
dependencies = [
|
|
20
|
+
"typer",
|
|
21
|
+
"ruamel.yaml",
|
|
22
|
+
"docker",
|
|
23
|
+
"requests",
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
[project.optional-dependencies]
|
|
27
|
+
dev = ["towncrier"]
|
|
28
|
+
|
|
29
|
+
[tool.towncrier]
|
|
30
|
+
package = "proxy2vpn"
|
|
31
|
+
package_dir = "src"
|
|
32
|
+
filename = "CHANGELOG.md"
|
|
33
|
+
directory = "news"
|
|
34
|
+
start_string = "<!-- towncrier release notes start -->"
|
|
35
|
+
template = "towncrier:default.md"
|
|
36
|
+
title_format = "## [{version}]"
|
|
37
|
+
underlines = ["-", "~"]
|
|
38
|
+
|
|
39
|
+
[tool.towncrier.fragment.feature]
|
|
40
|
+
name = "Features"
|
|
41
|
+
showcontent = true
|
|
42
|
+
|
|
43
|
+
[tool.towncrier.fragment.bugfix]
|
|
44
|
+
name = "Bug fixes"
|
|
45
|
+
showcontent = true
|
|
46
|
+
|
|
47
|
+
[tool.towncrier.fragment.doc]
|
|
48
|
+
name = "Documentation"
|
|
49
|
+
showcontent = true
|
|
50
|
+
|
|
51
|
+
[tool.towncrier.fragment.removal]
|
|
52
|
+
name = "Removals"
|
|
53
|
+
showcontent = true
|
|
54
|
+
|
|
55
|
+
[tool.towncrier.fragment.misc]
|
|
56
|
+
name = "Miscellaneous"
|
|
57
|
+
showcontent = true
|
|
58
|
+
|
|
59
|
+
[project.scripts]
|
|
60
|
+
proxy2vpn = "proxy2vpn.cli:app"
|
|
61
|
+
|
|
62
|
+
[tool.setuptools.packages.find]
|
|
63
|
+
where = ["src"]
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"""proxy2vpn Python package."""
|
|
2
|
+
|
|
3
|
+
try:
|
|
4
|
+
from importlib.metadata import version
|
|
5
|
+
|
|
6
|
+
__version__ = version("proxy2vpn")
|
|
7
|
+
except Exception:
|
|
8
|
+
# Fallback when package is not installed (development mode)
|
|
9
|
+
__version__ = "dev"
|
|
10
|
+
|
|
11
|
+
__all__ = [
|
|
12
|
+
"cli",
|
|
13
|
+
"compose_utils",
|
|
14
|
+
"docker_ops",
|
|
15
|
+
"compose_manager",
|
|
16
|
+
"models",
|
|
17
|
+
"config",
|
|
18
|
+
"server_manager",
|
|
19
|
+
"__version__",
|
|
20
|
+
]
|