From f117fe15df0df16a75f36273a1a38968522f04da Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Mon, 27 Jun 2022 10:09:08 -0700 Subject: [PATCH 1/7] fix(startup): Added hooks for async startup --- README.md | 2 ++ bin/server.js | 6 ++++++ dev-docs/README.md | 10 ++++++++++ src/adapters/index.js | 7 ++++++- src/controllers/index.js | 23 +++++++++++++++++------ src/use-cases/index.js | 11 +++++++++++ test/e2e/automated/a01-auth.rest-e2e.js | 1 + test/unit/adapters/adapters-index-unit.js | 3 ++- test/unit/misc/server-unit.js | 2 ++ 9 files changed, 57 insertions(+), 8 deletions(-) create mode 100644 dev-docs/README.md diff --git a/README.md b/README.md index ddc5b71..411c69b 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,8 @@ API documentation is written inline and generated by [apidoc](http://apidocjs.co Visit `http://localhost:5000/docs/` to view docs +There is additional developer documentation in the [dev-docs directory](./dev-docs). + ## Dependencies - [koa2](https://github.com/koajs/koa/tree/v2.x) diff --git a/bin/server.js b/bin/server.js index 0d2871a..6b94b41 100644 --- a/bin/server.js +++ b/bin/server.js @@ -79,6 +79,12 @@ class Server { // Dev Note: This line must come BEFORE controllers.attachRESTControllers() app.use(cors({ origin: '*' })) + // Wait for any adapters to initialize. + await this.controllers.initAdapters() + + // Wait for any use-libraries to initialize. + await this.controllers.initUseCases() + // Attach REST API and JSON RPC controllers to the app. await this.controllers.attachRESTControllers(app) diff --git a/dev-docs/README.md b/dev-docs/README.md new file mode 100644 index 0000000..5a1bc2b --- /dev/null +++ b/dev-docs/README.md @@ -0,0 +1,10 @@ +# Developer Documentation + +This directory needs to be fleshed out with more information. The markdown files in this directory are intended to provide additional documentation for software developers that use this boilerplate to run their own forks. + +## Startup +This software requires an IPFS node in order to operate the JSON RPC and ipfs-coord features. There are two ways to incorporate an IPFS node: + +- js-ipfs is integrated into this repository. If you simply run `npm start`, then this app will default to the js-ipfs IPFS node. However, js-ipfs is not as full featured as go-ipfs. It has memory leaks and lags considerably behind go-ipfs in terms of features. + +- go-ipfs is the preferred way to run a node. It can be run externally by following the guidence on the [IPFS homepage](https://ipfs.io). Once the IPFS node is running, this app can take control of it. Use the [local-external-ipfs-node.sh](../shell-scripts/local-external-ipfs-node.sh) shell script to start this app and attach it to the go-ipfs node. diff --git a/src/adapters/index.js b/src/adapters/index.js index 92d2506..52d7960 100644 --- a/src/adapters/index.js +++ b/src/adapters/index.js @@ -46,7 +46,12 @@ class Adapters { } // Start the IPFS node. - await this.ipfs.start() + // Do not start these adapters if this is an e2e test. + if (this.config.env !== 'test') { + await this.ipfs.start() + } + + console.log('Async Adapters have been started.') return true } catch (err) { diff --git a/src/controllers/index.js b/src/controllers/index.js index ba3cc22..1708494 100644 --- a/src/controllers/index.js +++ b/src/controllers/index.js @@ -25,14 +25,14 @@ class Controllers { this.useCases = new UseCases({ adapters: this.adapters }) } - async attachControllers (app) { - // Wait for any startup processes to complete for the Adapters libraries. + // Spin up any adapter libraries that have async startup needs. + async initAdapters () { await this.adapters.start() + } - // Attach the REST controllers to the Koa app. - // this.attachRESTControllers(app) - - this.attachRPCControllers() + // Run any Use Cases to startup the app. + async initUseCases () { + await this.useCases.start() } // Top-level function for this library. @@ -47,6 +47,17 @@ class Controllers { restControllers.attachRESTControllers(app) } + // Attach any other controllers other than REST API controllers. + async attachControllers (app) { + // Wait for any startup processes to complete for the Adapters libraries. + // await this.adapters.start() + + // Attach the REST controllers to the Koa app. + // this.attachRESTControllers(app) + + this.attachRPCControllers() + } + // Add the JSON RPC router to the ipfs-coord adapter. attachRPCControllers () { const jsonRpcController = new JSONRPC({ diff --git a/src/use-cases/index.js b/src/use-cases/index.js index 015368f..6560709 100644 --- a/src/use-cases/index.js +++ b/src/use-cases/index.js @@ -18,6 +18,17 @@ class UseCases { // console.log('use-cases/index.js localConfig: ', localConfig) this.user = new UserUseCases(localConfig) } + + // Run any startup Use Cases at the start of the app. + async start () { + try { + console.log('Async Use Cases have been started.') + } catch (err) { + console.error('Error in use-cases/index.js/startUseCases()') + console.log(err) + throw err + } + } } module.exports = UseCases diff --git a/test/e2e/automated/a01-auth.rest-e2e.js b/test/e2e/automated/a01-auth.rest-e2e.js index 43bc3c5..0968848 100644 --- a/test/e2e/automated/a01-auth.rest-e2e.js +++ b/test/e2e/automated/a01-auth.rest-e2e.js @@ -7,6 +7,7 @@ // Public npm libraries const assert = require('chai').assert const axios = require('axios').default +// const sinon = require('sinon') // Local support libraries const config = require('../../../config') diff --git a/test/unit/adapters/adapters-index-unit.js b/test/unit/adapters/adapters-index-unit.js index 420a3d1..f704086 100644 --- a/test/unit/adapters/adapters-index-unit.js +++ b/test/unit/adapters/adapters-index-unit.js @@ -37,8 +37,9 @@ describe('#adapters', () => { it('should catch and throw an error', async () => { try { - // Force an error + // Force an error uut.config.getJwtAtStartup = false + uut.config.env = 'dev' sandbox.stub(uut.ipfs, 'start').rejects(new Error('test error')) await uut.start() diff --git a/test/unit/misc/server-unit.js b/test/unit/misc/server-unit.js index a5b1f95..8a39634 100644 --- a/test/unit/misc/server-unit.js +++ b/test/unit/misc/server-unit.js @@ -24,6 +24,8 @@ describe('#server', () => { it('should start the server', async () => { // Mock dependencies sandbox.stub(uut.mongoose, 'connect').resolves() + sandbox.stub(uut.controllers, 'initAdapters').resolves() + sandbox.stub(uut.controllers, 'initUseCases').resolves() sandbox.stub(uut.controllers, 'attachRESTControllers').resolves() sandbox.stub(uut.adminLib, 'createSystemUser').resolves(true) sandbox.stub(uut.controllers, 'attachControllers').resolves() From dd36ebc7a006dc912e1d54578994327534b6e1c2 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Mon, 27 Jun 2022 10:15:35 -0700 Subject: [PATCH 2/7] Got test coverage back to 100% --- src/use-cases/index.js | 16 +++++++++------- test/unit/use-cases/index.use-case.unit.js | 13 +++++++++++++ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/use-cases/index.js b/src/use-cases/index.js index 6560709..69f56e1 100644 --- a/src/use-cases/index.js +++ b/src/use-cases/index.js @@ -21,13 +21,15 @@ class UseCases { // Run any startup Use Cases at the start of the app. async start () { - try { - console.log('Async Use Cases have been started.') - } catch (err) { - console.error('Error in use-cases/index.js/startUseCases()') - console.log(err) - throw err - } + // try { + console.log('Async Use Cases have been started.') + + return true + // } catch (err) { + // console.error('Error in use-cases/index.js/start()') + // // console.log(err) + // throw err + // } } } diff --git a/test/unit/use-cases/index.use-case.unit.js b/test/unit/use-cases/index.use-case.unit.js index a3043d0..6830a71 100644 --- a/test/unit/use-cases/index.use-case.unit.js +++ b/test/unit/use-cases/index.use-case.unit.js @@ -47,4 +47,17 @@ describe('#use-cases', () => { } }) }) + + describe('#start', () => { + it('should initialize async use cases', async () => { + const result = await uut.start() + + assert.equal(result, true) + }) + + // it('should catch and throw errors', async () => { + // // Force an error + // sandbox.stub() + // }) + }) }) From 434a4d7bd6e5a6aabfbac01684a1f21a2221c799 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Mon, 27 Jun 2022 10:25:19 -0700 Subject: [PATCH 3/7] Refactoring failing unit tests --- test/unit/adapters/logapi.adapter.unit.js | 52 +++++++++-------------- 1 file changed, 20 insertions(+), 32 deletions(-) diff --git a/test/unit/adapters/logapi.adapter.unit.js b/test/unit/adapters/logapi.adapter.unit.js index 4563a69..bae3567 100644 --- a/test/unit/adapters/logapi.adapter.unit.js +++ b/test/unit/adapters/logapi.adapter.unit.js @@ -32,19 +32,15 @@ describe('#LogsApiLib', () => { }) it('should return log', async () => { - try { - const pass = 'test' - const result = await uut.getLogs(pass) - // console.log('result', result) + const pass = 'test' + const result = await uut.getLogs(pass) + // console.log('result', result) - assert.isTrue(result.success) - assert.isArray(result.data) - assert.property(result.data[0], 'message') - assert.property(result.data[0], 'level') - assert.property(result.data[0], 'timestamp') - } catch (err) { - assert(false, 'Unexpected result') - } + assert.isTrue(result.success) + assert.isArray(result.data) + assert.property(result.data[0], 'message') + assert.property(result.data[0], 'level') + assert.property(result.data[0], 'timestamp') }) it('should return false if files are not found!', async () => { @@ -201,31 +197,23 @@ describe('#LogsApiLib', () => { }) it('should ignore fileReader callback errors', async () => { - try { - // https://sinonjs.org/releases/latest/stubs/ - // About yields - sandbox.stub(uut.lineReader, 'eachLine').yieldsRight({}, true) + // https://sinonjs.org/releases/latest/stubs/ + // About yields + sandbox.stub(uut.lineReader, 'eachLine').yieldsRight({}, true) - const fileName = context.fileName - const result = await uut.readLines(fileName) - assert.isArray(result) - } catch (err) { - assert.fail('Unexpected result') - } + const fileName = context.fileName + const result = await uut.readLines(fileName) + assert.isArray(result) }) it('should return data', async () => { - try { - const fileName = context.fileName - const result = await uut.readLines(fileName) + const fileName = context.fileName + const result = await uut.readLines(fileName) - assert.isArray(result) - assert.property(result[1], 'message') - assert.property(result[1], 'level') - assert.property(result[1], 'timestamp') - } catch (err) { - assert.fail('Unexpected result') - } + assert.isArray(result) + assert.property(result[1], 'message') + assert.property(result[1], 'level') + assert.property(result[1], 'timestamp') }) }) }) From 3b17ba8e8bd1ec99e5166dcdb8e21ad5b98da8ff Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Mon, 27 Jun 2022 11:29:27 -0700 Subject: [PATCH 4/7] fix(logapi): Fixing issues with unit tests --- src/adapters/logapi.js | 4 +++- test/unit/adapters/logapi.adapter.unit.js | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/adapters/logapi.js b/src/adapters/logapi.js index dbb4ac5..8ec4c7a 100644 --- a/src/adapters/logapi.js +++ b/src/adapters/logapi.js @@ -135,8 +135,10 @@ class LogsApi { if (!filename || typeof filename !== 'string') { throw new Error('filename must be a string') } - // Throw an error if the file does not exist. + console.log('readLines() filename: ', filename) + + // Throw an error if the file does not exist. if (!_this.fs.existsSync(filename)) { throw new Error('file does not exist') } diff --git a/test/unit/adapters/logapi.adapter.unit.js b/test/unit/adapters/logapi.adapter.unit.js index bae3567..aab7d20 100644 --- a/test/unit/adapters/logapi.adapter.unit.js +++ b/test/unit/adapters/logapi.adapter.unit.js @@ -32,6 +32,9 @@ describe('#LogsApiLib', () => { }) it('should return log', async () => { + // Mock dependencies + sandbox.stub(uut, 'generateFileName').returns(`${__dirname.toString()}/../mocks/adapters/test.log`) + const pass = 'test' const result = await uut.getLogs(pass) // console.log('result', result) @@ -201,13 +204,15 @@ describe('#LogsApiLib', () => { // About yields sandbox.stub(uut.lineReader, 'eachLine').yieldsRight({}, true) - const fileName = context.fileName + const fileName = `${__dirname.toString()}/../mocks/adapters/test.log` + const result = await uut.readLines(fileName) assert.isArray(result) }) it('should return data', async () => { - const fileName = context.fileName + const fileName = `${__dirname.toString()}/../mocks/adapters/test.log` + const result = await uut.readLines(fileName) assert.isArray(result) From 5c25ebeeca11708e80169cf1a3041adbef36724c Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Mon, 27 Jun 2022 11:32:25 -0700 Subject: [PATCH 5/7] Renaming mock log --- test/unit/adapters/logapi.adapter.unit.js | 6 +- test/unit/mocks/adapters/fake-log | 70 +++++++++++++++++++++++ 2 files changed, 73 insertions(+), 3 deletions(-) create mode 100644 test/unit/mocks/adapters/fake-log diff --git a/test/unit/adapters/logapi.adapter.unit.js b/test/unit/adapters/logapi.adapter.unit.js index aab7d20..0d90b44 100644 --- a/test/unit/adapters/logapi.adapter.unit.js +++ b/test/unit/adapters/logapi.adapter.unit.js @@ -33,7 +33,7 @@ describe('#LogsApiLib', () => { it('should return log', async () => { // Mock dependencies - sandbox.stub(uut, 'generateFileName').returns(`${__dirname.toString()}/../mocks/adapters/test.log`) + sandbox.stub(uut, 'generateFileName').returns(`${__dirname.toString()}/../mocks/adapters/fake-log`) const pass = 'test' const result = await uut.getLogs(pass) @@ -204,14 +204,14 @@ describe('#LogsApiLib', () => { // About yields sandbox.stub(uut.lineReader, 'eachLine').yieldsRight({}, true) - const fileName = `${__dirname.toString()}/../mocks/adapters/test.log` + const fileName = `${__dirname.toString()}/../mocks/adapters/fake-log` const result = await uut.readLines(fileName) assert.isArray(result) }) it('should return data', async () => { - const fileName = `${__dirname.toString()}/../mocks/adapters/test.log` + const fileName = `${__dirname.toString()}/../mocks/adapters/fake-log` const result = await uut.readLines(fileName) diff --git a/test/unit/mocks/adapters/fake-log b/test/unit/mocks/adapters/fake-log new file mode 100644 index 0000000..59dd343 --- /dev/null +++ b/test/unit/mocks/adapters/fake-log @@ -0,0 +1,70 @@ +{"level":"error","message":"Error in lib/contact.js/sendEmail()","timestamp":"2022-06-27T17:36:43.907Z"} +{"level":"error","message":"Error in lib/contact.js/sendEmail()","timestamp":"2022-06-27T17:36:43.909Z"} +{"level":"error","message":"Error in lib/contact.js/sendEmail()","timestamp":"2022-06-27T17:36:43.910Z"} +{"level":"error","message":"Error in lib/contact.js/sendEmail()","timestamp":"2022-06-27T17:36:43.912Z"} +{"level":"error","message":"Error in lib/contact.js/sendEmail()","timestamp":"2022-06-27T17:36:43.915Z"} +{"level":"error","message":"Error in lib/nodemailer.js/sendEmail()","timestamp":"2022-06-27T17:36:58.979Z"} +{"level":"error","message":"Error in lib/nodemailer.js/sendEmail()","timestamp":"2022-06-27T17:36:58.980Z"} +{"level":"error","message":"Error in lib/nodemailer.js/sendEmail()","timestamp":"2022-06-27T17:36:58.981Z"} +{"level":"error","message":"Error in lib/nodemailer.js/sendEmail()","timestamp":"2022-06-27T17:36:58.982Z"} +{"level":"error","message":"Error in lib/nodemailer.js/sendEmail()","timestamp":"2022-06-27T17:36:58.983Z"} +{"level":"error","message":"Error in lib/nodemailer.js/validateEmailArray()","timestamp":"2022-06-27T17:36:59.002Z"} +{"level":"error","message":"Error in lib/nodemailer.js/validateEmailArray()","timestamp":"2022-06-27T17:36:59.003Z"} +{"level":"error","message":"Error in lib/nodemailer.js/getHtmlFromObject()","timestamp":"2022-06-27T17:36:59.005Z"} +{"level":"error","message":"Error in lib/nodemailer.js/getHtmlFromObject()","timestamp":"2022-06-27T17:36:59.006Z"} +{"level":"error","message":"Error in lib/nodemailer.js/getHtmlFromObject()","timestamp":"2022-06-27T17:36:59.008Z"} +{"level":"info","message":"Warning: Can not send JSON RPC response. Can not determine which peer this message came from.","timestamp":"2022-06-27T17:36:59.353Z"} +{"level":"info","message":"Rejecting invalid JSON RPC command.","timestamp":"2022-06-27T17:36:59.354Z"} +{"level":"info","message":"JSON RPC received from peerA, ID: ea442e78-2297-466a-823b-9cbb12c8ddd9, type: request, method: unknownMethod","timestamp":"2022-06-27T17:36:59.355Z"} +{"level":"error","message":"Error in rpc router(): test error","stack":"Error: test error\n at Context. (/home/trout/work/psf/code/ipfs-service-provider/test/unit/controllers/json-rpc/a10-rpc.unit.js:110:49)\n at callFn (/home/trout/work/psf/code/ipfs-service-provider/node_modules/mocha/lib/runnable.js:366:21)\n at Test.Runnable.run (/home/trout/work/psf/code/ipfs-service-provider/node_modules/mocha/lib/runnable.js:354:5)\n at Runner.runTest (/home/trout/work/psf/code/ipfs-service-provider/node_modules/mocha/lib/runner.js:666:10)\n at /home/trout/work/psf/code/ipfs-service-provider/node_modules/mocha/lib/runner.js:789:12\n at next (/home/trout/work/psf/code/ipfs-service-provider/node_modules/mocha/lib/runner.js:581:14)\n at /home/trout/work/psf/code/ipfs-service-provider/node_modules/mocha/lib/runner.js:591:7\n at next (/home/trout/work/psf/code/ipfs-service-provider/node_modules/mocha/lib/runner.js:474:14)\n at Immediate._onImmediate (/home/trout/work/psf/code/ipfs-service-provider/node_modules/mocha/lib/runner.js:559:5)\n at processImmediate (node:internal/timers:466:21)","timestamp":"2022-06-27T17:36:59.357Z"} +{"level":"info","message":"JSON RPC received from peerA, ID: 9ef6ad90-7fc3-4cb3-8769-4498e5512b3d, type: request, method: users","timestamp":"2022-06-27T17:36:59.358Z"} +{"level":"info","message":"JSON RPC received from peerA, ID: bd57a1cf-7f2f-4ff2-93d4-6727eec4d778, type: request, method: auth","timestamp":"2022-06-27T17:36:59.359Z"} +{"level":"info","message":"JSON RPC received from peerA, ID: 8fd9edc8-6a45-4042-ac06-9ace60567cbf, type: request, method: about","timestamp":"2022-06-27T17:36:59.361Z"} +{"level":"info","message":"JSON RPC received from peerA, ID: 1b27624a-e698-4bbe-9183-b860a1a0d78d, type: request, method: unknownMethod","timestamp":"2022-06-27T17:36:59.363Z"} +{"level":"info","message":"JSON RPC received from peerA, ID: 40fabddf-59c6-4910-a22c-63da7387f99a, type: request, method: unknownMethod","timestamp":"2022-06-27T17:36:59.365Z"} +{"level":"error","message":"Error in authUser(): Login credential do not match","stack":"Error: Login credential do not match\n at Context. (/home/trout/work/psf/code/ipfs-service-provider/test/unit/controllers/json-rpc/auth.json-rpc.controller.unit.js:144:18)\n at callFn (/home/trout/work/psf/code/ipfs-service-provider/node_modules/mocha/lib/runnable.js:366:21)\n at Test.Runnable.run (/home/trout/work/psf/code/ipfs-service-provider/node_modules/mocha/lib/runnable.js:354:5)\n at Runner.runTest (/home/trout/work/psf/code/ipfs-service-provider/node_modules/mocha/lib/runner.js:666:10)\n at /home/trout/work/psf/code/ipfs-service-provider/node_modules/mocha/lib/runner.js:789:12\n at next (/home/trout/work/psf/code/ipfs-service-provider/node_modules/mocha/lib/runner.js:581:14)\n at /home/trout/work/psf/code/ipfs-service-provider/node_modules/mocha/lib/runner.js:591:7\n at next (/home/trout/work/psf/code/ipfs-service-provider/node_modules/mocha/lib/runner.js:474:14)\n at Immediate. (/home/trout/work/psf/code/ipfs-service-provider/node_modules/mocha/lib/runner.js:559:5)\n at processImmediate (node:internal/timers:466:21)","timestamp":"2022-06-27T17:37:04.421Z"} +{"level":"error","message":"Error in authUser(): login must be specified","stack":"Error: login must be specified\n at AuthRPC.authUser (/home/trout/work/psf/code/ipfs-service-provider/src/controllers/json-rpc/auth/index.js:78:93)\n at Context. (/home/trout/work/psf/code/ipfs-service-provider/test/unit/controllers/json-rpc/auth.json-rpc.controller.unit.js:165:34)\n at callFn (/home/trout/work/psf/code/ipfs-service-provider/node_modules/mocha/lib/runnable.js:366:21)\n at Test.Runnable.run (/home/trout/work/psf/code/ipfs-service-provider/node_modules/mocha/lib/runnable.js:354:5)\n at Runner.runTest (/home/trout/work/psf/code/ipfs-service-provider/node_modules/mocha/lib/runner.js:666:10)\n at /home/trout/work/psf/code/ipfs-service-provider/node_modules/mocha/lib/runner.js:789:12\n at next (/home/trout/work/psf/code/ipfs-service-provider/node_modules/mocha/lib/runner.js:581:14)\n at /home/trout/work/psf/code/ipfs-service-provider/node_modules/mocha/lib/runner.js:591:7\n at next (/home/trout/work/psf/code/ipfs-service-provider/node_modules/mocha/lib/runner.js:474:14)\n at Immediate._onImmediate (/home/trout/work/psf/code/ipfs-service-provider/node_modules/mocha/lib/runner.js:559:5)\n at processImmediate (node:internal/timers:466:21)","timestamp":"2022-06-27T17:37:04.423Z"} +{"level":"error","message":"Error in authUser(): password must be specified","stack":"Error: password must be specified\n at AuthRPC.authUser (/home/trout/work/psf/code/ipfs-service-provider/src/controllers/json-rpc/auth/index.js:78:284)\n at Context. (/home/trout/work/psf/code/ipfs-service-provider/test/unit/controllers/json-rpc/auth.json-rpc.controller.unit.js:185:34)\n at callFn (/home/trout/work/psf/code/ipfs-service-provider/node_modules/mocha/lib/runnable.js:366:21)\n at Test.Runnable.run (/home/trout/work/psf/code/ipfs-service-provider/node_modules/mocha/lib/runnable.js:354:5)\n at Runner.runTest (/home/trout/work/psf/code/ipfs-service-provider/node_modules/mocha/lib/runner.js:666:10)\n at /home/trout/work/psf/code/ipfs-service-provider/node_modules/mocha/lib/runner.js:789:12\n at next (/home/trout/work/psf/code/ipfs-service-provider/node_modules/mocha/lib/runner.js:581:14)\n at /home/trout/work/psf/code/ipfs-service-provider/node_modules/mocha/lib/runner.js:591:7\n at next (/home/trout/work/psf/code/ipfs-service-provider/node_modules/mocha/lib/runner.js:474:14)\n at Immediate._onImmediate (/home/trout/work/psf/code/ipfs-service-provider/node_modules/mocha/lib/runner.js:559:5)\n at processImmediate (node:internal/timers:466:21)","timestamp":"2022-06-27T17:37:04.425Z"} +{"level":"error","timestamp":"2022-06-27T17:37:04.466Z"} +{"level":"info","message":"Running server in environment: dev","timestamp":"2022-06-27T17:37:04.487Z"} +{"level":"error","message":"Error in lib/users.js/createUser()","timestamp":"2022-06-27T17:37:04.495Z"} +{"level":"error","message":"Error in lib/users.js/createUser()","timestamp":"2022-06-27T17:37:04.495Z"} +{"level":"error","message":"Error in lib/users.js/createUser()","timestamp":"2022-06-27T17:37:04.496Z"} +{"level":"error","message":"Error in lib/users.js/createUser()","timestamp":"2022-06-27T17:37:04.497Z"} +{"level":"error","message":"Error in lib/users.js/createUser()","timestamp":"2022-06-27T17:37:04.497Z"} +{"level":"error","message":"Error in lib/users.js/getAllUsers()","timestamp":"2022-06-27T17:37:04.499Z"} +{"level":"error","message":"Error in lib/users.js/updateUser()","timestamp":"2022-06-27T17:37:04.502Z"} +{"level":"error","message":"Error in lib/users.js/updateUser()","timestamp":"2022-06-27T17:37:04.503Z"} +{"level":"error","message":"Error in lib/users.js/updateUser()","timestamp":"2022-06-27T17:37:04.503Z"} +{"level":"error","message":"Error in lib/users.js/updateUser()","timestamp":"2022-06-27T17:37:04.504Z"} +{"level":"error","message":"Error in lib/users.js/updateUser()","timestamp":"2022-06-27T17:37:04.505Z"} +{"level":"error","message":"Error in lib/users.js/updateUser()","timestamp":"2022-06-27T17:37:04.506Z"} +{"level":"error","message":"Error in lib/users.js/deleteUser()","timestamp":"2022-06-27T17:37:04.508Z"} +{"level":"info","message":"Running server in environment: test","timestamp":"2022-06-27T17:37:04.514Z"} +{"level":"error","message":"Error in lib/users.js/createUser()","timestamp":"2022-06-27T17:37:04.638Z"} +{"level":"error","message":"Error in lib/users.js/createUser()","timestamp":"2022-06-27T17:37:05.273Z"} +{"level":"error","message":"Error in lib/users.js/createUser()","timestamp":"2022-06-27T17:37:05.277Z"} +{"level":"error","message":"Error in lib/users.js/createUser()","timestamp":"2022-06-27T17:37:05.280Z"} +{"level":"error","message":"Error in lib/users.js/createUser()","timestamp":"2022-06-27T17:37:05.286Z"} +{"level":"error","timestamp":"2022-06-27T17:37:05.412Z"} +{"level":"verbose","message":"Calling user and target user do not match! Calling user: 62b9eac1b4f08950b955d27f, Target user: 1","timestamp":"2022-06-27T17:37:05.441Z"} +{"level":"error","message":"Error in lib/users.js/updateUser()","timestamp":"2022-06-27T17:37:05.448Z"} +{"level":"verbose","message":"Calling user and target user do not match! Calling user: 62b9eac1b4f08950b955d27f, Target user: 62b9eac1b4f08950b955d27d","timestamp":"2022-06-27T17:37:05.452Z"} +{"level":"error","message":"Error in lib/users.js/updateUser()","timestamp":"2022-06-27T17:37:05.457Z"} +{"level":"error","message":"Error in lib/users.js/updateUser()","timestamp":"2022-06-27T17:37:05.463Z"} +{"level":"error","message":"Error in lib/users.js/updateUser()","timestamp":"2022-06-27T17:37:05.467Z"} +{"level":"error","message":"Error in lib/users.js/updateUser()","timestamp":"2022-06-27T17:37:05.473Z"} +{"level":"verbose","message":"Calling user and target user do not match! Calling user: 62b9eac0b4f08950b955d274, Target user: 62b9eac1b4f08950b955d27d","timestamp":"2022-06-27T17:37:05.478Z"} +{"level":"verbose","message":"It's ok. The user is an admin.","timestamp":"2022-06-27T17:37:05.478Z"} +{"level":"verbose","message":"Calling user and target user do not match! Calling user: 62b9eac1b4f08950b955d27f, Target user: 1","timestamp":"2022-06-27T17:37:05.600Z"} +{"level":"verbose","message":"Calling user and target user do not match! Calling user: 62b9eac1b4f08950b955d27f, Target user: 62b9eac1b4f08950b955d27d","timestamp":"2022-06-27T17:37:05.603Z"} +{"level":"verbose","message":"Calling user and target user do not match! Calling user: 62b9eac0b4f08950b955d274, Target user: 62b9eac1b4f08950b955d27d","timestamp":"2022-06-27T17:37:05.615Z"} +{"level":"verbose","message":"It's ok. The user is an admin.","timestamp":"2022-06-27T17:37:05.615Z"} +{"level":"error","message":"Error in lib/contact.js/sendEmail()","timestamp":"2022-06-27T17:37:05.619Z"} +{"level":"error","message":"Error in lib/contact.js/sendEmail()","timestamp":"2022-06-27T17:37:05.622Z"} +{"level":"error","message":"Error in lib/contact.js/sendEmail()","timestamp":"2022-06-27T17:37:05.624Z"} +{"level":"error","message":"Error in lib/contact.js/sendEmail()","timestamp":"2022-06-27T17:37:05.627Z"} +{"level":"verbose","message":"Calling user and target user do not match! Calling user: 62b9eac1b4f08950b955d2a6, Target user: Target Id","timestamp":"2022-06-27T17:37:05.754Z"} +{"level":"verbose","message":"Calling user and target user do not match! Calling user: 62b9eac0b4f08950b955d274, Target user: 62b9eac1b4f08950b955d2a6","timestamp":"2022-06-27T17:37:05.756Z"} +{"level":"verbose","message":"It's ok. The user is an admin.","timestamp":"2022-06-27T17:37:05.756Z"} +{"level":"error","message":"Error in lib/users.js/createUser()","timestamp":"2022-06-27T17:37:06.060Z"} From 1518d1a12b691436224014da7f33168de2b1b68f Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Thu, 7 Jul 2022 15:16:03 -0700 Subject: [PATCH 6/7] fix(ipfs-coord): Updating to v8 --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 67b67e2..c81343d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "bcryptjs": "2.4.3", "glob": "7.1.6", "ipfs": "0.62.3", - "ipfs-coord": "7.1.19", + "ipfs-coord": "8.0.1", "ipfs-http-client": "55.0.0", "jsonrpc-lite": "2.2.0", "jsonwebtoken": "8.5.1", @@ -8440,9 +8440,9 @@ } }, "node_modules/ipfs-coord": { - "version": "7.1.19", - "resolved": "http://94.130.170.209:4873/ipfs-coord/-/ipfs-coord-7.1.19.tgz", - "integrity": "sha512-BwEbpwJTwVohOZrfwI4AJzdJVrKTLUBHZb7nKXuViHIcWJlcp/ThAeP2JWa0ts8CE4xIzpGlgxQwPodDeVN2lw==", + "version": "8.0.1", + "resolved": "http://94.130.170.209:4873/ipfs-coord/-/ipfs-coord-8.0.1.tgz", + "integrity": "sha512-07aqzRSCfHczC43MT05wDhV15OqXafcCWg8LTqkzI1WcUZXBwOvF1fiy0rRmIba0VcfnFwepMWHaYfHF05xF0Q==", "license": "MIT", "dependencies": { "axios": "0.21.4", @@ -27780,9 +27780,9 @@ } }, "ipfs-coord": { - "version": "7.1.19", - "resolved": "http://94.130.170.209:4873/ipfs-coord/-/ipfs-coord-7.1.19.tgz", - "integrity": "sha512-BwEbpwJTwVohOZrfwI4AJzdJVrKTLUBHZb7nKXuViHIcWJlcp/ThAeP2JWa0ts8CE4xIzpGlgxQwPodDeVN2lw==", + "version": "8.0.1", + "resolved": "http://94.130.170.209:4873/ipfs-coord/-/ipfs-coord-8.0.1.tgz", + "integrity": "sha512-07aqzRSCfHczC43MT05wDhV15OqXafcCWg8LTqkzI1WcUZXBwOvF1fiy0rRmIba0VcfnFwepMWHaYfHF05xF0Q==", "requires": { "axios": "0.21.4", "bch-encrypt-lib": "2.0.0", diff --git a/package.json b/package.json index 40d574b..d70436b 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "bcryptjs": "2.4.3", "glob": "7.1.6", "ipfs": "0.62.3", - "ipfs-coord": "7.1.19", + "ipfs-coord": "8.0.1", "ipfs-http-client": "55.0.0", "jsonrpc-lite": "2.2.0", "jsonwebtoken": "8.5.1", From 9967d5145be34bcc2d7a4424b90244f8838c6a52 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Thu, 7 Jul 2022 15:55:33 -0700 Subject: [PATCH 7/7] fix(ipfs-coord): Updating bootstrap nodes --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index c81343d..b32a725 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "bcryptjs": "2.4.3", "glob": "7.1.6", "ipfs": "0.62.3", - "ipfs-coord": "8.0.1", + "ipfs-coord": "8.0.2", "ipfs-http-client": "55.0.0", "jsonrpc-lite": "2.2.0", "jsonwebtoken": "8.5.1", @@ -8440,9 +8440,9 @@ } }, "node_modules/ipfs-coord": { - "version": "8.0.1", - "resolved": "http://94.130.170.209:4873/ipfs-coord/-/ipfs-coord-8.0.1.tgz", - "integrity": "sha512-07aqzRSCfHczC43MT05wDhV15OqXafcCWg8LTqkzI1WcUZXBwOvF1fiy0rRmIba0VcfnFwepMWHaYfHF05xF0Q==", + "version": "8.0.2", + "resolved": "http://94.130.170.209:4873/ipfs-coord/-/ipfs-coord-8.0.2.tgz", + "integrity": "sha512-CdUH4GLLFArUDb8LIRAXxPlhbRQ44A5PEWB4J9zzDB3by93O7DLEgjqPqLDolalzrtiQBVzoARO/exZvdxBF+w==", "license": "MIT", "dependencies": { "axios": "0.21.4", @@ -27780,9 +27780,9 @@ } }, "ipfs-coord": { - "version": "8.0.1", - "resolved": "http://94.130.170.209:4873/ipfs-coord/-/ipfs-coord-8.0.1.tgz", - "integrity": "sha512-07aqzRSCfHczC43MT05wDhV15OqXafcCWg8LTqkzI1WcUZXBwOvF1fiy0rRmIba0VcfnFwepMWHaYfHF05xF0Q==", + "version": "8.0.2", + "resolved": "http://94.130.170.209:4873/ipfs-coord/-/ipfs-coord-8.0.2.tgz", + "integrity": "sha512-CdUH4GLLFArUDb8LIRAXxPlhbRQ44A5PEWB4J9zzDB3by93O7DLEgjqPqLDolalzrtiQBVzoARO/exZvdxBF+w==", "requires": { "axios": "0.21.4", "bch-encrypt-lib": "2.0.0", diff --git a/package.json b/package.json index d70436b..0d340b2 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "bcryptjs": "2.4.3", "glob": "7.1.6", "ipfs": "0.62.3", - "ipfs-coord": "8.0.1", + "ipfs-coord": "8.0.2", "ipfs-http-client": "55.0.0", "jsonrpc-lite": "2.2.0", "jsonwebtoken": "8.5.1",