ecolitan / fatics

Python FICS Server, modified to run on Heroku

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Introduction
------------
This is an Internet chess server inteded to be a free software equivalant
for the server that currently runs at freechess.org.

Contact: Wil Mahan <wmahan+fatics@gmail.com>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

System requirements
-------------------
* Linux (it might work on other OSes, but I haven't tried)
* GCC, make and zlib1g-dev for compiling timeseal (any recent version
  should work)
* Python 2.6 or 2.7
* Twisted 8.2 or later (in venv)
* MySQL 5.0 or later
* The MySQLdb Python module
* The python-bcrypt module (in venv)
* The netaddr module (in venv)
* The pytz module (in venv)
* GNU gettext
* (optional) The pexpect module, for timeseal/zipseal tests (in venv)

Installation
------------

* Timeseal and zipseal *
The timeseal and zipseal programs can be compiled by changing to the
timeseal/ directory and typing "make".  That should build both the client
programs (named openseal and zipseal) and the decoders that
the server needs (openseal_decoder, zipseal_decoder, and zipseal_encoder).

The source code for Win32 version of zipseal is in timeseal/win32/, but it
doesn't have a proper build instructions, because I don't have Windows.
I currently compile it with an unholy mix of wine and a Microsoft
compiler.

* Gettext messages *
The gettext messages need to be compiled into machine-readable (.mo)
format.  Assuming you have GNU gettext, you can do this by executing
scripts/compile-messages from the top of the source tree.

* Running the server *
First you'll need to create a MySQL database and user.  I assume you
know how to do this.

The server uses localhost as the server and the username "chess" by default;
these can be changed by editing src/config.py.  The server looks in
~/.my.cnf for the password to use; for example:

# start .my.cnf
[client]
user = chess
password = your_password_here
# end .my.cnf

Next, you can create the tables FatICS needs using the schema in db/db.sql.
For example, from the top of the source directory:
"mysql chess < db/db.sql".


You can import the ECO codes into the database now using
"./scripts/import-eco.py".  This isn't required to run the server, but
if you don't, the "eco" command will report all openings as unknown, and
some tests will fail.

Source the virtualenv environment
  "$ source venv/bin/activate"

If there are no errors, you're ready to try to run the server.
From the top of the FatICS source tree, you can use one of the
following commands:

  "./chessd run"     -- run in the foreground; log to the console
  "./chessd start"   -- run as a daemon; log to chessd.log
  "./chessd profile" -- run in profiling mode

After the server is started, you can use these commands:

  "./chessd test"    -- run the test suite
  "./chessd stop"    -- shut down the server

If all goes according to plan, when you start the server it will be ready
for you to log in on port 5000 (port 5001 for zipseal).  By default the
schema creates one player named "admin" with the password "admin";
obviously it's a good idea to log in and change the password (using the
"password" command) if you are testing on a machine with ports open to
the Internet.

For information about running the tests, see README.tests

-- Wil

About

Python FICS Server, modified to run on Heroku

License:GNU Affero General Public License v3.0


Languages

Language:Python 94.7%Language:C 5.0%Language:Java 0.1%Language:Shell 0.1%Language:Assembly 0.0%Language:Racket 0.0%Language:C++ 0.0%