Skip to content

Commit

Permalink
Fix deleting
Browse files Browse the repository at this point in the history
  • Loading branch information
willnode committed Nov 15, 2024
1 parent e479041 commit b17eb19
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/executor/runner.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
detectCanShareSSL,
executeLock,
getRevision,
getVersion,
Expand Down Expand Up @@ -289,6 +290,19 @@ export default async function runConfig(config, domain, writer, sandbox = false)
break;
case 'delete':
await writeLog("$> virtualmin delete-domain");
const sharedSSL = detectCanShareSSL(domain);
if (sharedSSL && !domaindata['SSL shared with']) {
// OMG!
await writeLog("$> Applying SSL links with global domain before deleting");
await writeLog(await virtualminExec.pushVirtualServerConfig(domaindata['ID'], {
'ssl_same': sharedSSL.id,
'ssl_key': path.join(sharedSSL.path, 'ssl.key'),
'ssl_cert': path.join(sharedSSL.path, 'ssl.cert'),
'ssl_chain': path.join(sharedSSL.path, 'ssl.ca'),
'ssl_combined': path.join(sharedSSL.path, 'ssl.combined'),
'ssl_everything': path.join(sharedSSL.path, 'ssl.everything'),
}));
}
await spawnSudoUtil('SHELL_SUDO', [user, 'killall', '-u', user]);
await virtExec("delete-domain", value, {
domain,
Expand Down

0 comments on commit b17eb19

Please sign in to comment.