cloudron 4.12.6 → 4.12.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudron",
3
- "version": "4.12.6",
3
+ "version": "4.12.10",
4
4
  "license": "MIT",
5
5
  "description": "Cloudron Commandline Tool",
6
6
  "main": "main.js",
@@ -17,18 +17,18 @@
17
17
  },
18
18
  "author": "Cloudron Developers <support@cloudron.io>",
19
19
  "dependencies": {
20
- "async": "^3.2.1",
21
- "cloudron-manifestformat": "^5.10.2",
22
- "colors": "^1.4.0",
20
+ "async": "^3.2.2",
21
+ "cloudron-manifestformat": "^5.14.0",
22
+ "colors": "1.4.0",
23
23
  "commander": "^6.1.0",
24
- "debug": "^4.3.2",
25
- "easy-table": "^1.1.1",
24
+ "debug": "^4.3.3",
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
29
  "mkdirp": "^1.0.4",
30
30
  "once": "^1.4.0",
31
- "open": "^8.2.1",
31
+ "open": "^8.4.0",
32
32
  "progress": "^2.0.3",
33
33
  "progress-stream": "^2.0.0",
34
34
  "readline-sync": "^1.4.10",
@@ -39,7 +39,7 @@
39
39
  "superagent-sync": "^0.2.1",
40
40
  "supererror": "^0.7.2",
41
41
  "tar-fs": "https://registry.npmjs.org/tar-fs/-/tar-fs-1.12.0.tgz",
42
- "underscore": "^1.13.1"
42
+ "underscore": "^1.13.2"
43
43
  },
44
44
  "engines": {
45
45
  "node": ">= 14.x.x"
@@ -47,7 +47,7 @@
47
47
  "devDependencies": {
48
48
  "expect.js": "^0.3.1",
49
49
  "memorystream": "^0.3.1",
50
- "mocha": "^9.1.1",
50
+ "mocha": "^9.1.3",
51
51
  "rimraf": "^3.0.2"
52
52
  }
53
53
  }
package/src/actions.js CHANGED
@@ -250,13 +250,18 @@ function startApp(app, options, callback) {
250
250
  }
251
251
 
252
252
  async function authenticate(adminFqdn, username, password, options) {
253
+ assert.strictEqual(typeof adminFqdn, 'string');
254
+ assert.strictEqual(typeof username, 'string');
255
+ assert.strictEqual(typeof password, 'string');
256
+ assert.strictEqual(typeof options, 'object');
257
+
253
258
  let totpToken;
254
259
 
255
260
  const { rejectUnauthorized, askForTotpToken } = options;
256
261
  if (askForTotpToken) totpToken = readlineSync.question('2FA Token: ', {});
257
262
 
258
263
  const request = superagent.post(`https://${adminFqdn}/api/v1/cloudron/login`)
259
- .timeout(10000)
264
+ .timeout(60000)
260
265
  .send({ username, password, totpToken })
261
266
  .ok(() => true)
262
267
  .set('User-Agent', 'cloudron-cli');
@@ -264,10 +269,10 @@ async function authenticate(adminFqdn, username, password, options) {
264
269
  const response = await request; // this triggers the request
265
270
  if (response.status === 401) {
266
271
  if (response.body.message === 'A totpToken must be provided') {
267
- return await authenticate(username, password, { rejectUnauthorized, askForTotpToken: true });
272
+ return await authenticate(adminFqdn, username, password, { rejectUnauthorized, askForTotpToken: true });
268
273
  } else if (response.body.message === 'Invalid totpToken') {
269
274
  console.log('Invalid 2FA Token'.red);
270
- return await authenticate(username, password, { rejectUnauthorized, askForTotpToken: true });
275
+ return await authenticate(adminFqdn, username, password, { rejectUnauthorized, askForTotpToken: true });
271
276
  } else {
272
277
  throw new Error('Invalid credentials');
273
278
  }
@@ -290,7 +295,7 @@ async function login(adminFqdn, options) {
290
295
  let token = config.token();
291
296
  if (token) { // check if the token is not expired
292
297
  const [error, response] = await safe(superagent.get(`https://${adminFqdn}/api/v1/profile?access_token=${token}`)
293
- .timeout(10000)
298
+ .timeout(60000)
294
299
  .ok(() => true));
295
300
  if (error) return exit(error);
296
301
  if (response.status === 200) {
@@ -316,6 +321,8 @@ async function login(adminFqdn, options) {
316
321
  config.setToken(token);
317
322
  config.setAllowSelfsigned(options.parent.allowSelfsigned || options.parent.acceptSelfsigned);
318
323
  config.set('cloudrons.default', adminFqdn);
324
+
325
+ console.log('Login successful.'.green);
319
326
  }
320
327
 
321
328
  function logout() {
@@ -336,7 +336,7 @@ function build(options) {
336
336
  if (typeof options.setRepository === 'string') {
337
337
  repository = options.setRepository;
338
338
  } else {
339
- repository = readlineSync.question(`Enter repository (e.g registry/username/${manifest.id || path.basename(sourceDir)}): `, {});
339
+ repository = readlineSync.question(`Enter docker repository (e.g registry/username/${manifest.id || path.basename(sourceDir)}): `, {});
340
340
  if (!repository) exit('No repository provided');
341
341
  console.log();
342
342
  }
@@ -1,3 +1,3 @@
1
- FROM cloudron/base:3.0.0@sha256:455c70428723e3a823198c57472785437eb6eab082e79b3ff04ea584faf46e92
1
+ FROM cloudron/base:3.1.0@sha256:eb2ab9c7d361acda2f3ef2d8388154bc48f1651b5013fe6de4beea003018e427
2
2
 
3
3
  EXPOSE <%- httpPort %>