This is a guide for all MediaWiki admins. MediaWiki admins have access to Miraheze servers: mw121, mw122, mw131, mw132, mw141, mw142, mwtask141, test131, and jobchron121.
In case of any doubts regarding a command or configuration change, mw-admins should ask either another mw-admin, or Site Reliability Engineering before going through with it. In addition, mw-admins should test any new changes on test131 before adding them to production.
- Be respectful to other volunteers and users. You represent the Miraheze project.
- Don't suddenly change big parts of the MediaWiki infrastructure (e.g., way how things are done in the current style) without discussing it with the other sysadmins.
- Don't use the servers for non-Miraheze purposes.
- Don't put abnormally high load(s) on the server(s) if avoidable. (Grafana can be used for more details)
- Respect privacy. Don't publish access logs, IP addresses, content of private wikis, or other personally identifiable information. If in doubt, ask before publishing. Publishing any such content is likely to be a violation of your non-disclosure agreement (NDA) with Miraheze Limited.
- Don't publish database passwords, private keys, etc as well.
- When in doubt, ask questions first, act second.
Note: Violation of these rules can result in warnings or revocation of access.
- They should typically only be run on mwtask141.
- Always run them as www-data (prefix command with
sudo -u www-data).
!logmaintenance script runs in #miraheze-sre (unless you were running puppet or were using sql.php, and did not execute any queries that changed the database (e.g. SELECT/DESCRIBE queries)
- You can optionally use the mwscript wrapper to automatically log these.
- If you need to run a script on all wikis, use the foreachwikiindblist wrapper:
sudo -u www-data /usr/local/bin/foreachwikiindblist /srv/mediawiki/cache/databases.json /srv/mediawiki/w/maintenance/yourscript.php --put-your-parameters --here
- update.php is evil. If you need to run it while you're not doing a MediaWiki upgrade, then something is really wrong.
- maintenance/update.php just automatically creates all required database tables on the wiki(s) it is run on. SQL files should be added to the CreateWiki config setting so that tables are automatically added to all new wikis. See Tech:Adding a new extension for enabling extensions or adding tables to existing wikis.
Installing and enabling new extensions
See Tech:Adding a new extension.
Pushing configuration changes
- Ensure the PHP syntax is correct, you want to avoid deploying files with syntax errors.
- Although everyone makes mistakes sometimes, try to avoid them in the first place and be aware of how the changes you make can affect the entire site.
- If a syntax error should occur, push a fixing-commit to the repo(s) and manually run puppet (
sudo puppet agent -t) on mwtask141.
- When a configuration variable is changed, you should be completely aware what it does, and how it could impact a wiki security-wise.
- There is more stuff in LocalSettings.php than just configuration variables, like this. You are allowed to edit such stuff, but if you are not familiar with its functionality, it's not recommended to touch it (or to merge pull requests that make changes to this area).
See #Deployment for the rest.
- When deploying a configuration change or extension, you are required to closely watch the change going live.
- After committing a change to the mediawiki or mw-config repo (and being sure it should work), run
sudo puppet agent -ton mwtask141. It can take a while before the change is actually deployed.
- Watch the error logs: #Monitoring errors.
Follow the instructions at Tech:Graylog.
- Look at the error logs.
- Try to send the failing HTTP request to one of the mw servers with the header
X-Miraheze-Debug: (mw1|test131).miraheze.org(replace with the desired server), it could be an error that is cached in Varnish.