Skip to content

malcolmsharpe/websockettau

 
 

Repository files navigation

*** Requirements
Python 2.7 (for argparse module)
http://www.python.org/

Tornado Web Server
http://www.tornadoweb.org/

SQLAlchemy
http://www.sqlalchemy.org/


*** Running
You must first create a secrets.py module containing a single string
'cookie_secret':

  import base64
  import uuid
 
  print base64.b64encode(uuid.uuid4().bytes + uuid.uuid4().bytes)

Type:
  sudo python2.7 tau.py
Root access is required to bind to port 80.

For options, type:
  python2.7 tau.py --help


*** Adding a new game type (as of July 15, 2012)
- Implement the rules in game.py.
- Add a name mapping to static/game_list.js.
- Add a name mapping and URL mapping to tau.py.
- Add a rules description and name mapping to templates/about.html.
- (Sometimes applicable) Add changes to playing area in static/tau.js.
- (If adding new cards) Make the following updates:
    static/tau.js: getImgClass(), get_card_number()
    static/styles.css: new class similar to .regularTau, .projectiveTau, etc.

How to set up Fedora 16 server:
$ ssh root@...
$ passwd # to set password to something sane
$ yum install git
$ yum install python
$ yum install gcc-c++
$ git clone https://github.com/jasharpe/websockettau.git
# install tornado
$ wget https://github.com/downloads/facebook/tornado/tornado-2.4.1.tar.gz
$ tar xvzf tornado-2.4.1.tar.gz
$ cd tornado-2.4.1
$ python setup.py build
$ sudo python setup.py install
# install sqlalchemy
$ yum install python-sqlalchemy
# create secrets.py
$ cd ~/websockettau && cat > secrets.py
cookie_secret = "SOME STRING HERE"
# Set up certificates by creating localhost.crt certificate, and put in websockettau directory.
# Open ports, add to /etc/sysconfig/iptables:
# -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
# -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
$ ./restart.sh

# Set up ntp, so that time stays up to date (otherwise backups will fail when the clock skew gets too high!)
$ yum install ntp
$ ntpd

# setup automatic backups to S3
$ yum install s3cmd
$ s3cmd --configure
# follow the prompts...
# test that backups will work properly
$ ./run_backup
# verify that the backup appears in S3
# set up automatic backups. s3_crontab is a template. Modify it to suit you.
$ crontab s3_crontab

About

Web Socket Tau

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 66.8%
  • JavaScript 18.4%
  • Java 10.2%
  • CSS 3.2%
  • PHP 1.1%
  • Shell 0.3%