New PIA servers support (#227)
* Adapt storage: SyncServers write to file option, export FlushToFile * CLI built-in updater for old and new PIA servers * Update hardcoded IP addresses for PIA old and new servers * Add PIA old to allServers struct and update timestamps * Adapt code to work with new and old PIA servers * Remove PIA subdomains (unneeded) from resolver tool
This commit is contained in:
@@ -46,6 +46,8 @@ func _main(background context.Context, args []string) int { //nolint:gocognit,go
|
||||
err = cli.ClientKey(args[2:])
|
||||
case "openvpnconfig":
|
||||
err = cli.OpenvpnConfig()
|
||||
case "update":
|
||||
err = cli.Update(args[2:])
|
||||
default:
|
||||
err = fmt.Errorf("command %q is unknown", args[1])
|
||||
}
|
||||
@@ -92,7 +94,8 @@ func _main(background context.Context, args []string) int { //nolint:gocognit,go
|
||||
|
||||
// TODO run this in a loop or in openvpn to reload from file without restarting
|
||||
storage := storage.New(logger)
|
||||
allServers, err := storage.SyncServers(constants.GetAllServers())
|
||||
const updateServerFile = true
|
||||
allServers, err := storage.SyncServers(constants.GetAllServers(), updateServerFile)
|
||||
if err != nil {
|
||||
logger.Error(err)
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user