Skip to content

Commit

Permalink
Merge commit 'de81a340ec374d7103287b446ce3081bb3a020cc' into v1.x.x
Browse files Browse the repository at this point in the history
  • Loading branch information
nodebb-misty committed Apr 19, 2017
2 parents d19e59f + de81a34 commit 7181bb4
Show file tree
Hide file tree
Showing 580 changed files with 1,987 additions and 11,230 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"no-prototype-builtins": "off",
"new-cap": "off",
"no-plusplus": ["error", { "allowForLoopAfterthoughts": true }],
"import/no-unresolved": "error",

// ES6
"prefer-rest-params": "off",
Expand All @@ -43,7 +44,6 @@
"vars-on-top": "off",

// TODO
"import/no-unresolved": "off",
"import/no-extraneous-dependencies": "off",
"import/no-dynamic-require": "off",
"import/newline-after-import": "off",
Expand Down
8 changes: 3 additions & 5 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,9 @@ There is a chance that the issue you are experiencing may have already been fixe
You can find the NodeBB version number in the Admin Control Panel (ACP), as well as the first line output to the shell when running NodeBB

``` plaintext
info: NodeBB v0.5.2-dev Copyright (C) 2013-2014 NodeBB Inc.
info: This program comes with ABSOLUTELY NO WARRANTY.
info: This is free software, and you are welcome to redistribute it under certain conditions.
info:
info: Time: Tue Oct 07 2014 20:25:20 GMT-0400 (EDT)
3/4 12:38:57 [10752] - info: NodeBB v1.4.5 Copyright (C) 2013-2017 NodeBB Inc.
3/4 12:38:57 [10752] - info: This program comes with ABSOLUTELY NO WARRANTY.
3/4 12:38:57 [10752] - info: This is free software, and you are welcome to redistribute it under certain conditions.
```

If you are running NodeBB via git, it is also helpful to let the maintainers know what commit hash you are on. To find the commit hash, execute the following command:
Expand Down
44 changes: 30 additions & 14 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@

'use strict';

if (require.main !== module) {
require.main.require = function (path) {
return require(path);
};
}

var nconf = require('nconf');
nconf.argv().env('__');

Expand Down Expand Up @@ -206,22 +212,32 @@ function upgrade() {

function activate() {
var db = require('./src/database');
db.init(function (err) {
if (err) {
winston.error(err.stack);
process.exit(1);
}
var plugins = require('./src/plugins');
var plugin = nconf.get('activate');
async.waterfall([
function (next) {
db.init(next);
},
function (next) {
if (plugin.indexOf('nodebb-') !== 0) {
// Allow omission of `nodebb-plugin-`
plugin = 'nodebb-plugin-' + plugin;
}
plugins.isInstalled(plugin, next);
},
function (isInstalled, next) {
if (!isInstalled) {
return next(new Error('plugin not installed'));
}

var plugin = nconf.get('activate');
if (plugin.indexOf('nodebb-') !== 0) {
// Allow omission of `nodebb-plugin-`
plugin = 'nodebb-plugin-' + plugin;
winston.info('Activating plugin `%s`', plugin);
db.sortedSetAdd('plugins:active', 0, plugin, next);
},
], function (err) {
if (err) {
winston.error(err.message);
}

winston.info('Activating plugin `%s`', plugin);
db.sortedSetAdd('plugins:active', 0, plugin, function (err) {
process.exit(err ? 1 : 0);
});
process.exit(err ? 1 : 0);
});
}

Expand Down
36 changes: 18 additions & 18 deletions install/data/navigation.json
Original file line number Diff line number Diff line change
@@ -1,83 +1,83 @@
[
{
"route": "/categories",
"title": "\\[\\[global:header.categories\\]\\]",
"title": "[[global:header.categories]]",
"enabled": true,
"iconClass": "fa-list",
"textClass": "visible-xs-inline",
"text": "\\[\\[global:header.categories\\]\\]"
"text": "[[global:header.categories]]"
},
{
"id": "unread-count",
"route": "/unread",
"title": "\\[\\[global:header.unread\\]\\]",
"title": "[[global:header.unread]]",
"enabled": true,
"iconClass": "fa-inbox",
"textClass": "visible-xs-inline",
"text": "\\[\\[global:header.unread\\]\\]",
"text": "[[global:header.unread]]",
"properties": {
"loggedIn": true
}
},
{
"route": "/recent",
"title": "\\[\\[global:header.recent\\]\\]",
"title": "[[global:header.recent]]",
"enabled": true,
"iconClass": "fa-clock-o",
"textClass": "visible-xs-inline",
"text": "\\[\\[global:header.recent\\]\\]"
"text": "[[global:header.recent]]"
},
{
"route": "/tags",
"title": "\\[\\[global:header.tags\\]\\]",
"title": "[[global:header.tags]]",
"enabled": true,
"iconClass": "fa-tags",
"textClass": "visible-xs-inline",
"text": "\\[\\[global:header.tags\\]\\]"
"text": "[[global:header.tags]]"
},
{
"route": "/popular",
"title": "\\[\\[global:header.popular\\]\\]",
"title": "[[global:header.popular]]",
"enabled": true,
"iconClass": "fa-fire",
"textClass": "visible-xs-inline",
"text": "\\[\\[global:header.popular\\]\\]"
"text": "[[global:header.popular]]"
},
{
"route": "/users",
"title": "\\[\\[global:header.users\\]\\]",
"title": "[[global:header.users]]",
"enabled": true,
"iconClass": "fa-user",
"textClass": "visible-xs-inline",
"text": "\\[\\[global:header.users\\]\\]"
"text": "[[global:header.users]]"
},
{
"route": "/groups",
"title": "\\[\\[global:header.groups\\]\\]",
"title": "[[global:header.groups]]",
"enabled": true,
"iconClass": "fa-group",
"textClass": "visible-xs-inline",
"text": "\\[\\[global:header.groups\\]\\]"
"text": "[[global:header.groups]]"
},
{
"route": "/admin",
"title": "\\[\\[global:header.admin\\]\\]",
"title": "[[global:header.admin]]",
"enabled": true,
"iconClass": "fa-cogs",
"textClass": "visible-xs-inline",
"text": "\\[\\[global:header.admin\\]\\]",
"text": "[[global:header.admin]]",
"properties": {
"targetBlank": false,
"adminOnly": true
}
},
{
"route": "/search",
"title": "\\[\\[global:header.search\\]\\]",
"title": "[[global:header.search]]",
"enabled": true,
"iconClass": "fa-search",
"textClass": "visible-xs-inline",
"text": "\\[\\[global:header.search\\]\\]",
"text": "[[global:header.search]]",
"properties": {
"searchInstalled": true
}
Expand Down
4 changes: 3 additions & 1 deletion loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ var path = require('path');
var fork = require('child_process').fork;
var async = require('async');
var logrotate = require('logrotate-stream');

var file = require('./src/file');
var pkg = require('./package.json');

Expand All @@ -23,6 +24,7 @@ var workers = [];
var Loader = {
timesStarted: 0,
};
var appPath = path.join(__dirname, 'app.js');

Loader.init = function (callback) {
if (silent) {
Expand Down Expand Up @@ -114,7 +116,7 @@ function forkWorker(index, isPrimary) {
process.env.isCluster = ports.length > 1;
process.env.port = ports[index];

var worker = fork('app.js', args, {
var worker = fork(appPath, args, {
silent: silent,
env: process.env,
});
Expand Down

0 comments on commit 7181bb4

Please sign in to comment.