Cleanup and fixes

This commit is contained in:
Braydon 2024-04-29 02:32:47 -04:00
parent f6ce652f2e
commit 2e92154965
4 changed files with 939 additions and 682 deletions

View File

@ -37,7 +37,6 @@ jobs:
run: |
git config --global user.email "rainnny-ci@rainnny.club"
git config --global user.name "Rainnny-CI"
git pull
git add servers.json
git add README.md
git commit -m "Scheduled update"

View File

@ -1,6 +1,6 @@
![Servers](https://img.shields.io/badge/Servers-9,721-darkgreen)
![Servers](https://img.shields.io/badge/Servers-9,773-darkgreen)
![Total Regions](https://img.shields.io/badge/Total_Regions-97-darkgreen)
![Last Updated](https://img.shields.io/badge/Last_Updated-April_29_2024_02:20_EDT-darkgreen)
![Last Updated](https://img.shields.io/badge/Last_Updated-April_29_2024_02:32_EDT-darkgreen)
# PIA-ServerList
An automatically updated list of IPs for PIA servers, this list is updated every hour, and servers in this list will be removed in they have not been seen in the last week.
@ -10,43 +10,43 @@ Wanna see the IP list? [Click Here](./servers.json)
## Servers
| Region | Servers |
|----------------------|---------|
| Netherlands | 255 |
| CA Montreal | 252 |
| CA Vancouver | 251 |
| CA Toronto | 247 |
| US Texas | 247 |
| US Chicago | 240 |
| US West | 235 |
| UK London | 234 |
| US Las Vegas | 231 |
| US Silicon Valley | 231 |
| US California | 227 |
| US New York | 227 |
| US Washington DC | 225 |
| CA Ontario | 225 |
| Netherlands | 256 |
| CA Montreal | 255 |
| CA Vancouver | 254 |
| CA Toronto | 249 |
| US Texas | 249 |
| US Chicago | 242 |
| US West | 238 |
| UK London | 237 |
| US Silicon Valley | 234 |
| US Las Vegas | 232 |
| US California | 229 |
| US New York | 229 |
| CA Ontario | 228 |
| US Washington DC | 227 |
| US Atlanta | 226 |
| US Seattle | 223 |
| US East | 223 |
| US Atlanta | 223 |
| US Seattle | 220 |
| AU Melbourne | 219 |
| US Florida | 213 |
| DE Frankfurt | 199 |
| AU Sydney | 189 |
| Switzerland | 188 |
| AU Melbourne | 220 |
| US Florida | 215 |
| DE Frankfurt | 200 |
| AU Sydney | 190 |
| Switzerland | 189 |
| DE Berlin | 180 |
| UK Southampton | 176 |
| US Houston | 169 |
| UK Manchester | 168 |
| Singapore | 164 |
| US Houston | 171 |
| UK Manchester | 169 |
| Singapore | 165 |
| US Denver | 163 |
| AU Perth | 151 |
| AU Perth | 152 |
| New Zealand | 150 |
| Japan | 149 |
| Sweden | 141 |
| France | 134 |
| Mexico | 123 |
| Ireland | 114 |
| Norway | 100 |
| Israel | 94 |
| Norway | 101 |
| Israel | 95 |
| Denmark | 93 |
| Spain | 92 |
| Czech Republic | 89 |
@ -61,7 +61,7 @@ Wanna see the IP list? [Click Here](./servers.json)
| Luxembourg | 62 |
| Latvia | 60 |
| Ukraine | 59 |
| Romania | 58 |
| Romania | 59 |
| Lithuania | 56 |
| Greenland | 56 |
| Poland | 53 |

File diff suppressed because it is too large Load Diff

View File

@ -29,14 +29,14 @@ public final class PIAServerList {
@SneakyThrows
public static void main(@NonNull String[] args) {
List<PIAServer> fromFile = loadServersFromFile(); // Load the servers from the file
System.out.println("Loaded " + fromFile.size() + " server(s) from the servers file");
Set<PIAServer> servers = getNewServers(); // Get the new servers from PIA
int before = servers.size();
servers.addAll(loadServersFromFile()); // Load servers from the file
int loaded = servers.size() - before;
System.out.println("Loaded " + loaded + " server(s) from the servers file");
servers.addAll(fromFile); // Add servers from the file
// Delete servers that haven't been seen in more than two weeks
before = servers.size();
int before = servers.size();
servers.removeIf(server -> (System.currentTimeMillis() - server.getLastSeen()) >= TimeUnit.DAYS.toMillis(14L));
System.out.println("Removed " + (before - servers.size()) + " server(s) that haven't been seen in more than two weeks");
@ -45,7 +45,7 @@ public final class PIAServerList {
try (FileWriter fileWriter = new FileWriter(SERVERS_FILE)) {
GSON.toJson(servers, fileWriter);
}
System.out.println("Done, wrote " + servers.size() + " servers to the file (+" + (servers.size() - loaded) + " New)");
System.out.println("Done, wrote " + servers.size() + " servers to the file (+" + (servers.size() - fromFile.size()) + " New)");
// Update the README.md file
ReadMeManager.update(servers);
@ -70,7 +70,6 @@ public final class PIAServerList {
if (records == null) { // No A records resolved
continue;
}
System.out.println("Resolved " + records.length + " A Records for region " + region);
for (Record record : records) {
servers.add(new PIAServer(((ARecord) record).getAddress().getHostAddress(), region, System.currentTimeMillis()));
}
@ -117,7 +116,6 @@ public final class PIAServerList {
File serversDir = new File("servers"); // The dir where the downloaded OpenVPN files are stored
File[] openVpnFiles = serversDir.listFiles();
assert openVpnFiles != null;
System.out.println("Found " + openVpnFiles.length + " OpenVPN files, reading them...");
for (File file : openVpnFiles) {
String[] split = file.getName().split("\\.");
@ -140,7 +138,7 @@ public final class PIAServerList {
}
}
serversDir.delete(); // Delete the servers dir after reading the OpenVPN files
System.out.println("Found " + regionAddresses.size() + " regions");
return regionAddresses;
}