From 52cb62960ffbe04562ad1f14a84d5d4f4ec6bf63 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 14 May 2014 11:20:23 -0400 Subject: [PATCH] added reset code to disable ONE plugin, updated FAQ --- app.js | 23 ++++++++++++++++++++- docs/help/help.rst | 50 ++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 64 insertions(+), 9 deletions(-) diff --git a/app.js b/app.js index b2fc88cfc8..fddded63db 100644 --- a/app.js +++ b/app.js @@ -211,6 +211,8 @@ function reset() { if (nconf.get('themes')) { resetThemes(); + } else if (nconf.get('plugin')) { + resetPlugin(nconf.get('plugin')); } else if (nconf.get('plugins')) { resetPlugins(); } else if (nconf.get('widgets')) { @@ -227,7 +229,7 @@ function reset() { process.exit(); }); } else { - console.log('no match'); + winston.warn('[reset] Nothing reset.'); } }); } @@ -260,6 +262,25 @@ function resetThemes(callback) { }); } +function resetPlugin(pluginId) { + var db = require('./src/database'); + db.setRemove('plugins:active', pluginId, function(err, result) { + console.log(result); + if (err || result !== 1) { + winston.error('[reset] Could not disable plugin: ' + pluginId); + if (err) { + winston.error('[reset] Encountered error: ' + err.message); + } else { + winston.info('[reset] Perhaps it has already been disabled?'); + } + } else { + winston.info('[reset] Plugin `' + pluginId + '` disabled'); + } + + process.exit(); + }); +} + function resetPlugins(callback) { var db = require('./src/database'); db.delete('plugins:active', function(err) { diff --git a/docs/help/help.rst b/docs/help/help.rst index 30d73d5e1b..16036fdde3 100644 --- a/docs/help/help.rst +++ b/docs/help/help.rst @@ -7,13 +7,52 @@ Frequently Asked Questions If you experience difficulties setting up a NodeBB instance, perhaps one of the following may help. +How do I start/stop/restart NodeBB? +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +You can call the ``./nodebb`` executable to start and stop NodeBB: + +.. code:: bash + + $ ./nodebb + Welcome to NodeBB + Usage: ./nodebb {start|stop|reload|restart|log|setup|reset|upgrade|dev|watch} + + start Start the NodeBB server + stop Stops the NodeBB server + reload Restarts NodeBB + restart Restarts NodeBB + log Opens the logging interface (useful for debugging) + setup Runs the NodeBB setup script + reset Disables all plugins, restores the default theme. + upgrade Run NodeBB upgrade scripts, ensure packages are up-to-date + dev Start NodeBB in interactive development mode + watch Start NodeBB in development mode and watch for changes + +How do I upgrade my NodeBB? +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Please consult :doc:`Upgrading NodeBB <../upgrading/index>` + +I upgraded NodeBB and now X isn't working properly! +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Please consult :doc:`Upgrading NodeBB <../upgrading/index>` + +I installed an incompatible plugin, and now my forum won't start! +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +If you know which plugin caused problems, disable it by running: ``./nodebb reset plugin="nodebb-plugin-pluginName"`` + +Otherwise, disable all plugins by running: ``./nodebb reset plugins`` + Is it possible to install NodeBB via FTP? -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ It is possible to transfer the files to your remote server using FTP, but you do require shell access to the server in order to actually "start" NodeBB. Here is `a handy guide for installing NodeBB on DigitalOcean `_ I'm getting an "npm ERR!" error -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ For the most part, errors involving ``npm`` are due to Node.js being outdated. If you see an error similar to this one while running ``npm install``: @@ -32,11 +71,6 @@ To do this on Ubuntu: # apt-get update && apt-get dist-upgrade -y # apt-cache policy nodejs // should show a version higher than 0.8 -I upgraded NodeBB and now X isn't working properly! -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Please consult [[Upgrading NodeBB]] - Submit Bugs on our Issue Tracker -------------------------------- @@ -47,4 +81,4 @@ Before reporting bugs, please ensure that the issue has not already been filed o Ask the NodeBB Community ------------------------ -Having trouble installing NodeBB? Or did something break? Don't hesitate to `join our forum `_ and ask for help. Hopefully one day you'll be able to help others too :) \ No newline at end of file +Having trouble installing NodeBB? Or did something break? Don't hesitate to `join our forum `_ and ask for help. Hopefully one day you'll be able to help others too :) \ No newline at end of file