The configuration file of TorneLIB is written i JSON-style formatting like the example below, and should normally be put in /etc with the filename tornevall_database.json or tornevall_database

 

Formatting of configuration
{
  "database": {
    "servers": {
      "localhost": {
        "user": "root",
        "server": "localhost",
        "password": "password"
  },
      "production": {
        "user": "root",
        "server": "remotehost",
        "password": "password"
  },
    "config":{
      "exceptions":true,
      "forcenew":true,
      "mysql_deprecated":false,
      "timeout":6,
      "authdetails":false,
      "mysqldriverpriority": ["mysqli", "pdo", "deprecated"],
      "blockoverride": []
    }
  }
}

TorneLIB configuration is using a bunch of defaults, but may be "overriden" through the configuration file. Some of those configuration rows may also be runtime set. Here's what the parameters doing

Database configuration

  
  

Base database configuration

 

ParameterTypeDescription
exceptionsbooleanAllow TorneLIB to throw exceptions into the client. If false, TorneLIB will silently avoid throwing exceptions when it's possible
forcenewbooleanForce new database connection, each time we're trying to query a database (may sometimes be good during forkings, etc)
mysql_deprecatedbooleanThe deprecated MySQL-driver is normally not accepted by TorneLIB, and it prefers to use the mysqli-driver instead. Setting this paramter to true accepts the deprecated driver
timeoutintegerSets a timeout value to the database calls where it's possible. Sometimes there's a need for longer or shorter timeouts. This parameter changes this
authdetailsbooleanIf this parameter is set to false, TorneLIB will return much lesser information on connection failures whether is is possible. Normally, drivers throw more details about what failed on a connection - this parameter suppresses that
mysqldriverpriorityobjectDefines in which order TorneLIB should find a proper driver to use when connecting and makes queries to a MySQL-database. The preferred default order for TorneLIB is mysqli -> pdo -> the deprecated driver
blockoverrideobjectDefines if anything in the configuration should be blocked from overriders. This is good if an attacker somehow got access to the site source code or similar but still has no access to the confguration file and tries to inject override commands into TorneLIB

 

 

  • No labels