cloudron 4.14.4 → 4.15.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/bin/cloudron +1 -2
- package/bin/cloudron-appstore +1 -3
- package/bin/cloudron-backup +1 -3
- package/bin/cloudron-env +1 -3
- package/package.json +1 -2
- package/src/actions.js +19 -5
package/bin/cloudron
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
|
-
require('supererror');
|
|
6
|
-
|
|
7
5
|
const actions = require('../src/actions.js'),
|
|
8
6
|
buildActions = require('../src/build-actions.js'),
|
|
9
7
|
completion = require('../src/completion.js'),
|
|
@@ -142,6 +140,7 @@ program.command('install')
|
|
|
142
140
|
program.command('list')
|
|
143
141
|
.description('List installed applications')
|
|
144
142
|
.option('-q, --quiet', 'Only display app IDs')
|
|
143
|
+
.option('-t, --tag <tag>', 'Only display apps with this tag')
|
|
145
144
|
.action(actions.list);
|
|
146
145
|
|
|
147
146
|
program.command('login [cloudron]')
|
package/bin/cloudron-appstore
CHANGED
package/bin/cloudron-backup
CHANGED
package/bin/cloudron-env
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cloudron",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.15.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Cloudron Commandline Tool",
|
|
6
6
|
"main": "main.js",
|
|
@@ -34,7 +34,6 @@
|
|
|
34
34
|
"safetydance": "^2.2.0",
|
|
35
35
|
"split": "^1.0.1",
|
|
36
36
|
"superagent": "^7.0.2",
|
|
37
|
-
"supererror": "^0.7.2",
|
|
38
37
|
"tar-fs": "https://registry.npmjs.org/tar-fs/-/tar-fs-1.12.0.tgz",
|
|
39
38
|
"underscore": "^1.13.2"
|
|
40
39
|
},
|
package/src/actions.js
CHANGED
|
@@ -325,6 +325,16 @@ async function startApp(app, options) {
|
|
|
325
325
|
await waitForTask(response.body.taskId, options);
|
|
326
326
|
}
|
|
327
327
|
|
|
328
|
+
async function restartApp(app, options) {
|
|
329
|
+
assert.strictEqual(typeof app, 'object');
|
|
330
|
+
assert.strictEqual(typeof options, 'object');
|
|
331
|
+
|
|
332
|
+
const response = await createRequest('POST', `/api/v1/apps/${app.id}/restart`, options);
|
|
333
|
+
if (response.statusCode !== 202) throw `Failed to restart app: ${requestError(response)}`;
|
|
334
|
+
|
|
335
|
+
await waitForTask(response.body.taskId, options);
|
|
336
|
+
}
|
|
337
|
+
|
|
328
338
|
async function authenticate(adminFqdn, username, password, options) {
|
|
329
339
|
assert.strictEqual(typeof adminFqdn, 'string');
|
|
330
340
|
assert.strictEqual(typeof username, 'string');
|
|
@@ -427,16 +437,21 @@ async function list(options) {
|
|
|
427
437
|
if (error) return exit(error);
|
|
428
438
|
if (response.statusCode !== 200) return exit(`Failed to list apps: ${requestError(response)}`);
|
|
429
439
|
|
|
430
|
-
|
|
440
|
+
let apps = response.body.apps;
|
|
441
|
+
|
|
442
|
+
if (options.tag) apps = apps.filter(function (a) { return a.tags.indexOf(options.tag) !== -1; });
|
|
431
443
|
|
|
432
444
|
if (options.quiet) {
|
|
433
|
-
console.log(
|
|
445
|
+
console.log(apps.map(a => a.id).join('\n'));
|
|
434
446
|
return;
|
|
435
447
|
}
|
|
436
448
|
|
|
449
|
+
// after quiet
|
|
450
|
+
if (apps.length === 0) return console.log('No apps installed.');
|
|
451
|
+
|
|
437
452
|
var t = new Table();
|
|
438
453
|
|
|
439
|
-
|
|
454
|
+
apps.forEach(function (app) {
|
|
440
455
|
t.cell('Id', app.id);
|
|
441
456
|
t.cell('Location', app.fqdn);
|
|
442
457
|
t.cell('Manifest Id', (app.manifest.id || 'customapp') + '@' + app.manifest.version);
|
|
@@ -999,8 +1014,7 @@ async function restart(options) {
|
|
|
999
1014
|
try {
|
|
1000
1015
|
const app = await getApp(options);
|
|
1001
1016
|
if (!app) return exit(NO_APP_FOUND_ERROR_STRING);
|
|
1002
|
-
await
|
|
1003
|
-
await startApp(app, options);
|
|
1017
|
+
await restartApp(app, options);
|
|
1004
1018
|
await waitForHealthy(app.id, options);
|
|
1005
1019
|
console.log('\n\nApp restarted');
|
|
1006
1020
|
} catch (error) {
|