This repository has been archived by the owner on Oct 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from clajiness/v2
V2 -> master
- Loading branch information
Showing
5 changed files
with
182 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
*.yml | ||
*.log | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,24 @@ | ||
## **Deprecated** - This script will *not* work with PIA's NextGen network. | ||
|
||
# qBittorrent-PIA-Port-Forwarder | ||
# qBittorrent-PIA-Port-Forwarder V2 | ||
|
||
### A Ruby script for automatically setting qBittorrents listening port while connected to PIA VPN | ||
|
||
**Config**\ | ||
Enter your QBT credentials and IP address:port, and then enter your PIA credentials. | ||
**Requirements**\ | ||
Given that this is a Ruby script, it requires a Ruby environment. This script was tested with Ruby 2.6.5. If you need help installing and managing your environment, I'd recommend [RVM](https://rvm.io/). | ||
|
||
The script requires an active PIA VPN connection with the following attributes: | ||
* OpenVPN (This may work with WireGuard, but it hasn't been tested) | ||
* A server outside of the US. | ||
|
||
It was build for use on Ubuntu Server, but developed on a Mac. The only additional tools needed on Mac were [Homebrew](https://brew.sh/) with the `iproute2mac` package installed. | ||
|
||
**Environment**\ | ||
This script was tested with Ruby 2.5.3. | ||
You will also need Cron, or a similar service. The script needs to be executed every 15 minutes to maintain your forwarded port. In Ubuntu, I use cron via `crontab -e` with an entry similar to this: | ||
|
||
``` | ||
*/15 * * * * /bin/bash -c -l 'cd /home/clajiness/scripts/qBittorrent-PIA-Port-Forwarder; /home/clajiness/.rvm/rubies/ruby-2.6.5/bin/ruby qbt_pia_port_forwarder.rb' | ||
``` | ||
|
||
**Config**\ | ||
To set up the script, use `initial_config.yml.example` to create your `initial_config.yml` file. `cp initial_config.yml.example initial_config.yml` should work fine. Then, populate your new `initial_config.yml` file with the required data. Once complete, save your file and set up your cron job. | ||
|
||
**Usage**\ | ||
Enter your credentials into the config.yml file. Run the script with `ruby qbt_pia_port_forwarder.rb`. It will create a YAML file named `client_id.yml` for storing your client ID. If you wish to force a port change, simply delete the YAML file and run the script. I recommend executing the script with cron or a similar service. | ||
Run the script with `ruby qbt_pia_port_forwarder.rb`. If you wish to force a port change, simply delete the auto_config.yml file and run the script again. Again, I recommend executing the script every 15 minutes with cron or a similar service. If it's not ran every 15 minutes, you will lose your forwarded port. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
# These values must be populated before the first run. | ||
# Subsequent runs will pull data from the auto_config.yml file. | ||
# If you make changes to any of this data, delete your auto_config.yml file and run the script again. | ||
|
||
# PIA username and password | ||
:pia_username: # pNNNNNNN | ||
:pia_password: | ||
|
||
# qBittorrent username, password, and address:port | ||
:qbt_username: | ||
:qbt_password: | ||
:qbt_addr: # ex. http://10.0.1.48:8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters