Hosting The Dark Mod

From The DarkMod Wiki
Jump to: navigation, 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 or HTTPS 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 other methods.


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.
  • Space: 3 GByte for the mod itself, or 2 Gbyte for the FMs (about 5 GByte for both)
  • 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 3 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 maybe the mirror list (remove your own host!) at the top and run it on your server.

If you have not enough space

If you have not enough space for the entire mod, then hosting some files will still help. Here are a few files you can safely delete, because these are almost never used (most people either install from scratch or update from the latest version, v1.07 to v1.08):

  • tdm_update_1.02_to_1.03.zip (215 Mbyte)
  • tdm_update_1.03_to_1.04.zip (263 Mbyte)
  • tdm_update_1.04_to_1.05.zip (11 Mbyte)
  • tdm_update_1.05_to_1.06.zip (50 Mbyte)
  • tdm_update_1.06_to_1.07.zip (185 Mbyte)

Together these save you about 750 Mbytes.

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 individualy 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

Traffic bloodgate release v1.08.png

Normally, mnost updates of TDM are done 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. This can cause quite a traffic spike, but usually subsides quickly.

On the right you can see the effect.

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