poad 2.6.0 → 2.7.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/global/init.js CHANGED
@@ -12,7 +12,7 @@ module.exports = async (args) => {
12
12
  iss: 'poad',
13
13
  };
14
14
  const service = {
15
- role: 'service',
15
+ role: 'service_role',
16
16
  iss: 'poad',
17
17
  };
18
18
  const admin = {
package/global/install.js CHANGED
@@ -5,7 +5,6 @@ module.exports = async (args) => {
5
5
 
6
6
  const docker = new Docker();
7
7
  const imageName = 'poadio/engine:' + global.package.engine;
8
- const platform = 'linux/amd64';
9
8
 
10
9
  // Create a new progress bar
11
10
  const progressBar = new cliProgress.SingleBar(
@@ -15,7 +14,9 @@ module.exports = async (args) => {
15
14
 
16
15
  console.log(chalk.bold('\nInstalling poad environment...'));
17
16
 
18
- docker.pull(imageName, { platform }, (err, stream) => {
17
+ // Sans plateforme imposée, Docker tire la variante de la machine (amd64 ou
18
+ // arm64) : sur un Mac Apple Silicon, l'engine tourne sans émulation.
19
+ docker.pull(imageName, (err, stream) => {
19
20
  if (err) {
20
21
  console.error('Error pulling image:', err);
21
22
  return;
package/global/start.js CHANGED
@@ -26,6 +26,9 @@ module.exports = async (args) => {
26
26
  Tty: false,
27
27
  Env: [
28
28
  'OMNEEDIA_GATEWAY_URL=http://localhost:' + config.web.port,
29
+ // Projet local : le service auth accepte les redirections vers
30
+ // http://localhost:* (désactivé par défaut, hors du CLI)
31
+ 'OMNEEDIA_AUTH_ALLOW_LOCALHOST_REDIRECTS=true',
29
32
  'DATA_VOLUME_MOUNTPOINT=/data',
30
33
  'POSTGRES_PASSWORD=postgres',
31
34
  'ADMIN_API_KEY=' + config.auth.admin,
@@ -52,7 +55,6 @@ module.exports = async (args) => {
52
55
  Binds: [path.dirname(root) + '/data:/data'],
53
56
  AutoRemove: true,
54
57
  },
55
- Platform: 'linux/amd64',
56
58
  })
57
59
  .then((container) => {
58
60
  return container.start();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "poad",
3
- "version": "2.6.0",
4
- "engine": "0.6.1",
3
+ "version": "2.7.0",
4
+ "engine": "0.6.3",
5
5
  "main": "index.js",
6
6
  "license": "MIT",
7
7
  "bin": {
package/poad.js CHANGED
@@ -462,6 +462,18 @@ const display = (commands) => {
462
462
  }
463
463
  };
464
464
 
465
+ // True when version `a` is strictly newer than `b` (major.minor.patch).
466
+ const isNewerVersion = (a, b) => {
467
+ const pa = String(a).split('.').map(Number);
468
+ const pb = String(b).split('.').map(Number);
469
+ for (let i = 0; i < 3; i++) {
470
+ const x = pa[i] || 0;
471
+ const y = pb[i] || 0;
472
+ if (x !== y) return x > y;
473
+ }
474
+ return false;
475
+ };
476
+
465
477
  // Main function.
466
478
  const main = async () => {
467
479
  let version = await checkVersion();
@@ -470,9 +482,7 @@ const main = async () => {
470
482
  if (version === null) {
471
483
  version = current_version;
472
484
  }
473
- const cv = current_version.replace(/\./g, '') * 1;
474
- const v = version.replace(/\./g, '') * 1;
475
- if (v > cv) {
485
+ if (isNewerVersion(version, current_version)) {
476
486
  const message =
477
487
  `A new version (${version}) is available. You can upgrade by running:\n` +
478
488
  chalk.white.bold(`npm i -g poad@${version}`);