mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-04 23:24:20 +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(
|
||||
state.serverDomain!.domainName,
|
||||
serverDetails.ip4,
|
||||
false,
|
||||
),
|
||||
domain: state.serverDomain!,
|
||||
);
|
||||
|
@ -277,6 +278,7 @@ class ServerInstallationCubit extends Cubit<ServerInstallationState> {
|
|||
records: getProjectDnsRecords(
|
||||
state.serverDomain!.domainName,
|
||||
serverDetails.ip4,
|
||||
true,
|
||||
),
|
||||
domain: state.serverDomain!,
|
||||
);
|
||||
|
|
|
@ -4,14 +4,18 @@ CloudflareDnsRecord _fromDnsRecord(
|
|||
final DnsRecord dnsRecord,
|
||||
final String rootDomain,
|
||||
) {
|
||||
final String type = dnsRecord.type;
|
||||
String name = dnsRecord.name ?? '';
|
||||
if (name != rootDomain && name != '@') {
|
||||
name = '$name.$rootDomain';
|
||||
}
|
||||
if (type == 'MX' && name == '@') {
|
||||
name = rootDomain;
|
||||
}
|
||||
return CloudflareDnsRecord(
|
||||
content: dnsRecord.content,
|
||||
name: name,
|
||||
type: dnsRecord.type,
|
||||
type: type,
|
||||
zoneName: rootDomain,
|
||||
id: null,
|
||||
ttl: dnsRecord.ttl,
|
||||
|
|
|
@ -93,6 +93,7 @@ void launchURL(final url) async {
|
|||
List<DnsRecord> getProjectDnsRecords(
|
||||
final String? domainName,
|
||||
final String? ip4,
|
||||
final bool isCreating,
|
||||
) {
|
||||
final DnsRecord domainA =
|
||||
DnsRecord(type: 'A', name: domainName, content: ip4);
|
||||
|
@ -139,7 +140,7 @@ List<DnsRecord> getProjectDnsRecords(
|
|||
mx,
|
||||
txt1,
|
||||
txt2,
|
||||
txt3,
|
||||
if (!isCreating) txt3,
|
||||
vpn,
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue