128.io

2021-12-29: Finding Private Internet Access's config files on Linux

Recently, I searched to find where Private Internet Access stores account credentials and settings locally as part of maintaining a set of autoinstall/cloud-init files for provisioning my laptop. I wasn't able to find any information through a cursory web search, so I set out to find the settings myself. Here's what I found:

Relevant Files

/opt/piavpn/etc/account.json: Account Credentials

    {
      "active":true,
      "canceled":false,
      "daysRemaining":123,
      "dedicatedIps":[],
      "expirationTime":1640494017000,
      "expireAlert":false,
      "expired":false,
      "loggedIn":true,
      "needsPayment":false,
      "openvpnPassword":"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
      "openvpnUsername":"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
      "password":"",
      "plan":"24m",
      "portForwardPayload":"",
      "portForwardSignature":"",
      "recurring":true,
      "renewURL":"https://www.privateinternetaccess.com/helpdesk/",
      "renewable":false,
      "token":"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
      "username":"p1234567"
    }
  

/opt/piavpn/etc/data.json: VPN locations/latencies, translations

    {
      "appMessage": {
        "hasLink": false,
        "id": 0,
        "linkTranslations": {},
        "messageTranslations": {},
        "settingsAction": {},
        "uriAction": "",
        "viewAction": ""
      },
      "betaChannelOsRequired": "",
      "betaChannelVersion": "",
      "betaChannelVersionUri": "",
      "cachedModernRegionsList": {
        "groups": {
          "ikev2": [{"name": "ikev2", "ports": [500, 4500]}],
          "meta": [{"name": "meta", "ports": [443, 8080]}],
          "ovpntcp": [{"name": "openvpn_tcp", "ports": [80, 443, 853, 8443]}],
          "ovpnudp": [{"name": "openvpn_udp", "ports": [8080, 853, 123, 53]}],
          "proxysocks": [{"name": "socks", "ports": [1080]}],
          "proxyss": [{"name": "shadowsocks", "ports": [443]}],
          "wg": [{"name": "wireguard", "ports": [1337]}]
        },
        "regions": [
          {
            "auto_region": true,
            "country": "EX",
            "dns": "example.privacy.network",
            "geo": false,
            "id": "example",
            "name": "Example",
            "offline": false,
            "port_forward": true,
            "servers": {
              "ikev2": [
                {"cn": "example000", "ip": "127.0.0.1"},
                {"cn": "example123", "ip": "127.0.0.2"},
                {"cn": "example321", "ip": "127.0.0.3"}
              ],
              "meta": [
                {"cn": "example000", "ip": "127.0.0.1"},
                {"cn": "example123", "ip": "127.0.0.2"},
                {"cn": "example321", "ip": "127.0.0.3"}
              ],
              "ovpntcp": [
                {"cn": "example000", "ip": "127.0.0.1", "van": false},
                {"cn": "example123", "ip": "127.0.0.2", "van": false},
                {"cn": "example321", "ip": "127.0.0.3", "van": false}
              ],
              "ovpnudp": [
                {"cn": "example000", "ip": "127.0.0.1", "van": false},
                {"cn": "example123", "ip": "127.0.0.2", "van": false},
                {"cn": "example321", "ip": "127.0.0.3", "van": false}
              ],
              "wg": [
                {"cn": "example000", "ip": "127.0.0.1"},
                {"cn": "example123", "ip": "127.0.0.2"},
                {"cn": "example321", "ip": "127.0.0.3"}
              ]
            }
          }
        ]
      },
      "cachedModernShadowsocksList": [
        {
          "cipher": "aes-128-gcm",
          "host": "127.0.0.1",
          "key": "shadowsocks",
          "port": 443,
          "region": "ex"
        }
      ],
      "flags": [
        "email_login",
        "ratings_1",
        "dedicated_ip",
        "check_renew_dip",
        "trustpilot_feedback",
        "limit_one_dip",
        "service_quality_events"
      ],
      "gaChannelOsRequired": "",
      "gaChannelVersion": "3.1.2+06767",
      "gaChannelVersionUri": "https://privateinternetaccess-storage.s3.amazonaws.com/pub/pia_desktop/builds/pia-linux-3.1.2-06767.run",
      "modernLatencies": {
        "ex": 123
      },
      "modernRegionMeta": {
        "country_groups": {
          "ex": "Example"
        },
        "gps": {
          "ex": ["1.234567", "7.654321"]
        },
        "translations": {
          "Example": {
            "ex": "Example",
            "..": "E.x.a.m.p.l.e."
          }
        }
      },
      "qualityAggId": "",
      "qualityAggIdRotateTime": 0,
      "qualityEventsQueued": [],
      "qualityEventsSent": []
    }
  

/opt/piavpn/etc/settings.json: settings (VPN type, IP exclusions, etc.)

    {
      "allowLAN": true,
      "automaticTransport": true,
      "automationEnabled": false,
      "automationRules": [],
      "betaUpdateChannel": "beta",
      "blockIPv6": true,
      "bypassSubnets": [
          {
              "mode": "exclude",
              "subnet": "127.0.0.1/32"
          }
      ],
      "cipher": "AES-128-GCM",
      "connectOnLaunch": false,
      "defaultRoute": true,
      "desktopNotifications": true,
      "enableMACE": false,
      "favoriteLocations": [],
      "includeGeoOnly": true,
      "killswitch": "auto",
      "largeLogFiles": false,
      "lastDismissedAppMessageId": 0,
      "lastUsedVersion": "3.1.2+06767",
      "localPort": 0,
      "location": "example",
      "macStubDnsMethod": "NX",
      "manualServer": {
          "cn": "",
          "correspondingRegionId": "",
          "ip": "",
          "openvpnNcpSupport": false,
          "openvpnTcpPorts": [],
          "openvpnUdpPorts": [],
          "serviceGroups": []
      },
      "method": "wireguard",
      "mtu": 0,
      "offerBetaUpdates": false,
      "overrideDNS": "pia",
      "persistDaemon": false,
      "portForward": false,
      "primaryModules": [
          "region",
          "ip"
      ],
      "protocol": "udp",
      "proxyCustom": {
          "host": "",
          "password": "",
          "port": 0,
          "username": ""
      },
      "proxyEnabled": false,
      "proxyShadowsocksLocation": "auto",
      "proxyType": "shadowsocks",
      "ratingEnabled": true,
      "recentLocations": [],
      "remotePortTCP": 0,
      "remotePortUDP": 0,
      "routedPacketsOnVPN": true,
      "secondaryModules": [
          "quickconnect",
          "performance",
          "usage",
          "settings",
          "account"
      ],
      "sendServiceQualityEvents": false,
      "sessionCount": 7,
      "showAppMessages": true,
      "splitTunnelDNS": true,
      "splitTunnelEnabled": true,
      "splitTunnelRules": [],
      "themeName": "dark",
      "updateChannel": "release",
      "windowsIpMethod": "dhcp",
      "wireguardPingTimeout": 60,
      "wireguardUseKernel": true
    }