drop replify integration
This commit is contained in:
parent
cffb0da833
commit
4c51d464fd
@ -359,14 +359,6 @@ module.exports = {
|
|||||||
*/
|
*/
|
||||||
logFeedback: false,
|
logFeedback: false,
|
||||||
|
|
||||||
/* You can get a repl for debugging the server if you want it.
|
|
||||||
* to enable this, specify the debugReplName and then you can
|
|
||||||
* connect to it with `nc -U /tmp/repl/<your name>.sock`
|
|
||||||
* If you run multiple cryptpad servers, you need to use different
|
|
||||||
* repl names.
|
|
||||||
*/
|
|
||||||
//debugReplName: "cryptpad"
|
|
||||||
|
|
||||||
/* =====================
|
/* =====================
|
||||||
* DEPRECATED
|
* DEPRECATED
|
||||||
* ===================== */
|
* ===================== */
|
||||||
|
|||||||
5
package-lock.json
generated
5
package-lock.json
generated
@ -1069,11 +1069,6 @@
|
|||||||
"string_decoder": "~0.10.x"
|
"string_decoder": "~0.10.x"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"replify": {
|
|
||||||
"version": "1.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/replify/-/replify-1.2.0.tgz",
|
|
||||||
"integrity": "sha1-lAFm0gfRDphhT+SSU60vCsAZ9+E="
|
|
||||||
},
|
|
||||||
"rimraf": {
|
"rimraf": {
|
||||||
"version": "2.7.1",
|
"version": "2.7.1",
|
||||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
|
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
|
||||||
|
|||||||
@ -20,7 +20,6 @@
|
|||||||
"netflux-websocket": "^0.1.20",
|
"netflux-websocket": "^0.1.20",
|
||||||
"nthen": "0.1.8",
|
"nthen": "0.1.8",
|
||||||
"pull-stream": "^3.6.1",
|
"pull-stream": "^3.6.1",
|
||||||
"replify": "^1.2.0",
|
|
||||||
"saferphore": "0.0.1",
|
"saferphore": "0.0.1",
|
||||||
"sortify": "^1.0.4",
|
"sortify": "^1.0.4",
|
||||||
"stream-to-pull-stream": "^1.7.2",
|
"stream-to-pull-stream": "^1.7.2",
|
||||||
|
|||||||
3
rpc.js
3
rpc.js
@ -1369,7 +1369,6 @@ type NetfluxWebsocketSrvContext_t = {
|
|||||||
*/
|
*/
|
||||||
RPC.create = function (
|
RPC.create = function (
|
||||||
config /*:Config_t*/,
|
config /*:Config_t*/,
|
||||||
debuggable /*:<T>(string, T)=>T*/,
|
|
||||||
cb /*:(?Error, ?Function)=>void*/
|
cb /*:(?Error, ?Function)=>void*/
|
||||||
) {
|
) {
|
||||||
Log = config.log;
|
Log = config.log;
|
||||||
@ -1405,8 +1404,6 @@ RPC.create = function (
|
|||||||
console.error("Can't parse admin keys. Please update or fix your config.js file!");
|
console.error("Can't parse admin keys. Please update or fix your config.js file!");
|
||||||
}
|
}
|
||||||
|
|
||||||
debuggable('rpc_env', Env);
|
|
||||||
|
|
||||||
var Sessions = Env.Sessions;
|
var Sessions = Env.Sessions;
|
||||||
var paths = Env.paths;
|
var paths = Env.paths;
|
||||||
var pinPath = paths.pin = keyOrDefaultString('pinPath', './pins');
|
var pinPath = paths.pin = keyOrDefaultString('pinPath', './pins');
|
||||||
|
|||||||
23
server.js
23
server.js
@ -12,25 +12,10 @@ var nThen = require("nthen");
|
|||||||
|
|
||||||
var config = require("./lib/load-config");
|
var config = require("./lib/load-config");
|
||||||
|
|
||||||
// This is stuff which will become available to replify
|
|
||||||
const debuggableStore = new WeakMap();
|
|
||||||
const debuggable = function (name, x) {
|
|
||||||
if (name in debuggableStore) {
|
|
||||||
try { throw new Error(); } catch (e) {
|
|
||||||
console.error('cannot add ' + name + ' more than once [' + e.stack + ']');
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
debuggableStore[name] = x;
|
|
||||||
}
|
|
||||||
return x;
|
|
||||||
};
|
|
||||||
debuggable('global', global);
|
|
||||||
debuggable('config', config);
|
|
||||||
|
|
||||||
// support multiple storage back ends
|
// support multiple storage back ends
|
||||||
var Storage = require(config.storage||'./storage/file');
|
var Storage = require(config.storage||'./storage/file');
|
||||||
|
|
||||||
var app = debuggable('app', Express());
|
var app = Express();
|
||||||
|
|
||||||
// mode can be FRESH (default), DEV, or PACKAGE
|
// mode can be FRESH (default), DEV, or PACKAGE
|
||||||
|
|
||||||
@ -275,7 +260,7 @@ var nt = nThen(function (w) {
|
|||||||
if (typeof(config.rpc) !== 'string') { return; }
|
if (typeof(config.rpc) !== 'string') { return; }
|
||||||
// load pin store...
|
// load pin store...
|
||||||
var Rpc = require(config.rpc);
|
var Rpc = require(config.rpc);
|
||||||
Rpc.create(config, debuggable, w(function (e, _rpc) {
|
Rpc.create(config, w(function (e, _rpc) {
|
||||||
if (e) {
|
if (e) {
|
||||||
w.abort();
|
w.abort();
|
||||||
throw e;
|
throw e;
|
||||||
@ -298,7 +283,3 @@ var nt = nThen(function (w) {
|
|||||||
var wsSrv = new WebSocketServer(wsConfig);
|
var wsSrv = new WebSocketServer(wsConfig);
|
||||||
NetfluxSrv.run(wsSrv, config, historyKeeper);
|
NetfluxSrv.run(wsSrv, config, historyKeeper);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (config.debugReplName) {
|
|
||||||
require('replify')({ name: config.debugReplName, app: debuggableStore });
|
|
||||||
}
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user