Commit 721ff0a79fa253edc914f17782164f46f56761b5
dx: update ssb-server to v15
Andre Staltz committed on 7/10/2019, 10:27:15 PMParent: 37359f70471e994ca098e99f5021f3e386d51b4a
Files changed
package-lock.json | changed |
package.json | changed |
src/backend/index.ts | changed |
src/backend/package-lock.json | changed |
src/backend/package.json | changed |
tools/build-backend | changed |
tools/patch-backend-ssb-server | changed |
package-lock.json | ||
---|---|---|
The diff is too large to show. Use a local git client to view these changes. Old file size: 1100423 bytes New file size: 1100564 bytes |
package.json | ||
---|---|---|
@@ -130,5 +130,5 @@ | ||
130 | 130 | "react-native": { |
131 | 131 | "os": "react-native-os-staltz", |
132 | 132 | "rn-viewpager": "@staltz/rn-viewpager" |
133 | 133 | } |
134 | -} | |
134 | +} |
src/backend/index.ts | ||
---|---|---|
@@ -16,8 +16,9 @@ | ||
16 | 16 | const npip = require('non-private-ip'); |
17 | 17 | const injectSsbConfig = require('ssb-config/inject'); |
18 | 18 | const BluetoothManager = require('ssb-mobile-bluetooth-manager'); |
19 | 19 | const bluetoothTransportAndPlugin = require('ssb-bluetooth'); |
20 | +const SecretStack = require('secret-stack'); | |
20 | 21 | import syncingPlugin = require('./plugins/syncing'); |
21 | 22 | import blobsFromPathPlugin = require('./plugins/blobsFromPath'); |
22 | 23 | import votesPlugin = require('./plugins/votes'); |
23 | 24 | import manifest = require('./manifest'); |
@@ -103,19 +104,20 @@ | ||
103 | 104 | const bluetoothPluginConfig = { |
104 | 105 | scope: 'public', |
105 | 106 | }; |
106 | 107 | |
107 | -require('ssb-server/index') | |
108 | +SecretStack({caps: {shs: Buffer.from(require('ssb-caps').shs, 'base64')}}) | |
109 | + .use(require('ssb-db')) | |
108 | 110 | .use(noAuthTransform) |
109 | 111 | .use(rnChannelTransport) |
110 | 112 | .use(wsTransport) |
111 | 113 | .use(require('ssb-dht-invite')) |
112 | 114 | .use(dhtTransport) |
113 | 115 | .use(bluetoothTransportAndPlugin(bluetoothManager, bluetoothPluginConfig)) |
114 | - .use(require('ssb-server/plugins/master')) | |
116 | + .use(require('ssb-master')) | |
115 | 117 | .use(require('ssb-lan')) |
116 | 118 | .use(require('ssb-conn')) |
117 | - .use(require('ssb-server/plugins/replicate')) | |
119 | + .use(require('ssb-replicate')) | |
118 | 120 | .use(syncingPlugin) |
119 | 121 | .use(require('ssb-backlinks')) |
120 | 122 | .use(require('ssb-about')) |
121 | 123 | .use(require('ssb-friends')) |
@@ -126,7 +128,7 @@ | ||
126 | 128 | .use(require('ssb-private')) |
127 | 129 | .use(require('ssb-contacts')) |
128 | 130 | .use(require('ssb-query')) |
129 | 131 | .use(require('ssb-threads')) |
130 | - .use(require('ssb-server/plugins/invite')) | |
132 | + .use(require('ssb-invite')) | |
131 | 133 | .use(require('ssb-ebt')) |
132 | 134 | .call(null, config); |
src/backend/package-lock.json | ||
---|---|---|
The diff is too large to show. Use a local git client to view these changes. Old file size: 239078 bytes New file size: 216841 bytes |
src/backend/package.json | ||
---|---|---|
@@ -5,50 +5,50 @@ | ||
5 | 5 | "engines": { |
6 | 6 | "node": "10.13.0" |
7 | 7 | }, |
8 | 8 | "dependencies": { |
9 | - "abstract-leveldown": "5.0.0", | |
10 | 9 | "bindings-noderify-nodejs-mobile": "10.3.0", |
11 | 10 | "bufferutil": "4.0.1", |
12 | 11 | "cached-path-relative": ">=1.0.2", |
13 | 12 | "chloride": "2.2.14", |
14 | 13 | "delay": "3.1.0", |
15 | 14 | "estimate-progress": "1.0.0", |
16 | - "flumeview-level": "3.0.8", | |
17 | 15 | "ip": "1.1.5", |
18 | 16 | "multiserver-dht": "4.0.0", |
19 | - "multiserver-rn-channel": "1.2.0", | |
17 | + "multiserver-rn-channel": "1.3.0", | |
20 | 18 | "non-private-ip-android": "1.4.4-2", |
21 | 19 | "pull-cat": "1.1.11", |
22 | 20 | "pull-file": "1.1.0", |
23 | 21 | "pull-pushable": "2.2.0", |
24 | - "pull-stream": "3.6.9", | |
22 | + "pull-stream": "3.6.13", | |
25 | 23 | "pull-thenable": "1.0.0", |
26 | - "secret-stack": "6.2.0", | |
24 | + "secret-stack": "6.2.1", | |
27 | 25 | "secret-stack-decorators": "~1.0.0", |
28 | - "ssb-server": "13.6.3", | |
26 | + "ssb-db": "19.2.0", | |
29 | 27 | "ssb-about": "2.0.0", |
30 | 28 | "ssb-backlinks": "0.7.3", |
31 | - "ssb-blobs": "1.1.7", | |
29 | + "ssb-blobs": "1.2.1", | |
32 | 30 | "ssb-bluetooth": "1.1.14", |
33 | 31 | "ssb-lan": "0.0.2", |
34 | - "ssb-config": "2.3.7", | |
32 | + "ssb-config": "3.3.1", | |
35 | 33 | "ssb-contacts": "0.0.2", |
36 | 34 | "ssb-dht-invite": "1.0.0", |
37 | - "ssb-ebt": "5.2.7", | |
38 | - "ssb-friends": "3.1.9", | |
39 | - "ssb-keys": "7.1.3", | |
35 | + "ssb-ebt": "5.6.7", | |
36 | + "ssb-friends": "4.1.4", | |
37 | + "ssb-keys": "7.1.7", | |
40 | 38 | "ssb-conn": "0.0.12", |
39 | + "ssb-master": "1.0.3", | |
40 | + "ssb-invite": "2.1.3", | |
41 | + "ssb-replicate": "1.3.0", | |
41 | 42 | "ssb-mobile-bluetooth-manager": "3.2.2", |
42 | 43 | "ssb-private": "0.2.3", |
43 | - "ssb-query": "2.3.0", | |
44 | + "ssb-query": "2.4.2", | |
44 | 45 | "ssb-ref": "2.13.9", |
45 | - "ssb-serve-blobs": "2.0.0", | |
46 | + "ssb-serve-blobs": "2.1.0", | |
46 | 47 | "ssb-threads": "3.4.0", |
47 | 48 | "ssb-typescript": "1.4.0", |
48 | 49 | "utf-8-validate": "5.0.2", |
49 | - "utp-native-no-prebuild": "1.7.3-4", | |
50 | - "xtend": "4.0.1" | |
50 | + "utp-native-no-prebuild": "1.7.3-4" | |
51 | 51 | }, |
52 | 52 | "devDependencies": { |
53 | 53 | "noderify": "4.1.0" |
54 | 54 | } |
tools/build-backend | ||
---|---|---|
@@ -33,9 +33,9 @@ | ||
33 | 33 | rm ./nodejs-assets/nodejs-project/*.js.map; |
34 | 34 | rm ./nodejs-assets/nodejs-project/plugins/*.js.map; |
35 | 35 | |
36 | 36 | echo "Installing dependencies..."; |
37 | -cd ./nodejs-assets/nodejs-project && npm i; | |
37 | +cd ./nodejs-assets/nodejs-project && npm install --no-optional; | |
38 | 38 | |
39 | 39 | # For more details on this, read issue #398: |
40 | 40 | echo "Removing problematic transitive dependencies..."; |
41 | 41 | cd node_modules && rm -rf chokidar fsevents && cd ../../..; |
tools/patch-backend-ssb-server | ||
---|---|---|
@@ -6,49 +6,28 @@ | ||
6 | 6 | const fs = require('fs'); |
7 | 7 | const path = require('path'); |
8 | 8 | |
9 | 9 | const backendPath = process.argv[2]; |
10 | -const ssbServerPath = path.join(backendPath, 'node_modules/ssb-server'); | |
10 | +const ssbDbPath = path.join(backendPath, 'node_modules/ssb-db'); | |
11 | 11 | |
12 | -if (!fs.existsSync(ssbServerPath)) { | |
13 | - throw new Error('Cannot find file ssb-server/lib/apidocs.js to patch'); | |
12 | +if (!fs.existsSync(ssbDbPath)) { | |
13 | + throw new Error('Cannot find file ssb-db/index.js to patch'); | |
14 | 14 | } |
15 | 15 | |
16 | -const apidocsPath = path.join(ssbServerPath, './lib/apidocs.js'); | |
17 | -const prevContent = fs.readFileSync(apidocsPath, 'utf-8'); | |
16 | +const indexjsPath = path.join(ssbDbPath, './index.js'); | |
17 | +const prevContent = fs.readFileSync(indexjsPath, 'utf-8'); | |
18 | 18 | |
19 | -const dirname = path.dirname(apidocsPath); | |
19 | +const dirname = path.dirname(indexjsPath); | |
20 | 20 | |
21 | 21 | function readMarkdownCompileTime(relPath) { |
22 | 22 | return fs |
23 | 23 | .readFileSync(path.join(dirname, relPath), 'utf-8') |
24 | 24 | .replace(/\`\`\`/g, '') |
25 | 25 | .replace(/\`/g, '"'); |
26 | 26 | } |
27 | 27 | |
28 | -const nextContent = prevContent | |
29 | - .replace( | |
30 | - `fs.readFileSync(path.join(__dirname, '../api.md'), 'utf-8')`, | |
31 | - `\`${readMarkdownCompileTime('../api.md')}\``, | |
32 | - ) | |
33 | - .replace( | |
34 | - `fs.readFileSync(path.join(__dirname, '../plugins/friends.md'), 'utf-8')`, | |
35 | - `\`${readMarkdownCompileTime('../plugins/friends.md')}\``, | |
36 | - ) | |
37 | - .replace( | |
38 | - `fs.readFileSync(path.join(__dirname, '../plugins/gossip.md'), 'utf-8')`, | |
39 | - `\`${readMarkdownCompileTime('../plugins/gossip.md')}\``, | |
40 | - ) | |
41 | - .replace( | |
42 | - `fs.readFileSync(path.join(__dirname, '../plugins/invite.md'), 'utf-8')`, | |
43 | - `\`${readMarkdownCompileTime('../plugins/invite.md')}\``, | |
44 | - ) | |
45 | - .replace( | |
46 | - `fs.readFileSync(path.join(__dirname, '../plugins/plugins.md'), 'utf-8')`, | |
47 | - `\`${readMarkdownCompileTime('../plugins/plugins.md')}\``, | |
48 | - ) | |
49 | - .replace( | |
50 | - `fs.readFileSync(path.join(__dirname, '../plugins/replicate.md'), 'utf-8')`, | |
51 | - `\`${readMarkdownCompileTime('../plugins/replicate.md')}\``, | |
52 | - ); | |
28 | +const nextContent = prevContent.replace( | |
29 | + `fs.readFileSync(path.join(__dirname, 'api.md'), 'utf-8')`, | |
30 | + `\`${readMarkdownCompileTime('api.md')}\``, | |
31 | +); | |
53 | 32 | |
54 | -fs.writeFileSync(apidocsPath, nextContent, 'utf-8'); | |
33 | +fs.writeFileSync(indexjsPath, nextContent, 'utf-8'); |
Built with git-ssb-web