services: add recoveryMode
This commit is contained in:
@@ -695,8 +695,10 @@ async function configureMail(mailFqdn, mailDomain, serviceConfig) {
|
||||
const allowInbound = await createMailConfig(mailFqdn, mailDomain);
|
||||
|
||||
const ports = allowInbound ? '-p 587:2587 -p 993:9993 -p 4190:4190 -p 25:2587 -p 465:2465' : '';
|
||||
const readOnly = !serviceConfig.recoveryMode ? '--read-only' : '';
|
||||
const cmd = serviceConfig.recoveryMode ? '/bin/bash -c \'echo "Debug mode. Sleeping" && sleep infinity\'' : '';
|
||||
|
||||
const cmd = `docker run --restart=always -d --name="mail" \
|
||||
const runCmd = `docker run --restart=always -d --name="mail" \
|
||||
--net cloudron \
|
||||
--net-alias mail \
|
||||
--log-driver syslog \
|
||||
@@ -713,9 +715,9 @@ async function configureMail(mailFqdn, mailDomain, serviceConfig) {
|
||||
-v "${paths.PLATFORM_DATA_DIR}/addons/mail:/etc/mail" \
|
||||
${ports} \
|
||||
--label isCloudronManaged=true \
|
||||
--read-only -v /run -v /tmp ${tag}`;
|
||||
${readOnly} -v /run -v /tmp ${tag} ${cmd}`;
|
||||
|
||||
await shell.promises.exec('startMail', cmd);
|
||||
await shell.promises.exec('startMail', runCmd);
|
||||
}
|
||||
|
||||
async function getMailAuth() {
|
||||
|
||||
Reference in New Issue
Block a user