Permalink
Browse files

+ added README.md (5%)

+ added script to verify dependencies (70%)
+ added package.json (0%)
+ added nodester_official_install_guide.txt (taken from nodester repo)
  • Loading branch information...
0 parents commit 40bc42cdd91f303557c74ef7b7edc93134a9fb02 Lele committed Apr 24, 2011
Showing with 203 additions and 0 deletions.
  1. +7 −0 README.md
  2. +85 −0 dependencies_verify.sh
  3. +111 −0 nodester_official_install_guide.txt
  4. 0 package.json
@@ -0,0 +1,7 @@
+# NNi - nodester npm installer
+## Description
+ This is the nodester npm cross-platform intaller (Linux & MacOSX)
+## Disclaimer
+ **WARNING**
+ We're not responsible for whatever injuries/damage you could get from/by this script. Included but not limited to fried cats, zombie relatives or your fiacee suddenly turning nerdy.
+
@@ -0,0 +1,85 @@
+#!/bin/bash
+# simple script to verify if youw system already has the needed binary for express
+
+# color used for printing
+use_color=true;
+if ($use_color) ;
+then
+ BLDWHI=$(tput bold ; tput setaf 3)
+ BLDVIO=$(tput bold ; tput setaf 5)
+ BLDCYA=$(tput bold ; tput setaf 6)
+ BLDRED=$(tput bold ; tput setaf 1)
+ BLDGRN=$(tput bold ; tput setaf 2)
+ NOCOLR=$(tput sgr0)
+fi
+
+declare -a deps_not_ok
+deps_not_ok=()
+# checking system dependencies
+declare -a sys_dependencies
+# define your system dependencies here
+sys_dependencies=("node" "npm" "curl" "foobar" "foo" "bar")
+for sys_dep in ${sys_dependencies[@]}
+do
+ type -P $sys_dep &>/dev/null \
+ && {
+ DEP_OK="I need $sys_dep and it is correctly installed." ;
+ OK_MSG="OK - :)";
+ TRM_COL=$(tput cols) ; DEP_COL_OK=${#DEP_OK} ; OK_MSG_COL=${#OK_MSG} ;
+ COL_OK=$(( $TRM_COL - $DEP_COL_OK - $OK_MSG_COL )) ;
+ sys_dep="${BLDCYA}${sys_dep}${NOCOLR}"
+ DEP_OK="I need $sys_dep and it is correctly installed." ;
+ printf '%s%*s%s' "$DEP_OK" $COL_OK "[${BLDGRN}${OK_MSG}${NOCOLR}]" >&2;
+ echo ;
+ } \
+ || {
+ DEP_KO="I need $sys_dep and but it is missing." ;
+ KO_MSG="KO - :(";
+ TRM_COL=$(tput cols) ; DEP_COL_KO=${#DEP_KO} ; KO_MSG_COL=${#KO_MSG} ;
+ COL_KO=$(( $TRM_COL - $DEP_COL_KO - $KO_MSG_COL )) ;
+ sys_dep="${BLDCYA}${sys_dep}${NOCOLR}"
+ DEP_KO="I need $sys_dep and but it is missing." ;
+ printf '%s%*s%s' "$DEP_KO" $COL_KO "[${BLDRED}${KO_MSG}${NOCOLR}]" >&2;
+ echo ;
+ new_len=$(( ${#deps_not_ok[@]} + 1 ))
+ deps_not_ok[$new_len]=$sys_dep
+ }
+done
+# checking npm dependencies
+declare -a npm_modules_dependencies
+# define your npm dependencies here
+npm_modules_dependencies=("express" "jade" "node" "npm" "curl")
+for npm_mod in ${npm_modules_dependencies[@]}
+do
+ installed=$(npm -dg ls 2>&1 | grep -E '[├│└]' | grep " $npm_mod\\@" | wc -l)
+ [ $installed -gt 0 ] \
+ && {
+ DEP_OK="I need $npm_mod and it is correctly installed." ;
+ OK_MSG="OK - :)";
+ TRM_COL=$(tput cols) ; DEP_COL_OK=${#DEP_OK} ; OK_MSG_COL=${#OK_MSG} ;
+ COL_OK=$(( $TRM_COL - $DEP_COL_OK - $OK_MSG_COL )) ;
+ npm_mod="${BLDVIO}${npm_mod}${NOCOLR}"
+ DEP_OK="I need $npm_mod and it is correctly installed." ;
+ printf '%s%*s%s' "$DEP_OK" $COL_OK "[${BLDGRN}${OK_MSG}${NOCOLR}]" >&2;
+ echo ;
+ } \
+ || {
+ DEP_KO="I need $npm_mod and but it is missing." ;
+ KO_MSG="KO - :(";
+ TRM_COL=$(tput cols) ; DEP_COL_KO=${#DEP_KO} ; KO_MSG_COL=${#KO_MSG} ;
+ COL_KO=$(( $TRM_COL - $DEP_COL_KO - $KO_MSG_COL )) ;
+ npm_mod="${BLDVIO}${npm_mod}${NOCOLR}"
+ DEP_KO="I need $npm_mod and but it is missing." ;
+ printf '%s%*s%s' "$DEP_KO" $COL_KO "[${BLDRED}${KO_MSG}${NOCOLR}]" >&2;
+ echo ;
+ new_len=$(( ${#deps_not_ok[@]} + 1 ))
+ deps_not_ok[$new_len]=$npm_mod
+ }
+done
+# printing missing dependencies
+echo -n "Components ${BLDWHI}not found${NOCOLR}: ";
+for i in "${deps_not_ok[@]}"
+do
+ echo -n "$i "
+done
+echo ;
@@ -0,0 +1,111 @@
+Nodester - A node.js hosting platform
+
+Dependencies:
+ node.js (Latest stable version 0.4.0)
+ npm
+ curl
+ node.js Modules:
+ # http-proxy -- Included in libs/3rdparty due to changes at are not in upstream yet
+ pool
+ express
+ request
+ npm-wrapper
+ daemon
+ forever
+ cradle
+
+Installation:
+ Install node.js (0.4.x recommended)
+ Package from distro
+ OR wget, ./configure, make, make install
+ Create a user and group to run nodester as
+ sudo su -
+ groupadd -g 501 nodester
+ useradd -d /var/nodester -c "nodester" -g nodester -m -r -s /bin/bash -u 501 nodester
+ passwd nodester
+ Login to that account and ensure that .ssh/authorized_keys exists
+ ssh nodester@yourhost
+ cd ~
+ mkdir .ssh
+ touch .ssh/authorized_keys
+ chmod go-rwx .ssh/authorized_keys
+ Update sudoers to allow running of the proxy on port 80
+ sudo visudo
+ And add the following lines
+ nodester ALL = NOPASSWD: /var/nodester/nodester/proxy/start_proxy.sh *
+ nodester ALL = NOPASSWD: /var/nodester/nodester/proxy/stop.sh
+ nodester ALL = NOPASSWD: /var/nodester/nodester/scripts/launch_app.sh *
+ Install npm
+ cd ~
+ echo -e "root = ~/.node_libraries\nmanroot = ~/local/share/man\nbinroot = ~/bin" > ~/.npmrc
+ echo -e "export PATH=\"\${PATH}:~/bin\";" >> ~/.bashrc
+ source ~/.bashrc
+
+ ##This part is a hack to use the old npm with the new node until
+ ## certain packages can catch up and be installed with npm@0.3.x
+
+ mkdir ~/src
+ cd src
+ git clone git://github.com/isaacs/npm.git ./npm
+ cd npm
+ git checkout origin/0.2
+ make dev
+
+ ##Fetch 0.2.6 version of node for npm
+ cd ~/src
+ sudo mkdir -p /usr/local/n/versions/
+ wget http://nodejs.org/dist/node-v0.2.6.tar.gz
+ tar -vzxr node-v0.2.6.tar.gz
+ cd node-v0.2.6
+ ./configure --prefix=/usr/local/n/versions/0.2.6
+ make
+ sudo make install
+
+ cd ~/bin
+ cp npm\@0.2.18 nodester-npm
+ vim nodester-npm
+ "Replace '#!/usr/bin/env node' with '#!/usr/local/n/versions/0.2.6/bin/node'
+
+ Either install CouchDB or get a CouchOne account
+
+ Install node-module dependencies
+ for X in pool express npm-wrapper request daemon forever cradle; do npm install ${X}; done
+
+ Get nodester
+ cd ~
+ git clone git://github.com/nodester/nodester.git
+ cd nodester
+
+ (Need to do these steps as the non-nodester user)
+ Ensure that the ownership of nodester/proxy is all root for security
+ cd /var/nodester
+ sudo chown -R root:root nodester/proxy
+ Install the git folder shell to restrict git to per user folders
+ cd /var/nodester/nodester
+ sudo cp scripts/git-shell-enforce-directory /usr/local/bin
+ sudo chmod +x /usr/local/bin/git-shell-enforce-directory
+
+ (Back to the nodester user)
+ Configure the app
+ Copy nodester/example_config.js to nodester/config.js
+ Edit the settings in nodester/config.js
+ Copy scripts/example_gitrepoclone.sh to scripts/gitrepoclone.sh
+ Update scripts/gitrepoclone.sh with the key you specified in config.js
+ Setup the CouchDB tables
+ cd ./nodester/scripts/couchdb
+ ./create_all_couchdb_tables.js
+ ./setup_default_views.js
+ Start up the proxy and main/api app
+ cd nodester
+ ./bin/app_start.sh
+ sudo ./bin/proxy_start.sh
+ Test the web frontend at 127.0.0.1:80
+ Create a user
+ ..
+ Create an app
+ ..
+ Start the app
+ ..
+ Test the app
+ ..
+ Rejoice!
No changes.

0 comments on commit 40bc42c

Please sign in to comment.