cloudron 6.0.0 → 7.0.1

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 CHANGED
@@ -45,3 +45,7 @@
45
45
  [5.16.1]
46
46
  * Remove the update checker
47
47
 
48
+ [6.0.0]
49
+ * Various changes to accomodate Cloudron 9 release API changes
50
+ * add --siteId to cloudron backup to specify site id explicitly
51
+
package/bin/cloudron CHANGED
@@ -1,38 +1,32 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- 'use strict';
4
-
5
- const actions = require('../src/actions.js'),
6
- backupTools = require('../src/backup-tools.js'),
7
- buildActions = require('../src/build-actions.js'),
8
- completion = require('../src/completion.js'),
9
- config = require('../src/config.js'),
10
- Command = require('commander').Command,
11
- safe = require('safetydance'),
12
- semver = require('semver'),
13
- superagent = require('@cloudron/superagent'),
14
- util = require('util');
15
-
16
- const version = require('../package.json').version;
3
+ import actions from '../src/actions.js';
4
+ import backupTools from '../src/backup-tools.js';
5
+ import completion from '../src/completion.js';
6
+ import { Command } from 'commander';
7
+ import semver from 'semver';
8
+ import pkg from '../package.json' with { type: 'json' };
17
9
 
18
10
  // ensure node version
19
- if (!semver.satisfies(process.version, require('../package.json').engines.node)) {
20
- console.error('Your nodejs version is not compatible. Please install nodejs', require('../package.json').engines.node);
11
+ if (!semver.satisfies(process.version, pkg.engines.node)) {
12
+ console.error('Your nodejs version is not compatible. Please install nodejs', pkg.engines.node);
21
13
  process.exit(1);
22
14
  }
23
15
 
24
16
  const program = new Command();
25
- program.version(version);
17
+ program.version(pkg.version);
26
18
 
27
19
  // global options
28
20
  program.option('--server <server>', 'Cloudron domain')
29
21
  .option('--token <token>', 'Cloudron token')
30
22
  .option('--allow-selfsigned', 'Accept self signed SSL certificate')
31
- .option('--accept-selfsigned', 'Accept self signed SSL certificate');
23
+ .option('--accept-selfsigned', 'Accept self signed SSL certificate')
24
+ .option('--no-wait', 'Do not wait for the operation to finish');
32
25
 
33
26
  // these are separate binaries since global options are not applicable
34
27
  program.command('appstore', 'Cloudron appstore commands');
35
28
  program.command('build', 'Cloudron build commands');
29
+ program.command('versions', 'Cloudron versions commands');
36
30
 
37
31
  const backupCommand = program.command('backup')
38
32
  .description('App backup commands');
@@ -57,7 +51,7 @@ backupCommand.command('decrypt <infile> <outfile>')
57
51
  backupCommand.command('decrypt-dir <indir> <outdir>')
58
52
  .description('Decrypt an encrypted directory')
59
53
  .option('--password <password>', 'password')
60
- .option('--no-decrypt-filenames', 'Decrypt filenames [false]')
54
+ .option('--no-decrypt-filenames', 'Do not decrypt filenames')
61
55
  .action(backupTools.decryptDir);
62
56
 
63
57
  backupCommand.command('decrypt-filename <path>')
@@ -165,7 +159,6 @@ program.command('init')
165
159
  program.command('install')
166
160
  .description('Install or update app')
167
161
  .option('--image <docker image>', 'Docker image')
168
- .option('--no-wait', 'Wait for healthcheck to succeed [false]')
169
162
  .option('-p, --port-bindings [PORT=port,...]', 'Query/Set port bindings')
170
163
  .option('-l, --location <domain>', 'Subdomain or full domain')
171
164
  .option('-s, --secondary-domains [DOMAIN=domain,...]', 'Set secondary domains')
@@ -186,8 +179,8 @@ program.command('list')
186
179
 
187
180
  program.command('login [cloudron]')
188
181
  .description('Login to cloudron')
189
- .option('-u, --username <username>', 'Username')
190
- .option('-p, --password <password>', 'Password')
182
+ .option('-u, --username <username>', 'Username [will be removed after Cloudron 9.1]')
183
+ .option('-p, --password <password>', 'Password [will be removed after Cloudron 9.1]')
191
184
  .action(actions.login);
192
185
 
193
186
  program.command('logout')
@@ -233,26 +226,22 @@ program.command('repair')
233
226
  .description('Repair an installed application (re-configure)')
234
227
  .option('--app <id/location>', 'App id or location')
235
228
  .option('--image <docker image>', 'Docker image')
236
- .option('--no-wait', 'Wait for healthcheck to succeed [false]')
237
229
  .action(actions.repair);
238
230
 
239
231
  program.command('restore')
240
232
  .description('Restore app from known backup')
241
233
  .option('--app <id/location>', 'App id or location')
242
234
  .option('--backup <backup>', 'Backup id')
243
- .option('--no-wait', 'Wait for healthcheck to succeed [false]')
244
235
  .action(actions.restore);
245
236
 
246
237
  program.command('restart')
247
238
  .description('Restart an installed application')
248
239
  .option('--app <id/location>', 'App id or location')
249
- .option('--no-wait', 'Wait for healthcheck to succeed [false]')
250
240
  .action(actions.restart);
251
241
 
252
242
  program.command('set-location')
253
243
  .description('Set the location of an app')
254
244
  .option('--app <id/location>', 'App id or location')
255
- .option('--no-wait', 'Wait for healthcheck to succeed [false]')
256
245
  .option('-p, --port-bindings [PORT=port,...]', 'Query port bindings')
257
246
  .option('-l, --location <location>', 'Location')
258
247
  .option('-s, --secondary-domains [DOMAIN=domain,...]', 'Query/Set secondary domains')
@@ -263,7 +252,6 @@ program.command('set-location')
263
252
  program.command('start')
264
253
  .description('Start an installed application')
265
254
  .option('--app <id/location>', 'App id or location')
266
- .option('--no-wait', 'Wait for healthcheck to succeed [false]')
267
255
  .action(actions.start);
268
256
 
269
257
  program.command('stop')
@@ -287,9 +275,7 @@ program.command('update')
287
275
  .option('--appstore-id <appid[@version]>', 'Use app from the store')
288
276
  .option('--image <docker image>', 'Docker image')
289
277
  .option('--no-backup', 'Skip backup [false]')
290
- .option('--no-wait', 'Wait for healthcheck to succeed [false]')
291
278
  .option('--no-force', 'Match appstore id and manifest id before updating', true)
292
279
  .action(actions.update);
293
280
 
294
281
  program.parse(process.argv);
295
-
@@ -1,14 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- 'use strict';
4
-
5
- const appstoreActions = require('../src/appstore-actions.js'),
6
- Command = require('commander').Command;
7
-
8
- const version = require('../package.json').version;
3
+ import appstoreActions from '../src/appstore-actions.js';
4
+ import { Command } from 'commander';
5
+ import pkg from '../package.json' with { type: 'json' };
9
6
 
10
7
  const program = new Command();
11
- program.version(version);
8
+ program.version(pkg.packageVersion);
12
9
 
13
10
  // global options. IMPORTANT: These cannot conflict with global options!
14
11
  program
@@ -1,11 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- 'use strict';
3
+ import { program } from 'commander';
4
+ import buildActions from '../src/build-actions.js';
5
+ import pkg from '../package.json' with { type: 'json' };
4
6
 
5
- const { program } = require('commander'),
6
- buildActions = require('../src/build-actions.js');
7
-
8
- program.version(require('../package.json').version);
7
+ program.version(pkg.version);
9
8
 
10
9
  program.addHelpText('after', `
11
10
 
@@ -20,25 +19,36 @@ function collectArgs(value, collected) {
20
19
 
21
20
  // global options. IMPORTANT: These cannot conflict with global options!
22
21
  program.option('--server <server>', 'Cloudron domain')
23
- .option('--build-token, --build-service-token <token>', 'Build service token')
24
- .option('--url, --set-build-service [buildservice url]', 'Set build service URL. This build service is automatically used for future calls from this project');
22
+ .option('--build-service-url <url>', 'Build service URL')
23
+ .option('--build-service-token <token>', 'Build service token');
25
24
 
26
25
  program.command('build', { isDefault: true })
27
26
  .description('Build an app. This is the default subcommand')
28
27
  .option('--build-arg <namevalue>', 'Build arg passed to docker. Can be used multiple times', collectArgs, [])
29
28
  .option('-f, --file <dockerfile>', 'Name of the Dockerfile')
30
29
  .option('--set-repository [repository url]', 'Change the repository. This url is stored for future builds for this project. e.g registry/username/projectname')
31
- .option('--local', 'Build docker images locally')
32
30
  .option('--no-cache', 'Do not use cache')
33
31
  .option('--no-push', 'Do not push built image to registry')
34
32
  .option('--raw', 'Raw output build log')
35
33
  .option('--tag <docker image tag>', 'Docker image tag. Note that this does not include the repository name')
36
34
  .action(buildActions.build);
37
35
 
36
+ program.command('clear')
37
+ .description('Clears build information')
38
+ .action(buildActions.clear);
39
+
40
+ program.command('info')
41
+ .description('Print build information')
42
+ .action(buildActions.info);
43
+
38
44
  program.command('login')
39
45
  .description('Login to the build service')
40
46
  .action(buildActions.login);
41
47
 
48
+ program.command('logout')
49
+ .description('Logout from the build service')
50
+ .action(buildActions.logout);
51
+
42
52
  program.command('logs')
43
53
  .description('Build logs. This works only when using the Build Service')
44
54
  .option('--id <buildid>', 'Build ID')
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env node
2
+
3
+ import versionsActions from '../src/versions-actions.js';
4
+ import { Command } from 'commander';
5
+ import pkg from '../package.json' with { type: 'json' };
6
+
7
+ const program = new Command();
8
+ program.version(pkg.version);
9
+
10
+ program.command('add')
11
+ .description('Add the current build to version file')
12
+ .option('--state <state>', 'Publish state (published or testing)')
13
+ .action(versionsActions.addOrUpdate);
14
+
15
+ program.command('init')
16
+ .description('Create versions file')
17
+ .action(versionsActions.init);
18
+
19
+ program.command('list')
20
+ .description('List existing versions')
21
+ .action(versionsActions.list);
22
+
23
+ program.command('revoke')
24
+ .description('Revoke the latest version')
25
+ .action(versionsActions.revoke);
26
+
27
+ program.command('update')
28
+ .description('Update existing version')
29
+ .option('--version <version>', 'Version to update')
30
+ .option('--state <state>', 'Publish state (published or testing)')
31
+ .action(versionsActions.addOrUpdate);
32
+
33
+ program.parse(process.argv);
package/eslint.config.js CHANGED
@@ -1,7 +1,7 @@
1
- const js = require('@eslint/js');
2
- const globals = require('globals');
1
+ import js from '@eslint/js';
2
+ import globals from 'globals';
3
3
 
4
- module.exports = [
4
+ export default [
5
5
  js.configs.recommended,
6
6
  {
7
7
  files: ["**/*.js"],
@@ -10,12 +10,13 @@ module.exports = [
10
10
  ...globals.node,
11
11
  },
12
12
  ecmaVersion: 13,
13
- sourceType: "commonjs"
13
+ sourceType: "module"
14
14
  },
15
15
  rules: {
16
16
  semi: "error",
17
- "prefer-const": "error"
17
+ "prefer-const": "error",
18
+ "no-use-before-define": "error",
19
+ "no-shadow": "error"
18
20
  }
19
21
  }
20
22
  ];
21
-
package/package.json CHANGED
@@ -1,41 +1,42 @@
1
1
  {
2
2
  "name": "cloudron",
3
- "version": "6.0.0",
3
+ "version": "7.0.1",
4
4
  "license": "MIT",
5
5
  "description": "Cloudron Commandline Tool",
6
- "main": "main.js",
6
+ "type": "module",
7
7
  "homepage": "https://git.cloudron.io/platform/cloudron-cli",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "https://git.cloudron.io/platform/cloudron-cli.git"
11
11
  },
12
12
  "scripts": {
13
- "test": "mocha test/test.js"
13
+ "test": "mocha --bail --no-timeouts test/test.js"
14
14
  },
15
15
  "bin": {
16
16
  "cloudron": "bin/cloudron"
17
17
  },
18
18
  "author": "Cloudron Developers <support@cloudron.io>",
19
19
  "dependencies": {
20
- "@cloudron/manifest-format": "^5.28.0",
21
- "@cloudron/superagent": "^1.0.0",
22
- "commander": "^14.0.1",
20
+ "@cloudron/manifest-format": "^6.0.2",
21
+ "@cloudron/safetydance": "^3.0.1",
22
+ "@cloudron/superagent": "^2.1.1",
23
+ "commander": "^14.0.3",
23
24
  "debug": "^4.4.3",
24
25
  "easy-table": "^1.2.0",
25
- "ejs": "^3.1.10",
26
- "eventsource": "^4.0.0",
26
+ "ejs": "^4.0.1",
27
+ "eventsource": "^4.1.0",
27
28
  "micromatch": "^4.0.8",
28
- "open": "^10.2.0",
29
- "safetydance": "^2.5.1",
29
+ "open": "^11.0.0",
30
+ "semver": "^7.7.4",
30
31
  "tar-fs": "^3.1.1"
31
32
  },
32
33
  "engines": {
33
- "node": ">= 18.x.x"
34
+ "node": ">= 20.11.0"
34
35
  },
35
36
  "devDependencies": {
36
- "@eslint/js": "^9.37.0",
37
- "eslint": "^9.37.0",
38
- "expect.js": "^0.3.1",
39
- "mocha": "^11.7.4"
37
+ "@eslint/js": "^10.0.1",
38
+ "eslint": "^10.0.0",
39
+ "globals": "^17.3.0",
40
+ "mocha": "^11.7.5"
40
41
  }
41
42
  }