cloudron 6.0.0 → 7.0.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/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,28 +1,20 @@
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')
@@ -33,6 +25,7 @@ program.option('--server <server>', 'Cloudron domain')
33
25
  // these are separate binaries since global options are not applicable
34
26
  program.command('appstore', 'Cloudron appstore commands');
35
27
  program.command('build', 'Cloudron build commands');
28
+ program.command('versions', 'Cloudron versions commands');
36
29
 
37
30
  const backupCommand = program.command('backup')
38
31
  .description('App backup commands');
@@ -57,7 +50,7 @@ backupCommand.command('decrypt <infile> <outfile>')
57
50
  backupCommand.command('decrypt-dir <indir> <outdir>')
58
51
  .description('Decrypt an encrypted directory')
59
52
  .option('--password <password>', 'password')
60
- .option('--no-decrypt-filenames', 'Decrypt filenames [false]')
53
+ .option('--no-decrypt-filenames', 'Do not decrypt filenames')
61
54
  .action(backupTools.decryptDir);
62
55
 
63
56
  backupCommand.command('decrypt-filename <path>')
@@ -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')
@@ -292,4 +285,3 @@ program.command('update')
292
285
  .action(actions.update);
293
286
 
294
287
  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.0",
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
  }