@ -1,8 +1,27 @@
/ *
NodeBB - A forum powered by node in development by designcreateplay
Copyright ( C ) 2013 DesignCreatePlay Inc .
This program is free software : you can redistribute it and / or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
You should have received a copy of the GNU General Public License
along with this program . If not , see < http : //www.gnu.org/licenses/>.
* /
// Read config.js to grab redis info
var fs = require ( 'fs' ) ,
path = require ( 'path' ) ,
utils = require ( './public/src/utils.js' ) ,
url = require ( 'url' ) ,
ver = '0.0.2' ,
args = { } ;
// Runtime environment
@ -16,14 +35,19 @@ process.argv.slice(2).forEach(function(value) {
}
} ) ;
console . log ( 'Info: Checking for valid base configuration file' ) ;
// Log GNU copyright info along with server info
console . log ( 'Info: NodeBB v' + ver + ' Copyright (C) 2013 DesignCreatePlay Inc.' ) ;
console . log ( 'Info: This program comes with ABSOLUTELY NO WARRANTY.' ) ;
console . log ( 'Info: This is free software, and you are welcome to redistribute it under certain conditions.' ) ;
console . log ( 'Info: ===' ) ;
fs . readFile ( path . join ( _ _dirname , 'config.json' ) , function ( err , data ) {
if ( ! err && args . setup !== true ) {
global . config = JSON . parse ( data ) ;
global . config . url = global . config . base _url + ( global . config . use _port ? ':' + global . config . port : '' ) + '/' ;
global . config . upload _url = global . config . url + 'uploads/' ;
console . log ( 'Info: Initializing NodeBB v' + ver + ', on port ' + global . config . port + ', using Redis store at ' + global . config . redis . host + ':' + global . config . redis . port + '.' ) ;
console . log ( 'Info: Base Configuration OK.' ) ;
var meta = require ( './src/meta.js' ) ;
@ -84,7 +108,7 @@ fs.readFile(path.join(__dirname, 'config.json'), function(err, data) {
var user = require ( './src/user.js' ) ;
user . makeAdministrator ( 1 ) ;
} else {
console . log ( 'Info: Good .') ;
console . log ( 'Info: Categories OK. Found ' + data . categories . length + ' categories .') ;
}
} ) ;
}