From 46b0c595f97cf4ca01113667001feb08edf28b03 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Thu, 26 Aug 2021 08:54:33 -0700 Subject: [PATCH 1/9] fix(production): Updating Docker container --- package.json | 2 +- production/Dockerfile | 10 +++++----- production/start-production | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 5e49504..c604e26 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "bcryptjs": "^2.4.3", "glob": "^7.1.6", "ipfs": "0.55.4", - "ipfs-coord": "^6.1.4", + "ipfs-coord": "^6.1.7", "jsonrpc-lite": "^2.2.0", "jsonwebtoken": "^8.5.1", "jwt-bch-lib": "^1.3.0", diff --git a/production/Dockerfile b/production/Dockerfile index c97f57d..3b60e8a 100644 --- a/production/Dockerfile +++ b/production/Dockerfile @@ -29,18 +29,18 @@ RUN echo 'abcd8765' | sudo -S pwd # Clone the rest.bitcoin.com repository WORKDIR /home/safeuser -RUN git clone https://github.com/christroutner/koa-api-boilerplate -RUN mv koa-api-boilerplate koa -RUN mkdir keys +RUN git clone https://github.com/Permissionless-Software-Foundation/ipfs-service-provider # Switch to the desired branch. `master` is usually stable, # and `stage` has the most up-to-date changes. -WORKDIR /home/safeuser/koa +WORKDIR /home/safeuser/ipfs-service-provider # For development: switch to unstable branch -# RUN git checkout unstable +RUN git checkout ct-unstable # Install dependencies +RUN mkdir .ipfsdata +RUN npm install -g @mapbox/node-pre-gyp RUN npm install # Generate the API docs diff --git a/production/start-production b/production/start-production index 155efee..46433e1 100755 --- a/production/start-production +++ b/production/start-production @@ -1,3 +1,3 @@ #!/bin/bash -export KOA_ENV=production +export SVC_ENV=production npm start From 2a2d940e7ccf8d2599549056e96a4cc8daabd5f4 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Thu, 26 Aug 2021 09:21:08 -0700 Subject: [PATCH 2/9] fix(startup): Adding startup and env var settings --- bin/server.js | 6 ++++++ config/env/common.js | 7 ++++++- config/env/production.js | 5 ++++- docker-compose.yml | 25 ------------------------- production/cleanup-images.sh | 5 +++++ production/docker-compose.yml | 26 ++++++++++++++++++++++++++ production/start-production | 27 +++++++++++++++++++++++++++ src/adapters/ipfs/ipfs-coord.js | 3 ++- 8 files changed, 76 insertions(+), 28 deletions(-) delete mode 100644 docker-compose.yml create mode 100755 production/cleanup-images.sh create mode 100644 production/docker-compose.yml diff --git a/bin/server.js b/bin/server.js index 04638b6..e8b37d0 100644 --- a/bin/server.js +++ b/bin/server.js @@ -39,11 +39,17 @@ class Server { // Connect to the Mongo Database. mongoose.Promise = global.Promise mongoose.set('useCreateIndex', true) // Stop deprecation warning. + console.log( + `Connecting to MongoDB with this connection string: ${config.database}` + ) await mongoose.connect(config.database, { useUnifiedTopology: true, useNewUrlParser: true }) + console.log(`Starting environment: ${config.env}`) + console.log(`Debug level: ${config.debugLevel}`) + // MIDDLEWARE START app.use(convert(logger())) diff --git a/config/env/common.js b/config/env/common.js index 92003ff..4f00938 100644 --- a/config/env/common.js +++ b/config/env/common.js @@ -71,5 +71,10 @@ module.exports = { // IPFS Ports ipfsTcpPort: process.env.IPFS_TCP_PORT ? process.env.IPFS_TCP_PORT : 4001, - ipfsWsPort: process.env.IPFS_WS_PORT ? process.env.IPFS_WS_PORT : 4003 + ipfsWsPort: process.env.IPFS_WS_PORT ? process.env.IPFS_WS_PORT : 4003, + + // BCH Mnemonic for generating encryption keys and payment address + mnemonic: process.env.MNEMONIC ? process.env.MNEMONIC : '', + + debugLevel: process.env.DEBUG_LEVEL ? parseInt(process.env.DEBUG_LEVEL) : 2 } diff --git a/config/env/production.js b/config/env/production.js index b4b2f1c..c138976 100644 --- a/config/env/production.js +++ b/config/env/production.js @@ -10,6 +10,9 @@ module.exports = { session: 'secret-boilerplate-token', token: 'secret-jwt-token', - database: 'mongodb://172.17.0.1:5555/ipfs-service-prod', + // database: 'mongodb://172.17.0.1:5555/ipfs-service-prod', + database: process.env.DBURL + ? process.env.DBURL + : 'mongodb://172.17.0.1:5555/ipfs-service-prod', env: 'prod' } diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 67d0af8..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,25 +0,0 @@ -# Start the testnet server with the command 'docker-compose up -d' - -koa-mongodb: - image: mongo - container_name: mongo-koa - ports: - - "5555:27017" # : - volumes: - - ./database:/data/db - command: mongod --smallfiles --logpath=/dev/null # -- quiet - restart: always - -koa: - build: ./production/ - dockerfile: Dockerfile - container_name: koa - links: - - koa-mongodb - ports: - - "5001:5001" # : - volumes: -# - ./logs:/home/coinjoin/consolidating-coinjoin/logs - - ./keys:/home/safeuser/keys - - restart: always diff --git a/production/cleanup-images.sh b/production/cleanup-images.sh new file mode 100755 index 0000000..405d9f5 --- /dev/null +++ b/production/cleanup-images.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +# Remove all untagged docker images. +docker rmi $(docker images | grep "^" | awk '{print $3}') + diff --git a/production/docker-compose.yml b/production/docker-compose.yml new file mode 100644 index 0000000..325c9eb --- /dev/null +++ b/production/docker-compose.yml @@ -0,0 +1,26 @@ +# Start the testnet server with the command 'docker-compose up -d' + +mongo-ipfs-service: + image: mongo + container_name: mongo-ipfs-service + ports: + - '5555:27017' # : + volumes: + - ./database:/data/db + command: mongod --logpath=/dev/null # -- quiet + restart: always + +ipfs-service: + build: . + dockerfile: Dockerfile + container_name: ipfs-service + links: + - mongo-ipfs-service + ports: + - '5001:5001' # : + volumes: + # - ./logs:/home/coinjoin/consolidating-coinjoin/logs + #- ./keys:/home/safeuser/keys + - ../.ipfsdata:/home/safeuser/ipfs-service-provider/.ipfsdata + + restart: always diff --git a/production/start-production b/production/start-production index 46433e1..d09f909 100755 --- a/production/start-production +++ b/production/start-production @@ -1,3 +1,30 @@ #!/bin/bash + +# BEGIN: Optional configuration settings + +# This mnemonic is used to set up persistent public key for e2ee +export MNEMONIC="olive two muscle bottom coral ancient wait legend bronze useful process session" + +# The human readable name this IPFS node identifies as. +export COORD_NAME=ipfs-service-provider-generic + +# Allow this node to function as a circuit relay. It must not be behind a firewall. +#export ENABLE_CIRCUIT_RELAY=true + +export DEBUG_LEVEL=2 + +# END: Optional configuration settings + + +# Production database connection string. +export DBURL=mongodb://172.17.0.1:5555/ipfs-service-prod + +# Configure IPFS ports +export IPFS_TCP_PORT=4001 +export IPFS_WS_PORT=4003 + +# Configure REST API port +export PORT=5001 + export SVC_ENV=production npm start diff --git a/src/adapters/ipfs/ipfs-coord.js b/src/adapters/ipfs/ipfs-coord.js index 1477679..feb4ec9 100644 --- a/src/adapters/ipfs/ipfs-coord.js +++ b/src/adapters/ipfs/ipfs-coord.js @@ -46,7 +46,8 @@ class IpfsCoordAdapter { privateLog: console.log, // Default to console.log isCircuitRelay: this.config.isCircuitRelay, apiInfo: this.config.apiInfo, - announceJsonLd: this.config.announceJsonLd + announceJsonLd: this.config.announceJsonLd, + debugLevel: this.config.debugLevel }) // Wait for the ipfs-coord library to signal that it is ready. From 596645ad6bc6f2aeb88c87269467aab9a74466ea Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Thu, 26 Aug 2021 10:17:11 -0700 Subject: [PATCH 3/9] Bumping to ipfs-coord v6.1.8 --- bin/server.js | 5 ++- package-lock.json | 81 ++++++++++++++++++++++++++++------------ package.json | 2 +- src/controllers/index.js | 2 +- 4 files changed, 63 insertions(+), 27 deletions(-) diff --git a/bin/server.js b/bin/server.js index e8b37d0..4bd59fd 100644 --- a/bin/server.js +++ b/bin/server.js @@ -71,7 +71,7 @@ class Server { // Attach REST API and JSON RPC controllers to the app. const Controllers = require('../src/controllers') const controllers = new Controllers() - await controllers.attachControllers(app) + await controllers.attachRESTControllers(app) app.controllers = controllers @@ -91,6 +91,9 @@ class Server { const success = await this.adminLib.createSystemUser() if (success) console.log('System admin user created.') + // Attach the other IPFS controllers + await controllers.attachControllers(app) + return app } catch (err) { console.error('Could not start server. Error: ', err) diff --git a/package-lock.json b/package-lock.json index d1b2c5a..4e0cd94 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "bcryptjs": "^2.4.3", "glob": "^7.1.6", "ipfs": "0.55.4", - "ipfs-coord": "^6.1.4", + "ipfs-coord": "^6.1.8", "jsonrpc-lite": "^2.2.0", "jsonwebtoken": "^8.5.1", "jwt-bch-lib": "^1.3.0", @@ -10028,9 +10028,9 @@ } }, "node_modules/ipfs-coord": { - "version": "6.1.4", - "resolved": "https://registry.npmjs.org/ipfs-coord/-/ipfs-coord-6.1.4.tgz", - "integrity": "sha512-uWSNJIp5JapAlLLaLczcsfZw8UO4jMu+ObA97u0otlU6eA5x2SLJj1nKnl5u1+hpRfBSiMqWGOLNifjThjdTIA==", + "version": "6.1.8", + "resolved": "https://registry.npmjs.org/ipfs-coord/-/ipfs-coord-6.1.8.tgz", + "integrity": "sha512-vzRbtBw+4X3r+mgJtcHkVb7tQek1SaeVOGOEX+xUgyCMrUKetD9BcIaCy7OvdUppqiZnJQHBMv6oQgSdcxJNLw==", "dependencies": { "bch-encrypt-lib": "^2.0.0", "orbit-db": "^0.26.1" @@ -10701,14 +10701,22 @@ } }, "node_modules/ipfs-log/node_modules/ipld-dag-cbor/node_modules/multicodec": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/multicodec/-/multicodec-3.1.0.tgz", - "integrity": "sha512-f6d4DhbQ9a8WiJ/wpbKgeJSeR0/juP/1wnjbKdZ0KAWDkC/z7Lb3xOegMUG+uTcfwSYf6j1eTvFf8HDgqPRGmQ==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/multicodec/-/multicodec-3.1.1.tgz", + "integrity": "sha512-q29htEIgHglgxEcD0SvTmf1er68nfhm87rMKPqpClequHOTJknDCX5xA8QHBwBstgj+niO2KrsJeFzpsMZj2DQ==", "dependencies": { - "uint8arrays": "^2.1.5", + "uint8arrays": "^3.0.0", "varint": "^6.0.0" } }, + "node_modules/ipfs-log/node_modules/ipld-dag-cbor/node_modules/multicodec/node_modules/uint8arrays": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-3.0.0.tgz", + "integrity": "sha512-HRCx0q6O9Bfbp+HHSfQQKD7wU70+lydKVt4EghkdOvlK/NlrF90z+eXV34mUd48rNvVJXwkrMSPpCATkct8fJA==", + "dependencies": { + "multiformats": "^9.4.2" + } + }, "node_modules/ipfs-log/node_modules/ipld-dag-pb": { "version": "0.20.0", "resolved": "https://registry.npmjs.org/ipld-dag-pb/-/ipld-dag-pb-0.20.0.tgz", @@ -21888,17 +21896,24 @@ "integrity": "sha512-LPzSaBYp/TcbuSlpGwqT5jR9kvJ3Zp5ic2N5c2ybx6XB/lSfEHq2D7ja8AgoxHoMD91wXFALJoXsvshKPuXyew==" }, "node_modules/protons": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/protons/-/protons-2.0.2.tgz", - "integrity": "sha512-EIPoT9ftVirJ9QJ3oFoueYUiBhmPqE1AoSBPypLSqbbvHvx+OcUeK9z84YIsk6jda+N3FL58dU1LcWmfGCZGHA==", - "deprecated": "This module is no longer maintained", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/protons/-/protons-2.0.3.tgz", + "integrity": "sha512-j6JikP/H7gNybNinZhAHMN07Vjr1i4lVupg598l4I9gSTjJqOvKnwjzYX2PzvBTSVf2eZ2nWv4vG+mtW8L6tpA==", "dependencies": { "protocol-buffers-schema": "^3.3.1", "signed-varint": "^2.0.1", - "uint8arrays": "^2.1.3", + "uint8arrays": "^3.0.0", "varint": "^5.0.0" } }, + "node_modules/protons/node_modules/uint8arrays": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-3.0.0.tgz", + "integrity": "sha512-HRCx0q6O9Bfbp+HHSfQQKD7wU70+lydKVt4EghkdOvlK/NlrF90z+eXV34mUd48rNvVJXwkrMSPpCATkct8fJA==", + "dependencies": { + "multiformats": "^9.4.2" + } + }, "node_modules/protons/node_modules/varint": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", @@ -34345,9 +34360,9 @@ } }, "ipfs-coord": { - "version": "6.1.4", - "resolved": "https://registry.npmjs.org/ipfs-coord/-/ipfs-coord-6.1.4.tgz", - "integrity": "sha512-uWSNJIp5JapAlLLaLczcsfZw8UO4jMu+ObA97u0otlU6eA5x2SLJj1nKnl5u1+hpRfBSiMqWGOLNifjThjdTIA==", + "version": "6.1.8", + "resolved": "https://registry.npmjs.org/ipfs-coord/-/ipfs-coord-6.1.8.tgz", + "integrity": "sha512-vzRbtBw+4X3r+mgJtcHkVb7tQek1SaeVOGOEX+xUgyCMrUKetD9BcIaCy7OvdUppqiZnJQHBMv6oQgSdcxJNLw==", "requires": { "bch-encrypt-lib": "^2.0.0", "orbit-db": "^0.26.1" @@ -34922,12 +34937,22 @@ }, "dependencies": { "multicodec": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/multicodec/-/multicodec-3.1.0.tgz", - "integrity": "sha512-f6d4DhbQ9a8WiJ/wpbKgeJSeR0/juP/1wnjbKdZ0KAWDkC/z7Lb3xOegMUG+uTcfwSYf6j1eTvFf8HDgqPRGmQ==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/multicodec/-/multicodec-3.1.1.tgz", + "integrity": "sha512-q29htEIgHglgxEcD0SvTmf1er68nfhm87rMKPqpClequHOTJknDCX5xA8QHBwBstgj+niO2KrsJeFzpsMZj2DQ==", "requires": { - "uint8arrays": "^2.1.5", + "uint8arrays": "^3.0.0", "varint": "^6.0.0" + }, + "dependencies": { + "uint8arrays": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-3.0.0.tgz", + "integrity": "sha512-HRCx0q6O9Bfbp+HHSfQQKD7wU70+lydKVt4EghkdOvlK/NlrF90z+eXV34mUd48rNvVJXwkrMSPpCATkct8fJA==", + "requires": { + "multiformats": "^9.4.2" + } + } } } } @@ -43471,16 +43496,24 @@ "integrity": "sha512-LPzSaBYp/TcbuSlpGwqT5jR9kvJ3Zp5ic2N5c2ybx6XB/lSfEHq2D7ja8AgoxHoMD91wXFALJoXsvshKPuXyew==" }, "protons": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/protons/-/protons-2.0.2.tgz", - "integrity": "sha512-EIPoT9ftVirJ9QJ3oFoueYUiBhmPqE1AoSBPypLSqbbvHvx+OcUeK9z84YIsk6jda+N3FL58dU1LcWmfGCZGHA==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/protons/-/protons-2.0.3.tgz", + "integrity": "sha512-j6JikP/H7gNybNinZhAHMN07Vjr1i4lVupg598l4I9gSTjJqOvKnwjzYX2PzvBTSVf2eZ2nWv4vG+mtW8L6tpA==", "requires": { "protocol-buffers-schema": "^3.3.1", "signed-varint": "^2.0.1", - "uint8arrays": "^2.1.3", + "uint8arrays": "^3.0.0", "varint": "^5.0.0" }, "dependencies": { + "uint8arrays": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-3.0.0.tgz", + "integrity": "sha512-HRCx0q6O9Bfbp+HHSfQQKD7wU70+lydKVt4EghkdOvlK/NlrF90z+eXV34mUd48rNvVJXwkrMSPpCATkct8fJA==", + "requires": { + "multiformats": "^9.4.2" + } + }, "varint": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", diff --git a/package.json b/package.json index c604e26..4ed4f68 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "bcryptjs": "^2.4.3", "glob": "^7.1.6", "ipfs": "0.55.4", - "ipfs-coord": "^6.1.7", + "ipfs-coord": "^6.1.8", "jsonrpc-lite": "^2.2.0", "jsonwebtoken": "^8.5.1", "jwt-bch-lib": "^1.3.0", diff --git a/src/controllers/index.js b/src/controllers/index.js index b403499..ba3cc22 100644 --- a/src/controllers/index.js +++ b/src/controllers/index.js @@ -30,7 +30,7 @@ class Controllers { await this.adapters.start() // Attach the REST controllers to the Koa app. - this.attachRESTControllers(app) + // this.attachRESTControllers(app) this.attachRPCControllers() } From eca131fefcabc4e0d3d3c7dec348f1fb8f79fc1e Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Thu, 26 Aug 2021 10:27:22 -0700 Subject: [PATCH 4/9] minor comments to startup script --- production/start-production | 2 ++ 1 file changed, 2 insertions(+) diff --git a/production/start-production b/production/start-production index d09f909..c50fd45 100755 --- a/production/start-production +++ b/production/start-production @@ -3,6 +3,7 @@ # BEGIN: Optional configuration settings # This mnemonic is used to set up persistent public key for e2ee +# Replace this with your own 12-word mnemonic. export MNEMONIC="olive two muscle bottom coral ancient wait legend bronze useful process session" # The human readable name this IPFS node identifies as. @@ -11,6 +12,7 @@ export COORD_NAME=ipfs-service-provider-generic # Allow this node to function as a circuit relay. It must not be behind a firewall. #export ENABLE_CIRCUIT_RELAY=true +# Debug level. 0 = minimal info. 2 = max info. export DEBUG_LEVEL=2 # END: Optional configuration settings From f9df8c7fab5ce46489624db16a5299ac437aaa13 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Thu, 26 Aug 2021 10:53:53 -0700 Subject: [PATCH 5/9] fix(production): Running Docker as root --- production/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/production/Dockerfile b/production/Dockerfile index 3b60e8a..01f8e61 100644 --- a/production/Dockerfile +++ b/production/Dockerfile @@ -23,9 +23,9 @@ WORKDIR /home/safeuser #RUN runuser -l safeuser -c "npm config set prefix '~/.npm-global'" # Switch to user account. -USER safeuser +#USER safeuser # Prep 'sudo' commands. -RUN echo 'abcd8765' | sudo -S pwd +#RUN echo 'abcd8765' | sudo -S pwd # Clone the rest.bitcoin.com repository WORKDIR /home/safeuser @@ -39,7 +39,7 @@ WORKDIR /home/safeuser/ipfs-service-provider RUN git checkout ct-unstable # Install dependencies -RUN mkdir .ipfsdata +#RUN mkdir .ipfsdata RUN npm install -g @mapbox/node-pre-gyp RUN npm install From 0480f542878f58ce6634a8a0f62892d6840b6c98 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Thu, 26 Aug 2021 21:23:37 -0700 Subject: [PATCH 6/9] fix(ipfs-coord): Upgrading to v6.3.0 --- 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 4e0cd94..d6bb258 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "bcryptjs": "^2.4.3", "glob": "^7.1.6", "ipfs": "0.55.4", - "ipfs-coord": "^6.1.8", + "ipfs-coord": "^6.3.0", "jsonrpc-lite": "^2.2.0", "jsonwebtoken": "^8.5.1", "jwt-bch-lib": "^1.3.0", @@ -10028,9 +10028,9 @@ } }, "node_modules/ipfs-coord": { - "version": "6.1.8", - "resolved": "https://registry.npmjs.org/ipfs-coord/-/ipfs-coord-6.1.8.tgz", - "integrity": "sha512-vzRbtBw+4X3r+mgJtcHkVb7tQek1SaeVOGOEX+xUgyCMrUKetD9BcIaCy7OvdUppqiZnJQHBMv6oQgSdcxJNLw==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/ipfs-coord/-/ipfs-coord-6.3.0.tgz", + "integrity": "sha512-bxvXq8eq+xsy0IKzEa7/iC+N4E3fDaTjxhw0KKYybE7iBUv/HS+iaMQNqL6K5i8IwUw19HwYY3oagQNz+G+Sxw==", "dependencies": { "bch-encrypt-lib": "^2.0.0", "orbit-db": "^0.26.1" @@ -34360,9 +34360,9 @@ } }, "ipfs-coord": { - "version": "6.1.8", - "resolved": "https://registry.npmjs.org/ipfs-coord/-/ipfs-coord-6.1.8.tgz", - "integrity": "sha512-vzRbtBw+4X3r+mgJtcHkVb7tQek1SaeVOGOEX+xUgyCMrUKetD9BcIaCy7OvdUppqiZnJQHBMv6oQgSdcxJNLw==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/ipfs-coord/-/ipfs-coord-6.3.0.tgz", + "integrity": "sha512-bxvXq8eq+xsy0IKzEa7/iC+N4E3fDaTjxhw0KKYybE7iBUv/HS+iaMQNqL6K5i8IwUw19HwYY3oagQNz+G+Sxw==", "requires": { "bch-encrypt-lib": "^2.0.0", "orbit-db": "^0.26.1" diff --git a/package.json b/package.json index 4ed4f68..ed3ceef 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "bcryptjs": "^2.4.3", "glob": "^7.1.6", "ipfs": "0.55.4", - "ipfs-coord": "^6.1.8", + "ipfs-coord": "^6.3.0", "jsonrpc-lite": "^2.2.0", "jsonwebtoken": "^8.5.1", "jwt-bch-lib": "^1.3.0", From 326271f703331f42938271ec26bd442c99b32a79 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Thu, 26 Aug 2021 21:24:27 -0700 Subject: [PATCH 7/9] Updating Dockerfile --- production/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/Dockerfile b/production/Dockerfile index 01f8e61..5d0f85f 100644 --- a/production/Dockerfile +++ b/production/Dockerfile @@ -36,7 +36,7 @@ RUN git clone https://github.com/Permissionless-Software-Foundation/ipfs-service WORKDIR /home/safeuser/ipfs-service-provider # For development: switch to unstable branch -RUN git checkout ct-unstable +#RUN git checkout ct-unstable # Install dependencies #RUN mkdir .ipfsdata From 16182890783e1f20da1d624b1dbe48ba15958214 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Fri, 27 Aug 2021 15:04:09 -0700 Subject: [PATCH 8/9] fix(ipfs-coord): Updated to v6.4.0 --- 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 d6bb258..42e8115 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "bcryptjs": "^2.4.3", "glob": "^7.1.6", "ipfs": "0.55.4", - "ipfs-coord": "^6.3.0", + "ipfs-coord": "^6.4.0", "jsonrpc-lite": "^2.2.0", "jsonwebtoken": "^8.5.1", "jwt-bch-lib": "^1.3.0", @@ -10028,9 +10028,9 @@ } }, "node_modules/ipfs-coord": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/ipfs-coord/-/ipfs-coord-6.3.0.tgz", - "integrity": "sha512-bxvXq8eq+xsy0IKzEa7/iC+N4E3fDaTjxhw0KKYybE7iBUv/HS+iaMQNqL6K5i8IwUw19HwYY3oagQNz+G+Sxw==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/ipfs-coord/-/ipfs-coord-6.4.0.tgz", + "integrity": "sha512-rUejOfuQLUUDqs9Dhysl4iS258beBO5VryqWr/rpmJXvUD2G7D7lzEVYq7YizGTESQLYRr3pJO4cy+fC8VjyAA==", "dependencies": { "bch-encrypt-lib": "^2.0.0", "orbit-db": "^0.26.1" @@ -34360,9 +34360,9 @@ } }, "ipfs-coord": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/ipfs-coord/-/ipfs-coord-6.3.0.tgz", - "integrity": "sha512-bxvXq8eq+xsy0IKzEa7/iC+N4E3fDaTjxhw0KKYybE7iBUv/HS+iaMQNqL6K5i8IwUw19HwYY3oagQNz+G+Sxw==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/ipfs-coord/-/ipfs-coord-6.4.0.tgz", + "integrity": "sha512-rUejOfuQLUUDqs9Dhysl4iS258beBO5VryqWr/rpmJXvUD2G7D7lzEVYq7YizGTESQLYRr3pJO4cy+fC8VjyAA==", "requires": { "bch-encrypt-lib": "^2.0.0", "orbit-db": "^0.26.1" diff --git a/package.json b/package.json index ed3ceef..9a9653c 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "bcryptjs": "^2.4.3", "glob": "^7.1.6", "ipfs": "0.55.4", - "ipfs-coord": "^6.3.0", + "ipfs-coord": "^6.4.0", "jsonrpc-lite": "^2.2.0", "jsonwebtoken": "^8.5.1", "jwt-bch-lib": "^1.3.0", From fb215b11b7fe4b0a6498d23581bef859511fbb63 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Fri, 27 Aug 2021 15:41:33 -0700 Subject: [PATCH 9/9] fix(production): Tweeking production Docker container slightly --- production/Dockerfile | 4 ++-- production/docker-compose.yml | 4 ++-- production/{start-production => start-production.sh} | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) rename production/{start-production => start-production.sh} (97%) diff --git a/production/Dockerfile b/production/Dockerfile index 5d0f85f..a83058e 100644 --- a/production/Dockerfile +++ b/production/Dockerfile @@ -52,7 +52,7 @@ VOLUME /home/safeuser/keys EXPOSE 5001 # Start the application. -COPY start-production start-production -CMD ["./start-production"] +COPY start-production.sh start-production.sh +CMD ["./start-production.sh"] #CMD ["npm", "start"] diff --git a/production/docker-compose.yml b/production/docker-compose.yml index 325c9eb..6251120 100644 --- a/production/docker-compose.yml +++ b/production/docker-compose.yml @@ -6,7 +6,7 @@ mongo-ipfs-service: ports: - '5555:27017' # : volumes: - - ./database:/data/db + - ./data/database:/data/db command: mongod --logpath=/dev/null # -- quiet restart: always @@ -21,6 +21,6 @@ ipfs-service: volumes: # - ./logs:/home/coinjoin/consolidating-coinjoin/logs #- ./keys:/home/safeuser/keys - - ../.ipfsdata:/home/safeuser/ipfs-service-provider/.ipfsdata + - ./data/.ipfsdata:/home/safeuser/ipfs-service-provider/.ipfsdata restart: always diff --git a/production/start-production b/production/start-production.sh similarity index 97% rename from production/start-production rename to production/start-production.sh index c50fd45..8398de2 100755 --- a/production/start-production +++ b/production/start-production.sh @@ -13,7 +13,7 @@ export COORD_NAME=ipfs-service-provider-generic #export ENABLE_CIRCUIT_RELAY=true # Debug level. 0 = minimal info. 2 = max info. -export DEBUG_LEVEL=2 +export DEBUG_LEVEL=1 # END: Optional configuration settings