|
| 1 | +webDiplomacy readme, for webmasters |
| 2 | +---------------------------------------- |
| 3 | +=> Note to players |
| 4 | +=> requirements |
| 5 | +=> Installing |
| 6 | +=> Updating |
| 7 | +=> Maintenance |
| 8 | +=> Security |
| 9 | +=> Developing |
| 10 | +=> Help |
| 11 | + |
| 12 | + |
| 13 | +Note to players |
| 14 | +--------------- |
| 15 | +webDiplomacy doesn't have an install wizard which checks and installs everything for you, the |
| 16 | +code is made available mainly for developers who want to create unique webDiplomacy servers |
| 17 | +(e.g. with unique translations or rule variants), or work on the official code. |
| 18 | +If your only experience of PHP and MySQL is installing phpBB, say, you may have trouble with |
| 19 | +this software. |
| 20 | + |
| 21 | +If you just want to play with friends try to find an existing webDiplomacy server and set up |
| 22 | +a private game there. (http://webdiplomacy.net/ is the official server.) |
| 23 | + |
| 24 | + |
| 25 | +requirements |
| 26 | +------------ |
| 27 | +- PHP 5.2+ |
| 28 | +- MySQL 5, with support for MyISAM, InnoDB, and memory tables |
| 29 | +- The GD 2 PHP extension, with FreeType support |
| 30 | +- Ability to send e-mail from the server (Access to an SMTP server or sendmail) |
| 31 | +- Quite a bit of disk space (depending on the expected size of the server; if |
| 32 | + your hosting space is measured in MB you may not have enough) |
| 33 | +- Quite a bit of processing power (if you've only got an account with an oversold |
| 34 | + shared-hosting company you may have problems; webDiplomacy probably uses more |
| 35 | + resources per user than, say, phpBB) |
| 36 | +- Ability to set up a crontab to fetch a web-page every 5 minutes or so, to run |
| 37 | + the game processing / server maintenance script |
| 38 | + |
| 39 | + |
| 40 | +Installing |
| 41 | +---------- |
| 42 | +=> Database scripts |
| 43 | +Run install/install.sql to set up the initial data-set, you can run this in |
| 44 | +phpMyAdmin's "Import" tab, if you don't have shell access. |
| 45 | + |
| 46 | +=> Config |
| 47 | +Edit config.sample.php to work with your setup, being very careful to read the warnings |
| 48 | +about security issues. The salts/secrets, errorlog/orderlog directories, can all |
| 49 | +leave your server wide open if you don't set them right. Rename to config.php when ready. |
| 50 | + |
| 51 | +=> Log-on |
| 52 | +Once you've set config.php up you can use the random gameMasterSecret you entered |
| 53 | +to authenticate as the admin. First create a user via the registration page, then |
| 54 | +once logged on go to gamemaster.php?gameMasterSecret=[yoursecret] . |
| 55 | + |
| 56 | +It will give you admin rights, then refresh the page as admin to run the gamemaster |
| 57 | +script for the first time, which will initialize various stats and maintenance |
| 58 | +processes. (This only works for the first user that does it, any other |
| 59 | +admins/moderators have to be set via the admin control-panel.) |
| 60 | + |
| 61 | +Go to the Admin CP via the menu, find the "Toggle Maintenance Mode" action and |
| 62 | +run it, preventing others from using the server up while you're testing it. |
| 63 | + |
| 64 | +=> Test |
| 65 | +Once that's set up you should go to Help->DATC. With Maintenance mode on it will |
| 66 | +show a screen which can run through the DATC tests, which provides an easy way to |
| 67 | +test that the installation was successful. Click Batch-test and it'll run through |
| 68 | +all the tests one by one. If maps are being generated successfully then everything |
| 69 | +is probably going to work. (Batch-testing the DATC tests may have problems in IE, |
| 70 | +try Firefox/Chrome/Safari until this is fixed.) |
| 71 | + |
| 72 | +=> Open up |
| 73 | +Once you've looked around, posted a test message etc, and double-checked your |
| 74 | +config.php file for security issues, you can disable Maintenance mode via the |
| 75 | +admin CP to allow regular users to access the installation. |
| 76 | + |
| 77 | +=> Start a processing cycle |
| 78 | +Now you need to set the system up so that games are automatically processed. This |
| 79 | +means running gamemaster.php?gameMasterSecret=[yoursecret] every 5 minutes or so |
| 80 | +from an automated script, via cron for example. Here is an example crontab: |
| 81 | + |
| 82 | +For example here is my cron line: |
| 83 | +*/5 * * * * /usr/bin/wget -O - 'http://webdiplomacy.net/gamemaster.php?gameMasterSecret=12345' >/dev/null 2>&1 |
| 84 | + |
| 85 | +'*/5 * * * *' sets the times the script should run (every 5 minutes) |
| 86 | +'/usr/bin/wget' is the program which downloads the script thus running it. |
| 87 | +'http://webdiplomacy.net/gamemaster.php?gameMasterSecret=12345' is the gamemaster URL |
| 88 | +'-O - ' specifies to output to standard output |
| 89 | +'>/dev/null 2>&1' specifies that the standard output should be discarded (i.e. just run the |
| 90 | +page without saving the results) |
| 91 | + |
| 92 | +=> Check |
| 93 | +Once you're seeing the Last process time at the bottom of the page staying within 5 |
| 94 | +minutes of the current time the background processing is working, and everything should |
| 95 | +be up and running. |
| 96 | + |
| 97 | + |
| 98 | +Updating |
| 99 | +-------- |
| 100 | +If updating from an older webDiplomacy version check the install/ folder subdirectories. Each |
| 101 | +update should come with a readme. You may have to update through multiple versions. |
| 102 | + |
| 103 | +Remember to take backups! There aren't a large number of people testing these update scripts, |
| 104 | +unlike phpBB updates or other scripts you may be familiar with, so bugs and tweaking are to be |
| 105 | +expected as part of the updating process. |
| 106 | + |
| 107 | + |
| 108 | +Maintenance |
| 109 | +----------- |
| 110 | +Be sure to subscribe to the http://sf.net/projects/phpdiplomacy mailing list, to receive |
| 111 | +emails when updates are released, as they'll probably contain bugfixes. |
| 112 | + |
| 113 | +There are a bunch of variables at the bottom that indicate the general health of the server, |
| 114 | +whether the background-processor is running , whether there are any crashed games, etc. It's |
| 115 | +best to keep an eye on these. |
| 116 | + |
| 117 | +=> Cleaning up |
| 118 | +The mapstore folder can be deleted every so often if it's getting too large, however if |
| 119 | +space isn't a concern the directory structure is tree like and will scale to any reasonable |
| 120 | +number of games, and cacheing maps saves lots of CPU-time. |
| 121 | + |
| 122 | +Access logs in the database also need to be cleaned periodically, the admin CP will wipe all |
| 123 | +but the last 30 days of logs. |
| 124 | + |
| 125 | +If you have order-logging enabled the orderlog directory will fill up quickly, and can be |
| 126 | +wiped regularly. If players aren't complaining that they entered different orders there's |
| 127 | +no point logging orders to prove them wrong. |
| 128 | + |
| 129 | +If error logging is enabled logs can accumulate, but they should be handled and removed as they come. |
| 130 | + |
| 131 | +Game messages will probably take up the largest part of database storage. If keeping messages |
| 132 | +from old games is less important than using little space they can be deleted for old games |
| 133 | +occasionally (especially gamemaster auto-messages which also make a large part of the |
| 134 | +GameMessages table) |
| 135 | + |
| 136 | +TerrStatusArchive and MovesArchive are the other two large tables; they contain data used to |
| 137 | +draw old maps, and can be periodically wiped for old games if achived game history isn't |
| 138 | +needed. |
| 139 | + |
| 140 | +Other than that check the admin CP status lists every so often which should highlight any problems |
| 141 | +which are auto-detected. |
| 142 | + |
| 143 | + |
| 144 | +Security |
| 145 | +-------- |
| 146 | +First off you must make sure you have read the warnings in the config comments very carefully. |
| 147 | +The software won't try and detect silly mistakes that expose errorlogs/orderlogs to everyone. |
| 148 | +If people can access errorlogs they may be able to see database passwords and other sensitive |
| 149 | +info. If they can access the orderlogs they will know the moves others are entering. |
| 150 | + |
| 151 | +Security is taken seriously in the code; no security holes have yet been found in it, and |
| 152 | +nowhere are there dynamic require_once statements or evals, or any of the common PHP security traps, |
| 153 | +but this has to be supplemented by setting strict permissions and using secure passwords. |
| 154 | + |
| 155 | +After installation everything can be and should be set to read-only except for the errorlog, |
| 156 | +accesslog, and mapstore directories, which should be set so that nothing within them can be |
| 157 | +executed (e.g. by using a .htaccess file for Apache). |
| 158 | + |
| 159 | +The admin, board, gamemaster, gamepanel, gamesearch, install, lib, locales, map, objects, and |
| 160 | +register folders are all not required to be accessible from the web, and so access to these from |
| 161 | +the web server should be restricted (e.g. by using a .htaccess file for Apache). |
| 162 | + |
| 163 | +You may want to monitor webDiplomacy's resource use; it doesn't do this automatically and it |
| 164 | +may be using |
| 165 | + |
| 166 | + |
| 167 | +Developing |
| 168 | +---------- |
| 169 | +Check http://webdiplomacy.net/developers.php for the most up-to-date developer documentation. |
| 170 | + |
| 171 | +Be aware of the obligations of the AGPL software license we use: *If you change webDiplomacy you |
| 172 | +must be prepared to share any changes you make. If that doesn't fit your requirements do not use |
| 173 | +this software!* |
| 174 | + |
| 175 | + |
| 176 | +Help |
| 177 | +---- |
| 178 | +If you have any questions you can get help at the developer forum at http://forum.webdiplomacy.net/ |
| 179 | + |
| 180 | + |
| 181 | +Kestas Kuliukas - 30/08/09 |
0 commit comments