# 4. Configuration¶

As part of the installation of XTools, composer install or composer update may prompt you for configuration options.

## 4.1. Databases¶

XTools’ own database:

• database_host - Hostname for the server with the XTools database.
• database_port - Port for the server with the XTools database.
• database_name - Database name of the XTools database.
• database_user - Username for the XTools database.

The projects’ databases:

• database_replica_host - Hostname for the server with the MediaWiki databases. If you are developing against the WMF replicas through an SSH tunnel, the value should probably be 127.0.0.1.
• database_replica_port - Port for the server with the MediaWiki databases. If you are developing against the WMF replicas through an SSH tunnel, the value should the MySQL port that was forwarded.
• database_replica_name - Database name of any one of the MediaWiki databases (usually the default, or the ‘meta’; it doesn’t matter which). For installations connecting to the WMF replicas, this could for example be metawiki_p.
• database_replica_user - Username for the MediaWiki databases. If you are developing against the WMF replicas, you should use the credentials specified in the replica.my.cnf file, located in the home directory of your Toolforge account.

The ‘meta’ database:

• database_meta_name - Database name for the server with the wiki table (this is not required if app.single_wiki is set). If connecting to the WMF replicas, the value should be meta_p.
• database_meta_table - Name of the wiki table. Defaults to wiki.

For WMF installations, you should also specify credentials for the tools-db database server, which contains data from other tools (e.g. checkwiki):

• database_toolsdb_host - MySQL host name (127.0.0.1 if connecting to the replicas via SSH tunnel).
• database_toolsdb_port - MySQL port number.
• database_toolsdb_name - Username to connect as (should be the same as database_replica_user).
• database_toolsdb_password - Password to use for the user (should be the same as database_replica_password).

## 4.2. Authentication and Email¶

OAuth is used to allow users to make unlimited requests, and to allow them to see detailed statistics of their own account. The credentials need to be requested from Special:OAuthConsumerRegistration on your default wiki. This requires the OAuth extension. If this extension is not installed or you are developing locally, you can leave these options blank.

• oauth_key - Oauth consumer key.
• oauth_secret - Oauth consumer secret.
• mailer_transport - Software for the mailer. For development installations, you can leave all the mailer configuration options blank.
• mailer_host - Hostname for the mailer.
• mailer_user - Username for the mailer software.

## 4.3. Caching¶

These options are available if you wish to use a cache provider such as Redis. However, XTools will function well using only the file system for caching.

• cache.adapter A cache adapter supported by DoctrineCacheBundle. file_system is the default and should work well.
• cache.redis_dsn The DSN of the Redis server, if redis is used as the cache.adapter. If you’re not using Redis, this parameter can be ignored.

## 4.4. Wiki configuration¶

The parameters ensures paths to your wiki(s) are properly constructed, and for communicating with the API.

• wiki_url - Full URL of the wiki, used only if app.single_wiki is set to true. The title of pages are attached to the end.
• api_path - The API path for the projects, usually /w/api.php.
• default_project - The base URL of whatever wiki you consider to be the “default”. This will be the default value for the “Project” field in the forms. On the Wikimedia installation, en.wikipedia.org is used because it is the most popular wiki. For single-wiki installations, the “Project” field in the forms are hidden, but you still need to provide this value for default_project.
• oauth_project - Which wiki should be used for OAuth authentication. You may want this to be the same as the default_project.
• opted_in - A list of database names of projects that will display restricted statistics regardless of individual users’ preferences. For developers working off of the replicas, use enwiki_p.

## 4.5. Application¶

• secret - A secret key that’s used to generate certain security-related tokens, and as the secret for the internal API. This can be any non-blank value. If you are using a separate API server (as explained in the administration section), this parameter must have the same value on both the app server and API server.
• app.noticeDisplay - This is used to broadcast a notice at the top of XTools. Set to 1 to turn this feature on.
• app.noticeStyle - Style of the notice banner, correlating to the Bootstrap contextual classes. Available options include danger, warning, info and success.
• app.noticeText - Message shown to the user. If you provide a valid i18n message key, it will display that message instead.
• app.single_wiki - Point XTools to a single wiki, instead of using a meta database. This ignores database_meta_name above.
• app.is_labs - Whether XTools lives on the Wikimedia Foundation Cloud Services environment. If you are developing against the WMF replicas through an SSH tunnel, set this to true.
• app.replag_threshold - Number of seconds to consider the replicas as “lagged”, and show a warning to the user that the data may be out of date. For WMF installations, this parameter is obsolete and can be left blank, as the new replicas do not suffer from noticeable lag.
• app.query_timeout Maximum allowed time for queries to run. This is to ensure database quota is not exceeded.
• app.rate_limit_time - Used for rate limiting. This parameter is the number of minutes during which app.rate_limit_count requests from the same user are allowed. Set this to 0 to disable rate limiting.
• app.rate_limit_count - Number of requests from the same user that are allowed during the time frame specified by app.rate_limit_time. Set this to 0 to disable rate limiting.
• app.max_page_revisions - Set a maximum number of revisions to process for pages. This is to safeguard against unnecessarily consuming too many resources for queries that will most surely timeout. Set this to 0 to disable all limitations.
• app.max_user_edits - Querying a user that has more edits than this will be rejected. This is to safeguard against unnecessarily consuming too many resources for queries that will most surely timeout. Set this to 0 to disable all limitations.
• languageless_wikis - This should be left blank for any non-WMF installation. This is used only to convert legacy XTools URL parameters to the modern equivalents, listing any wikis where there is no specific language associated with it. “meta.wikimedia.org” is intentionally not included. Developers may also leave this value blank.

## 4.6. Tools¶

Selectively choose which tools to enable within XTools.