Over the last couple of weeks I’ve been trying to figure out IPv6. Having worked through some of the IPv6 certification at http://ipv6.he.net/ I now have an IPv6 enabled web server and mail server as well as IPv6 connectivity at home via tunnelbroker.net
I thought I’d update Shartak to allow access via IPv6 as well as IPv4 – mostly nothing needed to be changed, however…
…there were a few database tables where the IP address is stored and these had to be updated from 16 characters to 40 to accommodate the increased length of an IPv6 address compared to IPv4.
There was also some session management code that needed to be updated to parse IPv6 addresses just so it could compare the previous IP and current IP to see if they were mostly the same for session security.
The biggest issue I’ve found is that the Shartak game runs within it’s own copy of apache with custom config files and runs as a non-privileged user. This means that it has to use a non-standard port number and then I use iptables to redirect port 80 connections to the other port.
You might wonder why I don’t setup the main apache process to proxy requests – the reason is all the connections then appear to come from the local IP which then makes session security and “zerg” detection harder.
The only solution I could find was to modify the config to listen on port 80 and then start the apache server as root. It’s not a major problem to have to use sudo but I would rather not. After checking over any scripts (log parsing for web stats etc) to make sure they all use sudo where needed, an AAAA record was added to the DNS and Shartak is now fully IPv6 enabled.
One comment on “IPv6 and Shartak”
Thank you for bothering to line this all out for all of us. This post has been really helpful to me.
Comments are closed.