Skip to content

Commit ec204d8

Browse files
authored
Merge pull request #8 from Dhi13man/feature/global-protect
Release v0.0.2 | Global Protect Integration, data model decoupling and Zope Interfaces removal
2 parents 6629c76 + 21cee58 commit ec204d8

25 files changed

+726
-316
lines changed

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Releases
2+
3+
## [0.0.2] - 16th June 2024
4+
5+
1. Integrated one-step [Palo Alto Global Protect](https://docs.paloaltonetworks.com/globalprotect) VPN connection/disconnection.
6+
2. Decoupled VPN Config and VPN Data Models for future flexibility.
7+
3. Removed unnecessary Zope Interfaces dependency as it does not seem worth the maintenance effort.
8+
4. Upgraded `pyinstaller` dependency to leave vulnerable version.
9+
10+
## [0.0.1] - 25th March 2023
11+
12+
Initial implementation of the base features of the auto_vpn_connect script:
13+
14+
1. Connect/Disconnect and set up Auto-Connect to Pritunl VPNs.
15+
2. Save PINs, Tokens and auto fetch TOTPs using pyotp by providing the TOTP URL to minimise the effort to connect to VPNs, after a one-time setup.
16+
3. Set up customisable JSON VPN profiles and configs to customise where various CLIs and dependencies might be located
17+
4. Extensibility to add other VPN clients with ease.

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
[![Language](http://ForTheBadge.com/images/badges/made-with-python.svg)](https://www.python.org/)
1111
[!["Buy Me A Coffee"](https://img.buymeacoffee.com/button-api/?text=Buy%20me%20an%20Ego%20boost&emoji=%F0%9F%98%B3&slug=dhi13man&button_colour=FF5F5F&font_colour=ffffff&font_family=Lato&outline_colour=000000&coffee_colour=FFDD00****)](https://www.buymeacoffee.com/dhi13man)
1212

13-
A Python script that allows users to automatically connect to VPNs with minimal effort. As of now, only [Pritunl VPN Client](https://docs.pritunl.com/docs/command-line-interface) is supported.
13+
This is a Python script that allows users to automatically connect to VPNs with minimal effort. VPNs supported as of now:
14+
15+
1. [Pritunl VPN Client](https://docs.pritunl.com/docs/command-line-interface)
16+
2. [Palo Alto Global Protect](https://docs.paloaltonetworks.com/globalprotect)
1417

1518
## Usage
1619

@@ -24,7 +27,14 @@ A Python script that allows users to automatically connect to VPNs with minimal
2427
{
2528
"config": {
2629
"PRITUNL": {
30+
"vpn_type": "PRITUNL",
2731
"cli_path": "/Applications/Pritunl.app/Contents/Resources/pritunl-client"
32+
},
33+
"GLOBAL_PROTECT": {
34+
"vpn_type": "GLOBAL_PROTECT",
35+
"service_load_command": "launchctl load /Library/LaunchAgents/com.paloaltonetworks.gp.pangpa.plist",
36+
"service_unload_command": "launchctl unload /Library/LaunchAgents/com.paloaltonetworks.gp.pangpa.plist",
37+
"process_kill_command": "pkill -9 -f GlobalProtect"
2838
}
2939
},
3040
"vpn_list": [
@@ -44,6 +54,10 @@ A Python script that allows users to automatically connect to VPNs with minimal
4454
"vpn_type": "PRITUNL",
4555
"pin": "<vpn_pin_3>",
4656
"token": "<vpn_token>"
57+
},
58+
{
59+
"vpn_id": "GlobalProtect",
60+
"vpn_type": "GLOBAL_PROTECT"
4761
}
4862
]
4963
}
@@ -161,7 +175,6 @@ cd <path_to_script>
161175

162176
- [Python 3.10+](https://www.python.org/downloads/): Used for developing the script
163177
- [pyotp](https://pypi.org/project/pyotp/): Used for generating OTPs
164-
- [zope.interface](https://pypi.org/project/zope.interface/): Used for type hinting
165178

166179
#### External Dependencies
167180

__main__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from time import sleep
99

1010
from src.models.user_switches import UserSwitches
11-
from src.models.vpn_data import abstract_vpn_data
11+
from src.models.vpn_model import abstract_vpn_model
1212
from src.services.vpn_parser_service import VpnDataParserService
1313

1414
PROMPT: str = 'Run in Connect (c), Disconnect (d), or be in Always-Connected mode (w)'
@@ -57,7 +57,7 @@ def get_user_switches() -> UserSwitches:
5757
raise ValueError(f'Invalid action switch. {PROMPT}!')
5858

5959
# List all VPNs
60-
vpn_data_list: list[abstract_vpn_data.AbstractVpnData] = []
60+
vpn_data_list: list[abstract_vpn_model.AbstractVpnModel] = []
6161
with open(user_switches.vpn_data_json_path, 'r', encoding='utf-8') as f:
6262
vpn_parser_service: VpnDataParserService = VpnDataParserService()
6363
vpn_data_list = vpn_parser_service.parse_vpn_data(f.read())
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6.67 MB
Binary file not shown.
6.83 MB
Binary file not shown.
6.41 MB
Binary file not shown.

0 commit comments

Comments
 (0)