From ff6a4d0755d894469ac06e5a11e84e994ef35a07 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Thu, 15 Apr 2021 10:11:09 -0700 Subject: [PATCH] fix(JSON-LD): Adding JSON-LD using Schema.org --- config/env/common.js | 19 ++++++++++++++++++- package-lock.json | 12 +++++------- package.json | 2 +- src/lib/ipfs.js | 3 ++- 4 files changed, 26 insertions(+), 10 deletions(-) diff --git a/config/env/common.js b/config/env/common.js index 472a8c8..b7f1384 100644 --- a/config/env/common.js +++ b/config/env/common.js @@ -18,5 +18,22 @@ module.exports = { emailPassword: process.env.EMAILPASS ? process.env.EMAILPASS : 'emailpassword', // IPFS settings. - isCircuitRelay: process.env.ENABLE_CIRCUIT_RELAY ? true : false + isCircuitRelay: process.env.ENABLE_CIRCUIT_RELAY ? true : false, + + // Information passed to other IPFS peers about this node. + apiInfo: 'https://ipfs-service-provider.fullstack.cash/', + + // JSON-LD and Schema.org schema with info about this app. + announceJsonLd: { + '@context': 'https://schema.org/', + '@type': 'WebAPI', + name: 'ipfs-service-provider', + description: 'This is a generic IPFS Serivice Provider that uses JSON RPC over IPFS to communicate with it. This instance has not been customized. Source code: https://github.com/Permissionless-Software-Foundation/ipfs-service-provider', + documentation: 'https://ipfs-service-provider.fullstack.cash/', + provider: { + '@type': 'Organization', + name: 'Permissionless Software Foundation', + url: 'https://PSFoundation.cash' + } + } } diff --git a/package-lock.json b/package-lock.json index 5598ba0..7c78125 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6587,8 +6587,7 @@ }, "ini": { "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "resolved": "", "optional": true }, "is-fullwidth-code-point": { @@ -6791,8 +6790,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "resolved": "", "optional": true } } @@ -8679,9 +8677,9 @@ } }, "ipfs-coord": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/ipfs-coord/-/ipfs-coord-3.0.6.tgz", - "integrity": "sha512-EmlLcYptpOztZ9aLB6DHL8vy0gsnRzvRMzBOno1jW7Ht/SP7KhhYGpXvG/8+BYRFgFhAHPHiC2CJMn9N9La4fw==", + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/ipfs-coord/-/ipfs-coord-3.0.9.tgz", + "integrity": "sha512-EP1wo8vskjcXoDAr+YQuXT8ZYmw85UF91/bHL6mbu+sIvwmIrP/7ie6WmWD+XxX9FL19h6udevOvW/TCFyIx+w==", "requires": { "bch-encrypt-lib": "^2.0.0", "orbit-db": "^0.26.1" diff --git a/package.json b/package.json index a2a8d5c..398116c 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "bcryptjs": "^2.4.3", "glob": "^7.1.6", "ipfs": "^0.54.4", - "ipfs-coord": "^3.0.6", + "ipfs-coord": "^3.0.9", "jsonrpc-lite": "^2.2.0", "jsonwebtoken": "^8.5.1", "kcors": "^2.2.2", diff --git a/src/lib/ipfs.js b/src/lib/ipfs.js index 67df15e..45608ad 100644 --- a/src/lib/ipfs.js +++ b/src/lib/ipfs.js @@ -86,7 +86,8 @@ class IPFSLib { bchjs: this.bchjs, privateLog: this.rpc.router, isCircuitRelay: this.config.isCircuitRelay, - apiInfo: 'https://ipfs-service-provider.fullstack.cash/' + apiInfo: this.config.apiInfo, + announceJsonLd: this.config.announceJsonLd }) await this.ipfsCoord.isReady()