mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2024-11-20 03:19:15 +00:00
add reverse-dns
This commit is contained in:
parent
8ccb4f18f6
commit
d4f315214b
|
@ -192,4 +192,20 @@ class HetznerApi extends ApiMap {
|
|||
|
||||
return HetznerServerInfo.fromJson(response.data!['server']);
|
||||
}
|
||||
|
||||
Future<void> createReverseDns({
|
||||
required String ip4,
|
||||
required String cloudFlareDomain,
|
||||
}) async {
|
||||
var hetznerServer = getIt<ApiConfigModel>().hetznerServer;
|
||||
var client = await getClient();
|
||||
await client.post(
|
||||
'/servers/${hetznerServer!.id}/actions/change_dns_ptr',
|
||||
data: {
|
||||
"ip": ip4,
|
||||
"dns_ptr": cloudFlareDomain,
|
||||
},
|
||||
);
|
||||
close(client);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -149,7 +149,7 @@ class AppConfigRepository {
|
|||
}
|
||||
|
||||
Future<void> createDnsRecords(
|
||||
String? ip4,
|
||||
String ip4,
|
||||
CloudFlareDomain cloudFlareDomain,
|
||||
) async {
|
||||
var cloudflareApi = CloudflareApi();
|
||||
|
@ -163,6 +163,11 @@ class AppConfigRepository {
|
|||
ip4: ip4,
|
||||
cloudFlareDomain: cloudFlareDomain,
|
||||
);
|
||||
|
||||
await HetznerApi().createReverseDns(
|
||||
ip4: ip4,
|
||||
cloudFlareDomain: cloudFlareDomain.domainName,
|
||||
);
|
||||
}
|
||||
|
||||
Future<bool> isHttpServerWorking() async {
|
||||
|
|
Loading…
Reference in a new issue