diff --git a/package-lock.json b/package-lock.json index 68b70a4..03c2e17 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,15 @@ { "name": "domcloud-bridge", - "version": "0.27.0", + "version": "0.29.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "domcloud-bridge", - "version": "0.27.0", + "version": "0.29.0", "license": "MIT", "dependencies": { - "axios": "^1.4.0", + "axios": "^1.5.1", "cli": "^1.0.1", "dotenv": "^16.3.1", "express": "^4.18.2", @@ -19,9 +19,9 @@ "shelljs": "^0.8.5" }, "devDependencies": { - "@types/cli": "^0.11.21", - "@types/express": "^4.17.17", - "@types/shelljs": "^0.8.12" + "@types/cli": "^0.11.22", + "@types/express": "^4.17.19", + "@types/shelljs": "^0.8.13" }, "engines": { "node": ">=16.0.0" @@ -38,9 +38,9 @@ } }, "node_modules/@types/cli": { - "version": "0.11.21", - "resolved": "https://registry.npmjs.org/@types/cli/-/cli-0.11.21.tgz", - "integrity": "sha512-LRHorBP93ZPVtN8F0WBM7b00MeuU8SIBhbfr+B6Q4HhQ7AXubyRHE2ujnPkIyxXA/4A9pVK4QKz8X+524nCUHA==", + "version": "0.11.22", + "resolved": "https://registry.npmjs.org/@types/cli/-/cli-0.11.22.tgz", + "integrity": "sha512-VQeIual2D6XDH0EPBhc1a8umpvr88BPLr/xqos1A4Ce5KPRqPc03cTn0pzFHIdwou8yFVgph/NvhUK54c4XBiA==", "dev": true, "dependencies": { "@types/node": "*" @@ -56,9 +56,9 @@ } }, "node_modules/@types/express": { - "version": "4.17.17", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.17.tgz", - "integrity": "sha512-Q4FmmuLGBG58btUnfS1c1r/NQdlp3DMfGDGig8WhfpA2YRUtEkxAjkZb0yvplJGYdF1fsQ81iMDcH24sSCNC/Q==", + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.19.tgz", + "integrity": "sha512-UtOfBtzN9OvpZPPbnnYunfjM7XCI4jyk1NvnFhTVz5krYAnW4o5DCoIekvms+8ApqhB4+9wSge1kBijdfTSmfg==", "dev": true, "dependencies": { "@types/body-parser": "*", @@ -140,9 +140,9 @@ } }, "node_modules/@types/shelljs": { - "version": "0.8.12", - "resolved": "https://registry.npmjs.org/@types/shelljs/-/shelljs-0.8.12.tgz", - "integrity": "sha512-ZA8U81/gldY+rR5zl/7HSHrG2KDfEb3lzG6uCUDhW1DTQE9yC/VBQ45fXnXq8f3CgInfhZmjtdu/WOUlrXRQUg==", + "version": "0.8.13", + "resolved": "https://registry.npmjs.org/@types/shelljs/-/shelljs-0.8.13.tgz", + "integrity": "sha512-++uMLOQSLlse1kCfEOwhgmHuaABZwinkylmUKCpvcEGZUov3TtM+gJZloSkW/W+9pEAEg/VBOwiSR05oqJsa5A==", "dev": true, "dependencies": { "@types/glob": "~7.2.0", @@ -172,9 +172,9 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "node_modules/axios": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.4.0.tgz", - "integrity": "sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.5.1.tgz", + "integrity": "sha512-Q28iYCWzNHjAm+yEAot5QaAMxhMghWLFVf7rRdwhUI+c2jix2DUXjAHXVi+s1ibs3mjPO/cCgbA++3BjD0vP/A==", "dependencies": { "follow-redirects": "^1.15.0", "form-data": "^4.0.0", @@ -1040,9 +1040,9 @@ } }, "@types/cli": { - "version": "0.11.21", - "resolved": "https://registry.npmjs.org/@types/cli/-/cli-0.11.21.tgz", - "integrity": "sha512-LRHorBP93ZPVtN8F0WBM7b00MeuU8SIBhbfr+B6Q4HhQ7AXubyRHE2ujnPkIyxXA/4A9pVK4QKz8X+524nCUHA==", + "version": "0.11.22", + "resolved": "https://registry.npmjs.org/@types/cli/-/cli-0.11.22.tgz", + "integrity": "sha512-VQeIual2D6XDH0EPBhc1a8umpvr88BPLr/xqos1A4Ce5KPRqPc03cTn0pzFHIdwou8yFVgph/NvhUK54c4XBiA==", "dev": true, "requires": { "@types/node": "*" @@ -1058,9 +1058,9 @@ } }, "@types/express": { - "version": "4.17.17", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.17.tgz", - "integrity": "sha512-Q4FmmuLGBG58btUnfS1c1r/NQdlp3DMfGDGig8WhfpA2YRUtEkxAjkZb0yvplJGYdF1fsQ81iMDcH24sSCNC/Q==", + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.19.tgz", + "integrity": "sha512-UtOfBtzN9OvpZPPbnnYunfjM7XCI4jyk1NvnFhTVz5krYAnW4o5DCoIekvms+8ApqhB4+9wSge1kBijdfTSmfg==", "dev": true, "requires": { "@types/body-parser": "*", @@ -1142,9 +1142,9 @@ } }, "@types/shelljs": { - "version": "0.8.12", - "resolved": "https://registry.npmjs.org/@types/shelljs/-/shelljs-0.8.12.tgz", - "integrity": "sha512-ZA8U81/gldY+rR5zl/7HSHrG2KDfEb3lzG6uCUDhW1DTQE9yC/VBQ45fXnXq8f3CgInfhZmjtdu/WOUlrXRQUg==", + "version": "0.8.13", + "resolved": "https://registry.npmjs.org/@types/shelljs/-/shelljs-0.8.13.tgz", + "integrity": "sha512-++uMLOQSLlse1kCfEOwhgmHuaABZwinkylmUKCpvcEGZUov3TtM+gJZloSkW/W+9pEAEg/VBOwiSR05oqJsa5A==", "dev": true, "requires": { "@types/glob": "~7.2.0", @@ -1171,9 +1171,9 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "axios": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.4.0.tgz", - "integrity": "sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.5.1.tgz", + "integrity": "sha512-Q28iYCWzNHjAm+yEAot5QaAMxhMghWLFVf7rRdwhUI+c2jix2DUXjAHXVi+s1ibs3mjPO/cCgbA++3BjD0vP/A==", "requires": { "follow-redirects": "^1.15.0", "form-data": "^4.0.0", diff --git a/package.json b/package.json index 261c54b..88edcac 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "domcloud-bridge", - "version": "0.28.0", + "version": "0.29.0", "description": "Deployment runner for DOM Cloud", "main": "app.js", "engines": { @@ -17,7 +17,7 @@ "license": "MIT", "type": "module", "dependencies": { - "axios": "^1.4.0", + "axios": "^1.5.1", "cli": "^1.0.1", "dotenv": "^16.3.1", "express": "^4.18.2", @@ -27,8 +27,8 @@ "shelljs": "^0.8.5" }, "devDependencies": { - "@types/cli": "^0.11.21", - "@types/express": "^4.17.17", - "@types/shelljs": "^0.8.12" + "@types/cli": "^0.11.22", + "@types/express": "^4.17.19", + "@types/shelljs": "^0.8.13" } } diff --git a/src/executor/runner.js b/src/executor/runner.js index c0e6873..82546c6 100644 --- a/src/executor/runner.js +++ b/src/executor/runner.js @@ -228,6 +228,21 @@ export default async function runConfig(config, domain, writer, sandbox = false) domain, }); break; + case 'backup': + await writeLog("$> virtualmin backup-domain"); + await virtExec("backup-domain", value, { + domain, + 'all-features': !value.features, + 'as-owner': true, + }); + break; + case 'restore': + await writeLog("$> virtualmin restore-domain"); + await virtExec("restore-domain", value, { + domain, + 'reuid': true, + }); + break; case 'delete': await writeLog("$> virtualmin delete-domain"); await virtExec("delete-domain", value, {