Make the dkim selector dynamic

it has to change with the adminLocation so that multiple cloudrons
can send out emails at the same time.
This commit is contained in:
Girish Ramakrishnan
2017-10-31 10:19:52 -07:00
parent 36534f6bb2
commit 8ede37a43d
6 changed files with 12 additions and 7 deletions

View File

@@ -17,6 +17,7 @@ exports = module.exports = {
apiServerOrigin: apiServerOrigin,
webServerOrigin: webServerOrigin,
fqdn: fqdn,
zoneName: zoneName,
setFqdn: setFqdn,
token: token,
version: version,
@@ -33,9 +34,9 @@ exports = module.exports = {
mailLocation: mailLocation,
mailFqdn: mailFqdn,
appFqdn: appFqdn,
zoneName: zoneName,
setZoneName: setZoneName,
hasIPv6: hasIPv6,
dkimSelector: dkimSelector,
isDemo: isDemo,
@@ -248,3 +249,9 @@ function hasIPv6() {
const IPV6_PROC_FILE = '/proc/net/if_inet6';
return fs.existsSync(IPV6_PROC_FILE);
}
function dkimSelector() {
var loc = adminLocation();
return loc === 'my' ? 'cloudron' : `cloudron-${loc.replace(/\./g, '')}`;
}