Skip to content

Commit

Permalink
Release 1.0.31 (#451)
Browse files Browse the repository at this point in the history
* 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)
  • Loading branch information
Railag authored and dbusel committed Dec 21, 2018
1 parent 27e4472 commit 207e54a
Show file tree
Hide file tree
Showing 23 changed files with 1,520 additions and 263 deletions.
20 changes: 10 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ jobs:
script:
- 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"
- stage: release
before_install:
- git clone "https://github.com/$TRAVIS_REPO_SLUG.git" "$TRAVIS_REPO_SLUG";
- cd "$TRAVIS_REPO_SLUG";
- git checkout -qf "$TRAVIS_COMMIT";
- git checkout master
before_deploy:
- git config --global user.name "${GH_USERNAME}";
- git config credential.helper "store --file=.git/credentials";
- echo "https://${GH_TOKEN}:@github.com" > .git/credentials;
- npm run automatic-release
#before_install:
#- git clone "https://github.com/$TRAVIS_REPO_SLUG.git" "$TRAVIS_REPO_SLUG";
#- cd "$TRAVIS_REPO_SLUG";
#- git checkout -qf "$TRAVIS_COMMIT";
#- git checkout master
#before_deploy:
#- git config --global user.name "${GH_USERNAME}";
#- git config credential.helper "store --file=.git/credentials";
#- echo "https://${GH_TOKEN}:@github.com" > .git/credentials;
#- npm run automatic-release
deploy:
skip_cleanup: true
provider: npm
Expand Down
8 changes: 1 addition & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@ Also see the **[release page](https://github.com/ioFog/Controller/releases)**.

<br>

## [1.0.31](https://github.com/ioFog/Controller/releases/tag/1.0.31) (2018-12-14)


<br>

## [1.1.0](https://github.com/ioFog/Controller/releases/tag/1.1.0) (2018-12-14)

## [1.0.28](https://github.com/ioFog/Controller/releases/tag/1.0.28) (2018-12-14)

<br>

Expand Down
190 changes: 150 additions & 40 deletions scripts/postinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,57 +17,49 @@ const fs = require('fs');
const semver = require('semver');
const currentVersion = require('../package').version;

const rootDir = `${__dirname}/../`;
const rootDir = `${__dirname}/..`;
let installationVariablesFileName = 'iofogcontroller_install_variables';
let installationVariablesFile;
let tempDir;

if (os.type() === 'Linux') {
tempDir = '/tmp/';
} else if (os.type() === 'Darwin') {
tempDir = '/tmp/';
} else if (os.type() === 'Windows_NT') {
tempDir = `${process.env.APPDATA}/`;
} else {
throw new Error("Unsupported OS found: " + os.type());
}

installationVariablesFile = tempDir + installationVariablesFileName;
let tempDir = getTempDirLocation();
const installationVariablesFile = tempDir + '/' + installationVariablesFileName;

const devDbBackup = `${tempDir}dev_database.sqlite`;
//restore all files
const devDbBackup = `${tempDir}/dev_database.sqlite`;
const devDb = `${rootDir}/src/sequelize/dev_database.sqlite`;
if (fs.existsSync(devDbBackup)) {
fs.renameSync(devDbBackup, devDb);
}
moveFileIfExists(devDbBackup, devDb);

const prodDbBackup = `${tempDir}prod_database.sqlite`;
const prodDbBackup = `${tempDir}/prod_database.sqlite`;
const prodDb = `${rootDir}/src/sequelize/prod_database.sqlite`;
if (fs.existsSync(prodDbBackup)) {
fs.renameSync(prodDbBackup, prodDb);
}
moveFileIfExists(prodDbBackup, prodDb);

const defConfigBackup = `${tempDir}/default_iofog_backup.json`;
const defConfig = `${rootDir}/src/config/default.json`;
moveFileIfExists(defConfigBackup, defConfig);

const prodConfigBackup = `${tempDir}/production_iofog_backup.json`;
const prodConfig = `${rootDir}/src/config/production.json`;
moveFileIfExists(prodConfigBackup, prodConfig);

const devConfigBackup = `${tempDir}/development_iofog_backup.json`;
const devConfig = `${rootDir}/src/config/development.json`;
moveFileIfExists(devConfigBackup, devConfig);

//process migrations
try {
const instalationVarsStr = fs.readFileSync(installationVariablesFile);
const instalationVars = JSON.parse(instalationVarsStr);
const prevVersion = instalationVars.prevVer;
const installationVarsStr = fs.readFileSync(installationVariablesFile);
const installationVars = JSON.parse(installationVarsStr);
const prevVersion = installationVars.prevVer;

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

if (semver.satisfies(prevVersion, '<=1.0.0')) {
console.log('upgrading from version <=1.0.0 :');
console.log(' inserting seeds meta info in db');
const options = {
env: {
"PATH": process.env.PATH
},
stdio: [process.stdin, process.stdout, process.stderr]
};

execSync(`sqlite3 ${prodDb} "insert into SequelizeMeta (name) values ('20180928110125-insert-registry.js');"`, options);
execSync(`sqlite3 ${prodDb} "insert into SequelizeMeta (name) values ('20180928111532-insert-catalog-item.js');"`, options);
execSync(`sqlite3 ${prodDb} "insert into SequelizeMeta (name) values ('20180928112152-insert-iofog-type.js');"`, options);
execSync(`sqlite3 ${prodDb} "insert into SequelizeMeta (name) values ('20180928121334-insert-catalog-item-image.js');"`, options);
console.log('upgrading from version <= 1.0.0 :');
insertSeeds();
}

if (semver.satisfies(prevVersion, '<=1.0.30')) {
console.log('upgrading from version <= 1.0.30 :');
updateEncryptionMethod();
}

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

execSync('node ./src/main.js init', options);
execSync('node ./src/main.js init', options);

//other functions definitions

function getTempDirLocation() {
let tempDir;
if (os.type() === 'Linux') {
tempDir = '/tmp';
} else if (os.type() === 'Darwin') {
tempDir = '/tmp';
} else if (os.type() === 'Windows_NT') {
tempDir = `${process.env.APPDATA}`;
} else {
throw new Error("Unsupported OS found: " + os.type());
}
return tempDir;
}

function moveFileIfExists(from, to) {
if (fs.existsSync(from)) {
fs.renameSync(from, to);
}
}

function insertSeeds() {
console.log(' inserting seeds meta info in db');
const options = {
env: {
"PATH": process.env.PATH
},
stdio: [process.stdin, process.stdout, process.stderr]
};

execSync(`sqlite3 ${prodDb} "insert into SequelizeMeta (name) values ('20180928110125-insert-registry.js');"`, options);
execSync(`sqlite3 ${prodDb} "insert into SequelizeMeta (name) values ('20180928111532-insert-catalog-item.js');"`, options);
execSync(`sqlite3 ${prodDb} "insert into SequelizeMeta (name) values ('20180928112152-insert-iofog-type.js');"`, options);
execSync(`sqlite3 ${prodDb} "insert into SequelizeMeta (name) values ('20180928121334-insert-catalog-item-image.js');"`, options);
}

function updateEncryptionMethodForUsersPassword(decryptionFunc) {
const options = {
env: {
"PATH": process.env.PATH
}
};

const usersOutput = execSync(`sqlite3 ${prodDb} "select id, email, password from Users;"`, options).toString();
const usersLines = usersOutput.match(/[^\r\n]+/g);
for (let line of usersLines) {
let id, email, oldEncryptedPassword;
try {
const vals = line.split('|');
id = vals[0];
email = vals[1];
oldEncryptedPassword = vals[2];

const decryptedPassword = decryptionFunc(oldEncryptedPassword, email);

const AppHelper = require('../src/helpers/app-helper');
const newEncryptedPassword = AppHelper.encryptText(decryptedPassword, email);

const options = {
env: {
"PATH": process.env.PATH
},
stdio: [process.stdin, process.stdout, process.stderr]
};
execSync(`sqlite3 ${prodDb} "update Users set password='${newEncryptedPassword}' where id=${id};"`, options);
} catch (e) {
console.log('db problem');
}
}
}

function updateEncryptionMethodForEmailService(configFile, decryptionFunc) {
console.log(configFile);
if (!configFile) {
return
}
const configObj = JSON.parse(fs.readFileSync(configFile, 'utf8'));
console.log(configObj);
if (!configObj || !configObj.Email || !configObj.Email.Address || !configObj.Email.Password) {
return
}

const email = configObj.Email.Address;
const oldEncryptedPassword = configObj.Email.Password;

const decryptedPassword = decryptionFunc(oldEncryptedPassword, email);

const AppHelper = require('../src/helpers/app-helper');
configObj.Email.Password = AppHelper.encryptText(decryptedPassword, email);

console.log(configObj);
try {
fs.writeFileSync(configFile, JSON.stringify(configObj, null, 2));
} catch (e) {
console.log(e)
}
}

function updateEncryptionMethod() {
console.log(' updating encryption method for old users');

function decryptTextVer30(text, salt) {
const crypto = require('crypto');
const ALGORITHM = 'aes-256-ctr';

const decipher = crypto.createDecipher(ALGORITHM, salt);
let dec = decipher.update(text, 'hex', 'utf8');
dec += decipher.final('utf8');
return dec
}

updateEncryptionMethodForUsersPassword(decryptTextVer30);
updateEncryptionMethodForEmailService(defConfig, decryptTextVer30);
updateEncryptionMethodForEmailService(devConfig, decryptTextVer30);
updateEncryptionMethodForEmailService(prodConfig, decryptTextVer30);
}
29 changes: 22 additions & 7 deletions scripts/preuninstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@ const execSync = require('child_process').execSync;
const fs = require('fs');
const version = require('../package').version;

const rootDir = `${__dirname}/../`;
const rootDir = `${__dirname}/..`;
let installationVariablesFileName = 'iofogcontroller_install_variables';
let installationVariablesFile;
let tempDir;

if (os.type() === 'Linux') {
tempDir = '/tmp/';
tempDir = '/tmp';
} else if (os.type() === 'Darwin') {
tempDir = '/tmp/';
tempDir = '/tmp';
} else if (os.type() === 'Windows_NT') {
tempDir = `${process.env.APPDATA}/`;
tempDir = `${process.env.APPDATA}`;
} else {
throw new Error("Unsupported OS found: " + os.type());
}

installationVariablesFile = tempDir + installationVariablesFileName;
installationVariablesFile = tempDir + '/' + installationVariablesFileName;

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

const devDb = `${rootDir}/src/sequelize/dev_database.sqlite`;
if (fs.existsSync(devDb)) {
fs.renameSync(devDb, `${tempDir}dev_database.sqlite`)
fs.renameSync(devDb, `${tempDir}/dev_database.sqlite`)
}

const prodDb = `${rootDir}/src/sequelize/prod_database.sqlite`;
if (fs.existsSync(prodDb)) {
fs.renameSync(prodDb, `${tempDir}prod_database.sqlite`)
fs.renameSync(prodDb, `${tempDir}/prod_database.sqlite`)
}

const defConfig = `${rootDir}/src/config/default.json`;
if (fs.existsSync(defConfig)) {
fs.renameSync(defConfig, `${tempDir}/default_iofog_backup.json`)
}

const devConfig = `${rootDir}/src/config/development.json`;
if (fs.existsSync(devConfig)) {
fs.renameSync(devConfig, `${tempDir}/development_iofog_backup.json`)
}

const prodConfig = `${rootDir}/src/config/production.json`;
if (fs.existsSync(prodConfig)) {
fs.renameSync(prodConfig, `${tempDir}/production_iofog_backup.json`)
}

5 changes: 3 additions & 2 deletions src/cli/diagnostics.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,16 @@ const _changeMicroserviceStraceState = async function (obj) {
const isEnable = AppHelper.validateBooleanCliOptions(obj.enable, obj.disable);
await DiagnosticService.changeMicroserviceStraceState(obj.microserviceUuid, {enable: isEnable}, {}, true);
const msg = isEnable ? 'Microservice strace has been enabled' : 'Microservice strace has been disabled';

logger.info(msg);
};

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

const result = await DiagnosticService.getMicroserviceStraceData(obj.microserviceUuid, {format: obj.format}, {}, true);
logger.info(JSON.stringify(result, null, 2));
logger.info('Strace data:');
logger.info('=============================');
logger.info(result.data);
logger.info('Microservice strace data has been retrieved successfully.');
};

Expand Down
11 changes: 8 additions & 3 deletions src/cli/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ class User extends BaseCLIHandler {
name: 'password', alias: 'p', type: String,
description: 'User\'s password',
group: [constants.CMD_ADD, constants.CMD_UPDATE],
},
{
name: 'force', alias: 'F', type: Boolean,
description: 'User\'s force delete',
group: [constants.CMD_REMOVE],
}
];
this.commands = {
Expand Down Expand Up @@ -136,10 +141,10 @@ const _updateUserDetails = async function (userDetails, user) {
logger.info('User updated successfully.');
};

const _deleteUser = async function (emailObj, user) {
logger.info(JSON.stringify(emailObj));
const _deleteUser = async function (obj, user) {
logger.info(JSON.stringify(obj));

await UserService.deleteUser(user, true);
await UserService.deleteUser(obj.force, user, true);
logger.info('User removed successfully.');
};

Expand Down
Loading

0 comments on commit 207e54a

Please sign in to comment.