cloudron 5.16.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -0
- package/bin/cloudron +3 -16
- package/package.json +8 -8
- package/src/actions.js +11 -2
package/CHANGELOG.md
CHANGED
package/bin/cloudron
CHANGED
|
@@ -39,6 +39,7 @@ const backupCommand = program.command('backup')
|
|
|
39
39
|
|
|
40
40
|
backupCommand.command('create')
|
|
41
41
|
.description('Create new app backup')
|
|
42
|
+
.option('--site <siteid>', 'App id')
|
|
42
43
|
.option('--app <id>', 'App id')
|
|
43
44
|
.action(actions.backupCreate);
|
|
44
45
|
|
|
@@ -290,19 +291,5 @@ program.command('update')
|
|
|
290
291
|
.option('--no-force', 'Match appstore id and manifest id before updating', true)
|
|
291
292
|
.action(actions.update);
|
|
292
293
|
|
|
293
|
-
(
|
|
294
|
-
|
|
295
|
-
if (process.argv[2] !== 'completion') {
|
|
296
|
-
if (Date.now() - (config.get('lastCliUpdateCheck') || 0) > 24*60*60*1000) {
|
|
297
|
-
// check if cli tool is up-to-date
|
|
298
|
-
const [error, response] = await safe(superagent.get('https://registry.npmjs.org/cloudron').retry(0).ok(() => true));
|
|
299
|
-
if (!error && response.status === 200 && response.body['dist-tags'].latest !== version) {
|
|
300
|
-
const updateCommand = 'npm install -g cloudron@' + response.body['dist-tags'].latest;
|
|
301
|
-
process.stderr.write(util.format('A new version of Cloudron CLI is available. Please update with: %s\n', updateCommand));
|
|
302
|
-
}
|
|
303
|
-
config.set('lastCliUpdateCheck', Date.now());
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
program.parse(process.argv);
|
|
308
|
-
})();
|
|
294
|
+
program.parse(process.argv);
|
|
295
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cloudron",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Cloudron Commandline Tool",
|
|
6
6
|
"main": "main.js",
|
|
@@ -19,23 +19,23 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@cloudron/manifest-format": "^5.28.0",
|
|
21
21
|
"@cloudron/superagent": "^1.0.0",
|
|
22
|
-
"commander": "^
|
|
23
|
-
"debug": "^4.4.
|
|
22
|
+
"commander": "^14.0.1",
|
|
23
|
+
"debug": "^4.4.3",
|
|
24
24
|
"easy-table": "^1.2.0",
|
|
25
25
|
"ejs": "^3.1.10",
|
|
26
|
-
"eventsource": "^
|
|
26
|
+
"eventsource": "^4.0.0",
|
|
27
27
|
"micromatch": "^4.0.8",
|
|
28
28
|
"open": "^10.2.0",
|
|
29
29
|
"safetydance": "^2.5.1",
|
|
30
|
-
"tar-fs": "^3.1.
|
|
30
|
+
"tar-fs": "^3.1.1"
|
|
31
31
|
},
|
|
32
32
|
"engines": {
|
|
33
33
|
"node": ">= 18.x.x"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@eslint/js": "^9.
|
|
37
|
-
"eslint": "^9.
|
|
36
|
+
"@eslint/js": "^9.37.0",
|
|
37
|
+
"eslint": "^9.37.0",
|
|
38
38
|
"expect.js": "^0.3.1",
|
|
39
|
-
"mocha": "^11.7.
|
|
39
|
+
"mocha": "^11.7.4"
|
|
40
40
|
}
|
|
41
41
|
}
|
package/src/actions.js
CHANGED
|
@@ -384,7 +384,7 @@ async function login(adminFqdn, localOptions, cmd) {
|
|
|
384
384
|
console.log('Existing token still valid.');
|
|
385
385
|
} else {
|
|
386
386
|
token = null;
|
|
387
|
-
console.log(
|
|
387
|
+
console.log(requestError(response));
|
|
388
388
|
}
|
|
389
389
|
}
|
|
390
390
|
|
|
@@ -1107,8 +1107,17 @@ async function backupCreate(localOptions, cmd) {
|
|
|
1107
1107
|
const app = await getApp(options);
|
|
1108
1108
|
if (!app) return exit(NO_APP_FOUND_ERROR_STRING);
|
|
1109
1109
|
|
|
1110
|
+
let backupSiteId = options.site || null;
|
|
1111
|
+
if (!backupSiteId) {
|
|
1112
|
+
const response = await createRequest('GET', `/api/v1/backup_sites`, options);
|
|
1113
|
+
if (response.status !== 200) throw new Error(`Failed to list backup sites: ${requestError(response)}`);
|
|
1114
|
+
if (response.body.backupSites.length === 0) throw new Error(`No backup sites`);
|
|
1115
|
+
backupSiteId = response.body.backupSites[0].id;
|
|
1116
|
+
if (response.body.backupSites.length > 1) console.warn(`More than one backup site. Picking ${response.body.backupSites[0].name}`);
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1110
1119
|
const request = createRequest('POST', `/api/v1/apps/${app.id}/backup`, options);
|
|
1111
|
-
const response = await request.send({});
|
|
1120
|
+
const response = await request.send({ backupSiteId });
|
|
1112
1121
|
if (response.status !== 202) return exit(`Failed to start backup: ${requestError(response)}`);
|
|
1113
1122
|
|
|
1114
1123
|
// FIXME: this should be waitForHealthCheck but the box code incorrectly modifies the installationState
|