cloudron 4.15.0 → 4.15.3
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/README.md +2 -2
- package/bin/cloudron +1 -1
- package/bin/cloudron-appstore +1 -1
- package/bin/cloudron-backup +3 -3
- package/bin/cloudron-env +1 -1
- package/package.json +1 -1
- package/src/actions.js +17 -11
- package/src/backup-tools.js +8 -8
- package/src/templates/Dockerfile.ejs +1 -1
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# The Cloudron CLI tool
|
|
2
2
|
|
|
3
|
-
The [Cloudron](https://cloudron.io) CLI tool allows you to install, configure and test apps on your Cloudron.
|
|
3
|
+
The [Cloudron](https://cloudron.io) [CLI tool](https://docs.cloudron.io/packaging/cli/) allows you to install, configure and test apps on your Cloudron.
|
|
4
4
|
It is also used to submit your app to the Cloudron Store. The `machine` subcommand can be used for
|
|
5
5
|
various maintenance tasks on a selfhosted Cloudron.
|
|
6
6
|
|
|
7
|
-
Read the Cloudron.io [documentation](https://cloudron.io/
|
|
7
|
+
Read the Cloudron.io [documentation](https://docs.cloudron.io/) for in-depth information.
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
package/bin/cloudron
CHANGED
|
@@ -257,7 +257,7 @@ program.command('update')
|
|
|
257
257
|
|
|
258
258
|
const knownCommand = program.commands.some(function (command) { return command._name === process.argv[2] || command._alias === process.argv[2]; });
|
|
259
259
|
if (!knownCommand) {
|
|
260
|
-
console.log('Unknown command: ' + process.argv[2]
|
|
260
|
+
console.log('Unknown command: ' + process.argv[2] + '.\nTry ' + 'cloudron help');
|
|
261
261
|
process.exit(1);
|
|
262
262
|
}
|
|
263
263
|
})();
|
package/bin/cloudron-appstore
CHANGED
|
@@ -71,7 +71,7 @@ if (!process.argv.slice(2).length) {
|
|
|
71
71
|
|
|
72
72
|
var knownCommand = program.commands.some(function (command) { return command._name === process.argv[2] || command._alias === process.argv[2]; });
|
|
73
73
|
if (!knownCommand) {
|
|
74
|
-
console.log('Unknown command: ' + process.argv[2]
|
|
74
|
+
console.log('Unknown command: ' + process.argv[2] + '.\nTry ' + 'cloudron appstore help');
|
|
75
75
|
process.exit(1);
|
|
76
76
|
}
|
|
77
77
|
return;
|
package/bin/cloudron-backup
CHANGED
|
@@ -20,12 +20,12 @@ program.command('list')
|
|
|
20
20
|
.action(actions.backupList);
|
|
21
21
|
|
|
22
22
|
program.command('decrypt <file>')
|
|
23
|
-
.description('Decrypt
|
|
23
|
+
.description('Decrypt an encrypted file')
|
|
24
24
|
.option('--password <password>', 'password')
|
|
25
25
|
.action(backupTools.decrypt);
|
|
26
26
|
|
|
27
27
|
program.command('decrypt-dir <indir> <outdir>')
|
|
28
|
-
.description('Decrypt
|
|
28
|
+
.description('Decrypt an encrypted directory')
|
|
29
29
|
.option('--password <password>', 'password')
|
|
30
30
|
.action(backupTools.decryptDir);
|
|
31
31
|
|
|
@@ -56,7 +56,7 @@ if (!process.argv.slice(2).length) {
|
|
|
56
56
|
|
|
57
57
|
var knownCommand = program.commands.some(function (command) { return command._name === process.argv[2] || command._alias === process.argv[2]; });
|
|
58
58
|
if (!knownCommand) {
|
|
59
|
-
console.log('Unknown command: ' + process.argv[2]
|
|
59
|
+
console.log('Unknown command: ' + process.argv[2] + '.\nTry ' + 'cloudron backup help');
|
|
60
60
|
process.exit(1);
|
|
61
61
|
}
|
|
62
62
|
return;
|
package/bin/cloudron-env
CHANGED
|
@@ -39,7 +39,7 @@ if (!process.argv.slice(2).length) {
|
|
|
39
39
|
|
|
40
40
|
var knownCommand = program.commands.some(function (command) { return command._name === process.argv[2] || command._alias === process.argv[2]; });
|
|
41
41
|
if (!knownCommand) {
|
|
42
|
-
console.log('Unknown command: ' + process.argv[2]
|
|
42
|
+
console.log('Unknown command: ' + process.argv[2] + '.\nTry ' + 'cloudron env help');
|
|
43
43
|
process.exit(1);
|
|
44
44
|
}
|
|
45
45
|
return;
|
package/package.json
CHANGED
package/src/actions.js
CHANGED
|
@@ -449,23 +449,29 @@ async function list(options) {
|
|
|
449
449
|
// after quiet
|
|
450
450
|
if (apps.length === 0) return console.log('No apps installed.');
|
|
451
451
|
|
|
452
|
-
|
|
452
|
+
const t = new Table();
|
|
453
453
|
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
454
|
+
for (const app of apps) {
|
|
455
|
+
const response2 = await createRequest('GET', `/api/v1/apps/${app.id}`, options);
|
|
456
|
+
if (response2.statusCode !== 200) return exit(`Failed to list app: ${requestError(response2)}`);
|
|
457
|
+
response2.body.location = response2.body.location || response2.body.subdomain; // LEGACY support
|
|
458
|
+
|
|
459
|
+
const detailedApp = response2.body;
|
|
460
|
+
|
|
461
|
+
t.cell('Id', detailedApp.id);
|
|
462
|
+
t.cell('Location', detailedApp.fqdn);
|
|
463
|
+
t.cell('Manifest Id', (detailedApp.manifest.id || 'customapp') + '@' + detailedApp.manifest.version);
|
|
458
464
|
var prettyState;
|
|
459
|
-
if (
|
|
460
|
-
prettyState = (
|
|
461
|
-
} else if (
|
|
462
|
-
prettyState = `error (${
|
|
465
|
+
if (detailedApp.installationState === 'installed') {
|
|
466
|
+
prettyState = (detailedApp.debugMode ? 'debug' : detailedApp.runState);
|
|
467
|
+
} else if (detailedApp.installationState === 'error') {
|
|
468
|
+
prettyState = `error (${detailedApp.error.installationState})`;
|
|
463
469
|
} else {
|
|
464
|
-
prettyState =
|
|
470
|
+
prettyState = detailedApp.installationState;
|
|
465
471
|
}
|
|
466
472
|
t.cell('State', prettyState);
|
|
467
473
|
t.newRow();
|
|
468
|
-
}
|
|
474
|
+
}
|
|
469
475
|
|
|
470
476
|
console.log();
|
|
471
477
|
console.log(t.toString());
|
package/src/backup-tools.js
CHANGED
|
@@ -23,7 +23,7 @@ function encryptFilePath(filePath, encryption) {
|
|
|
23
23
|
assert.strictEqual(typeof filePath, 'string');
|
|
24
24
|
assert.strictEqual(typeof encryption, 'object');
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
const encryptedParts = filePath.split('/').map(function (part) {
|
|
27
27
|
let hmac = crypto.createHmac('sha256', Buffer.from(encryption.filenameHmacKey, 'hex'));
|
|
28
28
|
const iv = hmac.update(part).digest().slice(0, 16); // iv has to be deterministic, for our sync (copy) logic to work
|
|
29
29
|
const cipher = crypto.createCipheriv('aes-256-cbc', Buffer.from(encryption.filenameKey, 'hex'), iv);
|
|
@@ -42,7 +42,7 @@ function decryptFilePath(filePath, encryption) {
|
|
|
42
42
|
assert.strictEqual(typeof filePath, 'string');
|
|
43
43
|
assert.strictEqual(typeof encryption, 'object');
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
const decryptedParts = [];
|
|
46
46
|
for (let part of filePath.split('/')) {
|
|
47
47
|
part = part + Array(part.length % 4).join('='); // add back = padding
|
|
48
48
|
part = part.replace(/-/g, '/'); // replace with '/'
|
|
@@ -197,9 +197,9 @@ function encrypt(input, options) {
|
|
|
197
197
|
|
|
198
198
|
const encryption = aesKeysFromPassword(options.password);
|
|
199
199
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
200
|
+
const inStream = fs.createReadStream(input);
|
|
201
|
+
const outStream = process.stdout;
|
|
202
|
+
const encryptStream = new EncryptStream(encryption);
|
|
203
203
|
|
|
204
204
|
inStream.on('error', exit);
|
|
205
205
|
encryptStream.on('error', exit);
|
|
@@ -227,9 +227,9 @@ function decrypt(input, options) {
|
|
|
227
227
|
|
|
228
228
|
const encryption = aesKeysFromPassword(options.password);
|
|
229
229
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
230
|
+
const inStream = fs.createReadStream(input);
|
|
231
|
+
const outStream = process.stdout;
|
|
232
|
+
const decryptStream = new DecryptStream(encryption);
|
|
233
233
|
|
|
234
234
|
inStream.on('error', exit);
|
|
235
235
|
decryptStream.on('error', exit);
|