As part of the installation of XTools, you'll need to provide values for various configuration options. Sensible defaults are included, but at minimum you should have your own database connection. All configuration is done in the
.env file, which should be initially copied from
XTools records basic usage stats in its own database. As a developer, unless you are working on this feature (see https://xtools.wmflabs.org/meta), you can leave these options blank.
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.
DATABASE_PASSWORD– Password for the user for the XTools database.
DATABASE_REPLICA_USER– Username for the replica databases. Use the credentials specified in the
replica.my.cnffile, located in the home directory of your Toolforge account.
DATABASE_REPLICA_PASSWORD– Password for the replica databases.
DATABASE_REPLICA_PORT_S1– Host and port for the s1 slice. Repeat for all 8 slices. See XTools/Development#Developing against Toolforge replicas for more. In production these values should be
s1with the corresponding slice), and all ports should be
Some parts of XTools such as the Page History tool communicate with the Toolforge user databases, such as checkwiki.
DATABASE_TOOLSDB_HOST– MySQL host name (
127.0.0.1if connecting to the replicas via SSH tunnel). On production this should be
DATABASE_TOOLSDB_PORT– MySQL port number. Use 3306 in production.
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 meta:Special:OAuthConsumerRegistration. If you are developing locally, you can leave these options blank.
OAUTH_KEY– Oauth consumer key.
OAUTH_SECRET– Oauth consumer secret.
Email is only used to send error reports to the maintainers. If you don’t care about this (such as in development installations), you can use the defaults for all mailer options and no emails will be sent. Note the 'from' and 'to' emails must have valid addresses.
MAILER_DSN– The data source path of the mailer, which including any necessary credentials.
MAILER_FROM_EMAIL– The 'from' email.
MAILER_TO_EMAIL– The 'to' email.
In development, the filesystem is used as the caching adapter. In production, it uses APCu. Since XTools version 3.17, the adapters are no longer configurable.
WIKI_URL– Full URL of the wiki, used only if
app.single_wikiis set to
true. The title of pages are attached to the end.
API_PATH– The API path for the projects, usually
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.orgis 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
CENTRAL_AUTH_PROJECT– Which wiki should be used for CentralAuth (if applicable), and also for OAuth authentication. You may want this to be the same as the
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
APP_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 (see Wikitech docs), this parameter must have the same value on both the app server and API server. nux.net/secret can auto-generate a secure token for you.
APP_NOTICE_DISPLAY– This is used to broadcast a notice at the top of XTools. Set to
1to turn this feature on.
APP_NOTICE_STYLE– Style of the notice banner, correlating to the Bootstrap contextual classes. Available options include
APP_NOTICE_TEXT– 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. Use
0if you are developing against the wiki replicas.
APP_IS_WMF– Whether XTools lives on the Wikimedia Foundation Cloud Services environment. If you are developing against the wiki replicas through an SSH tunnel, set this to
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_COUNTrequests from the same user are allowed. Set this to
0to 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
0to 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
0to 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
0to disable all limitations.
APP_MULTILINGUAL_WIKIS– Wikis for which there is no specific site language, such as
metawiki. This is currently only used to convert legacy URL parameters, and hence the value is not important for any non-WMF installation. However in the future it may be used to control other functionality.
Selectively choose which tools to enable within XTools.
APP_ENABLE_ADMINSCORE– Enable the Admin Score tool.
APP_ENABLE_ADMINSTATS– Enable the Admin Statistics tool.
APP_ENABLE_ARTICLEINFO– Enable the Page History (aka ArticleInfo) tool.
APP_ENABLE_AUTHORSHIP– Enable the Authorship tool (WMF-only).
APP_ENABLE_AUTOEDITS– Enable the Automated Edits tool.
APP_ENABLE_BLAME– Enable the Blame tool (WMF-only).
APP_ENABLE_CATEGORYEDITS– Enable the Category Edits tool.
APP_ENABLE_EDITCOUNTER– Enable the Edit Counter tool.
APP_ENABLE_EDITSUMMARY– Enable the Edit Summaries tool.
APP_ENABLE_GLOBALCONTRIBS– Enable the Global Contributions tool.
APP_ENABLE_LARGESTPAGES– Enable the Largest pages tool.
APP_ENABLE_META– Enable the Meta tool, which tracks usage of the XTools installation.
APP_ENABLE_PAGES– Enable the Pages Created tool.
APP_ENABLE_QUOTE– Enable the Bash Quotes tool.
APP_ENABLE_RFXANALYSIS– Enable the RfX Analysis tool.
APP_ENABLE_RFXVOTECALCULATOR– Enable the RfX Vote Calculator tool.
APP_ENABLE_SIMPLEEDITCOUNTER– Enable the Simple Counter tool.
APP_ENABLE_TOPEDITS– Enable the Top Edits tool.