BMO is Mozilla's highly customized version of Bugzilla.
Contents
If you want to contribute to BMO, you can fork this repo and get a local copy of BMO running in a few minutes using Docker.
This repository contains a docker-compose file that will create a local Bugzilla for testing.
To use docker compose, ensure you have the latest Docker install for your environment (Linux, Windows, or Mac OS). If you are using Ubuntu, then you can read the next section to ensure that you have the correct docker setup.
docker compose up --build
This command will bring up the main webserver process, database, memcached, and various other background tasks such as the Push system and the Feed system. The latter two are used for workflow management between bugzilla.mozilla.org and other external systems.
For normal development, you can run just the main webserver, database, and memcached by running the following command instead:
docker compose up --build bmo.test
After that, you should be able to visit http://localhost:8000/ from your browser. You can login as admin@mozilla.bugs with the password "password012!" (without quotes).
If you want to update the code running in the web container, you do not need to restart everything. You can run the following command:
docker compose exec bmo.test rsync -avz --exclude .git --exclude local /mnt/sync/ /app/
The Mojolicious morbo development server, used by the web container, will notice any code changes and restart itself.
If you are using Visual Studio Code, these docker compose
commands will come in handy as the
editor's tasks that can be found under the Terminal menu. The update command is assigned to the
default build task so it can be executed by simply hitting Ctrl+Shift+B on Windows/Linux or
Command+Shift+B on macOS. An extension bundle for VS Code is also available.
On Ubuntu, Docker can be installed using apt-get. After installing, you need to do run these commands to ensure that it has installed fine:
sudo groupadd docker # add a new group called "docker"
sudo gpasswd -a <your username> docker # add yourself to "docker" group
Log in & log out of your system, so that changes in the above commands will & do this:
sudo service docker restart
docker run hello-world
If the output of last command looks like this. then congrats you have installed docker successfully:
Hello from Docker!
This message shows that your installation appears to be working correctly.
This repository is also a runnable docker container.
Currently, the entry point takes a single command argument. This can be httpd or shell.
$PORT
This is the URL for attachments. When the allow_attachment_display parameter is on, it is possible for a malicious attachment to steal your cookies or perform an attack on Bugzilla using your credentials.
If you would like additional security on attachments to avoid this, set this parameter to an alternate URL for your Bugzilla that is not the same as urlbase or sslbase. That is, a different domain name that resolves to this exact same Bugzilla installation.
For added security, you can insert %bugid% into the URL, which will be replaced with the ID of the current bug that the attachment is on, when you access an attachment. This will limit attachments to accessing only other attachments on the same bug. Remember, though, that all those possible domain names (such as 1234.your.domain.com) must point to this same Bugzilla instance.
{ "RLIMIT_AS": 2000000000 }
.Boolean. By default log messages are logged as plain text to STDERR. Setting this to a true value disables this behavior.
Note: For programs that run using the cereal log aggregator, this environment variable will be ignored.
How Bugzilla logs is entirely configured by the environmental variable LOG4PERL_CONFIG_FILE. This config file should be familiar to someone familiar with log4j, and it is extensively documented in Log::Log4perl.
Many examples are provided in the logs/ directory.
If multiple processes will need to log, it should be configured to log to a socket on port 5880. This will be the "cereal" daemon, which will only be started for jobqueue and httpd-type containers.
The example log config files will often be configured to log to stderr themselves. To prevent duplicate lines (or corrupted log messages), stderr logging should be filtered on the existence of the LOG4PERL_STDERR_DISABLE environmental variable.
Logging configuration also controls which errors are sent to Sentry.
Bugzilla comes with several integrated test suites that do basic sanity checks to more involved web UI testing. To execute the tests, run the following commands:
Basic sanity tests
docker compose -f docker-compose.test.yml down && docker compose -f docker-compose.test.yml run -e CI=1 --no-deps bmo.test test_sanity
Webservices API tests
docker compose -f docker-compose.test.yml down && docker compose -f docker-compose.test.yml run bmo.test test_webservices
Selenium Web UI tests
docker compose -f docker-compose.test.yml down && docker compose -f docker-compose.test.yml run bmo.test test_selenium
Configure your MTA setting you want to use by going to http://localhost:8000/editparams.cgi?section=mta
and changing the mail_delivery_method to 'Test'. With this option, all mail will be appended to a
data/mailer.testfile
. To see the emails being sent:
docker compose run bmo.test cat /app/data/mailer.testfile
This Docker environment is a very scaled-down version of production BMO. It uses roughly the same Perl dependencies as production. It is also configured to use memcached. The push connector is running but is not currently configured, nor is the Phabricator feed daemon.
It includes a couple example products, some fake users, and some of BMO's real groups. Email is disabled for all users; however, it is safe to enable email as the box is configured to send all email to the 'admin' user on the web vm.
docker build -t bmo-cpanfile -f Dockerfile.cpanfile .
docker run -it -v "$(pwd):/app/result" bmo-cpanfile cp cpanfile cpanfile.snapshot /app/result
The mozillabteam/bmo-perl-slim image is stored in the Mozilla B-Team
Docker Hub repository. It contains just the Perl dependencies in /app/local
and other Debian packages needed. Whenever the cpanfile
and
cpanfile.snapshot
files have been changed by the above steps after a
succcessful merge, a new mozillabteam/bmo-perl-slim image will need to be
built and pushed to Docker Hub.
A Docker Hub organization administrator with the correct permissions will
normally do the docker login
and docker push
.
The <DATE>
value should be the current date in YYYYMMDD.X
format with X being the current iteration value. For example, 20191209.1
.
docker build -t mozillabteam/bmo-perl-slim:<DATE> -f Dockerfile.bmo-slim .
docker login
docker push mozillabteam/bmo-perl-slim:<DATE>
After pushing to Docker Hub, you will need to update Dockerfile
to include the new
built image with correct date. Create a PR, review and commit the new change.
You can chat with the BMO team on Matrix.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。