mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-06 16:14:15 +00:00
fix(cloudflare): Convert MX name from @ to root domain
- https://git.selfprivacy.org/SelfPrivacy/selfprivacy.org.app/issues/265
This commit is contained in:
parent
39f92f769b
commit
2836ce4870
|
@ -270,6 +270,7 @@ class ServerInstallationCubit extends Cubit<ServerInstallationState> {
|
||||||
records: getProjectDnsRecords(
|
records: getProjectDnsRecords(
|
||||||
state.serverDomain!.domainName,
|
state.serverDomain!.domainName,
|
||||||
serverDetails.ip4,
|
serverDetails.ip4,
|
||||||
|
false,
|
||||||
),
|
),
|
||||||
domain: state.serverDomain!,
|
domain: state.serverDomain!,
|
||||||
);
|
);
|
||||||
|
@ -277,6 +278,7 @@ class ServerInstallationCubit extends Cubit<ServerInstallationState> {
|
||||||
records: getProjectDnsRecords(
|
records: getProjectDnsRecords(
|
||||||
state.serverDomain!.domainName,
|
state.serverDomain!.domainName,
|
||||||
serverDetails.ip4,
|
serverDetails.ip4,
|
||||||
|
true,
|
||||||
),
|
),
|
||||||
domain: state.serverDomain!,
|
domain: state.serverDomain!,
|
||||||
);
|
);
|
||||||
|
|
|
@ -4,14 +4,18 @@ CloudflareDnsRecord _fromDnsRecord(
|
||||||
final DnsRecord dnsRecord,
|
final DnsRecord dnsRecord,
|
||||||
final String rootDomain,
|
final String rootDomain,
|
||||||
) {
|
) {
|
||||||
|
final String type = dnsRecord.type;
|
||||||
String name = dnsRecord.name ?? '';
|
String name = dnsRecord.name ?? '';
|
||||||
if (name != rootDomain && name != '@') {
|
if (name != rootDomain && name != '@') {
|
||||||
name = '$name.$rootDomain';
|
name = '$name.$rootDomain';
|
||||||
}
|
}
|
||||||
|
if (type == 'MX' && name == '@') {
|
||||||
|
name = rootDomain;
|
||||||
|
}
|
||||||
return CloudflareDnsRecord(
|
return CloudflareDnsRecord(
|
||||||
content: dnsRecord.content,
|
content: dnsRecord.content,
|
||||||
name: name,
|
name: name,
|
||||||
type: dnsRecord.type,
|
type: type,
|
||||||
zoneName: rootDomain,
|
zoneName: rootDomain,
|
||||||
id: null,
|
id: null,
|
||||||
ttl: dnsRecord.ttl,
|
ttl: dnsRecord.ttl,
|
||||||
|
|
|
@ -93,6 +93,7 @@ void launchURL(final url) async {
|
||||||
List<DnsRecord> getProjectDnsRecords(
|
List<DnsRecord> getProjectDnsRecords(
|
||||||
final String? domainName,
|
final String? domainName,
|
||||||
final String? ip4,
|
final String? ip4,
|
||||||
|
final bool isCreating,
|
||||||
) {
|
) {
|
||||||
final DnsRecord domainA =
|
final DnsRecord domainA =
|
||||||
DnsRecord(type: 'A', name: domainName, content: ip4);
|
DnsRecord(type: 'A', name: domainName, content: ip4);
|
||||||
|
@ -139,7 +140,7 @@ List<DnsRecord> getProjectDnsRecords(
|
||||||
mx,
|
mx,
|
||||||
txt1,
|
txt1,
|
||||||
txt2,
|
txt2,
|
||||||
txt3,
|
if (!isCreating) txt3,
|
||||||
vpn,
|
vpn,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue