55 Commits

Author SHA1 Message Date
Lachlan Wisdom
3b66c47aa7 Fix LOC print
Incorrect pipe position was causing jq error instead of printing locations
2025-05-17 22:31:45 +10:00
Michael Moon
ded22bdf5a curl no longer accepts --CAcert, change to --cacert. Fixes #15 2024-10-30 20:12:56 +08:00
Michael Moon
40fd36fb0e Silence some noise, check wg latest-handshakes to detect connection success 2024-10-30 20:11:20 +08:00
Michael Moon
91bda8c52b Create config dir if it doesn't exist; refer issue #6 2022-08-17 16:22:20 +08:00
Rushab Shah
c66dee2768 pia-wg: sort by location while displaying regions 2022-07-16 06:28:34 +05:30
Michael Moon
14e28a8e76 Try to fix issue #2, tricky since I can't reproduce it locally 2022-06-07 16:57:46 +08:00
Michael Moon
74626ea240 Fix trying to edit routing tables even in config-only mode 2022-06-05 17:07:50 +08:00
Michael Moon
f96ce853f1 pia-portforward: implement ability to specify a portforward hook in config. pia-wg: add example portforward hook to default config 2022-05-21 22:42:53 +08:00
Michael Moon
2b7277e678 Forgot one instance of hardcoded routing table names. Also have to move alternate routing table setup to catch it 2022-03-16 11:13:13 +08:00
Michael Moon
4c605a4a51 pia-wg, net.pia: Add new option: -f Fast reconnect. Only restores cached connection, does not check if connection is valid or perform any other online operations 2021-12-08 12:48:19 +08:00
Michael Moon
00796022f0 pia-wg: Reject slow servers earlier during connection stability test 2021-10-26 16:11:19 +08:00
Michael Moon
77189addc4 Fix conncache to only hold the selected server 2021-10-11 20:04:31 +08:00
Michael Moon
ae39b79e68 Use v6 serverlist which offers multiple IPs per location 2021-10-11 19:52:08 +08:00
Michael Moon
5d6f2ced17 Allow LAN when exporting config 2021-10-01 20:14:41 +08:00
Michael Moon
fc4a48aa56 Extra debug info on WG key registration failure, reduce timeouts to more rapidly cycle if an endpoint is slow 2021-10-01 20:14:24 +08:00
Michael Moon
a6fd58066a Fix some other variable names from bad copypasta, explicitly forget password and notify user 2021-06-01 18:33:11 +08:00
Michael Moon
86470b2978 Fix silly typo
Reported-by: reddit.com/u/Bexacef
2021-06-01 18:25:03 +08:00
Michael Moon
1935e798a1 Try meta server if PIA v2 api can't be reached, only ping-test connection 5 times instead of 10 2021-06-01 18:24:09 +08:00
Michael Moon
887d0b9301 Reorganise dependency checks and a few code blocks, clarify some messages 2021-04-19 13:23:04 +08:00
Michael Moon
611f706cf3 Only test for ip and wg if we need them; -c config-only does not require them 2021-04-02 14:54:44 +08:00
Michael Moon
42f06a9d7c pia-wg -c (config only) option will now also spit out a QR code for use with phones 2021-04-02 14:41:21 +08:00
Michael Moon
147ef7be1c Reshuffle reconnect mechanics after discussion with PIA L2 tech support, add option to only generate config eg for use with a router or another third-party Wireguard client 2021-04-02 13:54:44 +08:00
Michael Moon
9ed4828744 Only use console codes if stdout is a terminal 2021-02-10 12:34:10 +08:00
Michael Moon
8aac2ef06a Big update: centralise config option processing into one file, auto-generate requisite routing tables if they're not already available 2021-02-10 12:24:59 +08:00
Michael Moon
bbc6f0502e Keep previous connection info cached so it can be reused on cold boot - add pia-wg -n option to force re-choosing and endpoint 2021-01-12 13:15:53 +08:00
Michael Moon
59278ced81 add some timeouts, fall back to public serverlist if VPN serverlist fetch fails 2020-11-14 21:37:38 +08:00
Michael Moon
bdfd607655 Try harder to find pia-portforward since PATH is fairly plain in init scripts 2020-09-30 12:23:54 +08:00
Michael Moon
b9e7c8b9e5 pia-wg: if PORTFORWARD="true", only accept port-forwarding servers, and request a port forward after connection 2020-09-26 16:27:01 +08:00
Michael Moon
d3f03cc48e Attempt to protect passwords that contain special characters from shell interpretation 2020-09-14 22:02:08 +08:00
Michael Moon
9805ac1463 USER -> PIA_USERNAME to avoid collision with common system env var 2020-09-14 20:35:44 +08:00
Michael Moon
5f9e884e53 Use newly available v4 server list to update cache after connection 2020-08-26 06:39:04 +08:00
Michael Moon
ac7d270d2a pia-wg: use fwmark instead of ip rules to steer wireguard packets, prettify location list output 2020-08-20 12:31:36 +08:00
Michael Moon
4015c34f6f Fix dirs in init script to match new locations in pia-wg, fix pia-wg stripping groups on serverlist update, fix pia-wg always selecting a US-based server, minor rearrangements 2020-07-21 19:41:59 +08:00
Michael Moon
90d2442f03 Change default config and cache locations for root user 2020-07-20 15:03:11 +08:00
Michael Moon
2d787561b6 Fallback to common name if registration using dns name fails, preserve "groups" section of server list and pick a random port in case PIA ever opens more ports for wireguard 2020-07-18 14:00:17 +08:00
Michael Moon
cda3ed5093 Ensure we exit 0 on success, fix a typo where we grabbed a new server list every single time instead of every few days 2020-07-17 00:49:45 +08:00
Michael Moon
5863d08065 Switch server list to new generation list 2020-07-15 17:11:01 +08:00
Michael Moon
31c9f28223 Don't wait indefinitely for connection to stabilise, fail after a while so we can try again 2020-07-15 17:02:40 +08:00
Michael Moon
8e7131d1d8 pia-wg: check sysfs instead of invoking ip link to test if interface exists 2020-06-30 14:56:37 +08:00
Michael Moon
1b2679cdf6 Exit properly if key registration fails, don't overwrite token file with every invocation, allow ctrl+c to work while waiting for connection to stabilise 2020-06-25 18:22:23 +08:00
Michael Moon
47dd996ae6 Add timeout while activating public key, make sure to ping the right interface during connection check 2020-06-25 12:51:51 +08:00
Michael Moon
e5795872e1 Use PIA's self-signed RSA cert to verify endpoints's serial number instead of their wildcard *.privateinternetaccess.com cert, clean up some meaningless warnings during interface setup 2020-06-17 17:08:18 +08:00
Michael Moon
4986fca570 Add suggestions from /u/Threarah, no longer require wg-quick, re-fetch server list after connection if cached list is stale, check that the few prerequisites are available 2020-06-17 14:39:53 +08:00
Michael Moon
4696b1bbb2 Clarify token file location in an error message 2020-06-16 17:38:34 +08:00
Michael Moon
ff2df879a3 handle = in keys properly 2020-06-09 21:49:07 +08:00
Michael Moon
064cd537df Make output less noisy, allow endpoint hop without a teardown/setup cycle 2020-06-04 17:00:08 +08:00
Michael Moon
b37773362b Fix some ip route stuff 2020-05-20 15:16:33 +08:00
Michael Moon
5a3bc432f1 Move configs to ~/.config/pia-wg/ by default, expand settings management, improved gateway discovery, extra routing rules 2020-05-19 13:54:38 +08:00
Michael Moon
bd6af408a0 Use first gateway instead of last. TODO: find proper gateway 2020-05-13 12:53:33 +08:00
Michael Moon
176ba4a5d6 Stop wg from breaking certain network setups, do it manually instead if required. Also add commented DNS entries 2020-05-11 23:28:21 +08:00