Hosting The Dark Mod

From The DarkMod Wiki
Revision as of 09:07, 10 November 2012 by Tels (talk | contribs) (fix description)
Jump to navigationJump to search

If you want to help to distribute The Dark Mod, this article offers help on what you need to do.

How it works

TDM is distributed via HTTP only.

Both tdm_update (downloads and updates the mod) and the in-game downloader (downloads and updates Fan Missions) don't support FTP, HTTP redirects, meta-refreshes or any other method. HTTPS might work, but has generally not been tried yet.


When the mod itself is updated, first tdm_mirrors.txt is downloaded. This file contains a list of mirror servers and a score, which helps balance the traffic. Here is a list of the currently know mirrors:

# This file lists mirror sites for The Dark Mod, which are used by the
# tdm_update utility to update your TDM installation.

[Mirror KeepOfMetalAndGold]
url = http://www.keepofmetalandgold.com/files/tdm/
weight = 10

[Mirror ShadowDarkKeep]
url = http://www.shadowdarkkeep.com/files/tdm/
weight = 3

[Mirror SouthQuarter]
url = http://www.southquarter.com/tdm/
weight = 6

[Mirror roggen.jmnet.us]
url = http://roggen.jmnet.us/darkmod/
weight = 4

[Mirror fidcal.com]
# unlimited traffic
url = http://www.fidcal.com/darkuser/
weight = 6

[Mirror robertrueger.de]
url = http://thedarkmod.robertrueger.de/
weight = 10

[Mirror bloodgate.com]
# 100 Gbyte traffic
url = http://bloodgate.com/mirrors/tdm/pub/pk4/
weight = 1

[Mirror swift-mazes.com]
# 1 Tbyte traffic
url = http://swift-mazes.com/mirrors/tdm/release/
weight = 2

[Mirror tunnels-of-danger.com]
# 1 Tbyte traffic (shared with swift-mazes.com)
url = http://tunnels-of-danger.com/mirrors/tdm/release/
weight = 2

[Mirror molez.net]
# unlimited traffic
url = http://www.molez.net/mirror/tdm/
weight = 5

What you need

  • A server with a fast connection, preferable with either unlimited traffic, or at least 1 Terabyte per month.
  • 2.5 GByte space for the mod itself, or 2 Gbyte for the fan missions (or about 4.5 GByte overall)
  • A way to give the TDM core team access to your server, preferable via FTP login. If that cannot be arranged, you need to be available when files need to be updated.
  • The server must respond to individual file requests via HTTP with a "200 OK" and the content. Things like redirects (302, 307 etc.) as well as intermediate HTML pages (meta refresh), or FTP are currently not supported by the updater nor the in-game downloader.

Hosting the mod

The mod itself needs approximately 2.5 Gbyte space. It is possible to host only parts of it by deleting the biggest files. This however causes the updater to hit files needlessly, so if possible, the entire mod should be hosted.

Here is a list of files and their MD5 sums that you need: TDM filelist

Once you have added all the files to your server, a TDM developer can add an entry to the tdm_mirrors.txt file. This file contains the base URL for each server, as well as a score. The score helps balance the traffic between the mirrors.

If you look for a fast way to mirror the entire mod or the FMs onto your server, you can use this Perl script. Adjust the Path and URL at the top and run it on your server.

Hosting FMs

All FMs todate need about 2 Gbyte space. It is possible to host only certain FMs (the newest, or the biggest). Since every FM is added individual to the mirror list, this causes no harm.

For a list of all available FMs and their current download locations, see here.

Once you have added an FM file to your server, you need to send the URL to a TDM developer (Bikerdue, nbohr1more, Springheel or Tels) and let them add the URL to the mirror list. The URLs are both used by the in-game downloader as well as made public on the webpage. This happens automatically.

Keeping traffic under control

Normally, updates to TDM are by downloading a small differential file (usually only a few hundred Mbytes). Shortly after a release, and from time to time, there are people who install the mod from scratch. These can cause quite a bit of traffic, but are usually a minority.

What costs traffic, however, are bots, who are either blindly following links, or traversal directories on your server. Here are a few tips to keep them out and your traffic low:

  • disallow directory traversal on your server. If you can open http://yourserver/thedarkmodfiles/ on your server and see a listing, it is still enabled.
  • use a robots.txt to keep Google, Bing, Yahoo, Baidu etc out of this directory (better disallow all robots)
  • disallow anything that has a known bot or spider signature (wget, Java, libwww, common bot names, or anything that has a referer of the file itself (PK4 files cannot be refering to themselves).

If all else fails, block anything except tdm_update. Here is its signatures:

"GET /pk4/tdm_sound_vocals06.pk4 HTTP/1.1" 200 33639507 "-" "The Dark Mod Updater / libtdm_update v0.58/Win32"

The OS (Win32, Linux etc.) can vary, as well as the version number.

The same goes for FM hosting. The signature of the in-game downloader is:

"GET /fms/madmountain.pk4 HTTP/1.1" 200 2422893 "-" "The Dark Mod Agent/1.08 Linux"

See also