forked from jakesgordon/javascript-tetris
-
Notifications
You must be signed in to change notification settings - Fork 1
Install a own Fishtris Server
Sven Anders edited this page Mar 21, 2014
·
5 revisions
https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager
curl https://www.npmjs.org/install.sh >install.sh
chmod 755 install.sh
./install.sh
npm install -p socket.io
npm install winston
useradd fishtris
su -s /bin/bash fishtris
git clone [email protected]:tabacha/fishtris2.git
cd fishtris2
nodejs fishtris-server.js
Now you can connect with a browser to http://localhost:8080/
Do not start fishtris-server as root. This is not good, for security reasons.
If you want to listen to port 80 add as root:
iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080
If you want Ipv6, there is no nat rule. We use haproxy for translating between port 80 and port 8080. You find the required config file in git doc/haproxy.cfg
npm install -p js-beatuify
npm install jshint -g
npm install uglify-js -g
#!/bin/bash
JSB=$(which js-beautify)
if [ -z "$JSB" ] ; then
echo please install js-beautify
exit 1
else
$JSB fishtris.js >/tmp/fishtris$$.js
diff fishtris.js /tmp/fishtris$$.js
if [ $? != 0 ] ; then
echo "Please js-beautify -r fishtris.js"
exit 1
fi
$JSB fishtris-server.js >/tmp/fishtris-server$$.js
diff fishtris-server.js /tmp/fishtris-server$$.js
if [ $? != 0 ] ; then
echo "Please js-beautify -r fishtris-server.js"
exit 1
fi
rm /tmp/fishtris$$.js /tmp/fishtris-server$$.js
fi
exit 0