It is currently April 8th, 2020, 3:36 pm

Private Internet Access (VPN) broke recently

Help with creating, editing & fixing problems with skins
Darv
Posts: 4
Joined: September 27th, 2015, 1:48 am

Private Internet Access (VPN) broke recently

Post by Darv »

Hoping someone that knows Rainmeter coding can figure this out.

Private Internet Access aka PIA recently released version 1.8 of their VPN. The update broke the Rainmeter skin which I use to make sure my connection is secure. Really missing it. The skin itself seems pretty straight forward but I can't determine what changed in 1.8. Reverting to version 1.7 resolves the issue. The problem is that it doesn't seem to recognize when the VPN is connected. Any help or suggestions would be appreciated but I wouldn't even call myself a novice. Just a rainmeter user with some programming background.

-------------------------------------------------------------------------------------------------------------------------------------

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
BackgroundMode=2
SolidColor=0,0,0,0

[MeasureNetwork]
Measure=Plugin
Plugin=SysInfo
SysInfoType=IP_ADDRESS
SysInfoData=1
RegExpSubstitute=1
Substitute="^(.*)\.(.*)\.(.*)\.(.*)$":"\1"

[OnlineStatus]
Measure=Calc
Formula=[MeasureNetwork]
IfBelowValue = 11
IfBelowAction=[!SetOption MeterNetwork FontColor 0,255,0,200][!SetOption PiaIcon ImageName pia_on.png][!UpdateMeter PiaIcon][!Redraw]
IfAboveValue = 11
IfAboveAction=[!SetOption MeterNetwork FontColor 255,0,0,255][!SetOption PiaIcon ImageName pia_off.png][!UpdateMeter PiaIcon][!Redraw]
DynamicVariables=1

[PiaIcon]
Meter=Image
ImageName=pia_gray.png
W=30
H=30
X=8
Y=7

[MeterNetwork]
Meter=String
MeasureName=OnlineStatus
FontSize=30
FontColor=167,167,167,255
StringStyle=Bold
AntiAlias=1
Text=VPN
X=30
y=0
Last edited by Brian on March 17th, 2020, 6:57 am, edited 1 time in total.
Reason: Please use the code tags. It's the </> button.
mak_kawa
Posts: 564
Joined: December 30th, 2015, 9:47 am

Re: Private Internet Access (VPN) broke recently

Post by mak_kawa »

I don't know abput PIA at all, so can't do specific help abput it and the skin. But...how about the value of [MeasureNetwork] *before* the RegExpSubstitution?
User avatar
Yincognito
Posts: 1152
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Private Internet Access (VPN) broke recently

Post by Yincognito »

Darv wrote:
March 17th, 2020, 6:53 am
Hoping someone that knows Rainmeter coding can figure this out.

Private Internet Access aka PIA recently released version 1.8 of their VPN. The update broke the Rainmeter skin which I use to make sure my connection is secure. Really missing it. The skin itself seems pretty straight forward but I can't determine what changed in 1.8. Reverting to version 1.7 resolves the issue. The problem is that it doesn't seem to recognize when the VPN is connected. Any help or suggestions would be appreciated but I wouldn't even call myself a novice. Just a rainmeter user with some programming background.
The coding appears to be fine, although I didn't tested it yet - and the fact that it works for previous PIA versions seems to indicate that as well. However, the process is the key here: you basically test to see if the number before the first dot in the address (i.e. its most significant bits) of the IP address of the NIC (aka network interface controller) whose index number is 1 is less or greater than 11. So, one (or more) of the following possibilities might have "broken" this process:

- the NIC whose IP address you want to be tested has a different index in SysInfoData (low probability, but still a possibility)
- the number before the first dot in the address being less or greater than 11 doesn't reflect the security of the connection anymore, in the new PIA version
- the new version uses a different method to secure your connection, a method that doesn't translate in the IP address change you used to test in the previous versions

Now, if this process works for the previous version of PIA in the same test environment, I think one of the latter two possibilities are more likely, so, assuming the skin itself works, that's where I would start my investigation at.

P.S. Personally, I wouldn't count to much on the index of the NIC in SysInfoData. To me, the name of the NIC (or the 'Best' value, if that's the case) seem safer and more credible when approaching this...
User avatar
jsmorley
Developer
Posts: 20457
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Private Internet Access (VPN) broke recently

Post by jsmorley »

I'm sure it varies by VPN, but the way that I test to see if my VPN in providing the connection is like this:

Code: Select all

[MeasureAdapterDesc]
Measure=Plugin
Plugin=SysInfo
SysInfoType=ADAPTER_DESCRIPTION
SysInfoData=Best
UpdateDivider=5
DynamicVariables=1
IfMatch=IPVanish
IfMatchAction=[!SetVariable Interface "[MeasureAdapterDesc]"][!SetOption MeterWANLabel Text "VPN"][!SetOption MeterLANLabel Text "TAP"]
IfNotMatchAction=[!SetVariable Interface "[MeasureAdapterDesc]"][!SetOption MeterWANLabel Text "WAN"][!SetOption MeterLANLabel Text "LAN"]
So I just use an Interface option of "Best", then check the name of the adapter it returns to see if it is my VPN. This will either be the name of my physical NIC, or if the VPN is active, the name of the virtual TUN/TAP adapter the software sets up.

From then on, I just use the name returned in [MeasureAdapterDesc] as the Interface option in all my network measures.

I certainly can't be sure this will work for any and all VPN's out there, although I would think most of them use some sort of TUN/TAP virtual adapter to create a Virtual Private Network.

Note the DynamicVariables=1 on this. SysInfo will not see a real-time change to the information it returns unless the measure is made dynamic.


1.jpg

2.jpg
You do not have the required permissions to view the files attached to this post.