From 4c51d464fd7f7223c52f88c2d5ba68c7326ee587 Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 23 Dec 2019 17:15:07 -0500 Subject: [PATCH] drop replify integration --- config/config.example.js | 8 -------- package-lock.json | 5 ----- package.json | 1 - rpc.js | 3 --- server.js | 23 ++--------------------- 5 files changed, 2 insertions(+), 38 deletions(-) diff --git a/config/config.example.js b/config/config.example.js index 7dd49c54c..82b919bb5 100644 --- a/config/config.example.js +++ b/config/config.example.js @@ -359,14 +359,6 @@ module.exports = { */ 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/.sock` - * If you run multiple cryptpad servers, you need to use different - * repl names. - */ - //debugReplName: "cryptpad" - /* ===================== * DEPRECATED * ===================== */ diff --git a/package-lock.json b/package-lock.json index 08328fcb1..cdf37370d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1069,11 +1069,6 @@ "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": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", diff --git a/package.json b/package.json index 835641d6b..be6071a2f 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,6 @@ "netflux-websocket": "^0.1.20", "nthen": "0.1.8", "pull-stream": "^3.6.1", - "replify": "^1.2.0", "saferphore": "0.0.1", "sortify": "^1.0.4", "stream-to-pull-stream": "^1.7.2", diff --git a/rpc.js b/rpc.js index 8c7fe6c70..8968b9a4c 100644 --- a/rpc.js +++ b/rpc.js @@ -1369,7 +1369,6 @@ type NetfluxWebsocketSrvContext_t = { */ RPC.create = function ( config /*:Config_t*/, - debuggable /*:(string, T)=>T*/, cb /*:(?Error, ?Function)=>void*/ ) { 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!"); } - debuggable('rpc_env', Env); - var Sessions = Env.Sessions; var paths = Env.paths; var pinPath = paths.pin = keyOrDefaultString('pinPath', './pins'); diff --git a/server.js b/server.js index 1a619e63c..37cd0a00c 100644 --- a/server.js +++ b/server.js @@ -12,25 +12,10 @@ var nThen = require("nthen"); 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 var Storage = require(config.storage||'./storage/file'); -var app = debuggable('app', Express()); +var app = Express(); // mode can be FRESH (default), DEV, or PACKAGE @@ -275,7 +260,7 @@ var nt = nThen(function (w) { if (typeof(config.rpc) !== 'string') { return; } // load pin store... var Rpc = require(config.rpc); - Rpc.create(config, debuggable, w(function (e, _rpc) { + Rpc.create(config, w(function (e, _rpc) { if (e) { w.abort(); throw e; @@ -298,7 +283,3 @@ var nt = nThen(function (w) { var wsSrv = new WebSocketServer(wsConfig); NetfluxSrv.run(wsSrv, config, historyKeeper); }); - -if (config.debugReplName) { - require('replify')({ name: config.debugReplName, app: debuggableStore }); -}