Commit Graph

64 Commits

Author SHA1 Message Date
Michael Moon
b2da119d3c pia-speedtest: better quoting, and only refresh cache if test succeeded 2021-12-08 12:44:40 +08:00
Michael Moon
89d29830f4 pia-portforward: fix a spurious %s that snuck in somehow 2021-12-08 12:43:50 +08:00
Michael Moon
7833bc535a pia-speedtest: minor improvements and tweaks, try to find a test mirror in the same country as VPN endpoint if possible 2021-10-29 19:40:26 +08:00
Michael Moon
780bb70c78 pia-speedtest: cache some stuff, use a better method for speed reports 2021-10-28 14:26:41 +08:00
Michael Moon
82d0a37684 pia-speedtest: Crude speed test utility to assist in hopping servers until a fast one is found. Does not actually perform server hops. 2021-10-26 16:12:11 +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
d64a3f078d Update README with details from https://github.com/pia-foss/manual-connections/pull/111#issuecomment-822824399 plus a few other clarifying tweaks 2021-04-20 13:47:00 +08:00
Michael Moon
5e5ee59f4a Add a README 2021-04-20 01:53:06 +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
f23c3d359d pia-check: force ping over $PIA_INTERFACE in case LANs are using a 10.x address too 2021-03-01 15:27:43 +08:00
Michael Moon
8af8073ba8 Add pia-check, a simple script to ping the endpoint through the VPN to check if it's up 2021-02-11 22:12:41 +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
0f87a7c46b openrc-init-pia: Use default interface name if none specified 2021-01-26 22:05:33 +08:00
Michael Moon
ca643c6b69 pia-portfoward: use cache if available, otherwise fall back to matching ip in data json as before 2021-01-26 22:05:14 +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
e20118c56a portforward refresh works 2020-11-14 21:36:52 +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
ee39c45b4d pia-portforward: experiment with hiding curl arguments from process table using redirected file descriptors 2020-09-24 18:07:15 +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
63c2d9a209 Make currentserver and portforward more robust against endpoint IP changing in datafile after connection, by performing a search if the exact IP isn't found 2020-09-14 13:56:10 +08:00
Michael Moon
4b58c956fb Use CN instead of DNS name for registration, apparently some of the DNS names have expired certs 2020-09-11 10:16:33 +08:00
Michael Moon
1e45c82d36 Port forwarding: Add proof-of-concept with almost zero error checking or recovery 2020-09-09 18:47:55 +08:00
Michael Moon
853f5656b3 Add small script to check which server is currently in use 2020-08-26 06:39:55 +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
e29712cda2 openrc-init: keep a log so we can check what it's doing during startup 2020-08-20 12:32:13 +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
1d6657e773 Quick openrc init script 2020-06-30 14:56:49 +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