Disk

The settings for the disk filesystem. This filesystem is accessible on / via HTTP. This filesystem can only be accessed for reading via HTTP. Writing to and deleting from the filesystem is possible via the API.

Configuration

{
   "storage": {
      "disk": {
         "dir": "./data",
         "max_size_mbytes": 0,
         "cache": {
            "enable": true,
            "max_size_mbytes": 0,
            "ttl_seconds": 300,
            "max_file_size_mbytes": 1,
            "types": {
               "allow": [],
               "block": []
            }
         }
      }
   }
}

dir (string)

Path to a directory on disk. It will be exposed on / for reading.

Relative paths are interpreted relative to where the datarhei Core binary is executed.

By default it is set to ./data.

max_size_mbytes (unsigned integer)

The maximum amount of data that is allowed to be stored in this filesystem. The value is interpreted as megabytes. A 507 Insufficient Storage will be returned if you hit the limit. Use a value equal to or smaller than 0 to not impose any limits. Then all the available space on the disk is the limit.

By default no limit is set, i.e. a value of 0.

cache.enable (bool)

Set this value to true in order to enable the cache for the disk. The cache is an LRU cache, i.e. the least recently accessed files in the cache will be removed in case the cache is full and a new file wants to be added.

By default the value is set to true.

cache.max_size_mbytes (unsigned integer)

Limit for the size of the cache in megabytes. A value of 0 doesn't impose any limit. The limit will be the available memory.

By default no limit is set, i.e. a value of 0.

cache.ttl_seconds (integer)

Number of seconds to keep a file in the cache.

By default this value is set to 300 seconds.

cache.max_file_size_mbytes (unsigned integer)

Limit for the size of a file to be allowed to be put in the cache in megabytes.

By default this value is set to 1 megabyte.

cache.types.allow (array)

A list of file extensions to cache, e.g. [".ts", ".mp4"]. Leave the list empty in order to cache all files. Use a space-separated list of extensions for the environment variable, e.g. .ts .mp4.

By default the list is empty.

cache.types.block (array)

A list of file extensions not to cache, e.g. [".m3u8", ".mpd"]. Leave the list empty in order to block no extension. Use a space-separated list of extensions for the environment variable, e.g. .m3u8 .mpd.

By default the manifest files for HLS and DASH are blocked from caching, i.e. [".m3u8", ".mpd"].

Last updated