Skip to content

Commit 0056201

Browse files
authored
Release merge (#479)
* fix(bug) fixed system microservices (HAL, bluetooth) launch (EWC-413) (#424) * fix(bug) added registry email validation (EWC-418) * test(core) unit tests for iofog-controller (EWC-382) (#426) * test(core) unit tests for flow & diagnostics controllers, updated postman collection & refactored diagnostics (EWC-382) (#427) * bug(fix) CLI diagnostics: Incorrect error message is displayed when user try to get strace-info (#428) * test(core) unit tests for catalog, controller and agent controllers (EWC-382) (#430) * bug(fix) CLI diagnostics ftp: Incorrect error message is displayed when user try to get strace-info (EWC-431) * release merge (#433) * Release 1.0.28 * EWC-379 migrations between versions (#410) * Maksimchepelev/bugs (#411) * EWC-385 cli helps' outputs * EWC-395 cli `microservice port-mapping-remove` error message fix * EWC-389 cli `diagnostics strace-update` correct parsing of boolean * EWC-390 cli `diagnostics strace-...` correct validation error messages * EWC-392 cli `diagnostics strace-info` microservice validation * EWC-394 sequelize (deprecated)find -> findOne * EWC-388 validation of flowId in delete flow service * EWC-393 validation of microserviceUuid in image snapshot services * Maksimchepelev/bugs (#412) * fix(help): Fix rsa-key description in cli tunnel help need to update description for parameter -k, --rsa-key in help for tunnel from 'Tunnel RSA key' to 'Path to tunnel RSA key' Closes EWC-396 * fix(tunnel): if port range not provided in config use default values default range: 2000-10000 Closes EWC-397 * fix(tests): rename logLimit -> logSize (#416) create microservice request in Postman Collection diagnostics block Closes EWC-401 * feat(npm-scripts): allow to use only one image on catalog item creation (#415) Closes EWC-399 * fix(transactions): fix transaction validation if last method's arg is undefined (#414) Closes EWC-400 * feat(npm-scripts): init db automatically after installation (#413) Closes EWC-368 * Maksimchepelev/bugs (#417) * fix(code): delete routes on microservice deletion Closes EWC-362 * update version 1.0.27 (#418) * Merge versions (#420) * release 1.0.27 version (#419) * feat(core): add migration between versions (EWC-379) * feat(core): add cli help output (EWC-385) * fix(bug): fix cli `microservice port-mapping-remove` error message (EWC-395) * fix(bug): fix cli `diagnostics strace-update` parsing of boolean (EWC-389) * fix(bug): fix cli `diagnostics strace-...` validation error messages (EWC-390) * feat(core): add cli `diagnostics strace-info` microservice validation (EWC-392) * refactor(core): replace sequelize (deprecated)find -> findOne (EWC-394) * refactor(core): edit validation of flowId in delete flow service (EWC-388) * feat(core): add validation of microserviceUuid in image snapshot services (EWC-393) * fix(help): Fix rsa-key description in cli tunnel help need to update description for parameter -k, --rsa-key in help for tunnel from 'Tunnel RSA key' to 'Path to tunnel RSA key' Closes EWC-396 * fix(tunnel): if port range not provided in config use default values default range: 2000-10000 Closes EWC-397 * fix(tests): rename logLimit -> logSize (#416) create microservice request in Postman Collection diagnostics block Closes EWC-401 * feat(npm-scripts): allow to use only one image on catalog item creation (#415) Closes EWC-399 * fix(transactions): fix transaction validation if last method's arg is undefined (#414) Closes EWC-400 * feat(npm-scripts): init db automatically after installation (#413) Closes EWC-368 * fix(code): delete routes on microservice deletion Closes EWC-362 * Update CHANGELOG.md * Release of version 1.0.27 * test(core) unit tests for user-controller (EWC-382) * docs(core) Remove swagger.yml, remove CLI docs in README, add PULL_REQUEST_TEMPLATE.md (#422) * remove swagger.yml - its content moved to https://github.com/ioFog/iofog.org/blob/master/content/docs/1.0.0/controllers/rest-api.md * Add PULL_REQUEST_TEMPLATE.md * remove docs from README, instead use https://iofog.org/ * Maksimchepelev/bugs (#421) * fix(cli): user can't update deviceScanFrequency via cli deviceScanFrequency -> deviceFrequency in build cli data object Closes EWC-350 * fix(catalog): forbid to create system microservices Closes EWC-409 * fix(cli): forbid to delete connector when it used Closes EWC-364 * fix(connector): add certificates on close port request Closes EWC-411 EWC-406 * fix(cli): fix messages on incorrect requests Closes EWC-403 * fix(catalog): add validation in catalog service registryId validation empty update object validation Closes EWC-417 * changed connector error message variable * test(core) unit tests for microservices & registry controllers (EWC-382) (#423) * add build stage for release branch * Pre-release 1.0.28 (#429) * fix(bug) fixed system microservices (HAL, bluetooth) launch (EWC-413) (#424) * fix(bug) added registry email validation (EWC-418) * test(core) unit tests for iofog-controller (EWC-382) (#426) * test(core) unit tests for flow & diagnostics controllers, updated postman collection & refactored diagnostics (EWC-382) (#427) * bug(fix) CLI diagnostics: Incorrect error message is displayed when user try to get strace-info (#428) * Release 1.0.28 [skip ci] * Release 1.1.0 [skip ci] * Update package.json * Update CHANGELOG.md * Update package.json * Update package.json * remove automated release * bug(fix) strace feature bug (EWC-421) * bug(fix) fixed deprecation warnings (EWC-422) (#438) * bug(fix) CLI diagnostics ftp: invalid microservice uuid * bug(fix) CLI diagnostics ftp: invalid microservice id (update) (#440) * bug(fix) CLI diagnostics ftp: invalid microservice id (update) * bug(fix): update id to uuid * bug(fix) iofog agent API: core network containers are returned when flow isn't active (EWC-424) * test(core) unit tests progress for agent & access-token services (EWC-383) (#442) * feat(npm-scripts): npm scripts improvements (EWC-358 EWC-430) 1. save configs during releases 2. migrate to new encryption algorithm * bug(fix): microservices are shown after deleting user, new error message * bug(fix): microservices are shown after deleting user, new error message (up test) * bug(fix): microservices are shown after deleting user, new error message (up test2) * feat(microservice): update change tracking on delete port mapping (#445) Closes EWC-441 * version 1.0.31 * 1.0.31 Release * fix(bug) fixed system microservices (HAL, bluetooth) launch (EWC-413) (#424) * fix(bug) added registry email validation (EWC-418) * test(core) unit tests for iofog-controller (EWC-382) (#426) * test(core) unit tests for flow & diagnostics controllers, updated postman collection & refactored diagnostics (EWC-382) (#427) * bug(fix) CLI diagnostics: Incorrect error message is displayed when user try to get strace-info (#428) * test(core) unit tests for catalog, controller and agent controllers (EWC-382) (#430) * bug(fix) CLI diagnostics ftp: Incorrect error message is displayed when user try to get strace-info (EWC-431) * Release (#434) * release merge (#433) * Release 1.0.28 * EWC-379 migrations between versions (#410) * Maksimchepelev/bugs (#411) * EWC-385 cli helps' outputs * EWC-395 cli `microservice port-mapping-remove` error message fix * EWC-389 cli `diagnostics strace-update` correct parsing of boolean * EWC-390 cli `diagnostics strace-...` correct validation error messages * EWC-392 cli `diagnostics strace-info` microservice validation * EWC-394 sequelize (deprecated)find -> findOne * EWC-388 validation of flowId in delete flow service * EWC-393 validation of microserviceUuid in image snapshot services * Maksimchepelev/bugs (#412) * fix(help): Fix rsa-key description in cli tunnel help need to update description for parameter -k, --rsa-key in help for tunnel from 'Tunnel RSA key' to 'Path to tunnel RSA key' Closes EWC-396 * fix(tunnel): if port range not provided in config use default values default range: 2000-10000 Closes EWC-397 * fix(tests): rename logLimit -> logSize (#416) create microservice request in Postman Collection diagnostics block Closes EWC-401 * feat(npm-scripts): allow to use only one image on catalog item creation (#415) Closes EWC-399 * fix(transactions): fix transaction validation if last method's arg is undefined (#414) Closes EWC-400 * feat(npm-scripts): init db automatically after installation (#413) Closes EWC-368 * Maksimchepelev/bugs (#417) * fix(code): delete routes on microservice deletion Closes EWC-362 * update version 1.0.27 (#418) * Merge versions (#420) * release 1.0.27 version (#419) * feat(core): add migration between versions (EWC-379) * feat(core): add cli help output (EWC-385) * fix(bug): fix cli `microservice port-mapping-remove` error message (EWC-395) * fix(bug): fix cli `diagnostics strace-update` parsing of boolean (EWC-389) * fix(bug): fix cli `diagnostics strace-...` validation error messages (EWC-390) * feat(core): add cli `diagnostics strace-info` microservice validation (EWC-392) * refactor(core): replace sequelize (deprecated)find -> findOne (EWC-394) * refactor(core): edit validation of flowId in delete flow service (EWC-388) * feat(core): add validation of microserviceUuid in image snapshot services (EWC-393) * fix(help): Fix rsa-key description in cli tunnel help need to update description for parameter -k, --rsa-key in help for tunnel from 'Tunnel RSA key' to 'Path to tunnel RSA key' Closes EWC-396 * fix(tunnel): if port range not provided in config use default values default range: 2000-10000 Closes EWC-397 * fix(tests): rename logLimit -> logSize (#416) create microservice request in Postman Collection diagnostics block Closes EWC-401 * feat(npm-scripts): allow to use only one image on catalog item creation (#415) Closes EWC-399 * fix(transactions): fix transaction validation if last method's arg is undefined (#414) Closes EWC-400 * feat(npm-scripts): init db automatically after installation (#413) Closes EWC-368 * fix(code): delete routes on microservice deletion Closes EWC-362 * Update CHANGELOG.md * Release of version 1.0.27 * test(core) unit tests for user-controller (EWC-382) * docs(core) Remove swagger.yml, remove CLI docs in README, add PULL_REQUEST_TEMPLATE.md (#422) * remove swagger.yml - its content moved to https://github.com/ioFog/iofog.org/blob/master/content/docs/1.0.0/controllers/rest-api.md * Add PULL_REQUEST_TEMPLATE.md * remove docs from README, instead use https://iofog.org/ * Maksimchepelev/bugs (#421) * fix(cli): user can't update deviceScanFrequency via cli deviceScanFrequency -> deviceFrequency in build cli data object Closes EWC-350 * fix(catalog): forbid to create system microservices Closes EWC-409 * fix(cli): forbid to delete connector when it used Closes EWC-364 * fix(connector): add certificates on close port request Closes EWC-411 EWC-406 * fix(cli): fix messages on incorrect requests Closes EWC-403 * fix(catalog): add validation in catalog service registryId validation empty update object validation Closes EWC-417 * changed connector error message variable * test(core) unit tests for microservices & registry controllers (EWC-382) (#423) * add build stage for release branch * Pre-release 1.0.28 (#429) * fix(bug) fixed system microservices (HAL, bluetooth) launch (EWC-413) (#424) * fix(bug) added registry email validation (EWC-418) * test(core) unit tests for iofog-controller (EWC-382) (#426) * test(core) unit tests for flow & diagnostics controllers, updated postman collection & refactored diagnostics (EWC-382) (#427) * bug(fix) CLI diagnostics: Incorrect error message is displayed when user try to get strace-info (#428) * Release 1.0.28 [skip ci] * Release 1.1.0 [skip ci] * Update package.json * Update CHANGELOG.md * Release (#435) * release merge (#433) * Release 1.0.28 * EWC-379 migrations between versions (#410) * Maksimchepelev/bugs (#411) * EWC-385 cli helps' outputs * EWC-395 cli `microservice port-mapping-remove` error message fix * EWC-389 cli `diagnostics strace-update` correct parsing of boolean * EWC-390 cli `diagnostics strace-...` correct validation error messages * EWC-392 cli `diagnostics strace-info` microservice validation * EWC-394 sequelize (deprecated)find -> findOne * EWC-388 validation of flowId in delete flow service * EWC-393 validation of microserviceUuid in image snapshot services * Maksimchepelev/bugs (#412) * fix(help): Fix rsa-key description in cli tunnel help need to update description for parameter -k, --rsa-key in help for tunnel from 'Tunnel RSA key' to 'Path to tunnel RSA key' Closes EWC-396 * fix(tunnel): if port range not provided in config use default values default range: 2000-10000 Closes EWC-397 * fix(tests): rename logLimit -> logSize (#416) create microservice request in Postman Collection diagnostics block Closes EWC-401 * feat(npm-scripts): allow to use only one image on catalog item creation (#415) Closes EWC-399 * fix(transactions): fix transaction validation if last method's arg is undefined (#414) Closes EWC-400 * feat(npm-scripts): init db automatically after installation (#413) Closes EWC-368 * Maksimchepelev/bugs (#417) * fix(code): delete routes on microservice deletion Closes EWC-362 * update version 1.0.27 (#418) * Merge versions (#420) * release 1.0.27 version (#419) * feat(core): add migration between versions (EWC-379) * feat(core): add cli help output (EWC-385) * fix(bug): fix cli `microservice port-mapping-remove` error message (EWC-395) * fix(bug): fix cli `diagnostics strace-update` parsing of boolean (EWC-389) * fix(bug): fix cli `diagnostics strace-...` validation error messages (EWC-390) * feat(core): add cli `diagnostics strace-info` microservice validation (EWC-392) * refactor(core): replace sequelize (deprecated)find -> findOne (EWC-394) * refactor(core): edit validation of flowId in delete flow service (EWC-388) * feat(core): add validation of microserviceUuid in image snapshot services (EWC-393) * fix(help): Fix rsa-key description in cli tunnel help need to update description for parameter -k, --rsa-key in help for tunnel from 'Tunnel RSA key' to 'Path to tunnel RSA key' Closes EWC-396 * fix(tunnel): if port range not provided in config use default values default range: 2000-10000 Closes EWC-397 * fix(tests): rename logLimit -> logSize (#416) create microservice request in Postman Collection diagnostics block Closes EWC-401 * feat(npm-scripts): allow to use only one image on catalog item creation (#415) Closes EWC-399 * fix(transactions): fix transaction validation if last method's arg is undefined (#414) Closes EWC-400 * feat(npm-scripts): init db automatically after installation (#413) Closes EWC-368 * fix(code): delete routes on microservice deletion Closes EWC-362 * Update CHANGELOG.md * Release of version 1.0.27 * test(core) unit tests for user-controller (EWC-382) * docs(core) Remove swagger.yml, remove CLI docs in README, add PULL_REQUEST_TEMPLATE.md (#422) * remove swagger.yml - its content moved to https://github.com/ioFog/iofog.org/blob/master/content/docs/1.0.0/controllers/rest-api.md * Add PULL_REQUEST_TEMPLATE.md * remove docs from README, instead use https://iofog.org/ * Maksimchepelev/bugs (#421) * fix(cli): user can't update deviceScanFrequency via cli deviceScanFrequency -> deviceFrequency in build cli data object Closes EWC-350 * fix(catalog): forbid to create system microservices Closes EWC-409 * fix(cli): forbid to delete connector when it used Closes EWC-364 * fix(connector): add certificates on close port request Closes EWC-411 EWC-406 * fix(cli): fix messages on incorrect requests Closes EWC-403 * fix(catalog): add validation in catalog service registryId validation empty update object validation Closes EWC-417 * changed connector error message variable * test(core) unit tests for microservices & registry controllers (EWC-382) (#423) * add build stage for release branch * Pre-release 1.0.28 (#429) * fix(bug) fixed system microservices (HAL, bluetooth) launch (EWC-413) (#424) * fix(bug) added registry email validation (EWC-418) * test(core) unit tests for iofog-controller (EWC-382) (#426) * test(core) unit tests for flow & diagnostics controllers, updated postman collection & refactored diagnostics (EWC-382) (#427) * bug(fix) CLI diagnostics: Incorrect error message is displayed when user try to get strace-info (#428) * Release 1.0.28 [skip ci] * Release 1.1.0 [skip ci] * Update package.json * Update CHANGELOG.md * Update package.json * Merge (#436) * fix(bug) fixed system microservices (HAL, bluetooth) launch (EWC-413) (#424) * fix(bug) added registry email validation (EWC-418) * test(core) unit tests for iofog-controller (EWC-382) (#426) * test(core) unit tests for flow & diagnostics controllers, updated postman collection & refactored diagnostics (EWC-382) (#427) * bug(fix) CLI diagnostics: Incorrect error message is displayed when user try to get strace-info (#428) * test(core) unit tests for catalog, controller and agent controllers (EWC-382) (#430) * bug(fix) CLI diagnostics ftp: Incorrect error message is displayed when user try to get strace-info (EWC-431) * Release 1.1.0 [skip ci] * Update package.json * Release 1.1.0 [skip ci] * Update package.json * remove automated release * bug(fix) strace feature bug (EWC-421) * bug(fix) fixed deprecation warnings (EWC-422) (#438) * bug(fix) CLI diagnostics ftp: invalid microservice uuid * bug(fix) CLI diagnostics ftp: invalid microservice id (update) (#440) * bug(fix) CLI diagnostics ftp: invalid microservice id (update) * bug(fix): update id to uuid * bug(fix) iofog agent API: core network containers are returned when flow isn't active (EWC-424) * test(core) unit tests progress for agent & access-token services (EWC-383) (#442) * feat(npm-scripts): npm scripts improvements (EWC-358 EWC-430) 1. save configs during releases 2. migrate to new encryption algorithm * bug(fix): microservices are shown after deleting user, new error message * bug(fix): microservices are shown after deleting user, new error message (up test) * bug(fix): microservices are shown after deleting user, new error message (up test2) * feat(microservice): update change tracking on delete port mapping (#445) Closes EWC-441 * version 1.0.31 * 1.0.31 Release (#448) * fix(bug) fixed system microservices (HAL, bluetooth) launch (EWC-413) (#424) * fix(bug) added registry email validation (EWC-418) * test(core) unit tests for iofog-controller (EWC-382) (#426) * test(core) unit tests for flow & diagnostics controllers, updated postman collection & refactored diagnostics (EWC-382) (#427) * bug(fix) CLI diagnostics: Incorrect error message is displayed when user try to get strace-info (#428) * test(core) unit tests for catalog, controller and agent controllers (EWC-382) (#430) * bug(fix) CLI diagnostics ftp: Incorrect error message is displayed when user try to get strace-info (EWC-431) * Release (#434) * release merge (#433) * Release 1.0.28 * EWC-379 migrations between versions (#410) * Maksimchepelev/bugs (#411) * EWC-385 cli helps' outputs * EWC-395 cli `microservice port-mapping-remove` error message fix * EWC-389 cli `diagnostics strace-update` correct parsing of boolean * EWC-390 cli `diagnostics strace-...` correct validation error messages * EWC-392 cli `diagnostics strace-info` microservice validation * EWC-394 sequelize (deprecated)find -> findOne * EWC-388 validation of flowId in delete flow service * EWC-393 validation of microserviceUuid in image snapshot services * Maksimchepelev/bugs (#412) * fix(help): Fix rsa-key description in cli tunnel help need to update description for parameter -k, --rsa-key in help for tunnel from 'Tunnel RSA key' to 'Path to tunnel RSA key' Closes EWC-396 * fix(tunnel): if port range not provided in config use default values default range: 2000-10000 Closes EWC-397 * fix(tests): rename logLimit -> logSize (#416) create microservice request in Postman Collection diagnostics block Closes EWC-401 * feat(npm-scripts): allow to use only one image on catalog item creation (#415) Closes EWC-399 * fix(transactions): fix transaction validation if last method's arg is undefined (#414) Closes EWC-400 * feat(npm-scripts): init db automatically after installation (#413) Closes EWC-368 * Maksimchepelev/bugs (#417) * fix(code): delete routes on microservice deletion Closes EWC-362 * update version 1.0.27 (#418) * Merge versions (#420) * release 1.0.27 version (#419) * feat(core): add migration between versions (EWC-379) * feat(core): add cli help output (EWC-385) * fix(bug): fix cli `microservice port-mapping-remove` error message (EWC-395) * fix(bug): fix cli `diagnostics strace-update` parsing of boolean (EWC-389) * fix(bug): fix cli `diagnostics strace-...` validation error messages (EWC-390) * feat(core): add cli `diagnostics strace-info` microservice validation (EWC-392) * refactor(core): replace sequelize (deprecated)find -> findOne (EWC-394) * refactor(core): edit validation of flowId in delete flow service (EWC-388) * feat(core): add validation of microserviceUuid in image snapshot services (EWC-393) * fix(help): Fix rsa-key description in cli tunnel help need to update description for parameter -k, --rsa-key in help for tunnel from 'Tunnel RSA key' to 'Path to tunnel RSA key' Closes EWC-396 * fix(tunnel): if port range not provided in config use default values default range: 2000-10000 Closes EWC-397 * fix(tests): rename logLimit -> logSize (#416) create microservice request in Postman Collection diagnostics block Closes EWC-401 * feat(npm-scripts): allow to use only one image on catalog item creation (#415) Closes EWC-399 * fix(transactions): fix transaction validation if last method's arg is undefined (#414) Closes EWC-400 * feat(npm-scripts): init db automatically after installation (#413) Closes EWC-368 * fix(code): delete routes on microservice deletion Closes EWC-362 * Update CHANGELOG.md * Release of version 1.0.27 * test(core) unit tests for user-controller (EWC-382) * docs(core) Remove swagger.yml, remove CLI docs in README, add PULL_REQUEST_TEMPLATE.md (#422) * remove swagger.yml - its content moved to https://github.com/ioFog/iofog.org/blob/master/content/docs/1.0.0/controllers/rest-api.md * Add PULL_REQUEST_TEMPLATE.md * remove docs from README, instead use https://iofog.org/ * Maksimchepelev/bugs (#421) * fix(cli): user can't update deviceScanFrequency via cli deviceScanFrequency -> deviceFrequency in build cli data object Closes EWC-350 * fix(catalog): forbid to create system microservices Closes EWC-409 * fix(cli): forbid to delete connector when it used Closes EWC-364 * fix(connector): add certificates on close port request Closes EWC-411 EWC-406 * fix(cli): fix messages on incorrect requests Closes EWC-403 * fix(catalog): add validation in catalog service registryId validation empty update object validation Closes EWC-417 * changed connector error message variable * test(core) unit tests for microservices & registry controllers (EWC-382) (#423) * add build stage for release branch * Pre-release 1.0.28 (#429) * fix(bug) fixed system microservices (HAL, bluetooth) launch (EWC-413) (#424) * fix(bug) added registry email validation (EWC-418) * test(core) unit tests for iofog-controller (EWC-382) (#426) * test(core) unit tests for flow & diagnostics controllers, updated postman collection & refactored diagnostics (EWC-382) (#427) * bug(fix) CLI diagnostics: Incorrect error message is displayed when user try to get strace-info (#428) * Release 1.0.28 [skip ci] * Release 1.1.0 [skip ci] * Update package.json * Update CHANGELOG.md * Release (#435) * release merge (#433) * Release 1.0.28 * EWC-379 migrations between versions (#410) * Maksimchepelev/bugs (#411) * EWC-385 cli helps' outputs * EWC-395 cli `microservice port-mapping-remove` error message fix * EWC-389 cli `diagnostics strace-update` correct parsing of boolean * EWC-390 cli `diagnostics strace-...` correct validation error messages * EWC-392 cli `diagnostics strace-info` microservice validation * EWC-394 sequelize (deprecated)find -> findOne * EWC-388 validation of flowId in delete flow service * EWC-393 validation of microserviceUuid in image snapshot services * Maksimchepelev/bugs (#412) * fix(help): Fix rsa-key description in cli tunnel help need to update description for parameter -k, --rsa-key in help for tunnel from 'Tunnel RSA key' to 'Path to tunnel RSA key' Closes EWC-396 * fix(tunnel): if port range not provided in config use default values default range: 2000-10000 Closes EWC-397 * fix(tests): rename logLimit -> logSize (#416) create microservice request in Postman Collection diagnostics block Closes EWC-401 * feat(npm-scripts): allow to use only one image on catalog item creation (#415) Closes EWC-399 * fix(transactions): fix transaction validation if last method's arg is undefined (#414) Closes EWC-400 * feat(npm-scripts): init db automatically after installation (#413) Closes EWC-368 * Maksimchepelev/bugs (#417) * fix(code): delete routes on microservice deletion Closes EWC-362 * update version 1.0.27 (#418) * Merge versions (#420) * release 1.0.27 version (#419) * feat(core): add migration between versions (EWC-379) * feat(core): add cli help output (EWC-385) * fix(bug): fix cli `microservice port-mapping-remove` error message (EWC-395) * fix(bug): fix cli `diagnostics strace-update` parsing of boolean (EWC-389) * fix(bug): fix cli `diagnostics strace-...` validation error messages (EWC-390) * feat(core): add cli `diagnostics strace-info` microservice validation (EWC-392) * refactor(core): replace sequelize (deprecated)find -> findOne (EWC-394) * refactor(core): edit validation of flowId in delete flow service (EWC-388) * feat(core): add validation of microserviceUuid in image snapshot services (EWC-393) * fix(help): Fix rsa-key description in cli tunnel help need to update description for parameter -k, --rsa-key in help for tunnel from 'Tunnel RSA key' to 'Path to tunnel RSA key' Closes EWC-396 * fix(tunnel): if port range not provided in config use default values default range: 2000-10000 Closes EWC-397 * fix(tests): rename logLimit -> logSize (#416) create microservice request in Postman Collection diagnostics block Closes EWC-401 * feat(npm-scripts): allow to use only one image on catalog item creation (#415) Closes EWC-399 * fix(transactions): fix transaction validation if last method's arg is undefined (#414) Closes EWC-400 * feat(npm-scripts): init db automatically after installation (#413) Closes EWC-368 * fix(code): delete routes on microservice deletion Closes EWC-362 * Update CHANGELOG.md * Release of version 1.0.27 * test(core) unit tests for user-controller (EWC-382) * docs(core) Remove swagger.yml, remove CLI docs in README, add PULL_REQUEST_TEMPLATE.md (#422) * remove swagger.yml - its content moved to https://github.com/ioFog/iofog.org/blob/master/content/docs/1.0.0/controllers/rest-api.md * Add PULL_REQUEST_TEMPLATE.md * remove docs from README, instead use https://iofog.org/ * Maksimchepelev/bugs (#421) * fix(cli): user can't update deviceScanFrequency via cli deviceScanFrequency -> deviceFrequency in build cli data object Closes EWC-350 * fix(catalog): forbid to create system microservices Closes EWC-409 * fix(cli): forbid to delete connector when it used Closes EWC-364 * fix(connector): add certificates on close port request Closes EWC-411 EWC-406 * fix(cli): fix messages on incorrect requests Closes EWC-403 * fix(catalog): add validation in catalog service registryId validation empty update object validation Closes EWC-417 * changed connector error message variable * test(core) unit tests for microservices & registry controllers (EWC-382) (#423) * add build stage for release branch * Pre-release 1.0.28 (#429) * fix(bug) fixed system microservices (HAL, bluetooth) launch (EWC-413) (#424) * fix(bug) added registry email validation (EWC-418) * test(core) unit tests for iofog-controller (EWC-382) (#426) * test(core) unit tests for flow & diagnostics controllers, updated postman collection & refactored diagnostics (EWC-382) (#427) * bug(fix) CLI diagnostics: Incorrect error message is displayed when user try to get strace-info (#428) * Release 1.0.28 [skip ci] * Release 1.1.0 [skip ci] * Update package.json * Update CHANGELOG.md * Update package.json * Merge (#436) * fix(bug) fixed system microservices (HAL, bluetooth) launch (EWC-413) (#424) * fix(bug) added registry email validation (EWC-418) * test(core) unit tests for iofog-controller (EWC-382) (#426) * test(core) unit tests for flow & diagnostics controllers, updated postman collection & refactored diagnostics (EWC-382) (#427) * bug(fix) CLI diagnostics: Incorrect error message is displayed when user try to get strace-info (#428) * test(core) unit tests for catalog, controller and agent controllers (EWC-382) (#430) * bug(fix) CLI diagnostics ftp: Incorrect error message is displayed when user try to get strace-info (EWC-431) * Release 1.1.0 [skip ci] * Update package.json * Release 1.1.0 [skip ci] * Update package.json * remove automated release * bug(fix) strace feature bug (EWC-421) * bug(fix) fixed deprecation warnings (EWC-422) (#438) * bug(fix) CLI diagnostics ftp: invalid microservice uuid * bug(fix) CLI diagnostics ftp: invalid microservice id (update) (#440) * bug(fix) CLI diagnostics ftp: invalid microservice id (update) * bug(fix): update id to uuid * bug(fix) iofog agent API: core network containers are returned when flow isn't active (EWC-424) * test(core) unit tests progress for agent & access-token services (EWC-383) (#442) * feat(npm-scripts): npm scripts improvements (EWC-358 EWC-430) 1. save configs during releases 2. migrate to new encryption algorithm * bug(fix): microservices are shown after deleting user, new error message * bug(fix): microservices are shown after deleting user, new error message (up test) * bug(fix): microservices are shown after deleting user, new error message (up test2) * feat(microservice): update change tracking on delete port mapping (#445) Closes EWC-441 * version 1.0.31 * Release merge (#449) * fix(bug) fixed system microservices (HAL, bluetooth) launch (EWC-413) (#424) * fix(bug) added registry email validation (EWC-418) * test(core) unit tests for iofog-controller (EWC-382) (#426) * test(core) unit tests for flow & diagnostics controllers, updated postman collection & refactored diagnostics (EWC-382) (#427) * bug(fix) CLI diagnostics: Incorrect error message is displayed when user try to get strace-info (#428) * test(core) unit tests for catalog, controller and agent controllers (EWC-382) (#430) * bug(fix) CLI diagnostics ftp: Incorrect error message is displayed when user try to get strace-info (EWC-431) * Release (#434) * release merge (#433) * Release 1.0.28 * EWC-379 migrations between versions (#410) * Maksimchepelev/bugs (#411) * EWC-385 cli helps' outputs * EWC-395 cli `microservice port-mapping-remove` error message fix * EWC-389 cli `diagnostics strace-update` correct parsing of boolean * EWC-390 cli `diagnostics strace-...` correct validation error messages * EWC-392 cli `diagnostics strace-info` microservice validation * EWC-394 sequelize (deprecated)find -> findOne * EWC-388 validation of flowId in delete flow service * EWC-393 validation of microserviceUuid in image snapshot services * Maksimchepelev/bugs (#412) * fix(help): Fix rsa-key description in cli tunnel help need to update description for parameter -k, --rsa-key in help for tunnel from 'Tunnel RSA key' to 'Path to tunnel RSA key' Closes EWC-396 * fix(tunnel): if port range not provided in config use default values default range: 2000-10000 Closes EWC-397 * fix(tests): rename logLimit -> logSize (#416) create microservice request in Postman Collection diagnostics block Closes EWC-401 * feat(npm-scripts): allow to use only one image on catalog item creation (#415) Closes EWC-399 * fix(transactions): fix transaction validation if last method's arg is undefined (#414) Closes EWC-400 * feat(npm-scripts): init db automatically after installation (#413) Closes EWC-368 * Maksimchepelev/bugs (#417) * fix(code): delete routes on microservice deletion Closes EWC-362 * update version 1.0.27 (#418) * Merge versions (#420) * release 1.0.27 version (#419) * feat(core): add migration between versions (EWC-379) * feat(core): add cli help output (EWC-385) * fix(bug): fix cli `microservice port-mapping-remove` error message (EWC-395) * fix(bug): fix cli `diagnostics strace-update` parsing of boolean (EWC-389) * fix(bug): fix cli `diagnostics strace-...` validation error messages (EWC-390) * feat(core): add cli `diagnostics strace-info` microservice validation (EWC-392) * refactor(core): replace sequelize (deprecated)find -> findOne (EWC-394) * refactor(core): edit validation of flowId in delete flow service (EWC-388) * feat(core): add validation of microserviceUuid in image snapshot services (EWC-393) * fix(help): Fix rsa-key description in cli tunnel help need to update description for parameter -k, --rsa-key in help for tunnel from 'Tunnel RSA key' to 'Path to tunnel RSA key' Closes EWC-396 * fix(tunnel): if port range not provided in config use default values default range: 2000-10000 Closes EWC-397 * fix(tests): rename logLimit -> logSize (#416) create microservice request in Postman Collection diagnostics block Closes EWC-401 * feat(npm-scripts): allow to use only one image on catalog item creation (#415) Closes EWC-399 * fix(transactions): fix transaction validation if last method's arg is undefined (#414) Closes EWC-400 * feat(npm-scripts): init db automatically after installation (#413) Closes EWC-368 * fix(code): delete routes on microservice deletion Closes EWC-362 * Update CHANGELOG.md * Release of version 1.0.27 * test(core) unit tests for user-controller (EWC-382) * docs(core) Remove swagger.yml, remove CLI docs in README, add PULL_REQUEST_TEMPLATE.md (#422) * remove swagger.yml - its content moved to https://github.com/ioFog/iofog.org/blob/master/content/docs/1.0.0/controllers/rest-api.md * Add PULL_REQUEST_TEMPLATE.md * remove docs from README, instead use https://iofog.org/ * Maksimchepelev/bugs (#421) * fix(cli): user can't update deviceScanFrequency via cli deviceScanFrequency -> deviceFrequency in build cli data object Closes EWC-350 * fix(catalog): forbid to create system microservices Closes EWC-409 * fix(cli): forbid to delete connector when it used Closes EWC-364 * fix(connector): add certificates on close port request Closes EWC-411 EWC-406 * fix(cli): fix messages on incorrect requests Closes EWC-403 * fix(catalog): add validation in catalog service registryId validation empty update object validation Closes EWC-417 * changed connector error message variable * test(core) unit tests for microservices & registry controllers (EWC-382) (#423) * add build stage for release branch * Pre-release 1.0.28 (#429) * fix(bug) fixed system microservices (HAL, bluetooth) launch (EWC-413) (#424) * fix(bug) added registry email validation (EWC-418) * test(core) unit tests for iofog-controller (EWC-382) (#426) * test(core) unit tests for flow & diagnostics controllers, updated postman collection & refactored diagnostics (EWC-382) (#427) * bug(fix) CLI diagnostics: Incorrect error message is displayed when user try to get strace-info (#428) * Release 1.0.28 [skip ci] * Release 1.1.0 [skip ci] * Update package.json * Update CHANGELOG.md * Release (#435) * release merge (#433) * Release 1.0.28 * EWC-379 migrations between versions (#410) * Maksimchepelev/bugs (#411) * EWC-385 cli helps' outputs * EWC-395 cli `microservice port-mapping-remove` error message fix * EWC-389 cli `diagnostics strace-update` correct parsing of boolean * EWC-390 cli `diagnostics strace-...` correct validation error messages * EWC-392 cli `diagnostics strace-info` microservice validation * EWC-394 sequelize (deprecated)find -> findOne * EWC-388 validation of flowId in delete flow service * EWC-393 validation of microserviceUuid in image snapshot services * Maksimchepelev/bugs (#412) * fix(help): Fix rsa-key description in cli tunnel help need to update description for parameter -k, --rsa-key in help for tunnel from 'Tunnel RSA key' to 'Path to tunnel RSA key' Closes EWC-396 * fix(tunnel): if port range not provided in config use default values default range: 2000-10000 Closes EWC-397 * fix(tests): rename logLimit -> logSize (#416) create microservice request in Postman Collection diagnostics block Closes EWC-401 * feat(npm-scripts): allow to use only one image on catalog item creation (#415) Closes EWC-399 * fix(transactions): fix transaction validation if last method's arg is undefined (#414) Closes EWC-400 * feat(npm-scripts): init db automatically after installation (#413) Closes EWC-368 * Maksimchepelev/bugs (#417) * fix(code): delete routes on microservice deletion Closes EWC-362 * update version 1.0.27 (#418) * Merge versions (#420) * release 1.0.27 version (#419) * feat(core): add migration between versions (EWC-379) * feat(core): add cli help output (EWC-385) * fix(bug): fix cli `microservice port-mapping-remove` error message (EWC-395) * fix(bug): fix cli `diagnostics strace-update` parsing of boolean (EWC-389) * fix(bug): fix cli `diagnostics strace-...` validation error messages (EWC-390) * feat(core): add cli `diagnostics strace-info` microservice validation (EWC-392) * refactor(core): replace sequelize (deprecated)find -> findOne (EWC-394) * refactor(core): edit validation of flowId in delete flow service (EWC-388) * feat(core): add validation of microserviceUuid in image snapshot services (EWC-393) * fix(help): Fix rsa-key description in cli tunnel help need to update description for parameter -k, --rsa-key in help for tunnel from 'Tunnel RSA key' to 'Path to tunnel RSA key' Closes EWC-396 * fix(tunnel): if port range not provided in config use default values default range: 2000-10000 Closes EWC-397 * fix(tests): rename logLimit -> logSize (#416) create microservice request in Postman Collection diagnostics block Closes EWC-401 * feat(npm-scripts): allow to use only one image on catalog item creation (#415) Closes EWC-399 * fix(transactions): fix transaction validation if last method's arg is undefined (#414) Closes EWC-400 * feat(npm-scripts): init db automatically after installation (#413) Closes EWC-368 * fix(code): delete routes on microservice deletion Closes EWC-362 * Update CHANGELOG.md * Release of version 1.0.27 * test(core) unit tests for user-controller (EWC-382) * docs(core) Remove swagger.yml, remove CLI docs in README, add PULL_REQUEST_TEMPLATE.md (#422) * remove swagger.yml - its content moved to https://github.com/ioFog/iofog.org/blob/master/content/docs/1.0.0/controllers/rest-api.md * Add PULL_REQUEST_TEMPLATE.md * remove docs from README, instead use https://iofog.org/ * Maksimchepelev/bugs (#421) * fix(cli): user can't update deviceScanFrequency via cli deviceScanFrequency -> deviceFrequency in build cli data object Closes EWC-350 * fix(catalog): forbid to create system microservices Closes EWC-409 * fix(cli): forbid to delete connector when it used Closes EWC-364 * fix(connector): add certificates on close port request Closes EWC-411 EWC-406 * fix(cli): fix messages on incorrect requests Closes EWC-403 * fix(catalog): add validation in catalog service registryId validation empty update object validation Closes EWC-417 * changed connector error message variable * test(core) unit tests for microservices & registry controllers (EWC-382) (#423) * add build stage for release branch * Pre-release 1.0.28 (#429) * fix(bug) fixed system microservices (HAL, bluetooth) launch (EWC-413) (#424) * fix(bug) added registry email validation (EWC-418) * test(core) unit tests for iofog-controller (EWC-382) (#426) * test(core) unit tests for flow & diagnostics controllers, updated postman collection & refactored diagnostics (EWC-382) (#427) * bug(fix) CLI diagnostics: Incorrect error message is displayed when user try to get strace-info (#428) * Release 1.0.28 [skip ci] * Release 1.1.0 [skip ci] * Update package.json * Update CHANGELOG.md * Update package.json * Merge (#436) * fix(bug) fixed system microservices (HAL, bluetooth) launch (EWC-413) (#424) * fix(bug) added registry email validation (EWC-418) * test(core) unit tests for iofog-controller (EWC-382) (#426) * test(core) unit tests for flow & diagnostics controllers, updated postman collection & refactored diagnostics (EWC-382) (#427) * bug(fix) CLI diagnostics: Incorrect error message is displayed when user try to get strace-info (#428) * test(core) unit tests for catalog, controller and agent controllers (EWC-382) (#430) * bug(fix) CLI diagnostics ftp: Incorrect error message is displayed when user try to get strace-info (EWC-431) * Release 1.1.0 [skip ci] * Update package.json * Release 1.1.0 [skip ci] * Update package.json * remove automated release * bug(fix) strace feature bug (EWC-421) * bug(fix) fixed deprecation warnings (EWC-422) (#438) * bug(fix) CLI diagnostics ftp: invalid microservice uuid * bug(fix) CLI diagnostics ftp: invalid microservice id (update) (#440) * bug(fix) CLI diagnostics ftp: invalid microservice id (update) * bug(fix): update id to uuid * bug(fix) iofog agent API: core network containers are returned when flow isn't active (EWC-424) * test(core) unit tests progress for agent & access-token services (EWC-383) (#442) * feat(npm-scripts): npm scripts improvements (EWC-358 EWC-430) 1. save configs during releases 2. migrate to new encryption algorithm * bug(fix): microservices are shown after deleting user, new error message * bug(fix): microservices are shown after deleting user, new error message (up test) * bug(fix): microservices are shown after deleting user, new error message (up test2) * feat(microservice): update change tracking on delete port mapping (#445) Closes EWC-441 * version 1.0.31 * 1.0.31 Release (#448) * fix(bug) fixed system microservices (HAL, bluetooth) launch (EWC-413) (#424) * fix(bug) added registry email validation (EWC-418) * test(core) unit tests for iofog-controller (EWC-382) (#426) * test(core) unit tests for flow & diagnostics controllers, updated postman collection & refactored diagnostics (EWC-382) (#427) * bug(fix) CLI diagnostics: Incorrect error message is displayed when user try to get strace-info (#428) * test(core) unit tests for catalog, controller and agent controllers (EWC-382) (#430) * bug(fix) CLI diagnostics ftp: Incorrect error message is displayed when user try to get strace-info (EWC-431) * Release (#434) * release merge (#433) * Release 1.0.28 * EWC-379 migrations between versions (#410) * Maksimchepelev/bugs (#411) * EWC-385 cli helps' outputs * EWC-395 cli `microservice port-mapping-remove` error message fix * EWC-389 cli `diagnostics strace-update` correct parsing of boolean * EWC-390 cli `diagnostics strace-...` correct validation error messages * EWC-392 cli `diagnostics strace-info` microservice validation * EWC-394 sequelize (deprecated)find -> findOne * EWC-388 validation of flowId in delete flow service * EWC-393 validation of microserviceUuid in image snapshot services * Maksimchepelev/bugs (#412) * fix(help): Fix rsa-key description in cli tunnel help need to update description for parameter -k, --rsa-key in help for tunnel from 'Tunnel RSA key' to 'Path to tunnel RSA key' Closes EWC-396 * fix(tunnel): if port range not provided in config use default values default range: 2000-10000 Closes EWC-397 * fix(tests): rename logLimit -> logSize (#416) create microservice request in Postman Collection diagnostics block Closes EWC-401 * feat(npm-scripts): allow to use only one image on catalog item creation (#415) Closes EWC-399 * fix(transactions): fix transaction validation if last method's arg is undefined (#414) Closes EWC-400 * feat(npm-scripts): init db automatically after installation (#413) Closes EWC-368 * Maksimchepelev/bugs (#417) * fix(code): delete routes on microservice deletion Closes EWC-362 * update version 1.0.27 (#418) * Merge versions (#420) * release 1.0.27 version (#419) * feat(core): add migration between versions (EWC-379) * feat(core): add cli help output (EWC-385) * fix(bug): fix cli `microservice port-mapping-remove` error message (EWC-395) * fix(bug): fix cli `diagnostics strace-update` parsing of boolean (EWC-389) * fix(bug): fix cli `diagnostics strace-...` validation error messages (EWC-390) * feat(core): add cli `diagnostics strace-info` microservice validation (EWC-392) * refactor(core): replace sequelize (deprecated)find -> findOne (EWC-394) * refactor(core): edit validation of flowId in delete flow service (EWC-388) * feat(core): add validation of microserviceUuid in image snapshot services (EWC-393) * fix(help): Fix rsa-key description in cli tunnel help need to update description for parameter -k, --rsa-key in help for tunnel from 'Tunnel RSA key' to 'Path to tunnel RSA key' Closes EWC-396 * fix(tunnel): if port range not provided in config use default values default range: 2000-10000 Closes EWC-397 * fix(tests): rename logLimit -> logSize (#416) create microservice request in Postman Collection diagnostics block Closes EWC-401 * feat(npm-scripts): allow to use only one image on catalog item creation (#415) Closes EWC-399 * fix(transactions): fix transaction validation if last method's arg is undefined (#414) Closes EWC-400 * feat(npm-scripts): init db automatically after installation (#413) Closes EWC-368 * fix(code): delete routes on microservice deletion Closes EWC-362 * Update CHANGELOG.md * Release of version 1.0.27 * test(core) unit tests for user-controller (EWC-382) * docs(core) Remove swagger.yml, remove CLI docs in README, add PULL_REQUEST_TEMPLATE.md (#422) * remove swagger.yml - its content moved to https://github.com/ioFog/iofog.org/blob/master/content/docs/1.0.0/controllers/rest-api.md * Add PULL_REQUEST_TEMPLATE.md * remove docs from README, instead use https://iofog.org/ * Maksimchepelev/bugs (#421) * fix(cli): user can't update deviceScanFrequency via cli deviceScanFrequency -> deviceFrequency in build cli data object Closes EWC-350 * fix(catalog): forbid to create system microservices Closes EWC-409 * fix(cli): forbid to delete connector when it used Closes EWC-364 * fix(connector): add certificates on close port request Closes EWC-411 EWC-406 * fix(cli): fix messages on incorrect requests Closes EWC-403 * fix(catalog): add validation in catalog service registryId validation empty update object validation Closes EWC-417 * changed connector error message variable * test(core) unit tests for microservices & registry controllers (EWC-382) (#423) * add build stage for release branch * Pre-release 1.0.28 (#429) * fix(bug) fixed system microservices (HAL, bluetooth) launch (EWC-413) (#424) * fix(bug) added registry email validation (EWC-418) * test(core) unit tests for iofog-controller (EWC-382) (#426) * test(core) unit tests for flow & diagnostics controllers, updated postman collection & refactored diagnostics (EWC-382) (#427) * bug(fix) CLI diagnostics: Incorrect error message is displayed when user try to get strace-info (#428) * Release 1.0.28 [skip ci] * Release 1.1.0 [skip ci] * Update package.json * Update CHANGELOG.md * Release (#435) * release merge (#433) * Release 1.0.28 * EWC-379 migrations between versions (#410) * Maksimchepelev/bugs (#411) * EWC-385 cli helps' outputs * EWC-395 cli `microservice port-mapping-remove` error message fix * EWC-389 cli `diagnostics strace-update` correct parsing of boolean * EWC-390 cli `diagnostics strace-...` correct validation error messages * EWC-392 cli `diagnostics strace-info` microservice validation * EWC-394 sequelize (deprecated)find -> findOne * EWC-388 validation of flowId in delete flow service * EWC-393 validation of microserviceUuid in image snapshot services * Maksimchepelev/bugs (#412) * fix(help): Fix rsa-key description in cli tunnel help need to update description for parameter -k, --rsa-key in help for tunnel from 'Tunnel RSA key' to 'Path to tunnel RSA key' Closes EWC-396 * fix(tunnel): if port range not provided in config use default values default range: 2000-10000 Closes EWC-397 * fix(tests): rename logLimit -> logSize (#416) create microservice request in Postman Collection diagnostics block Closes EWC-401 * feat(npm-scripts): allow to use only one image on catalog item creation (#415) Closes EWC-399 * fix(transactions): fix transaction validation if last method's arg is undefined (#414) Closes EWC-400 * feat(npm-scripts): init db automatically after installation (#413) Closes EWC-368 * Maksimchepelev/bugs (#417) * fix(code): delete routes on microservice deletion Closes EWC-362 * update version 1.0.27 (#418) * Merge versions (#420) * release 1.0.27 version (#419) * feat(core): add migration between versions (EWC-379) * feat(core): add cli help output (EWC-385) * fix(bug): fix cli `microservice port-mapping-remove` error message (EWC-395) * fix(bug): fix cli `diagnostics strace-update` parsing of boolean (EWC-389) * fix(bug): fix cli `diagnostics strace-...` validation error messages (EWC-390) * feat(core): add cli `diagnostics strace-info` microservice validation (EWC-392) * refactor(core): replace sequelize (deprecated)find -> findOne (EWC-394) * refactor(core): edit validation of flowId in delete flow service (EWC-388) * feat(core): add validation of microserviceUuid in image snapshot services (EWC-393) * fix(help): Fix rsa-key description in cli tunnel help need to update description for parameter -k, --rsa-key in help for tunnel from 'Tunnel RSA key' to 'Path to tunnel RSA key' Closes EWC-396 * fix(tunnel): if port range not provided in config use default values default range: 2000-10000 Closes EWC-397 * fix(tests): rename logLimit -> logSize (#416) create microservice request in Postman Collection diagnostics block Closes EWC-401 * feat(npm-scripts): allow to use only one image on catalog item creation (#415) Closes EWC-399 * fix(transactions): fix transaction validation if last method's arg is undefined (#414) Closes EWC-400 * feat(npm-scripts): init db automatically after installation (#413) Closes EWC-368 * fix(code): delete routes on microservice deletion Closes EWC-362 * Update CHANGELOG.md * Release of version 1.0.27 * test(core) unit tests for user-controller (EWC-382) * docs(core) Remove swagger.yml, remove CLI docs in README, add PULL_REQUEST_TEMPLATE.md (#422) * remove swagger.yml - its content moved to https://github.com/ioFog/iofog.org/blob/master/content/docs/1.0.0/controllers/rest-api.md * Add PULL_REQUEST_TEMPLATE.md * remove docs from README, instead use https://iofog.org/ * Maksimchepelev/bugs (#421) * fix(cli): user can't update deviceScanFrequency via cli deviceScanFrequency -> deviceFrequency in build cli data object Closes EWC-350 * fix(catalog): forbid to create system microservices Closes EWC-409 * fix(cli): forbid to delete connector when it used Closes EWC-364 * fix(connector): add certificates on close port request Closes EWC-411 EWC-406 * fix(cli): fix messages on incorrect requests Closes EWC-403 * fix(catalog): add validation in catalog service registryId validation empty update object validation Closes EWC-417 * changed connector error message variable * test(core) unit tests for microservices & registry controllers (EWC-382) (#423) * add build stage for release branch * Pre-release 1.0.28 (#429) * fix(bug) fixed system microservices (HAL, bluetooth) launch (EWC-413) (#424) * fix(bug) added registry email validation (EWC-418) * test(core) unit tests for iofog-controller (EWC-382) (#426) * test(core) unit tests for flow & diagnostics controllers, updated postman collection & refactored diagnostics (EWC-382) (#427) * bug(fix) CLI diagnostics: Incorrect error message is displayed when user try to get strace-info (#428) * Release 1.0.28 [skip ci] * Release 1.1.0 [skip ci] * Update package.json * Update CHANGELOG.md * Update package.json * Merge (#436) * fix(bug) fixed system microservices (HAL, bluetooth) launch (EWC-413) (#424) * fix(bug) added registry email validation (EWC-418) * test(core) unit tests for iofog-controller (EWC-382) (#426) * test(core) unit tests for flow & diagnostics controllers, updated postman collection & refactored diagnostics (EWC-382) (#427) * bug(fix) CLI diagnostics: Incorrect error message is displayed when user try to get strace-info (#428) * test(core) unit tests for catalog, controller and agent controllers (EWC-382) (#430) * bug(fix) CLI diagnostics ftp: Incorrect error message is displayed when user try to get strace-info (EWC-431) * Release 1.1.0 [skip ci] * Update package.json * Release 1.1.0 [skip ci] * Update package.json * remove automated release * bug(fix) strace feature bug (EWC-421) * bug(fix) fixed deprecation warnings (EWC-422) (#438) * bug(fix) CLI diagnostics ftp: invalid microservice uuid * bug(fix) CLI diagnostics ftp: invalid microservice id (update) (#440) * bug(fix) CLI diagnostics ftp: invalid microservice id (update) * bug(fix): update id to uuid * bug(fix) iofog agent API: core network containers are returned when flow isn't active (EWC-424) * test(core) unit tests progress for agent & access-token services (EWC-383) (#442) * feat(npm-scripts): npm scripts improvements (EWC-358 EWC-430) 1. save configs during releases 2. migrate to new encryption algorithm * bug(fix): microservices are shown after deleting user, new error message * bug(fix): microservices are shown after deleting user, new error message (up test) * bug(fix): microservices are shown after deleting user, new error message (up test2) * feat(microservice): update change tracking on delete port mapping (#445) Closes EWC-441 * version 1.0.31 * Epankou/bug network containers not removed ewc 424 (#450) * EWC-418 added registry email validation * EWC-421 strace feature bug * EWC-421 strace feature bug fix * bug(fix) iofog agent API: core network containers are returned when flow isn't active (EWC-424) * bug(fix) microservice removal: port mapping removal (EWC-424) * bug(fix) microservice removal: switched to const (EWC-424) * test(core) unit tests for agent service progress (EWC-383) (#452) * fix(cli): fix bug with generating access token for user in cli (#453) Closes EWC-443 * fix(cli): fix bug with generating access token for user in cli (EWC-453) * test(core) unit tests for agent-service (EWC-383) (#455) * bug(fix) fixed deprecated warning about Buffer constructor (EWC-422) * test(core) unit tests for catalog service (EWC-383) (#458) * Maksimchepelev/bugs (#457) * fix(cli): fix validation on delete connector Closes EWC-447 * fix(cli): fix data types and descriptions in help '... settings JSON file' -> 'Path to ... settings JSON file' flowId and catalogId type 'string' -> 'number' in help Closes EWC-445 EWC-446 * Maksimchepelev/bugs (#459) * fix(iofog): add validation for version command compare version command with isReadyToUpgrade and isReadyToRollback fields Closes EWC-448 * fix(code): fix logger is not defined error in app-helper Closes EWC-397 * test(core) unit tests for change-tracking service (EWC-383) (#460) * version 1.0.32 (#461) * Release 1.0.32 (#462) * fix(bug) fixed system microservices (HAL, bluetooth) launch (EWC-413) (#424) * fix(bug) added registry email validation (EWC-418) * test(core) unit tests for iofog-controller (EWC-382) (#426) * test(core) unit tests for flow & diagnostics controllers, updated postman collection & refactored diagnostics (EWC-382) (#427) * bug(fix) CLI diagnostics: Incorrect error message is displayed when user try to get strace-info (#428) * test(core) unit tests for catalog, controller and agent controllers (EWC-382) (#430) * bug(fix) CLI diagnostics ftp: Incorrect error message is displayed when user try to get strace-info (EWC-431) * Update package.json * remove automated release * bug(fix) strace feature bug (EWC-421) * bug(fix) fixed deprecation warnings (EWC-422) (#438) * bug(fix) CLI diagnostics ftp: invalid microservice uuid * bug(fix) CLI diagnostics ftp: invalid microservice id (update) (#440) * bug(fix) CLI diagnostics ftp: invalid microservice id (update) * bug(fix): update id to uuid * bug(fix) iofog agent API: core network containers are returned when flow isn't active (EWC-424) * test(core) unit tests progress for agent & access-token services (EWC-383) (#442) * feat(npm-scripts): npm scripts improvements (EWC-358 EWC-430) 1. save configs during releases 2. migrate to new encryption algorithm * bug(fix): microservices are shown after deleting user, new error message * bug(fix): microservices are shown after deleting user, new error message (up test) * bug(fix): microservices are shown after deleting user, new error message (up test2) * feat(microservice): update change tracking on delete port mapping (#445) Closes EWC-441 * version 1.0.31 * 1.0.31 Release (#448) * fix(bug) fixed system microservices (HAL, bluetooth) launch (EWC-413) (#424) * fix(bug) added registry email validation (EWC-418) * test(core) unit tests for iofog-controller (EWC-382) (#426) * test(core) unit tests for flow & diagnostics controllers, updated postman collection & refactored diagnostics (EWC-382) (#427) * bug(fix) CLI diagnostics: Incorrect error message is displayed when user try to get strace-info (#428) * test(core) unit tests for catalog, controller and agent controllers (EWC-382) (#430) * bug(fix) CLI diagnostics ftp: Incorrect error message is displayed when user try to get strace-info (EWC-431) * Release (#434) * release merge (#433) * Release 1.0.28 * EWC-379 migrations between versions (#410) * Maksimchepelev/bugs (#411) * EWC-385 cli helps' outputs * EWC-395 cli `microservice port-mapping-remove` error message fix * EWC-389 cli `diagnostics strace-update` correct parsing of boolean * EWC-390 cli `diagnostics strace-...` correct validation error messages * EWC-392 cli `diagnostics strace-info` microservice validation * EWC-394 sequelize (deprecated)find -> findOne * EWC-388 validation of flowId in delete flow service * EWC-393 validation of microserviceUuid in image snapshot services * Maksimchepelev/bugs (#412) * fix(help): Fix rsa-key description in cli tunnel help need to update description for parameter -k, --rsa-key in help for tunnel from 'Tunnel RSA key' to 'Path to tunnel RSA key' Closes EWC-396 * fix(tunnel): if port range not provided in config use default values default range: 2000-10000 Closes EWC-397 * fix(tests): rename logLimit -> logSize (#416) create microservice request in Postman Collection diagnostics block Closes EWC-401 * feat(npm-scripts): allow to use only one image on catalog item creation (#415) Closes EWC-399 * fix(transactions): fix transaction validation if last method's arg is undefined (#414) Closes EWC-400 * feat(npm-scripts): init db automatically after installation (#413) Closes EWC-368 * Maksimchepelev/bugs (#417) * fix(code): delete routes on microservice deletion Closes EWC-362 * update version 1.0.27 (#418) * Merge versions (#420) * release 1.0.27 version (#419) * feat(core): add migration between versions (EWC-379) * feat(core): add cli help output (EWC-385) * fix(bug): fix cli `microservice port-mapping-remove` error message (EWC-395) * fix(bug): fix cli `diagnostics strace-update` parsing of boolean (EWC-389) * fix(bug): fix cli `diagnostics strace-...` validation error messages (EWC-390) * feat(core): add cli `diagnostics strace-info` microservice validation (EWC-392) * refactor(core): replace sequelize (deprecated)find -> findOne (EWC-394) * refactor(core): edit validation of flowId in delete flow service (EWC-388) * feat(core): add validation of microserviceUuid in image snapshot services (EWC-393) * fix(help): Fix rsa-key description in cli tunnel help need to update description for parameter -k, --rsa-key in help for tunnel from 'Tunnel RSA key' to 'Path to tunnel RSA key' Closes EWC-396 * fix(tunnel): if port range not provided in config use default values default range: 2000-10000 Closes EWC-397 * fix(tests): rename logLimit -> logSize (#416) create microservice request in Postman Collection diagnostics block Closes EWC-401 * feat(npm-scripts): allow to use only one image on catalog item creation (#415) Closes EWC-399 * fix(transactions): fix transaction validation if last method's arg is undefined (#414) Closes EWC-400 * feat(npm-scripts): init db automatically after installation (#413) Closes EWC-368 * fix(code): delete routes on microservice deletion Closes EWC-362 * Update CHANGELOG.md * Release of version 1.0.27 * test(core) unit tests for user-controller (EWC-382) * docs(core) Remove swagger.yml, remove CLI docs in README, add PULL_REQUEST_TEMPLATE.md (#422) * remove swagger.yml - its content moved to https://github.com/ioFog/iofog.org/blob/master/content/docs/1.0.0/controllers/rest-api.md * Add PULL_REQUEST_TEMPLATE.md * remove docs from README, instead use https://iofog.org/ * Maksimchepelev/bugs (#421) * fix(cli): user can't update deviceScanFrequency via cli deviceScanFrequency -> deviceFrequency in build cli data object Closes EWC-350 * fix(catalog): forbid to create system microservices Closes EWC-409 * fix(cli): forbid to delete connector when it used Closes EWC-364 * fix(connector): add certificates on close port request Closes EWC-411 EWC-406 * fix(cli): fix messages on incorrect requests Closes EWC-403 * fix(catalog): add validation in catalog service registryId validation empty update object validation Closes EWC-417 * changed connector error message variable * test(core) unit tests for microservices & registry controllers (EWC-382) (#423) * add build stage for release branch * Pre-release 1.0.28 (#429) * fix(bug) fixed system microservices (HAL, bluetooth) launch (EWC-413) (#424) * fix(bug) added registry email validation (EWC-418) * test(core) unit tests for iofog-controller (EWC-382) (#426) * test(core) unit tests for flow & diagnostics controllers, updated postman collection & refactored diagnostics (EWC-382) (#427) * bug(fix) CLI diagnostics: Incorrect error message is displayed when user try to get strace-info (#428) * Release 1.0.28 [skip ci] *…
1 parent 36a65cd commit 0056201

30 files changed

+6980
-809
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "iofogcontroller",
3-
"version": "1.0.32",
3+
"version": "1.0.33",
44
"description": "ioFog Controller project for Eclipse IoFog @ iofog.org \\nCopyright (c) 2018 Edgeworx, Inc.",
55
"main": "./src/main.js",
66
"author": "Saeid Baghbidi",

src/cli/iofog.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ async function _deleteFog(obj, user) {
314314
}
315315

316316
async function _getFogList(obj, user) {
317-
const emptyFilters = []
317+
const emptyFilters = [];
318318
const list = await FogService.getFogList(emptyFilters, user, true);
319319
logger.info(JSON.stringify(list, null, 2));
320320
logger.info('Fog list has been gotten successfully.');
@@ -359,8 +359,11 @@ async function _getHalHardwareInfo(obj) {
359359

360360
logger.info("Parameters" + JSON.stringify(uuidObj));
361361

362-
const info = await FogService.getHalHardwareInfo(uuidObj, {}, true);
363-
logger.info(JSON.stringify(info, null, 2));
362+
const data = await FogService.getHalHardwareInfo(uuidObj, {}, true);
363+
if (data.info) {
364+
data.info = JSON.parse(data.info);
365+
}
366+
logger.info(JSON.stringify(data, null, 2));
364367
logger.info('Hardware info has been retrieved successfully.')
365368
}
366369

@@ -371,8 +374,11 @@ async function _getHalUsbInfo(obj) {
371374

372375
logger.info("Parameters" + JSON.stringify(uuidObj));
373376

374-
const info = await FogService.getHalHardwareInfo(uuidObj, {}, true);
375-
logger.info(JSON.stringify(info, null, 2));
377+
const data = await FogService.getHalUsbInfo(uuidObj, {}, true);
378+
if (data.info) {
379+
data.info = JSON.parse(data.info);
380+
}
381+
logger.info(JSON.stringify(data, null, 2));
376382
logger.info('Usb info has been retrieved successfully.')
377383
}
378384

src/cli/microservice.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ const _createMicroservice = async function (obj, user) {
421421

422422
logger.info(JSON.stringify(microservice));
423423

424-
const result = await MicroserviceService.createMicroserviceOnFog(microservice, user, true);
424+
const result = await MicroserviceService.createMicroservice(microservice, user, true);
425425
logger.info(JSON.stringify(result));
426426
logger.info('Microservice has been created successfully.');
427427
};

src/config/development.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,4 @@
2929
"Diagnostics": {
3030
"DiagnosticDir": "diagnostic"
3131
}
32-
}
33-
32+
}

src/controllers/microservices-controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const createMicroserviceOnFogEndPoint = async function (req, user) {
2020

2121
logger.info("Parameters:" + JSON.stringify(microservice));
2222

23-
return await MicroservicesService.createMicroserviceOnFog(microservice, user, false)
23+
return await MicroservicesService.createMicroservice(microservice, user, false)
2424
};
2525

2626
const getMicroserviceEndPoint = async function (req, user) {

src/helpers/app-helper.js

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,7 @@ const findAvailablePort = async function (hostname) {
7878
}
7979
let portBounds = portRange.split("-").map(i => parseInt(i));
8080
return await portscanner.findAPortNotInUse(portBounds[0], portBounds[1], hostname);
81-
}
82-
83-
/**
84-
* @desc generates a random String of the size specified by the input param
85-
* @param Integer - size
86-
* @return String - returns random string
87-
*/
81+
};
8882

8983
function isFileExists(filePath) {
9084
if (path.extname(filePath).indexOf(".") >= 0) {
@@ -109,7 +103,7 @@ function isValidDomain(domain) {
109103
}
110104

111105
const isValidPublicIP = function (publicIP) {
112-
let re = /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$|^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$|^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/;
106+
const re = /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$|^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$|^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/;
113107
return re.test(publicIP);
114108
};
115109

@@ -142,7 +136,7 @@ function deleteUndefinedFields(obj) {
142136
} else if (obj[fld] instanceof Object) {
143137
obj[fld] = deleteUndefinedFields(obj[fld])
144138
}
145-
})
139+
});
146140

147141
return obj
148142
}
@@ -191,11 +185,11 @@ function trimCertificate(cert) {
191185
function validateParameters(command, commandDefinitions, args) {
192186
// 1st argument = command
193187
args.shift();
194-
188+
195189
const possibleAliasesList = _getPossibleAliasesList(command, commandDefinitions);
196190
const possibleArgsList = _getPossibleArgsList(command, commandDefinitions);
197191

198-
for (let arg of args) {
192+
for (const arg of args) {
199193
// arg is [argument, alias, value]
200194

201195
if (arg.startsWith("--")) { // argument
@@ -272,14 +266,13 @@ function isTest() {
272266
}
273267

274268
function isEmpty(obj) {
275-
for(let key in obj) {
276-
if(obj.hasOwnProperty(key))
269+
for (const key in obj) {
270+
if (obj.hasOwnProperty(key))
277271
return false;
278272
}
279273
return true;
280274
}
281275

282-
283276
module.exports = {
284277
encryptText,
285278
decryptText,

src/helpers/error-messages.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,6 @@ module.exports = {
7373
INVALID_ROUTE: 'Route parsing error. Please provide valid route.'
7474
},
7575
CONNECTOR_IS_IN_USE: 'You can\'t delete connector, because it is used for routing now.',
76-
INVALID_VERSION_COMMAND: 'Can\'t {} version now.'
76+
INVALID_VERSION_COMMAND_UPGRADE: 'Can\'t upgrade version now. Latest is already installed',
77+
INVALID_VERSION_COMMAND_ROLLBACK: 'Can\'t rollback version now. There are no backups on agent'
7778
};

src/sequelize/managers/microservice-public-mode-manager.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,28 @@
1313

1414
const BaseManager = require('../managers/base-manager')
1515
const models = require('./../models');
16-
const MicroservicePublicMode = models.MicroservicePublicMode
16+
const MicroservicePublicMode = models.MicroservicePublicMode;
17+
const ConnectorPort = models.ConnectorPort;
1718

1819
class MicroservicePublicModeManager extends BaseManager {
1920
getEntity() {
2021
return MicroservicePublicMode
2122
}
23+
24+
findAllMicroservicePublicModesByConnectorId(connectorId, transaction) {
25+
return MicroservicePublicMode.findAll({
26+
include: [
27+
{
28+
model: ConnectorPort,
29+
as: 'connectorPort',
30+
required: true
31+
}
32+
],
33+
where: {
34+
'$connectorPort.connector_id$': connectorId
35+
}
36+
}, {transaction: transaction})
37+
}
2238
}
2339

2440
const instance = new MicroservicePublicModeManager()

src/sequelize/managers/routing-manager.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,27 @@
1414
const BaseManager = require('./base-manager');
1515
const models = require('./../models');
1616
const Routing = models.Routing;
17+
const ConnectorPort = models.ConnectorPort;
1718

1819
class RoutingManager extends BaseManager {
1920
getEntity() {
2021
return Routing;
2122
}
23+
24+
findAllRoutesByConnectorId(connectorId, transaction) {
25+
return Routing.findAll({
26+
include: [
27+
{
28+
model: ConnectorPort,
29+
as: 'connectorPort',
30+
required: true
31+
}
32+
],
33+
where: {
34+
'$connectorPort.connector_id$': connectorId
35+
}
36+
}, {transaction: transaction})
37+
}
2238
}
2339

2440
const instance = new RoutingManager();
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
/*
2+
* *******************************************************************************
3+
* * Copyright (c) 2018 Edgeworx, Inc.
4+
* *
5+
* * This program and the accompanying materials are made available under the
6+
* * terms of the Eclipse Public License v. 2.0 which is available at
7+
* * http://www.eclipse.org/legal/epl-2.0
8+
* *
9+
* * SPDX-License-Identifier: EPL-2.0
10+
* *******************************************************************************
11+
*
12+
*/
13+
14+
const ConnectorManager = require('../sequelize/managers/connector-manager');
15+
const https = require('https');
16+
const http = require('http');
17+
const constants = require('../helpers/constants');
18+
const logger = require('../logger');
19+
const qs = require('qs');
20+
const fs = require('fs');
21+
22+
async function openPortOnRandomConnector(isPublicAccess, transaction) {
23+
let isConnectorPortOpen = false;
24+
let ports = null;
25+
let connector = null;
26+
const maxAttempts = 5;
27+
for (let i = 0; i < maxAttempts; i++) {
28+
try {
29+
connector = await _getRandomConnector(transaction);
30+
ports = await _openPortsOnConnector(connector, isPublicAccess);
31+
if (ports) {
32+
isConnectorPortOpen = true;
33+
break;
34+
}
35+
} catch (e) {
36+
logger.warn(`Failed to open ports on Connector. Attempts ${i + 1}/${maxAttempts}`)
37+
}
38+
}
39+
if (!isConnectorPortOpen) {
40+
throw new Error('Not able to open port on remote Connector. Gave up after 5 attempts.')
41+
}
42+
ports.connectorId = connector.id;
43+
return {ports: ports, connector: connector}
44+
}
45+
46+
async function _openPortsOnConnector(connector, isPublicAccess) {
47+
let data = isPublicAccess
48+
? await qs.stringify({
49+
mapping: '{"type":"public","maxconnections":60,"heartbeatabsencethreshold":200000}'
50+
})
51+
: await qs.stringify({
52+
mapping: '{"type":"private","maxconnectionsport1":1, "maxconnectionsport2":1, ' +
53+
'"heartbeatabsencethresholdport1":200000, "heartbeatabsencethresholdport2":200000}'
54+
});
55+
56+
let port = connector.devMode ? constants.CONNECTOR_HTTP_PORT : constants.CONNECTOR_HTTPS_PORT;
57+
58+
let options = {
59+
host: connector.domain,
60+
port: port,
61+
path: '/api/v2/mapping/add',
62+
method: 'POST',
63+
headers: {
64+
'Content-Type': 'application/x-www-form-urlencoded',
65+
'Content-Length': Buffer.byteLength(data)
66+
}
67+
};
68+
if (!connector.devMode && connector.cert && connector.isSelfSignedCert === true) {
69+
const ca = fs.readFileSync(connector.cert);
70+
options.ca = new Buffer.from(ca);
71+
}
72+
73+
const ports = await _makeRequest(connector, options, data);
74+
return ports
75+
}
76+
77+
async function _getRandomConnector(transaction) {
78+
const connectors = await ConnectorManager.findAll({}, transaction);
79+
80+
if (connectors && connectors.length > 0) {
81+
const randomNumber = Math.round((Math.random() * (connectors.length - 1)));
82+
return connectors[randomNumber]
83+
} else {
84+
throw new Error('no connectors defined')
85+
}
86+
}
87+
88+
async function closePortOnConnector(connector, ports) {
89+
let data = qs.stringify({
90+
mappingid: ports.mappingId
91+
});
92+
console.log(data);
93+
94+
let port = connector.devMode ? constants.CONNECTOR_HTTP_PORT : constants.CONNECTOR_HTTPS_PORT;
95+
96+
let options = {
97+
host: connector.domain,
98+
port: port,
99+
path: '/api/v2/mapping/remove',
100+
method: 'POST',
101+
headers: {
102+
'Content-Type': 'application/x-www-form-urlencoded',
103+
'Content-Length': Buffer.byteLength(data)
104+
}
105+
};
106+
if (!connector.devMode && connector.cert && connector.isSelfSignedCert === true) {
107+
const ca = fs.readFileSync(connector.cert);
108+
options.ca = new Buffer.from(ca);
109+
}
110+
111+
112+
await _makeRequest(connector, options, data)
113+
}
114+
115+
async function _makeRequest(connector, options, data) {
116+
return new Promise((resolve, reject) => {
117+
let httpreq = (connector.devMode ? http : https).request(options, function (response) {
118+
console.log(response.statusCode);
119+
let output = '';
120+
response.setEncoding('utf8');
121+
122+
response.on('data', function (chunk) {
123+
output += chunk;
124+
});
125+
126+
response.on('end', function () {
127+
let responseObj = JSON.parse(output);
128+
console.log(responseObj);
129+
if (responseObj.errormessage) {
130+
return reject(new Error(responseObj.errormessage));
131+
} else {
132+
return resolve(responseObj);
133+
}
134+
});
135+
});
136+
137+
httpreq.on('error', function (err) {
138+
console.log(err);
139+
if (err instanceof Error)
140+
return reject(new Error(err.message));
141+
else
142+
return reject(new Error(JSON.stringify(err)));
143+
});
144+
145+
httpreq.write(data);
146+
httpreq.end();
147+
})
148+
}
149+
150+
module.exports = {
151+
openPortOnRandomConnector: openPortOnRandomConnector,
152+
closePortOnConnector: closePortOnConnector
153+
};

0 commit comments

Comments
 (0)