hotfix(publicip): return an error if trying to use cloudflare as ip provider for updating servers data

This commit is contained in:
Quentin McGaw
2024-10-11 21:55:03 +00:00
parent a7d70dd9a3
commit 2388e0550b
10 changed files with 50 additions and 2 deletions

View File

@@ -14,6 +14,10 @@ import (
func (u *Updater) FetchServers(ctx context.Context, minServers int) (
servers []models.Server, err error,
) {
if !u.ipFetcher.CanFetchAnyIP() {
return nil, fmt.Errorf("%w: %s", common.ErrIPFetcherUnsupported, u.ipFetcher.String())
}
const url = "https://privadovpn.com/apps/ovpn_configs.zip"
contents, err := u.unzipper.FetchAndExtract(ctx, url)
if err != nil {