mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-09 01:21:14 +00:00
fix: Remove unneded DNS check depending on CLOUDFLARE
This commit is contained in:
parent
a690fb5089
commit
29cbf702e5
|
@ -23,7 +23,6 @@ import 'package:selfprivacy/logic/models/hive/server_domain.dart';
|
||||||
import 'package:selfprivacy/logic/models/hive/user.dart';
|
import 'package:selfprivacy/logic/models/hive/user.dart';
|
||||||
import 'package:selfprivacy/logic/models/json/device_token.dart';
|
import 'package:selfprivacy/logic/models/json/device_token.dart';
|
||||||
import 'package:selfprivacy/logic/models/json/dns_records.dart';
|
import 'package:selfprivacy/logic/models/json/dns_records.dart';
|
||||||
import 'package:selfprivacy/logic/models/message.dart';
|
|
||||||
import 'package:selfprivacy/logic/models/server_basic_info.dart';
|
import 'package:selfprivacy/logic/models/server_basic_info.dart';
|
||||||
import 'package:selfprivacy/logic/models/server_type.dart';
|
import 'package:selfprivacy/logic/models/server_type.dart';
|
||||||
import 'package:selfprivacy/ui/helpers/modals.dart';
|
import 'package:selfprivacy/ui/helpers/modals.dart';
|
||||||
|
@ -208,46 +207,20 @@ class ServerInstallationRepository {
|
||||||
final String? ip4,
|
final String? ip4,
|
||||||
final Map<String, bool> skippedMatches,
|
final Map<String, bool> skippedMatches,
|
||||||
) async {
|
) async {
|
||||||
final List<String> addresses = <String>[
|
|
||||||
'$domainName',
|
|
||||||
'api.$domainName',
|
|
||||||
'cloud.$domainName',
|
|
||||||
'meet.$domainName',
|
|
||||||
'password.$domainName'
|
|
||||||
];
|
|
||||||
|
|
||||||
final Map<String, bool> matches = <String, bool>{};
|
final Map<String, bool> matches = <String, bool>{};
|
||||||
|
await InternetAddress.lookup(domainName!).then(
|
||||||
for (final String address in addresses) {
|
(final records) {
|
||||||
if (skippedMatches[address] ?? false) {
|
for (final record in records) {
|
||||||
matches[address] = true;
|
if (skippedMatches[record.host] ?? false) {
|
||||||
continue;
|
matches[record.host] = true;
|
||||||
}
|
continue;
|
||||||
final List<RRecord>? lookupRecordRes = await DnsUtils.lookupRecord(
|
}
|
||||||
address,
|
if (record.address == ip4!) {
|
||||||
RRecordType.A,
|
matches[record.host] = true;
|
||||||
provider: DnsApiProvider.CLOUDFLARE,
|
}
|
||||||
);
|
}
|
||||||
getIt.get<ConsoleModel>().addMessage(
|
},
|
||||||
Message(
|
);
|
||||||
text:
|
|
||||||
'DnsLookup: address: $address, $RRecordType, provider: CLOUDFLARE, ip4: $ip4',
|
|
||||||
),
|
|
||||||
);
|
|
||||||
getIt.get<ConsoleModel>().addMessage(
|
|
||||||
Message(
|
|
||||||
text:
|
|
||||||
'DnsLookup: ${lookupRecordRes == null ? 'empty' : (lookupRecordRes[0].data != ip4 ? 'wrong ip4' : 'right ip4')}',
|
|
||||||
),
|
|
||||||
);
|
|
||||||
if (lookupRecordRes == null ||
|
|
||||||
lookupRecordRes.isEmpty ||
|
|
||||||
lookupRecordRes[0].data != ip4) {
|
|
||||||
matches[address] = false;
|
|
||||||
} else {
|
|
||||||
matches[address] = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return matches;
|
return matches;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue