Skip to content

Commit 207e54a

Browse files
Railagdbusel
authored andcommitted
Release 1.0.31 (#451)
* 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 * 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 * 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 * fix(cli): fix bug with generating access token for user in cli (EWC-453)
1 parent 27e4472 commit 207e54a

23 files changed

+1520
-263
lines changed

.travis.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@ jobs:
3737
script:
3838
- sshpass -p $PROD_MACHINE_PASSWORD ssh -o StrictHostKeyChecking=no $PROD_MACHINE_USERNAME@$PROD_MACHINE_IP "cd /Controller; NODE_ENV=production node src/main.js stop; git pull; npm i; NODE_ENV=production node src/main.js start"
3939
- stage: release
40-
before_install:
41-
- git clone "https://github.com/$TRAVIS_REPO_SLUG.git" "$TRAVIS_REPO_SLUG";
42-
- cd "$TRAVIS_REPO_SLUG";
43-
- git checkout -qf "$TRAVIS_COMMIT";
44-
- git checkout master
45-
before_deploy:
46-
- git config --global user.name "${GH_USERNAME}";
47-
- git config credential.helper "store --file=.git/credentials";
48-
- echo "https://${GH_TOKEN}:@github.com" > .git/credentials;
49-
- npm run automatic-release
40+
#before_install:
41+
#- git clone "https://github.com/$TRAVIS_REPO_SLUG.git" "$TRAVIS_REPO_SLUG";
42+
#- cd "$TRAVIS_REPO_SLUG";
43+
#- git checkout -qf "$TRAVIS_COMMIT";
44+
#- git checkout master
45+
#before_deploy:
46+
#- git config --global user.name "${GH_USERNAME}";
47+
#- git config credential.helper "store --file=.git/credentials";
48+
#- echo "https://${GH_TOKEN}:@github.com" > .git/credentials;
49+
#- npm run automatic-release
5050
deploy:
5151
skip_cleanup: true
5252
provider: npm

CHANGELOG.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,7 @@ Also see the **[release page](https://github.com/ioFog/Controller/releases)**.
44

55
<br>
66

7-
## [1.0.31](https://github.com/ioFog/Controller/releases/tag/1.0.31) (2018-12-14)
8-
9-
10-
<br>
11-
12-
## [1.1.0](https://github.com/ioFog/Controller/releases/tag/1.1.0) (2018-12-14)
13-
7+
## [1.0.28](https://github.com/ioFog/Controller/releases/tag/1.0.28) (2018-12-14)
148

159
<br>
1610

scripts/postinstall.js

Lines changed: 150 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -17,57 +17,49 @@ const fs = require('fs');
1717
const semver = require('semver');
1818
const currentVersion = require('../package').version;
1919

20-
const rootDir = `${__dirname}/../`;
20+
const rootDir = `${__dirname}/..`;
2121
let installationVariablesFileName = 'iofogcontroller_install_variables';
22-
let installationVariablesFile;
23-
let tempDir;
24-
25-
if (os.type() === 'Linux') {
26-
tempDir = '/tmp/';
27-
} else if (os.type() === 'Darwin') {
28-
tempDir = '/tmp/';
29-
} else if (os.type() === 'Windows_NT') {
30-
tempDir = `${process.env.APPDATA}/`;
31-
} else {
32-
throw new Error("Unsupported OS found: " + os.type());
33-
}
34-
35-
installationVariablesFile = tempDir + installationVariablesFileName;
22+
let tempDir = getTempDirLocation();
23+
const installationVariablesFile = tempDir + '/' + installationVariablesFileName;
3624

37-
const devDbBackup = `${tempDir}dev_database.sqlite`;
25+
//restore all files
26+
const devDbBackup = `${tempDir}/dev_database.sqlite`;
3827
const devDb = `${rootDir}/src/sequelize/dev_database.sqlite`;
39-
if (fs.existsSync(devDbBackup)) {
40-
fs.renameSync(devDbBackup, devDb);
41-
}
28+
moveFileIfExists(devDbBackup, devDb);
4229

43-
const prodDbBackup = `${tempDir}prod_database.sqlite`;
30+
const prodDbBackup = `${tempDir}/prod_database.sqlite`;
4431
const prodDb = `${rootDir}/src/sequelize/prod_database.sqlite`;
45-
if (fs.existsSync(prodDbBackup)) {
46-
fs.renameSync(prodDbBackup, prodDb);
47-
}
32+
moveFileIfExists(prodDbBackup, prodDb);
33+
34+
const defConfigBackup = `${tempDir}/default_iofog_backup.json`;
35+
const defConfig = `${rootDir}/src/config/default.json`;
36+
moveFileIfExists(defConfigBackup, defConfig);
4837

38+
const prodConfigBackup = `${tempDir}/production_iofog_backup.json`;
39+
const prodConfig = `${rootDir}/src/config/production.json`;
40+
moveFileIfExists(prodConfigBackup, prodConfig);
41+
42+
const devConfigBackup = `${tempDir}/development_iofog_backup.json`;
43+
const devConfig = `${rootDir}/src/config/development.json`;
44+
moveFileIfExists(devConfigBackup, devConfig);
45+
46+
//process migrations
4947
try {
50-
const instalationVarsStr = fs.readFileSync(installationVariablesFile);
51-
const instalationVars = JSON.parse(instalationVarsStr);
52-
const prevVersion = instalationVars.prevVer;
48+
const installationVarsStr = fs.readFileSync(installationVariablesFile);
49+
const installationVars = JSON.parse(installationVarsStr);
50+
const prevVersion = installationVars.prevVer;
5351

5452
console.log(`previous version - ${prevVersion}`);
5553
console.log(`new version - ${currentVersion}`);
5654

5755
if (semver.satisfies(prevVersion, '<=1.0.0')) {
58-
console.log('upgrading from version <=1.0.0 :');
59-
console.log(' inserting seeds meta info in db');
60-
const options = {
61-
env: {
62-
"PATH": process.env.PATH
63-
},
64-
stdio: [process.stdin, process.stdout, process.stderr]
65-
};
66-
67-
execSync(`sqlite3 ${prodDb} "insert into SequelizeMeta (name) values ('20180928110125-insert-registry.js');"`, options);
68-
execSync(`sqlite3 ${prodDb} "insert into SequelizeMeta (name) values ('20180928111532-insert-catalog-item.js');"`, options);
69-
execSync(`sqlite3 ${prodDb} "insert into SequelizeMeta (name) values ('20180928112152-insert-iofog-type.js');"`, options);
70-
execSync(`sqlite3 ${prodDb} "insert into SequelizeMeta (name) values ('20180928121334-insert-catalog-item-image.js');"`, options);
56+
console.log('upgrading from version <= 1.0.0 :');
57+
insertSeeds();
58+
}
59+
60+
if (semver.satisfies(prevVersion, '<=1.0.30')) {
61+
console.log('upgrading from version <= 1.0.30 :');
62+
updateEncryptionMethod();
7163
}
7264

7365
fs.unlinkSync(installationVariablesFile);
@@ -84,4 +76,122 @@ const options = {
8476
stdio: [process.stdin, process.stdout, process.stderr]
8577
};
8678

87-
execSync('node ./src/main.js init', options);
79+
execSync('node ./src/main.js init', options);
80+
81+
//other functions definitions
82+
83+
function getTempDirLocation() {
84+
let tempDir;
85+
if (os.type() === 'Linux') {
86+
tempDir = '/tmp';
87+
} else if (os.type() === 'Darwin') {
88+
tempDir = '/tmp';
89+
} else if (os.type() === 'Windows_NT') {
90+
tempDir = `${process.env.APPDATA}`;
91+
} else {
92+
throw new Error("Unsupported OS found: " + os.type());
93+
}
94+
return tempDir;
95+
}
96+
97+
function moveFileIfExists(from, to) {
98+
if (fs.existsSync(from)) {
99+
fs.renameSync(from, to);
100+
}
101+
}
102+
103+
function insertSeeds() {
104+
console.log(' inserting seeds meta info in db');
105+
const options = {
106+
env: {
107+
"PATH": process.env.PATH
108+
},
109+
stdio: [process.stdin, process.stdout, process.stderr]
110+
};
111+
112+
execSync(`sqlite3 ${prodDb} "insert into SequelizeMeta (name) values ('20180928110125-insert-registry.js');"`, options);
113+
execSync(`sqlite3 ${prodDb} "insert into SequelizeMeta (name) values ('20180928111532-insert-catalog-item.js');"`, options);
114+
execSync(`sqlite3 ${prodDb} "insert into SequelizeMeta (name) values ('20180928112152-insert-iofog-type.js');"`, options);
115+
execSync(`sqlite3 ${prodDb} "insert into SequelizeMeta (name) values ('20180928121334-insert-catalog-item-image.js');"`, options);
116+
}
117+
118+
function updateEncryptionMethodForUsersPassword(decryptionFunc) {
119+
const options = {
120+
env: {
121+
"PATH": process.env.PATH
122+
}
123+
};
124+
125+
const usersOutput = execSync(`sqlite3 ${prodDb} "select id, email, password from Users;"`, options).toString();
126+
const usersLines = usersOutput.match(/[^\r\n]+/g);
127+
for (let line of usersLines) {
128+
let id, email, oldEncryptedPassword;
129+
try {
130+
const vals = line.split('|');
131+
id = vals[0];
132+
email = vals[1];
133+
oldEncryptedPassword = vals[2];
134+
135+
const decryptedPassword = decryptionFunc(oldEncryptedPassword, email);
136+
137+
const AppHelper = require('../src/helpers/app-helper');
138+
const newEncryptedPassword = AppHelper.encryptText(decryptedPassword, email);
139+
140+
const options = {
141+
env: {
142+
"PATH": process.env.PATH
143+
},
144+
stdio: [process.stdin, process.stdout, process.stderr]
145+
};
146+
execSync(`sqlite3 ${prodDb} "update Users set password='${newEncryptedPassword}' where id=${id};"`, options);
147+
} catch (e) {
148+
console.log('db problem');
149+
}
150+
}
151+
}
152+
153+
function updateEncryptionMethodForEmailService(configFile, decryptionFunc) {
154+
console.log(configFile);
155+
if (!configFile) {
156+
return
157+
}
158+
const configObj = JSON.parse(fs.readFileSync(configFile, 'utf8'));
159+
console.log(configObj);
160+
if (!configObj || !configObj.Email || !configObj.Email.Address || !configObj.Email.Password) {
161+
return
162+
}
163+
164+
const email = configObj.Email.Address;
165+
const oldEncryptedPassword = configObj.Email.Password;
166+
167+
const decryptedPassword = decryptionFunc(oldEncryptedPassword, email);
168+
169+
const AppHelper = require('../src/helpers/app-helper');
170+
configObj.Email.Password = AppHelper.encryptText(decryptedPassword, email);
171+
172+
console.log(configObj);
173+
try {
174+
fs.writeFileSync(configFile, JSON.stringify(configObj, null, 2));
175+
} catch (e) {
176+
console.log(e)
177+
}
178+
}
179+
180+
function updateEncryptionMethod() {
181+
console.log(' updating encryption method for old users');
182+
183+
function decryptTextVer30(text, salt) {
184+
const crypto = require('crypto');
185+
const ALGORITHM = 'aes-256-ctr';
186+
187+
const decipher = crypto.createDecipher(ALGORITHM, salt);
188+
let dec = decipher.update(text, 'hex', 'utf8');
189+
dec += decipher.final('utf8');
190+
return dec
191+
}
192+
193+
updateEncryptionMethodForUsersPassword(decryptTextVer30);
194+
updateEncryptionMethodForEmailService(defConfig, decryptTextVer30);
195+
updateEncryptionMethodForEmailService(devConfig, decryptTextVer30);
196+
updateEncryptionMethodForEmailService(prodConfig, decryptTextVer30);
197+
}

scripts/preuninstall.js

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,22 @@ const execSync = require('child_process').execSync;
1616
const fs = require('fs');
1717
const version = require('../package').version;
1818

19-
const rootDir = `${__dirname}/../`;
19+
const rootDir = `${__dirname}/..`;
2020
let installationVariablesFileName = 'iofogcontroller_install_variables';
2121
let installationVariablesFile;
2222
let tempDir;
2323

2424
if (os.type() === 'Linux') {
25-
tempDir = '/tmp/';
25+
tempDir = '/tmp';
2626
} else if (os.type() === 'Darwin') {
27-
tempDir = '/tmp/';
27+
tempDir = '/tmp';
2828
} else if (os.type() === 'Windows_NT') {
29-
tempDir = `${process.env.APPDATA}/`;
29+
tempDir = `${process.env.APPDATA}`;
3030
} else {
3131
throw new Error("Unsupported OS found: " + os.type());
3232
}
3333

34-
installationVariablesFile = tempDir + installationVariablesFileName;
34+
installationVariablesFile = tempDir + '/' + installationVariablesFileName;
3535

3636
const instalationVars = {
3737
prevVer: version
@@ -41,11 +41,26 @@ fs.writeFileSync(installationVariablesFile, JSON.stringify(instalationVars));
4141

4242
const devDb = `${rootDir}/src/sequelize/dev_database.sqlite`;
4343
if (fs.existsSync(devDb)) {
44-
fs.renameSync(devDb, `${tempDir}dev_database.sqlite`)
44+
fs.renameSync(devDb, `${tempDir}/dev_database.sqlite`)
4545
}
4646

4747
const prodDb = `${rootDir}/src/sequelize/prod_database.sqlite`;
4848
if (fs.existsSync(prodDb)) {
49-
fs.renameSync(prodDb, `${tempDir}prod_database.sqlite`)
49+
fs.renameSync(prodDb, `${tempDir}/prod_database.sqlite`)
50+
}
51+
52+
const defConfig = `${rootDir}/src/config/default.json`;
53+
if (fs.existsSync(defConfig)) {
54+
fs.renameSync(defConfig, `${tempDir}/default_iofog_backup.json`)
55+
}
56+
57+
const devConfig = `${rootDir}/src/config/development.json`;
58+
if (fs.existsSync(devConfig)) {
59+
fs.renameSync(devConfig, `${tempDir}/development_iofog_backup.json`)
60+
}
61+
62+
const prodConfig = `${rootDir}/src/config/production.json`;
63+
if (fs.existsSync(prodConfig)) {
64+
fs.renameSync(prodConfig, `${tempDir}/production_iofog_backup.json`)
5065
}
5166

src/cli/diagnostics.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,16 @@ const _changeMicroserviceStraceState = async function (obj) {
131131
const isEnable = AppHelper.validateBooleanCliOptions(obj.enable, obj.disable);
132132
await DiagnosticService.changeMicroserviceStraceState(obj.microserviceUuid, {enable: isEnable}, {}, true);
133133
const msg = isEnable ? 'Microservice strace has been enabled' : 'Microservice strace has been disabled';
134-
135134
logger.info(msg);
136135
};
137136

138137
const _getMicroserviceStraceData = async function (obj) {
139138
logger.info(JSON.stringify(obj));
140139

141140
const result = await DiagnosticService.getMicroserviceStraceData(obj.microserviceUuid, {format: obj.format}, {}, true);
142-
logger.info(JSON.stringify(result, null, 2));
141+
logger.info('Strace data:');
142+
logger.info('=============================');
143+
logger.info(result.data);
143144
logger.info('Microservice strace data has been retrieved successfully.');
144145
};
145146

src/cli/user.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ class User extends BaseCLIHandler {
5151
name: 'password', alias: 'p', type: String,
5252
description: 'User\'s password',
5353
group: [constants.CMD_ADD, constants.CMD_UPDATE],
54+
},
55+
{
56+
name: 'force', alias: 'F', type: Boolean,
57+
description: 'User\'s force delete',
58+
group: [constants.CMD_REMOVE],
5459
}
5560
];
5661
this.commands = {
@@ -136,10 +141,10 @@ const _updateUserDetails = async function (userDetails, user) {
136141
logger.info('User updated successfully.');
137142
};
138143

139-
const _deleteUser = async function (emailObj, user) {
140-
logger.info(JSON.stringify(emailObj));
144+
const _deleteUser = async function (obj, user) {
145+
logger.info(JSON.stringify(obj));
141146

142-
await UserService.deleteUser(user, true);
147+
await UserService.deleteUser(obj.force, user, true);
143148
logger.info('User removed successfully.');
144149
};
145150

0 commit comments

Comments
 (0)