iobroker.js-controller 4.0.21 → 4.0.24

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/io-package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "js-controller",
4
- "version": "4.0.21",
4
+ "version": "4.0.24",
5
5
  "platform": "Javascript/Node.js",
6
6
  "controller": true,
7
7
  "mode": "daemon",
@@ -19,6 +19,31 @@
19
19
  "zh-cn": "JS控制器"
20
20
  },
21
21
  "news": {
22
+ "4.0.24": {
23
+ "en": "Exclude iot and cloud from masking special properties\nAdded time based JSONL compaction (once a day)\nOptimized message sequence id generation\nUse ipv4 as primary DNS lookup option also in Node.js 18+\nExtended Docker detection to prevent issues in new Debian",
24
+ "de": "iot und cloud aus maskieren besonderen Eigenschaften ausschliessen\nZeitbasierte JSONL-Verdichtung hinzugefügt (einmal pro Tag)\nOptimierung der ID Generierung\nIPv5 als primäre DNS-Lookup-Option auch in Node.js 18+ benutzen\nDocker-Erkennung erweitert, um Probleme in neuem Debian zu verhindern",
25
+ "ru": "Исключить iot и облако от маскировки специальных свойств\nДобавьте время на основе JSONL уплотнения (один раз в день)\nОптимизируйте последовательность сообщений id поколения\nИспользуйте ipv4 как опцию первичного DNS Lookup также в Node.js 18+\nРасширение обнаружения Docker для предотвращения проблем в новом Debian",
26
+ "pt": "Excluir iot e nuvem de mascarar propriedades especiais\nAdicionar compactação JSONL baseada no tempo (uma vez por dia)\nOtimizar a geração de identificação de sequência de mensagem\nUse ipv4 como opção de pesquisa DNS primário também em Node.js 18+\nAmplie a detecção do Docker para evitar problemas no novo Debian",
27
+ "nl": "Uitgesloten iot en wolk van het maskeren van speciale eigenschappen\nVoeg de tijd op basis van JSONL compact (once per dag)\nVertaling:\nGebruik ipv4 als primaire DNS-optie ook in Node\nExtend Docker detectie om problemen te voorkomen in nieuwe Debian",
28
+ "fr": "Exclure iot et nuage de masquer des propriétés spéciales\nAjouter le compactage JSONL basé sur le temps (une fois par jour)\nOptimiser la génération de messages id\nUtilisez ipv4 comme option de recherche DNS primaire également dans Node.js 18+\nÉtendre la détection de Docker pour prévenir les problèmes dans le nouveau Debian",
29
+ "it": "Escludere iot e cloud da mascherare proprietà speciali\nAggiungere la compattazione JSONL (una volta al giorno)\nOttimizzare la generazione id della sequenza dei messaggi\nUtilizzare ipv4 come opzione di ricerca DNS primaria anche in Node.js 18+\nEstendere il rilevamento Docker per prevenire problemi nel nuovo Debian",
30
+ "es": "Excluir el iot y la nube de propiedades especiales enmascarando\nAñadir la compactación JSONL basada en el tiempo (una vez al día)\nOptimize message sequence id generation\nUtilice ipv4 como opción de búsqueda DNS primaria también en Node.js 18+\nExtender la detección de Docker para prevenir problemas en Nueva Debian",
31
+ "pl": "Okazuje się, że iot i chmura z maskowania specjalnych właściwości\nJSONL zwartość (na dzień)\nOptimize message sequence id generation (ang.)\nUżycie ipv4 jako podstawowego pakietu DNS w Node.js 18+\nSzczegółowe wykrycie Dockera zapobiegało nowym problemom",
32
+ "uk": "Виключіть iot і хмару з маскування спеціальних властивостей\nДодати час на основі JSONL ущільнення (на добу)\nОптимізуйте послідовність повідомлень id покоління\nВикористовуйте ipv4 як основний параметр пошуку DNS також в Node.js 18+\nПродовжити виявлення Docker для запобігання проблемам в новому Debian",
33
+ "zh-cn": "采掘特殊财产的采掘\n增加以联索行动为基础的时间(一天)\n传播信息顺序\n第18+js\nD. 探查防止新 Debian出现问题"
34
+ },
35
+ "4.0.23": {
36
+ "en": "normalize JSONL options to prevent issues because of admin adding empty setting objects\nPrevent some crash cases reported by Sentry",
37
+ "de": "Normalisieren Sie JSONL-Optionen, um Probleme zu vermeiden, weil der Administrator leere Einstellungsobjekte hinzufügt\nVerhindern Sie einige von Sentry gemeldete Absturzfälle",
38
+ "ru": "нормализуйте параметры JSONL, чтобы предотвратить проблемы из-за того, что администратор добавляет пустые объекты настроек\nПредотвращение некоторых случаев сбоев, о которых сообщает Sentry.",
39
+ "pt": "normalize as opções JSONL para evitar problemas devido ao administrador adicionar objetos de configuração vazios\nPrevenir alguns casos de travamento relatados pelo Sentinela",
40
+ "nl": "normaliseer JSONL-opties om problemen te voorkomen omdat de beheerder lege instellingsobjecten toevoegt\nVoorkom enkele door Sentry gemelde crashgevallen",
41
+ "fr": "normaliser les options JSONL pour éviter les problèmes dus à l'ajout par l'administrateur d'objets de réglage vides\nEmpêcher certains cas de plantage signalés par Sentry",
42
+ "it": "normalizzare le opzioni JSONL per evitare problemi dovuti all'aggiunta di oggetti di impostazione vuoti da parte dell'amministratore\nPrevenire alcuni casi di crash segnalati da Sentry",
43
+ "es": "normalice las opciones de JSONL para evitar problemas debido a que el administrador agrega objetos de configuración vacíos\nEvitar algunos casos de bloqueo informados por Sentry",
44
+ "pl": "znormalizować opcje JSONL, aby zapobiec problemom z powodu dodania przez administratora pustych obiektów ustawień\nZapobiegaj niektórym przypadkom awarii zgłaszanych przez Sentry",
45
+ "zh-cn": "规范化 JSONL 选项以防止由于管理员添加空设置对象而出现问题\n防止 Sentry 报告的一些崩溃案例"
46
+ },
22
47
  "4.0.21": {
23
48
  "en": "Fix Backup Restore crash case",
24
49
  "de": "Beheben Sie den Absturzfall der Sicherungswiederherstellung",
@@ -78,30 +103,6 @@
78
103
  "es": "ver CHANGELOG.md",
79
104
  "pl": "zobacz CHANGELOG.md",
80
105
  "zh-cn": "看到CHANGELOG.md"
81
- },
82
- "3.1.6": {
83
- "en": "see CHANGELOG.md",
84
- "de": "Siehe CHANGELOG.md",
85
- "ru": "см. CHANGELOG.md",
86
- "pt": "veja CHANGELOG.md",
87
- "nl": "zie CHANGELOG.md",
88
- "fr": "voir CHANGELOG.md",
89
- "it": "vedi CHANGELOG.md",
90
- "es": "ver CHANGELOG.md",
91
- "pl": "zobacz CHANGELOG.md",
92
- "zh-cn": "看到CHANGELOG.md"
93
- },
94
- "3.0.20": {
95
- "en": "see CHANGELOG.md",
96
- "de": "Siehe CHANGELOG.md",
97
- "ru": "см. CHANGELOG.md",
98
- "pt": "veja CHANGELOG.md",
99
- "nl": "zie CHANGELOG.md",
100
- "fr": "voir CHANGELOG.md",
101
- "it": "vedi CHANGELOG.md",
102
- "es": "ver CHANGELOG.md",
103
- "pl": "zobacz CHANGELOG.md",
104
- "zh-cn": "看到CHANGELOG.md"
105
106
  }
106
107
  },
107
108
  "desc": {
@@ -633,25 +633,35 @@ class BackupRestore {
633
633
  }
634
634
 
635
635
  _copyBackupedFiles(backupDir) {
636
- if (!fs.existsSync(backupDir)) {
637
- console.log('No additional files to restore');
638
- return;
639
- }
640
- const dirs = fs.readdirSync(backupDir);
641
-
642
- dirs.forEach(dir => {
643
- if (dir === 'files') {
644
- return;
645
- }
646
- const path = pathLib.join(backupDir, dir);
647
- if (!fs.existsSync(path)) {
636
+ try {
637
+ if (!fs.existsSync(backupDir)) {
638
+ console.log('No additional files to restore');
648
639
  return;
649
640
  }
650
- const stat = fs.statSync(path);
651
- if (stat.isDirectory()) {
652
- this.copyFolderRecursiveSync(path, this.configDir);
653
- }
654
- });
641
+ const dirs = fs.readdirSync(backupDir);
642
+
643
+ dirs.forEach(dir => {
644
+ if (dir === 'files') {
645
+ return;
646
+ }
647
+ const path = pathLib.join(backupDir, dir);
648
+ let stat;
649
+ try {
650
+ if (!fs.existsSync(path)) {
651
+ return;
652
+ }
653
+ stat = fs.statSync(path);
654
+ } catch (err) {
655
+ console.error(`Ignoring ${path} because can not get file type: ${err.message}`);
656
+ return;
657
+ }
658
+ if (stat.isDirectory()) {
659
+ this.copyFolderRecursiveSync(path, this.configDir);
660
+ }
661
+ });
662
+ } catch (err) {
663
+ console.error(`Ignoring ${backupDir} because can not read directory: ${err.message}`);
664
+ }
655
665
  }
656
666
 
657
667
  /**
@@ -925,7 +935,7 @@ class BackupRestore {
925
935
  },
926
936
  err => {
927
937
  if (err) {
928
- console.error(`host.${hostname} Cannot extract from file "${name}"`);
938
+ console.error(`host.${hostname} Cannot extract from file "${name}": ${err.message}`);
929
939
  return void this.processExit(9);
930
940
  }
931
941
  if (!fs.existsSync(`${tmpDir}/backup/backup.json`)) {
@@ -1088,7 +1098,7 @@ class BackupRestore {
1088
1098
  },
1089
1099
  err => {
1090
1100
  if (err) {
1091
- console.error(`host.${hostname} Cannot extract from file "${name}"`);
1101
+ console.error(`host.${hostname} Cannot extract from file "${name}": ${err.message}`);
1092
1102
  return void this.processExit(9);
1093
1103
  }
1094
1104
  if (!fs.existsSync(`${tmpDir}/backup/backup.json`)) {
@@ -187,7 +187,7 @@ function Repo(options) {
187
187
  } else {
188
188
  repoUrl = repoUrl || systemConfig.common.activeRepo;
189
189
 
190
- if (typeof repoUrl !== 'object') {
190
+ if (!Array.isArray(repoUrl)) {
191
191
  repoUrl = [repoUrl];
192
192
  }
193
193
 
@@ -324,9 +324,7 @@ function Repo(options) {
324
324
  (obj.common.activeRepo &&
325
325
  typeof obj.common.activeRepo === 'string' &&
326
326
  obj.common.activeRepo === repoName) ||
327
- (obj.common.activeRepo &&
328
- typeof obj.common.activeRepo === 'object' &&
329
- obj.common.activeRepo.includes(repoName))
327
+ (obj.common.activeRepo && Array.isArray(obj.common.activeRepo) && obj.common.activeRepo.includes(repoName))
330
328
  ) {
331
329
  throw new Error(`Cannot delete active repository: ${repoName}`);
332
330
  } else {
@@ -418,7 +416,7 @@ function Repo(options) {
418
416
  sysConfigObj.common &&
419
417
  ((typeof sysConfigObj.common.activeRepo === 'string' &&
420
418
  sysConfigObj.common.activeRepo === oldName) ||
421
- (typeof sysConfigObj.common.activeRepo === 'object' &&
419
+ (Array.isArray(sysConfigObj.common.activeRepo) &&
422
420
  sysConfigObj.common.activeRepo.includes(oldName)))
423
421
  ) {
424
422
  if (typeof sysConfigObj.common.activeRepo === 'string') {
package/lib/setup.js CHANGED
@@ -24,6 +24,11 @@ const { tools: dbTools, getObjectsConstructor, getStatesConstructor } = require(
24
24
  const path = require('path');
25
25
  const { PluginHandler } = require('@iobroker/plugin-base');
26
26
 
27
+ const dns = require('dns');
28
+ if (typeof dns.setDefaultResultOrder === 'function') {
29
+ dns.setDefaultResultOrder('ipv4first');
30
+ }
31
+
27
32
  let pluginHandler;
28
33
 
29
34
  // @ts-ignore
package/main.js CHANGED
@@ -26,6 +26,12 @@ const { isDeepStrictEqual, inspect } = require('util');
26
26
  const { tools, EXIT_CODES, logger: toolsLogger } = require('@iobroker/js-controller-common');
27
27
  const { PluginHandler } = require('@iobroker/plugin-base');
28
28
  const NotificationHandler = require('./lib/notificationHandler');
29
+
30
+ const dns = require('dns');
31
+ if (typeof dns.setDefaultResultOrder === 'function') {
32
+ dns.setDefaultResultOrder('ipv4first');
33
+ }
34
+
29
35
  const controllerVersions = {};
30
36
 
31
37
  let pluginHandler;
@@ -769,7 +775,7 @@ function createObjects(onConnect) {
769
775
  delete hostAdapter[id];
770
776
  }
771
777
  }
772
- } else if (obj.type && obj.type === 'host' && obj.common && obj.common.installedVersion) {
778
+ } else if (obj && obj.type === 'host' && obj.common && obj.common.installedVersion) {
773
779
  // host object changed
774
780
  // TODO: remove this shim if 4.0 is old enough
775
781
  if (controllerVersions[id]) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.js-controller",
3
- "version": "4.0.21",
3
+ "version": "4.0.24",
4
4
  "engines": {
5
5
  "node": ">=12.0.0"
6
6
  },
@@ -17,16 +17,16 @@
17
17
  },
18
18
  "dependencies": {
19
19
  "@alcalzone/esbuild-register": "^2.5.1-1",
20
- "@iobroker/db-objects-file": "4.0.21",
21
- "@iobroker/db-objects-jsonl": "4.0.21",
22
- "@iobroker/db-objects-redis": "4.0.21",
23
- "@iobroker/db-states-file": "4.0.21",
24
- "@iobroker/db-states-jsonl": "4.0.21",
25
- "@iobroker/db-states-redis": "4.0.21",
26
- "@iobroker/js-controller-adapter": "4.0.21",
27
- "@iobroker/js-controller-cli": "4.0.21",
28
- "@iobroker/js-controller-common": "4.0.21",
29
- "@iobroker/js-controller-common-db": "4.0.21",
20
+ "@iobroker/db-objects-file": "4.0.24",
21
+ "@iobroker/db-objects-jsonl": "4.0.24",
22
+ "@iobroker/db-objects-redis": "4.0.24",
23
+ "@iobroker/db-states-file": "4.0.24",
24
+ "@iobroker/db-states-jsonl": "4.0.24",
25
+ "@iobroker/db-states-redis": "4.0.24",
26
+ "@iobroker/js-controller-adapter": "4.0.24",
27
+ "@iobroker/js-controller-cli": "4.0.24",
28
+ "@iobroker/js-controller-common": "4.0.24",
29
+ "@iobroker/js-controller-common-db": "4.0.24",
30
30
  "@iobroker/plugin-base": "~1.2.1",
31
31
  "@iobroker/plugin-sentry": "~1.2.0",
32
32
  "axios": "^0.24.0",
@@ -112,5 +112,5 @@
112
112
  "iobroker.js",
113
113
  "main.js"
114
114
  ],
115
- "gitHead": "4749d256d312623ae7621e7ae47d44580b3aa8c1"
115
+ "gitHead": "5645debf3394177abeef58917f872a7d8c43e320"
116
116
  }