Requirements:
-- A typical Linux server (circa 2011)
-- Node.js (Version 0.4.10 or later) [More ...](http://nodejs.org)
-- MongoDB (Version 1.8.2 or later) [More ...](http://mongodb.org)
+- Debian/ubuntu-server GNU/Linux Box with a modern kernel (2.6.39 <)
+- 1 GB (idealy) 512MB min.
+- Node.js (Version 0.6.1 or later) [More ...](http://nodejs.org)
+- MongoDB (Version 2.0.2 or later) [More ...](http://mongodb.org)
- forever
- $ pwd
- /home/you
- $ install git
- $ install node
- $ git clone git@github.com:/finalsclubdev/FinalsClub fc
- $ cd fc
- $ git submodule init
- $ git submodule update
+Deployment:
+
+1. Copy setup.sh to home directory.
+
+2. REVIEW setup.sh BEFORE RUNNING!!!!
+
+3. run: sudo setup.sh
+
+4. mongorestore any back-up databases that you may have.
+
+5. Copy "start" to home directory and run.
- [[ flesh this out with correct commands - reference util scripts - fix util scripts ]]
# System components
Most of the system is written in Javascript and executed by the Node.js runtime.
-
# Source Code
#!/bin/bash
-# TODO update this with the contents of new.sh
-exit # This breaks the script before it does anything else
-
-export PATH="/usr/local/bin:$PATH"
-
-cd ~
-rm -rf bc
-git clone git://github.com/finalsclubdev/bc.git
-cd ~/bc
-npm install connect
-npm install socket.io
-npm install express-messages
-npm install jade
-
-cd ~
-rm -rf FinalsClub
-git clone git://github.com/finalsclubdev/FinalsClub.git
-ln -sf FinalsClub fc
-
-cd ~/fc
-git checkout master
-git submodule init && git submodule update
-npm install
-cd etherpad-lite
-npm install
-
-# install some dependencies
-cd ~/fc
-npm install connect
-npm install socket.io
-npm install express-messages
-npm install jade
-
-
-## init fcbackup
-cd ~/fc/fcbackups
-chmod 775 fcbackup_init.sh
-./fcbackup_init.sh
-
-
-## start the server
-cd ~/fc
-./restart
-
+# Start Script for running app.js and Etherpad-lite
+# Kill all node instances
+killall node
+# Set Env. Vars.
+export NODE_PATH=/home/risci_atom/fc/etherpad-lite/node_modules:$NODE_MODULES
+export MONGO_HOST_URI=mongodb://localhost/fc
+export MONGO_HOST=localhost
+export SERVER_HOST=www.finalsclub.org
+export SERVER_PORT=80
+export NODE_ENV=production
+ps waux | grep node | grep -v grep
+echo "starting ..."
+cd fc/etherpad-lite/node
+forever server.js &> log.txt &
+cd ../../
+if [ "$(id -u)" != "0" ]; then
+ ## note: start as root, pass env vars to sudo param, this app will downgrade itself onc$
+ sudo -E forever app.js &> log.txt &
+else
+ forever app.js &> log.txt &
+fi