cloudron 4.12.10 → 4.14.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 +27 -30
- package/bin/cloudron-appstore +0 -1
- package/bin/cloudron-backup +0 -1
- package/bin/cloudron-env +0 -1
- package/package.json +5 -8
- package/src/actions.js +832 -1000
- package/src/appstore-actions.js +38 -40
- package/src/build-actions.js +21 -21
- package/src/completion.js +0 -2
- package/src/helper.js +2 -2
package/bin/cloudron
CHANGED
|
@@ -3,14 +3,15 @@
|
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
5
|
require('supererror');
|
|
6
|
-
require('colors');
|
|
7
6
|
|
|
8
7
|
const actions = require('../src/actions.js'),
|
|
9
8
|
buildActions = require('../src/build-actions.js'),
|
|
10
9
|
completion = require('../src/completion.js'),
|
|
11
10
|
config = require('../src/config.js'),
|
|
12
11
|
program = require('commander'),
|
|
12
|
+
safe = require('safetydance'),
|
|
13
13
|
semver = require('semver'),
|
|
14
|
+
superagent = require('superagent'),
|
|
14
15
|
util = require('util');
|
|
15
16
|
|
|
16
17
|
const version = require('../package.json').version;
|
|
@@ -21,19 +22,6 @@ if (!semver.satisfies(process.version, require('../package.json').engines.node))
|
|
|
21
22
|
process.exit(1);
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
// completion is useful in shell configs, so don't block here
|
|
25
|
-
if (process.argv[2] !== 'completion') {
|
|
26
|
-
if (Date.now() - (config.get('lastCliUpdateCheck') || 0) > 24*60*60*1000) {
|
|
27
|
-
// check if cli tool is up-to-date
|
|
28
|
-
var res = require('superagent-sync').get('https://registry.npmjs.org/cloudron').retry(0).end();
|
|
29
|
-
if (res.statusCode === 200 && res.body['dist-tags'].latest !== version) {
|
|
30
|
-
var updateCommand = 'npm install -g cloudron@' + res.body['dist-tags'].latest;
|
|
31
|
-
process.stderr.write(util.format('A new version of Cloudron CLI is available. Please update with: %s\n'.yellow.bold, updateCommand.white));
|
|
32
|
-
}
|
|
33
|
-
config.set('lastCliUpdateCheck', Date.now());
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
25
|
function collectArgs(value, collected) {
|
|
38
26
|
collected.push(value);
|
|
39
27
|
return collected;
|
|
@@ -85,15 +73,9 @@ program.command('configure')
|
|
|
85
73
|
.option('--no-wait', 'Wait for healthcheck to succeed [false]', false)
|
|
86
74
|
.option('-p, --port-bindings [PORT=port,...]', 'Query port bindings')
|
|
87
75
|
.option('-l, --location <location>', 'Location')
|
|
76
|
+
.option('-s, --secondary-domains [DOMAIN=domain,...]', 'Query/Set secondary domains')
|
|
88
77
|
.action(actions.configure);
|
|
89
78
|
|
|
90
|
-
program.command('createOAuthAppCredentials')
|
|
91
|
-
.option('--redirect-uri [uri]', 'Redirect Uri', 'http://localhost:4000')
|
|
92
|
-
.option('--scope [scopes]', 'Scopes (comma separated)', 'apps,appstore,clients,cloudron,domains,mail,profile,settings,subscription,users')
|
|
93
|
-
.option('--shell', 'Print shell friendly output')
|
|
94
|
-
.description('Create oauth app credentials for local development')
|
|
95
|
-
.action(actions.createOAuthAppCredentials);
|
|
96
|
-
|
|
97
79
|
program.command('debug [cmd...]')
|
|
98
80
|
.description('Put app in debug mode and run [cmd] as entrypoint. If cmd is "default" the main app entrypoint is run.')
|
|
99
81
|
.option('--app <id/location>', 'App id or location')
|
|
@@ -145,11 +127,11 @@ program.command('init')
|
|
|
145
127
|
|
|
146
128
|
program.command('install')
|
|
147
129
|
.description('Install or update app')
|
|
148
|
-
.option('--app <id/location>', 'App id or location. OBSOLETE: Use "update" instead.')
|
|
149
130
|
.option('--image <docker image>', 'Docker image')
|
|
150
131
|
.option('--no-wait', 'Wait for healthcheck to succeed [false]', false)
|
|
151
|
-
.option('-p, --port-bindings [PORT=port,...]', 'Query port bindings')
|
|
132
|
+
.option('-p, --port-bindings [PORT=port,...]', 'Query/Set port bindings')
|
|
152
133
|
.option('-l, --location <domain>', 'Subdomain or full domain')
|
|
134
|
+
.option('-s, --secondary-domains [DOMAIN=domain,...]', 'Query/Set secondary domains')
|
|
153
135
|
.option('--appstore-id <appid[@version]>', 'Use app from the store')
|
|
154
136
|
.option('--no-sso', 'Disable Cloudron SSO [false]', false)
|
|
155
137
|
.option('--debug [cmd]', 'Enable debug mode')
|
|
@@ -257,11 +239,26 @@ program.command('update')
|
|
|
257
239
|
.option('--no-force', 'Match appstore id and manifest id before updating', true)
|
|
258
240
|
.action(actions.update);
|
|
259
241
|
|
|
260
|
-
|
|
261
|
-
|
|
242
|
+
(async function main() {
|
|
243
|
+
// completion is useful in shell configs, so don't block here
|
|
244
|
+
if (process.argv[2] !== 'completion') {
|
|
245
|
+
if (Date.now() - (config.get('lastCliUpdateCheck') || 0) > 24*60*60*1000) {
|
|
246
|
+
// check if cli tool is up-to-date
|
|
247
|
+
const [error, response] = await safe(superagent.get('https://registry.npmjs.org/cloudron').retry(0).ok(() => true));
|
|
248
|
+
if (!error && response.statusCode === 200 && response.body['dist-tags'].latest !== version) {
|
|
249
|
+
const updateCommand = 'npm install -g cloudron@' + response.body['dist-tags'].latest;
|
|
250
|
+
process.stderr.write(util.format('A new version of Cloudron CLI is available. Please update with: %s\n', updateCommand));
|
|
251
|
+
}
|
|
252
|
+
config.set('lastCliUpdateCheck', Date.now());
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
program.parse(process.argv);
|
|
257
|
+
|
|
258
|
+
const knownCommand = program.commands.some(function (command) { return command._name === process.argv[2] || command._alias === process.argv[2]; });
|
|
259
|
+
if (!knownCommand) {
|
|
260
|
+
console.log('Unknown command: ' + process.argv[2].bold + '.\nTry ' + 'cloudron help'.yellow);
|
|
261
|
+
process.exit(1);
|
|
262
|
+
}
|
|
263
|
+
})();
|
|
262
264
|
|
|
263
|
-
var knownCommand = program.commands.some(function (command) { return command._name === process.argv[2] || command._alias === process.argv[2]; });
|
|
264
|
-
if (!knownCommand) {
|
|
265
|
-
console.log('Unknown command: ' + process.argv[2].bold + '.\nTry ' + 'cloudron help'.yellow);
|
|
266
|
-
process.exit(1);
|
|
267
|
-
}
|
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.14.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Cloudron Commandline Tool",
|
|
6
6
|
"main": "main.js",
|
|
@@ -17,26 +17,23 @@
|
|
|
17
17
|
},
|
|
18
18
|
"author": "Cloudron Developers <support@cloudron.io>",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"async": "^3.2.
|
|
21
|
-
"cloudron-manifestformat": "^5.
|
|
22
|
-
"colors": "1.4.0",
|
|
20
|
+
"async": "^3.2.3",
|
|
21
|
+
"cloudron-manifestformat": "^5.15.0",
|
|
23
22
|
"commander": "^6.1.0",
|
|
24
23
|
"debug": "^4.3.3",
|
|
24
|
+
"delay": "^5.0.0",
|
|
25
25
|
"easy-table": "^1.2.0",
|
|
26
26
|
"ejs": "^3.1.6",
|
|
27
27
|
"eventsource": "^1.1.0",
|
|
28
28
|
"micromatch": "^4.0.4",
|
|
29
|
-
"mkdirp": "^1.0.4",
|
|
30
29
|
"once": "^1.4.0",
|
|
31
30
|
"open": "^8.4.0",
|
|
32
31
|
"progress": "^2.0.3",
|
|
33
32
|
"progress-stream": "^2.0.0",
|
|
34
33
|
"readline-sync": "^1.4.10",
|
|
35
|
-
"request": "^2.88.2",
|
|
36
34
|
"safetydance": "^2.2.0",
|
|
37
35
|
"split": "^1.0.1",
|
|
38
|
-
"superagent": "^
|
|
39
|
-
"superagent-sync": "^0.2.1",
|
|
36
|
+
"superagent": "^7.0.2",
|
|
40
37
|
"supererror": "^0.7.2",
|
|
41
38
|
"tar-fs": "https://registry.npmjs.org/tar-fs/-/tar-fs-1.12.0.tgz",
|
|
42
39
|
"underscore": "^1.13.2"
|