Compare commits

...

154 Commits

Author SHA1 Message Date
367d80d846 Scheduled update 2024-07-31 17:57:29 +00:00
a6a1ab96c9 Scheduled update 2024-07-05 01:19:06 +00:00
2442170b40 Scheduled update 2024-07-05 00:19:06 +00:00
38fe5621f2 Scheduled update 2024-07-04 23:19:06 +00:00
c190ede8b6 Scheduled update 2024-07-04 22:19:06 +00:00
bfc3c5b605 Scheduled update 2024-07-04 21:19:06 +00:00
a88c29ce23 Scheduled update 2024-07-04 20:19:06 +00:00
7b6332b514 Scheduled update 2024-07-04 19:19:06 +00:00
fccf64441b Scheduled update 2024-07-04 18:19:06 +00:00
39722fc399 Scheduled update 2024-07-04 17:19:06 +00:00
34f7342957 Scheduled update 2024-07-04 16:19:06 +00:00
7ad6fb1be5 Scheduled update 2024-07-04 15:19:06 +00:00
1bd9d8fa1a Scheduled update 2024-07-04 14:19:06 +00:00
a7d1578ced Scheduled update 2024-07-04 13:19:06 +00:00
c94e72a309 Scheduled update 2024-07-04 12:19:06 +00:00
7b28cb4d6c Scheduled update 2024-07-04 11:19:06 +00:00
957f2f97fa Scheduled update 2024-07-04 10:19:06 +00:00
ccf32fcb48 Scheduled update 2024-07-04 09:19:06 +00:00
ca167ec694 Scheduled update 2024-07-04 08:19:06 +00:00
678829235f Scheduled update 2024-07-04 07:19:06 +00:00
8078e82cb6 Scheduled update 2024-07-04 06:19:06 +00:00
89c848e459 Scheduled update 2024-07-04 05:19:06 +00:00
c6dfd0c8eb Scheduled update 2024-07-04 04:19:06 +00:00
f0a59c3282 Scheduled update 2024-07-04 03:19:06 +00:00
598f44795a Scheduled update 2024-07-04 02:19:06 +00:00
05e2e4adc3 Scheduled update 2024-07-04 01:19:06 +00:00
dab39ddd1c Scheduled update 2024-07-04 00:19:06 +00:00
03b45b5129 Scheduled update 2024-07-03 23:19:06 +00:00
b171ca2018 Scheduled update 2024-07-03 22:19:06 +00:00
d6971db4c6 Scheduled update 2024-07-03 21:19:06 +00:00
f59b36756e Scheduled update 2024-07-03 20:19:06 +00:00
bd91c03dd5 Scheduled update 2024-07-03 19:19:06 +00:00
ac665e509a Scheduled update 2024-07-03 18:19:06 +00:00
17b97dc9d9 Scheduled update 2024-07-03 17:19:06 +00:00
67b412bff9 Scheduled update 2024-07-03 16:19:06 +00:00
8fafe56e2a Scheduled update 2024-07-03 15:19:06 +00:00
3c8d1cc8ad Scheduled update 2024-07-03 14:19:06 +00:00
4b65153d64 Scheduled update 2024-07-03 13:19:06 +00:00
6823e54822 Scheduled update 2024-07-03 12:19:06 +00:00
a50dee555c Scheduled update 2024-07-03 11:19:06 +00:00
80ac94f47c Scheduled update 2024-07-03 10:19:06 +00:00
398845a2c8 Scheduled update 2024-07-03 09:19:06 +00:00
1ab78de857 Scheduled update 2024-07-03 08:19:06 +00:00
32ded00d4b Scheduled update 2024-07-03 07:19:06 +00:00
b305d0ba2d Scheduled update 2024-07-03 06:19:06 +00:00
45ec521f80 Scheduled update 2024-07-03 05:19:06 +00:00
abfcf170f2 Scheduled update 2024-07-03 04:19:06 +00:00
4aee33cc40 Scheduled update 2024-07-03 03:19:06 +00:00
835fdd91a6 Scheduled update 2024-07-03 02:19:06 +00:00
ae896ddd4c Scheduled update 2024-07-03 01:19:06 +00:00
1b8ed8b27b Scheduled update 2024-07-03 00:19:06 +00:00
c2bc1fa098 Scheduled update 2024-07-02 23:19:06 +00:00
bee1c7e8be Scheduled update 2024-07-02 22:19:06 +00:00
c1bb4f83b4 Scheduled update 2024-07-02 21:19:06 +00:00
f943a1dea3 Scheduled update 2024-07-02 20:19:06 +00:00
0d607f9f08 Scheduled update 2024-07-02 19:19:06 +00:00
1b2069eebf Scheduled update 2024-07-02 18:19:06 +00:00
4e7224f5e8 Scheduled update 2024-07-02 17:19:06 +00:00
38b1db9fdc Scheduled update 2024-07-02 16:19:06 +00:00
6d1733ff2b Scheduled update 2024-07-02 15:19:06 +00:00
65d2c91115 Scheduled update 2024-07-02 14:19:06 +00:00
700fc9f9c1 Scheduled update 2024-07-02 13:19:06 +00:00
4c63890d2a Scheduled update 2024-07-02 12:19:06 +00:00
f5f9b2a190 Scheduled update 2024-07-02 11:19:06 +00:00
1dd7da92b6 Scheduled update 2024-07-02 10:19:06 +00:00
6505823b89 Scheduled update 2024-07-02 09:19:06 +00:00
7425156a1d Scheduled update 2024-07-02 08:19:06 +00:00
6794622d00 Scheduled update 2024-07-02 07:19:06 +00:00
d43f4c7af1 Scheduled update 2024-07-02 06:19:06 +00:00
3e5100e0fc Scheduled update 2024-07-02 05:19:06 +00:00
0e0a46d875 Scheduled update 2024-07-02 04:19:06 +00:00
020b31c472 Scheduled update 2024-07-02 03:19:06 +00:00
1f334aeb41 Scheduled update 2024-07-02 02:19:06 +00:00
cd841658ec Scheduled update 2024-07-02 01:19:06 +00:00
ac2bd66439 Scheduled update 2024-06-20 19:49:02 +00:00
79a2fa0b6e Scheduled update 2024-06-20 18:49:02 +00:00
6946b9724f Scheduled update 2024-06-20 17:49:02 +00:00
d1656b7182 Scheduled update 2024-06-20 16:49:02 +00:00
2b164eba6c Scheduled update 2024-06-20 15:49:02 +00:00
a6731e8c8d Scheduled update 2024-06-20 14:49:02 +00:00
20844bc19a Scheduled update 2024-06-20 13:49:02 +00:00
affe67a889 Scheduled update 2024-05-01 15:05:23 +00:00
f3136fb2cb Scheduled update 2024-05-01 14:05:23 +00:00
242e4fff2e Scheduled update 2024-05-01 13:05:23 +00:00
f4862641f5 Scheduled update 2024-05-01 12:05:23 +00:00
039ccb92e5 Scheduled update 2024-05-01 11:05:23 +00:00
0d28111346 Scheduled update 2024-05-01 10:05:23 +00:00
fcb20e8c7e Scheduled update 2024-05-01 09:05:23 +00:00
51d5d43674 Scheduled update 2024-05-01 08:05:23 +00:00
74b5bf977c Scheduled update 2024-05-01 07:05:23 +00:00
a22740793f Scheduled update 2024-05-01 06:05:23 +00:00
275276606f Scheduled update 2024-05-01 05:05:23 +00:00
ccf950c849 Scheduled update 2024-05-01 04:05:23 +00:00
388c805ac7 Scheduled update 2024-05-01 03:05:23 +00:00
71f8e853ea Scheduled update 2024-05-01 02:05:23 +00:00
7a3d871178 Scheduled update 2024-05-01 01:05:23 +00:00
dc2c6e1f7c Scheduled update 2024-05-01 00:05:23 +00:00
4fa16e8bec Scheduled update 2024-04-30 23:05:23 +00:00
1465b1ac6a Scheduled update 2024-04-30 22:05:23 +00:00
cfe69fef74 Scheduled update 2024-04-30 21:05:23 +00:00
561319f448 Scheduled update 2024-04-30 20:05:23 +00:00
20fbbef775 Scheduled update 2024-04-30 19:05:23 +00:00
3c14ad11cb Scheduled update 2024-04-30 18:05:23 +00:00
d62c45962d Scheduled update 2024-04-30 17:05:23 +00:00
4ac1632c48 Scheduled update 2024-04-30 16:05:23 +00:00
6f54afaf80 Scheduled update 2024-04-30 15:05:23 +00:00
191f42ea8e Scheduled update 2024-04-30 14:05:23 +00:00
6068b2ba2c Scheduled update 2024-04-30 13:05:23 +00:00
4945338be6 Scheduled update 2024-04-30 12:05:23 +00:00
103d6bb2fc Scheduled update 2024-04-30 11:05:23 +00:00
f8f5c78f2c Scheduled update 2024-04-30 10:05:23 +00:00
d5aa6d26a0 Scheduled update 2024-04-30 09:05:23 +00:00
5aa6363bb9 Scheduled update 2024-04-30 08:05:23 +00:00
16a8646085 Scheduled update 2024-04-30 07:05:23 +00:00
3901f2f947 Scheduled update 2024-04-30 06:05:23 +00:00
7bf8d6ef3d Scheduled update 2024-04-30 05:05:23 +00:00
c2dbc64dc4 Scheduled update 2024-04-30 04:05:23 +00:00
d9fd2731f1 Scheduled update 2024-04-30 03:05:23 +00:00
464ebf0132 Scheduled update 2024-04-30 02:05:23 +00:00
879e187b0f Scheduled update 2024-04-30 01:05:23 +00:00
546fdbf8c3 Scheduled update 2024-04-30 00:05:23 +00:00
9a79d1324a Scheduled update 2024-04-29 23:05:24 +00:00
c6347beece Scheduled update 2024-04-29 22:05:23 +00:00
Lee
bb2c72c574 Merge pull request 'Configure Renovate' (#1) from renovate/configure into master
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 40s
Reviewed-on: #1
2024-04-29 22:01:56 +00:00
3f2b092e88 Add renovate.json 2024-04-29 22:01:21 +00:00
b4666ddf14 Scheduled update 2024-04-29 21:06:15 +00:00
176ecdb34a Scheduled update 2024-04-29 20:06:15 +00:00
ec7a9c5c6c Scheduled update 2024-04-29 19:06:15 +00:00
4356af0368 Scheduled update 2024-04-29 18:06:15 +00:00
0baffb48f5 Scheduled update 2024-04-29 17:06:15 +00:00
4cc5230850 Scheduled update 2024-04-29 16:06:15 +00:00
ba29d73636 Scheduled update 2024-04-29 15:06:15 +00:00
61d3fc4695 Scheduled update 2024-04-29 14:06:15 +00:00
69df5d4249 Scheduled update 2024-04-29 13:06:15 +00:00
e7733bbe62 Scheduled update 2024-04-29 12:06:15 +00:00
c314166571 Scheduled update 2024-04-29 11:06:15 +00:00
58651f7626 Merge remote-tracking branch 'origin/master'
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 39s
2024-04-29 12:02:39 +01:00
7c6d9ddc59 cleanup 2024-04-29 12:02:33 +01:00
f46d78d3ec Scheduled update 2024-04-29 10:56:24 +00:00
4098f91bc0 Scheduled update 2024-04-29 09:56:24 +00:00
c5e12f5dd4 Scheduled update 2024-04-29 08:56:24 +00:00
4cd6d8b1ac Scheduled update 2024-04-29 07:56:24 +00:00
317a6be545 Merge remote-tracking branch 'origin/master'
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 39s
# Conflicts:
#	README.md
2024-04-29 08:52:50 +01:00
ee094be2eb update user that pushes the commits 2024-04-29 08:52:37 +01:00
6bff73fd72 Scheduled update 2024-04-29 07:44:07 +00:00
9060cf8929 Scheduled update 2024-04-29 06:44:07 +00:00
32e364a38c Merge remote-tracking branch 'origin/master'
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 39s
2024-04-29 07:40:30 +01:00
88b62cc225 update logging 2024-04-29 07:40:25 +01:00
438abb5591 Scheduled update 2024-04-29 06:37:06 +00:00
aeec428d48 Merge remote-tracking branch 'origin/master'
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 39s
2024-04-29 07:33:37 +01:00
a58edf7961 update readme 2024-04-29 07:33:33 +01:00
9f11aa362a Scheduled update 2024-04-29 06:28:21 +00:00
3f050ae976 Merge remote-tracking branch 'origin/master'
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 39s
2024-04-29 07:24:51 +01:00
6b7bca3b90 cleanup 2024-04-29 07:24:47 +01:00
8 changed files with 65079 additions and 163 deletions

181
README.md
View File

@ -1,106 +1,109 @@
# PIA Server List
![Servers](https://img.shields.io/badge/servers-5,252-blue) ![Regions](https://img.shields.io/badge/regions-97-blue) ![Last update](https://img.shields.io/badge/last_updated-Mon_Apr_29_06:19:45_UTC_2024-blue)
![Servers](https://img.shields.io/badge/servers-18,240-blue)
![Regions](https://img.shields.io/badge/regions-97-blue)
![Last update](https://img.shields.io/badge/last_updated-Wed_Jul_31_17:54:31_UTC_2024-blue)
This is a list of the OpenVPN servers provided by Private Internet Access (PIA). The list is updated hourly.
This is a list of the OpenVPN servers provided by Private Internet Access (PIA). The list is updated hourly. </br>
Servers that have not been active in the last 2 weeks will be automatically removed.
## Servers
| Region | Servers |
|----------------------|---------|
| netherlands | 109 |
| ca_vancouver | 98 |
| au_melbourne | 98 |
| ca_montreal | 98 |
| ca_toronto | 97 |
| us_chicago | 97 |
| us_silicon_valley | 97 |
| us_east | 96 |
| us_washington_dc | 96 |
| us_new_york | 95 |
| uk_london | 95 |
| us_california | 94 |
| us_texas | 94 |
| us_seattle | 93 |
| us_atlanta | 90 |
| us_las_vegas | 89 |
| switzerland | 89 |
| us_west | 89 |
| us_florida | 88 |
| de_frankfurt | 88 |
| ca_ontario | 86 |
| us_houston | 86 |
| uk_southampton | 84 |
| japan | 83 |
| de_berlin | 83 |
| au_sydney | 82 |
| mexico | 80 |
| sweden | 79 |
| uk_manchester | 79 |
| singapore | 78 |
| us_denver | 78 |
| new_zealand | 78 |
| au_perth | 73 |
| france | 70 |
| czech_republic | 64 |
| norway | 63 |
| ireland | 62 |
| estonia | 61 |
| bahamas | 59 |
| israel | 59 |
| spain | 57 |
| argentina | 55 |
| brazil | 54 |
| denmark | 52 |
| austria | 51 |
| panama | 50 |
| italy | 49 |
| ukraine | 48 |
| finland | 48 |
| luxembourg | 46 |
| latvia | 46 |
| turkey | 45 |
| romania | 45 |
| lithuania | 44 |
| poland | 42 |
| vietnam | 41 |
| slovakia | 41 |
| greenland | 40 |
| belgium | 40 |
| greece | 37 |
| andorra | 35 |
| venezuela | 35 |
| albania | 34 |
| algeria | 34 |
| taiwan | 34 |
| united_arab_emirates | 33 |
| china | 33 |
| malta | 32 |
| philippines | 31 |
| hungary | 29 |
| qatar | 29 |
| ca_montreal | 816 |
| netherlands | 811 |
| us_texas | 708 |
| us_chicago | 702 |
| ca_toronto | 643 |
| us_silicon_valley | 601 |
| us_washington_dc | 589 |
| us_atlanta | 565 |
| us_west | 559 |
| ca_vancouver | 547 |
| us_las_vegas | 542 |
| us_new_york | 541 |
| us_east | 536 |
| uk_london | 533 |
| us_california | 526 |
| us_florida | 496 |
| us_seattle | 496 |
| ca_ontario | 430 |
| au_melbourne | 426 |
| switzerland | 420 |
| de_frankfurt | 417 |
| us_houston | 384 |
| au_sydney | 355 |
| uk_southampton | 318 |
| japan | 308 |
| de_berlin | 261 |
| us_denver | 231 |
| uk_manchester | 224 |
| singapore | 218 |
| france | 202 |
| sweden | 192 |
| au_perth | 183 |
| new_zealand | 183 |
| mexico | 139 |
| ireland | 132 |
| romania | 120 |
| estonia | 117 |
| norway | 112 |
| belgium | 102 |
| israel | 100 |
| spain | 99 |
| denmark | 96 |
| czech_republic | 94 |
| italy | 87 |
| finland | 84 |
| bahamas | 78 |
| argentina | 75 |
| austria | 71 |
| panama | 71 |
| brazil | 69 |
| poland | 64 |
| luxembourg | 62 |
| latvia | 60 |
| ukraine | 59 |
| india | 59 |
| lithuania | 56 |
| greenland | 56 |
| turkey | 52 |
| slovakia | 52 |
| andorra | 48 |
| vietnam | 46 |
| taiwan | 46 |
| venezuela | 45 |
| greece | 45 |
| portugal | 43 |
| united_arab_emirates | 38 |
| china | 38 |
| malta | 37 |
| albania | 36 |
| philippines | 36 |
| algeria | 36 |
| qatar | 33 |
| bangladesh | 31 |
| hungary | 30 |
| liechtenstein | 29 |
| isle_of_man | 29 |
| saudi_arabia | 28 |
| bulgaria | 28 |
| india | 28 |
| south_africa | 28 |
| bangladesh | 28 |
| liechtenstein | 27 |
| saudi_arabia | 26 |
| isle_of_man | 26 |
| portugal | 25 |
| montenegro | 25 |
| macao | 26 |
| montenegro | 26 |
| nigeria | 25 |
| moldova | 24 |
| cambodia | 24 |
| cyprus | 24 |
| nigeria | 24 |
| macao | 24 |
| morocco | 24 |
| egypt | 24 |
| iceland | 24 |
| moldova | 23 |
| cambodia | 23 |
| morocco | 23 |
| kazakhstan | 23 |
| egypt | 23 |
| macedonia | 23 |
| monaco | 21 |
| monaco | 22 |
| georgia | 22 |
| hong_kong | 20 |
| georgia | 20 |
| serbia | 14 |
| serbia | 15 |
| armenia | 12 |
| mongolia | 12 |
| sri_lanka | 11 |

6
renovate.json Normal file
View File

@ -0,0 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"local>Fascinated/renovate-config"
]
}

64940
servers.json

File diff suppressed because it is too large Load Diff

View File

@ -13,13 +13,13 @@ public class GitUtils {
public static void commitFiles(String message, Path... files) {
System.out.println("Committing files");
if (Config.isProduction()) {
runCommand("git", "config", "--global", "user.email", "liam+pia-servers-ci@fascinated.cc");
runCommand("git", "config", "--global", "user.name", "PIA Servers CI");
runCommand("git", "config", "--global", "user.email", "fascinated-helper@fascinated.cc");
runCommand("git", "config", "--global", "user.name", "Fascinated's Helper");
for (Path file : files) {
runCommand("git", "add", file.toAbsolutePath().toString());
}
runCommand("git", "commit", "-m", message);
runCommand("git", "push", "https://pia-servers-ci:%s@git.fascinated.cc/Fascinated/PIA-Servers".formatted(System.getenv("AUTH_TOKEN")));
runCommand("git", "push", "https://fascinated-helper:%s@git.fascinated.cc/Fascinated/PIA-Servers".formatted(System.getenv("AUTH_TOKEN")));
}
}

View File

@ -1,17 +0,0 @@
package cc.fascinated.piaservers.model;
import lombok.AllArgsConstructor;
import lombok.Getter;
@AllArgsConstructor @Getter
public class PiaServerToken {
/**
* The ip for this server.
*/
private final String ip;
/**
* The region this server is in.
*/
private final String region;
}

View File

@ -3,7 +3,6 @@ package cc.fascinated.piaservers.pia;
import cc.fascinated.piaservers.Main;
import cc.fascinated.piaservers.common.GitUtils;
import cc.fascinated.piaservers.model.PiaServer;
import cc.fascinated.piaservers.model.PiaServerToken;
import cc.fascinated.piaservers.readme.ReadMeManager;
import com.google.gson.reflect.TypeToken;
import lombok.SneakyThrows;
@ -12,6 +11,7 @@ import org.xbill.DNS.Record;
import org.xbill.DNS.*;
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
@ -32,7 +32,7 @@ public class PiaManager {
public PiaManager() {
File serversFile = new File("servers.json");
if (!serversFile.exists()) {
System.out.println("servers.json does not exist, creating...");
System.out.println("The servers file doesn't exist, creating it...");
serversFile.createNewFile();
}
// Load the serversFile from the file
@ -40,18 +40,21 @@ public class PiaManager {
if (SERVERS == null) {
SERVERS = new HashSet<>();
}
System.out.println("Loaded " + SERVERS.size() + " servers from the file");
System.out.printf("Loaded %s servers from the file%n", SERVERS.size());
// Set the DNS resolver to Cloudflare
Lookup.setDefaultResolver(new SimpleResolver("1.1.1.1"));
GitUtils.cloneRepo(); // Clone the repository
// Update the servers every 2 minutes
// Update the servers every 5 minutes
new Timer().scheduleAtFixedRate(new TimerTask() {
@Override
public void run() {
updateServers(serversFile); // Update the servers
README_PATH = ReadMeManager.updateReadme(); // Update the README.md
}
}, 0, TimeUnit.MINUTES.toMillis(2));
}, 0, TimeUnit.MINUTES.toMillis(5));
// Commit the files every hour
new Timer().scheduleAtFixedRate(new TimerTask() {
@ -64,100 +67,76 @@ public class PiaManager {
@SneakyThrows
public static void updateServers(File serversFile) {
List<PiaServerToken> piaDomain = getPiaDomains();
System.out.println("Found " + piaDomain.size() + " pia domains");
List<PiaServer> servers = getPiaServers();
List<PiaServer> toRemove = new ArrayList<>();
System.out.println("Removing old servers...");
// Get the servers that need to be removed
for (PiaServer server : SERVERS) {
if (server.getLastSeen().getTime() < System.currentTimeMillis() - REMOVAL_THRESHOLD) {
toRemove.add(server);
}
}
toRemove.forEach(SERVERS::remove); // Remove the servers
System.out.printf("Removed %s old servers\n", toRemove.size());
int newServers = 0;
// Remove the servers that haven't been active in 2 weeks
int before = SERVERS.size();
SERVERS.removeIf(server -> System.currentTimeMillis() - server.getLastSeen().getTime() > REMOVAL_THRESHOLD);
System.out.printf("Removed %s servers that haven't been active in 2 weeks%n", before - SERVERS.size());
// Add the new servers to the list
for (PiaServerToken serverToken : piaDomain) {
boolean newServer = SERVERS.stream().noneMatch(server -> server.getIp().equals(serverToken.getIp()));
int newServers = 0;
for (PiaServer piaServer : servers) {
boolean newServer = SERVERS.stream().noneMatch(server -> server.getIp().equals(piaServer.getIp()));
if (newServer) {
newServers++;
}
// Add the server to the list
SERVERS.add(new PiaServer(serverToken.getIp(), serverToken.getRegion(), new Date()));
SERVERS.add(piaServer);
}
// Save the servers to the file
Files.writeString(serversFile.toPath(), Main.GSON.toJson(SERVERS));
System.out.printf("Wrote %s new servers to the file\n", newServers);
System.out.printf("Wrote %s servers to the file (+%s new)%n", SERVERS.size(), newServers);
}
@SneakyThrows
private static List<PiaServerToken> getPiaDomains() {
private static List<PiaServer> getPiaServers() {
long start = System.currentTimeMillis();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(PIA_OPENVPN_CONFIGS_URL))
.GET()
.build();
// Send the request and get the response
HttpResponse<Path> response = HTTP_CLIENT.send(request, HttpResponse.BodyHandlers.ofFile(Files.createTempFile("openvpn", ".zip")));
if (response.statusCode() != 200) {
System.out.println("Failed to get the PIA OpenVPN configs, status code: " + response.statusCode());
System.exit(1);
throw new IOException("Failed to get the PIA OpenVPN configs, status code: " + response.statusCode());
}
System.out.printf("Downloaded the OpenVPN configs in %sms%n", System.currentTimeMillis() - start);
Path downloadedFile = response.body();
File tempDir = Files.createTempDirectory("openvpn").toFile();
ZipUnArchiver unArchiver = new ZipUnArchiver();
// Extract the downloaded file
unArchiver.setSourceFile(downloadedFile.toFile());
unArchiver.setDestDirectory(tempDir);
unArchiver.extract();
// Get the extracted files
File[] files = tempDir.listFiles();
if (files == null || files.length == 0) {
System.out.println("Failed to extract the OpenVPN configs");
System.exit(1);
throw new IOException("Failed to extract the OpenVPN configs");
}
// Set the DNS resolver to Cloudflare
Lookup.setDefaultResolver(new SimpleResolver("1.1.1.1"));
// Search for the server domains
List<PiaServerToken> domains = new ArrayList<>();
List<PiaServer> servers = new ArrayList<>();
for (File file : files) {
if (file.isDirectory()) {
if (file.isDirectory() || !file.getName().endsWith(".ovpn")) {
continue;
}
if (!file.getName().endsWith(".ovpn")) {
continue;
}
// Read the file and get the server domain
List<String> lines = Files.readAllLines(file.toPath());
for (String line : lines) {
if (line.startsWith("remote ")) {
String[] parts = line.split(" ");
String hostname = parts[1];
String region = file.getName().split("\\.")[0];
Record[] records = new Lookup(hostname, Type.A).run();
if (records == null) {
continue;
}
for (Record record : records) {
ARecord aRecord = (ARecord) record;
domains.add(new PiaServerToken(aRecord.getAddress().getHostAddress(), region));
if (records != null) {
for (Record record : records) {
ARecord aRecord = (ARecord) record;
servers.add(new PiaServer(aRecord.getAddress().getHostAddress(), region, new Date()));
}
}
break;
}
}
}
return domains;
return servers;
}
}

View File

@ -19,6 +19,7 @@ public class ReadMeManager {
@SneakyThrows
public static Path updateReadme() {
System.out.println("Updating README.md");
InputStream readmeStream = Main.class.getResourceAsStream("/README.md");
if (readmeStream == null) {
System.out.println("Failed to find README.md");
@ -49,6 +50,7 @@ public class ReadMeManager {
.reduce((a, b) -> a + "\n" + b).orElse("")); // Reduce the entries to a single string
Files.write(readmeFile.toPath(), contents.getBytes());
System.out.println("Finished updating README.md");
return readmeFile.toPath();
}
}

View File

@ -1,8 +1,11 @@
# PIA Server List
![Servers](https://img.shields.io/badge/servers-{server_count}-blue) ![Regions](https://img.shields.io/badge/regions-{region_count}-blue) ![Last update](https://img.shields.io/badge/last_updated-{last_update}-blue)
![Servers](https://img.shields.io/badge/servers-{server_count}-blue)
![Regions](https://img.shields.io/badge/regions-{region_count}-blue)
![Last update](https://img.shields.io/badge/last_updated-{last_update}-blue)
This is a list of the OpenVPN servers provided by Private Internet Access (PIA). The list is updated hourly.
This is a list of the OpenVPN servers provided by Private Internet Access (PIA). The list is updated hourly. </br>
Servers that have not been active in the last 2 weeks will be automatically removed.
## Servers
| Region | Servers |