X. Configuration file and database

1.Configuration file

HSX requires a configuration file to run. Here is a description of each line of this file. Every line of the file has the following format:
Code,option where Code is a letter from A to Z (case insensitive) and option depends of the code. They are separated by a comma (,) WITHOUT SPACE.

CodeOptionMeaning
RstringThis line defines the path of the root site (where all HSX directories are). This code is mandatory. You must define an absolute path not a relative (path must start with a slash). Example: R,/home/hsx
PnumberDefines the site port number. The default value is 5500. This code is optionnal. Example: P,5500
Taddress[,password]Defines the address of a tracker where HSX must register the site. You can also specify an optionnal password. You can define upto 32 trackers to use. This code is optionnal. Example: T,dummy.tracker.com,adummypassword
SstringDefines the site name. This option is mandatory only if you plan to register the site on tracker. Sitename length is limited
to 31 characters. Example: S,mon site a moi.
DstringDefine the site description. This option is mandatory only if you plan to register the site on tracker. String length is limited to 255 characters. You can use any existing characters, including ‚,‘ . Example: D,this is a dummy site, and there is nothing here
XnumberDefines the number of simultaneous DOWNLOADS. Uploads are not affected by this option. If the number is below 0, the number of simultaneous downloads is not limited. Default value is -1 (not limited).
Example: X,5WARNING: this flag is no more supported, you must use key download_queue_size in the database.

2. Database

Since HSX has plugin support, a database is used to store some configuration parameters for HSX itself and also for plugins. You can use GHX to graphically configure HSX using HSX configuration manager. Moreover, some functions can only be configured using this plugin. A list of currently existing parameters is provided in HSX archive in the file named DATABASE.

The following parameters exist:

  • Keys for HSX itself:
    • download_queue_size: number of simultaneous downloads allowed on the server. If this key doesn’t exist when the server starts, it creates one with 10 as value. Negative value can be put to disable downloads but it is a very very bad idea. If this value is set to 0, when the server starts, it resets it to the default value. You’d better only use positive value here. Modifying this value when some downloads are queued may create forever hanging downloads. This problem should be fixed in later HSX version.
    • xfer.speed_limit_type: it is possible to limit the speed of transfers (ul and dl) in several ways. If this key doesn’t exist, the server assumes its value is 0. The possible values are:
      • 0: no speed limit, xfer goes as fast as possible
      • 1: speed is limited for each connection (see xfer.speed_limit key)
      • 2: speed is limited for each account (all xfers made from the same account have to share a given bandwidth). This type of xfer works only with new style account. (Not yet supported).
      • 3: speed is limited for the site (see xfer.speed_limit key). All xfers share the same bandwidth. Modification of this key doesn’t affect running xfers, only new ones will be affected.
    • xfer.speed_limit: According to the previous key, this key contains either the speed limit of a single xfer or the speed limit of the whole site. The speed is given in KB (1024 bytes) per second. If this key is not set, its default value is 10.
    • cnx.ip: If this key exists and is not empty, it should contains the list of IPs which can be used to connect to the server. This function is only useful if you have more than one IP on your computer and don’t want to allow access on all of them. If more than 1 IP is given, they are separated by a comma.
  • Keys for HTTPD plugin:
    • http-port: this key contains the port number HTTPD plugin must use. It’s default value is 8080. This key is only read by the plugin during its init stage, when the plugin is loaded (or when the server starts).
    • http.disable: if the key value is TRUE, HTTPD plugin leaves without doing anything during its init stage, thus, http access won’t be possible. This key is only read by the plugin during its init stage.
  • Key for verify plugin:
    • verify.xxx: where xxx is a file extension. This key is used by the verify plugin. When a file having xxx as file extension should be tested, the plugin uses its key value as a shell command line. Filename is append to this command line and the verification is performed.
      Ex: verify.gz key has „gzip -t“ as key value