EasyForti is a Python helper project designed to facilitate the creation of OTP inputs for a VPN and automate the probing of connection stability. It leverages the Openfortinet VPN tool to ensure seamless and reliable VPN connections.
- OTP Input Creation: Generates One-Time Password (OTP) inputs for VPN authentication.
- Automated Probing: Periodically checks the stability of the VPN connection by probing a specified URL and reconnects.
- Integration with Openfortinet: Utilizes the Openfortinet VPN tool for establishing VPN connections.
- Python 3.x
- Openfortinet VPN tool installed and configured on your system
-
Clone the repository:
git clone https://github.com/yourusername/easyforti.git cd easyforti
-
Install the required Python packages:
pip install -r requirements.txt
To use EasyForti, you need to provide the path to your Fortinet VPN configuration file, the path to your secret file, and optionally, a URL to probe for checking the VPN connection's liveness.
--config-path
or-c
: Path to the Fortinet VPN configuration file (required).--secret-file
or-s
: Path to the secret file containing authentication details (required) (read QR Code Script). It's a text file contains the secret data comes from qrcode, you can also get it from Google Authenticator.--probe-url
or-p
: URL to probe for checking VPN liveness (optional, defaults tohttp://gitlab.snapp.ir
).
python easyforti.py --config-path /path/to/config --secret-file /path/to/secret --probe-url http://example.com
This will start the VPN connection process, generate the OTP input, and periodically probe the specified URL to check the VPN's stability.
Ensure your Fortinet VPN configuration file is properly set up and accessible. The secret file should contain the necessary authentication details required by the Openfortinet tool. The secret is derived from a QR code provided by your VPN service.
A tool is provided to help you extract the secret from the QR code. Use the qrcode.py
file included in the repository:
-
Save your QR code as an image file (e.g.,
qrcode.png
). -
Run the
qrcode.py
script to extract the secret:python qrcode.py /path/to/qrcode.png
Below is a snippet of qrcode.py
script, It will help you to extract the secret from the qrcode to provide the secret parameter of easyforti:
python qrcode.py qrcode_image.png
Contributions are welcome! Please submit a pull request or open an issue to discuss potential changes.
Thank you for using EasyForti! We hope it simplifies your VPN connectivity and stability checks.