{"id":13596781,"url":"https://github.com/pschmitt/pia-tools","last_synced_at":"2025-09-12T18:46:21.284Z","repository":{"id":141970046,"uuid":"13001894","full_name":"pschmitt/pia-tools","owner":"pschmitt","description":"Shell script to automate privateinternetaccess port forwarding and starting/stopping transmission when connected/disconnected and other stuff","archived":false,"fork":false,"pushed_at":"2017-09-24T15:46:46.000Z","size":132,"stargazers_count":132,"open_issues_count":6,"forks_count":23,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-02-27T14:46:49.304Z","etag":null,"topics":["openvpn","pia","privateinternetaccess","systemd","torrent","transmission","vpn"],"latest_commit_sha":null,"homepage":"https://aur.archlinux.org/packages/pia-tools","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pschmitt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2013-09-21T20:30:25.000Z","updated_at":"2024-01-30T00:30:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"69737a01-9f85-40df-8c33-331afc562fdf","html_url":"https://github.com/pschmitt/pia-tools","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pschmitt%2Fpia-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pschmitt%2Fpia-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pschmitt%2Fpia-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pschmitt%2Fpia-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pschmitt","download_url":"https://codeload.github.com/pschmitt/pia-tools/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243830949,"owners_count":20354854,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["openvpn","pia","privateinternetaccess","systemd","torrent","transmission","vpn"],"created_at":"2024-08-01T16:02:47.617Z","updated_at":"2025-03-16T21:31:10.077Z","avatar_url":"https://github.com/pschmitt.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# pia-tools\n\n## Description\n\nOpenVPN hook for privateinternetaccess.com to automate port forwarding, dynamically add a firewall rule, starting/stopping transmission when connected/disconnected\n\n## TODO\n\n* ~~Ship a ready-to-go OpenVPN wrapper service for systemd~~\n* Get rid of ~~cURL and rename~~ (and sudo?) dependencies\n* Modularity\n* ~~Automate the [post-installation](#post-installation)~~\n* Better error handling\n\n## Dependencies\n\n* curl\n* dnsutils (nslookup)\n* openvpn\n* sed\n* sudo\n* systemd (**pseudo-optional - required for service start/stopping**)\n* transmission-cli\n* ufw\n\n## Installation\n\n### ArchLinux\n\n```bash\nmkdir /tmp/pia-tools; cd !$\ncurl -O https://raw.githubusercontent.com/pschmitt/pia-tools/master/{PKGBUILD,pia-tools.install}\nmakepkg -si\n```\n\n### Other distros\n\n```bash\ncurl https://raw.githubusercontent.com/pschmitt/pia-tools/master/pia-tools \u003e /usr/bin/pia-tools\n```\n\n#### MANPAGE\n\nIf you also want to have the MANPAGE:\n\n```bash\ncurl https://raw.githubusercontent.com/pschmitt/pia-tools/master/pia-tools.groff | gzip -c - \u003e $MAN_PATH/pia-tools.1.gz\n```\n\n**Note**: `$MANPATH` may not be defined, so you'll have to find out where to put the obtained file. On ArchLinux, this would be `/usr/share/man/man1/`\n\n#### Systemd service file\n\n```bash\ncurl https://raw.githubusercontent.com/pschmitt/pia-tools/master/pia@.service \u003e /usr/lib/systemd/system/pia@.service\n```\n\n## Post installation\n\nFirst I recommend to create `/etc/openvpn/pia` and the *required* config files:\n\n```bash\nmkdir -p /etc/openvpn/pia\n\n# Feel free to edit the up/down parameters\ncat \u003c\u003cEOM \u003e /etc/openvpn/pia/pia_common\nauth-user-pass passwd\nscript-security 2\nup \"/usr/bin/pia-tools -g\"\ndown \"/usr/bin/pia-tools --restore-dns\"\nEOM\n\n# Start interactive setup\npia-tools --setup\n```\n\nThe setup will store your credentials in `/etc/openvpn/pia/passwd`, download the config files from PIA and append `/etc/openvpn/pia/pia_common` to all of them.\n\nIn order to download the config files again run `pia-tools --update`\n\n## Go! Go! GOOOOO!\n\n```bash\nsystemctl start pia@Sweden\n```\n\n## Sample config file\n\nPath: `/etc/pia-tools.conf`\n\n```\nPIA_CONFIG_DIR='/etc/openvpn/pia'\nPIA_CONFIG_URL='https://www.privateinternetaccess.com/openvpn/openvpn.zip'\nPIA_COMMON_CONFIG=\"$PIA_CONFIG_DIR/pia_common\"\nPIA_SERVERS_FILE=\"$PIA_CONFIG_DIR/piaservers\"\nPIA_SERVERS_IP_FILE=\"$PIA_CONFIG_DIR/piaserverips\"\nPIA_PASSWD_FILE=\"$PIA_CONFIG_DIR/passwd\"\nPIA_CLIENT_ID_FILE=\"$PIA_CONFIG_DIR/clientid\"\nTRANSMISSION_SETTINGS_FILE='/home/dl/.config/transmission-daemon/settings.json'\nPIA_OPEN_PORT_FILE=\"$PIA_CONFIG_DIR/open_port\"\nVIRT_NET_DEV='tun0'\n```\n\n## Read more\n\nIf you installed the [MANPAGE](#manpage):\n\n```bash\nman pia-tools\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpschmitt%2Fpia-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpschmitt%2Fpia-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpschmitt%2Fpia-tools/lists"}