{"id":14128498,"url":"https://github.com/mozilla-bteam/bmo","last_synced_at":"2025-08-03T23:31:46.377Z","repository":{"id":14926542,"uuid":"17650869","full_name":"mozilla-bteam/bmo","owner":"mozilla-bteam","description":"bugzilla.mozilla.org source - report issues here: https://bugzilla.mozilla.org/enter_bug.cgi?product=bugzilla.mozilla.org","archived":false,"fork":false,"pushed_at":"2024-12-03T16:16:56.000Z","size":65941,"stargazers_count":155,"open_issues_count":16,"forks_count":180,"subscribers_count":43,"default_branch":"master","last_synced_at":"2024-12-03T17:28:57.862Z","etag":null,"topics":["perl"],"latest_commit_sha":null,"homepage":"https://bugzilla.mozilla.org","language":"Perl","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mozilla-bteam.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-03-12T01:03:55.000Z","updated_at":"2024-11-30T07:36:23.000Z","dependencies_parsed_at":"2023-09-22T06:21:28.448Z","dependency_job_id":"b00073e1-5336-4180-a898-642366c88e4f","html_url":"https://github.com/mozilla-bteam/bmo","commit_stats":{"total_commits":13100,"total_committers":230,"mean_commits":56.95652173913044,"dds":0.8426717557251908,"last_synced_commit":"69283b26687c81a6de784ffded62e18e3c2b7c9e"},"previous_names":[],"tags_count":370,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mozilla-bteam%2Fbmo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mozilla-bteam%2Fbmo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mozilla-bteam%2Fbmo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mozilla-bteam%2Fbmo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mozilla-bteam","download_url":"https://codeload.github.com/mozilla-bteam/bmo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228571844,"owners_count":17938772,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["perl"],"created_at":"2024-08-15T16:01:46.388Z","updated_at":"2024-12-07T06:31:28.580Z","avatar_url":"https://github.com/mozilla-bteam.png","language":"Perl","funding_links":[],"categories":["Perl"],"sub_categories":[],"readme":"=========================\nBMO: bugzilla.mozilla.org\n=========================\n\nBMO is Mozilla's highly customized version of Bugzilla.\n\n.. image:: https://circleci.com/gh/mozilla-bteam/bmo/tree/master.svg?style=svg\n    :target: https://circleci.com/gh/mozilla-bteam/bmo/tree/master\n\n.. image:: https://readthedocs.org/projects/bmo/badge/?version=latest\n    :target: https://bmo.readthedocs.io/en/latest/?badge=latest\n    :alt: Documentation Status\n\n.. image:: https://github.com/mozilla-bteam/bmo/actions/workflows/deploy.yml/badge.svg\n    :target: https://github.com/mozilla-bteam/bmo/actions\n\n.. contents::\n..\n    1.  Using Docker Compose (For Development)\n    2.  Docker Container\n      2.1  Container Arguments\n      2.2  Environmental Variables\n      2.3  Logging Configuration\n      2.4  Persistent Data Volume\n    3. Development Tips\n      3.1  Testing Emails\n    4. Administrative Tasks\n      4.1  Generating cpanfile and cpanfile.snapshot files\n      4.2  Generating a new mozillabteam/bmo-perl-slim base image\n    5. Support\n\nIf you want to contribute to BMO, you can fork this repo and get a local copy\nof BMO running in a few minutes using Docker.\n\n\nUsing Docker (For Development)\n==============================\n\nThis repository contains a docker-compose file that will create a local Bugzilla for testing.\n\nTo use docker compose, ensure you have the latest Docker install for your environment\n(Linux, Windows, or Mac OS). If you are using Ubuntu, then you can read the next section\nto ensure that you have the correct docker setup.\n\n.. code-block:: bash\n\n    docker compose up --build\n\nThis command will bring up the main webserver process, database, memcached, and various other\nbackground tasks such as the Push system and the Feed system. The latter two are used for workflow\nmanagement between bugzilla.mozilla.org and other external systems.\n\nFor normal development, you can run just the main webserver, database, and memcached by running the\nfollowing command instead:\n\n.. code-block:: bash\n\n    docker compose up --build bmo.test\n\nAfter that, you should be able to visit http://localhost:8000/ from your browser.\nYou can login as admin@mozilla.bugs with the password \"password012!\" (without\nquotes).\n\nIf you want to update the code running in the web container, you do not need to restart everything.\nYou can run the following command:\n\n.. code-block:: bash\n\n    docker compose exec bmo.test rsync -avz --exclude .git --exclude local /mnt/sync/ /app/\n\nThe Mojolicious morbo development server, used by the web container, will notice any code changes and\nrestart itself.\n\nIf you are using Visual Studio Code, these ``docker compose`` commands will come in handy as the\neditor's `tasks`_ that can be found under the Terminal menu. The update command is assigned to the\ndefault build task so it can be executed by simply hitting Ctrl+Shift+B on Windows/Linux or\nCommand+Shift+B on macOS. An `extension bundle`_ for VS Code is also available.\n\n.. _`tasks`: https://code.visualstudio.com/docs/editor/tasks\n.. _`extension bundle`: https://marketplace.visualstudio.com/items?itemName=dylanwh.bugzilla\n\n\nEnsuring your Docker setup on Ubuntu 16.04\n------------------------------------------\n\nOn Ubuntu, Docker can be installed using apt-get. After installing, you need to do run these\ncommands to ensure that it has installed fine:\n\n.. code-block:: bash\n\n    sudo groupadd docker # add a new group called \"docker\"\n    sudo gpasswd -a \u003cyour username\u003e docker # add yourself to \"docker\" group\n\nLog in \u0026 log out of your system, so that changes in the above commands will  \u0026 do this:\n\n.. code-block:: bash\n\n    sudo service docker restart\n    docker run hello-world\n\nIf the output of last command looks like this. then congrats you have installed\ndocker successfully:\n\n.. code-block:: bash\n\n    Hello from Docker!\n    This message shows that your installation appears to be working correctly.\n\nDocker Container\n================\n\nThis repository is also a runnable docker container.\n\nContainer Arguments\n-------------------\n\nCurrently, the entry point takes a single command argument.\nThis can be **httpd** or **shell**.\n\nhttpd\n    This will start apache listening for connections on ``$PORT``\nshell\n    This will start an interactive shell in the container. Useful for debugging.\n\n\nEnvironmental Variables\n-----------------------\n\nPORT\n  This must be a value \u003e= 1024. The httpd will listen on this port for incoming\n  plain-text HTTP connections.\n  Default: 8000\n\nMOJO_REVERSE_PROXY\n  This tells the backend that it is behind a proxy.\n  Default: 1\n\nMOJO_HEARTBEAT_INTERVAL\n  How often (in seconds) will the manager process send a heartbeat to the workers.\n  Default: 10\n\nMOJO_HEARTBEAT_TIMEOUT\n  Maximum amount of time in seconds before a worker without a heartbeat will be stopped gracefully\n  Default: 120\n\nMOJO_INACTIVITY_TIMEOUT\n  Maximum amount of time in seconds a connection can be inactive before getting closed.\n  Default: 120\n\nMOJO_WORKERS\n  Number of worker processes. A good rule of thumb is two worker processes per\n  CPU core for applications that perform mostly non-blocking operations,\n  blocking operations often require more and benefit from decreasing\n  concurrency with \"MOJO_CLIENTS\" (often as low as 1). Note that during zero\n  downtime software upgrades there will be twice as many workers active for a\n  short amount of time.\n  Default: 1\n\nMOJO_SPARE\n  Temporarily spawn up to this number of additional workers if there is a\n  need. This allows for new workers to be started while old ones are still\n  shutting down gracefully, drastically reducing the performance cost of\n  worker restarts.\n  Default: 1\n\nMOJO_CLIENTS\n  Maximum number of accepted connections each worker process is allowed to\n  handle concurrently, before stopping to accept new incoming connections. Note\n  that high concurrency works best with applications that perform mostly\n  non-blocking operations, to optimize for blocking operations you can decrease\n  this value and increase \"MOJO_WORKERS\" instead for better performance.\n  Default: 200\n\nBUGZILLA_ALLOW_INSECURE_HTTP\n  This should never be set in production. It allows oauth over http.\n\nBMO_urlbase\n  The public URL for this instance. Note that if this begins with https://\n  and BMO_inbound_proxies is set to '*' Bugzilla will believe the connection to it\n  is using SSL.\n\nBMO_canonical_urlbase\n  The public URL for the production instance, if different from urlbase above.\n\nBMO_attachment_base\n  This is the URL for attachments.\n  When the allow_attachment_display parameter is on, it is possible for a\n  malicious attachment to steal your cookies or perform an attack on Bugzilla\n  using your credentials.\n\n  If you would like additional security on attachments to avoid this, set this\n  parameter to an alternate URL for your Bugzilla that is not the same as\n  urlbase or sslbase. That is, a different domain name that resolves to this\n  exact same Bugzilla installation.\n\n  For added security, you can insert %bugid% into the URL, which will be\n  replaced with the ID of the current bug that the attachment is on, when you\n  access an attachment. This will limit attachments to accessing only other\n  attachments on the same bug. Remember, though, that all those possible domain\n  names (such as 1234.your.domain.com) must point to this same Bugzilla\n  instance.\n\nBMO_db_driver\n  What SQL database to use. Default is mysql. List of supported databases can be\n  obtained by listing Bugzilla/DB directory - every module corresponds to one\n  supported database and the name of the module (before \".pm\") corresponds to a\n  valid value for this variable.\n\nBMO_db_host\n  The DNS name or IP address of the host that the database server runs on.\n\nBMO_db_name\n  The name of the database.\n\nBMO_db_user\n  The database user to connect as.\n\nBMO_db_pass\n  The password for the user above.\n\nBMO_site_wide_secret\n  This secret key is used by your installation for the creation and\n  validation of encrypted tokens. These tokens are used to implement\n  security features in Bugzilla, to protect against certain types of attacks.\n  It's very important that this key is kept secret.\n\nBMO_jwt_secret\n  This secret key is used by your installation for the creation and validation\n  of jwts.  It's very important that this key is kept secret and it should be\n  different from the side_wide_secret. Changing this will invalidate all issued\n  jwts, so all oauth clients will need to start over. As such it should be a\n  high level of entropy, as it probably won't change for a very long time.\n\nBMO_inbound_proxies\n  This is a list of IP addresses that we expect proxies to come from.\n  This can be '*' if only the load balancer can connect to this container.\n  Setting this to '*' means that BMO will trust the X-Forwarded-For header.\n\nBMO_memcached_namespace\n  The global namespace for the memcached servers.\n\nBMO_memcached_servers\n  A list of memcached servers (IP addresses or host names). Can be empty.\n\nBMO_shadowdb\n  The database name of the read-only database.\n\nBMO_shadowdbhost\n  The hotname or IP address of the read-only database.\n\nBMO_shadowdbport\n   The port of the read-only database.\n\nBMO_setrlimit\n    This is a JSON object and can set any limit described in https://metacpan.org/pod/BSD::Resource.\n    Typically it used for setting RLIMIT_AS, and the default value is ``{ \"RLIMIT_AS\": 2000000000 }``.\n\nBMO_size_limit\n  This is the max amount of unshared memory the worker processes are allowed to\n  use before they will exit. Minimum 750000 (750MiB)\n\nBMO_mail_delivery_method\n  Usually configured on the MTA section of admin interface, but may be set here for testing purposes.\n  Valid values are None, Test, Sendmail, or SMTP.\n  If set to Test, email will be appended to the /app/data/mailer.testfile.\n\nBMO_use_mailer_queue\n  Usually configured on the MTA section of the admin interface, you may change this here for testing purposes.\n  Should be 1 or 0. If 1, the job queue will be used. For testing, only set to 0 if the BMO_mail_delivery_method is None or Test.\n\nUSE_NYTPROF\n  Write `Devel::NYTProf`_ profiles out for each requests.\n  These will be named /app/data/nytprof.$host.$script.$n.$pid, where $host is\n  the hostname of the container, script is the name of the script (without\n  extension), $n is a number starting from 1 and incrementing for each\n  request to the worker process, and $pid is the worker process id.\n\nNYTPROF_DIR\n  Alternative location to store profiles from the above option.\n\nLOG4PERL_CONFIG_FILE\n  Filename of `Log::Log4perl`_ config file.\n  It defaults to log4perl-syslog.conf.\n  If the file is given as a relative path, it will relative to the /app/conf/ directory.\n\n.. _`Devel::NYTProf`: https://metacpan.org/pod/Devel::NYTProf\n\n.. _`Log::Log4perl`: https://metacpan.org/pod/Log::Log4perl\n\nLOG4PERL_STDERR_DISABLE\n  Boolean. By default log messages are logged as plain text to `STDERR`.\n  Setting this to a true value disables this behavior.\n\n  Note: For programs that run using the `cereal` log aggregator, this environment\n  variable will be ignored.\n\n\nLogging Configuration\n---------------------\n\nHow Bugzilla logs is entirely configured by the environmental variable\n`LOG4PERL_CONFIG_FILE`.  This config file should be familiar to someone\nfamiliar with log4j, and it is extensively documented in `Log::Log4perl`_.\n\nMany examples are provided in the logs/ directory.\n\nIf multiple processes will need to log, it should be configured to log to a socket on port 5880.\nThis will be the \"cereal\" daemon, which will only be started for jobqueue and httpd-type containers.\n\nThe example log config files will often be configured to log to stderr\nthemselves.  To prevent duplicate lines (or corrupted log messages), stderr\nlogging should be filtered on the existence of the LOG4PERL_STDERR_DISABLE\nenvironmental variable.\n\nLogging configuration also controls which errors are sent to Sentry.\n\n\nDevelopment Tips\n================\n\nTest Suite\n----------\n\nBugzilla comes with several integrated test suites that do basic sanity checks to more involved web UI testing. To\nexecute the tests, run the following commands:\n\nBasic sanity tests\n\n.. code-block:: bash\n\n  docker compose -f docker-compose.test.yml down \u0026\u0026 docker compose -f docker-compose.test.yml run -e CI=1 --no-deps bmo.test test_sanity\n\nWebservices API tests\n\n.. code-block:: bash\n\n  docker compose -f docker-compose.test.yml down \u0026\u0026 docker compose -f docker-compose.test.yml run bmo.test test_webservices\n\nSelenium Web UI tests\n\n.. code-block:: bash\n\n  docker compose -f docker-compose.test.yml down \u0026\u0026 docker compose -f docker-compose.test.yml run bmo.test test_selenium\n\nTesting Emails\n--------------\n\nConfigure your MTA setting you want to use by going to http://localhost:8000/editparams.cgi?section=mta\nand changing the mail_delivery_method to 'Test'. With this option, all mail will be appended to a\n``data/mailer.testfile``. To see the emails being sent:\n\n.. code-block:: bash\n\n  docker compose run bmo.test cat /app/data/mailer.testfile\n\nTechnical Details\n-----------------\n\nThis Docker environment is a very scaled-down version of production BMO.\nIt uses roughly the same Perl dependencies as production. It is also\nconfigured to use memcached. The push connector is running but is not\ncurrently configured, nor is the Phabricator feed daemon.\n\nIt includes a couple example products, some fake users, and some of BMO's\nreal groups. Email is disabled for all users; however, it is safe to enable\nemail as the box is configured to send all email to the 'admin' user on the\nweb vm.\n\n\nAdministrative Tasks\n====================\n\nGenerating cpanfile and cpanfile.snapshot files\n-----------------------------------------------\n\n.. code-block:: bash\n\n  docker build -t bmo-cpanfile -f Dockerfile.cpanfile .\n  docker run -it -v \"$(pwd):/app/result\" bmo-cpanfile cp cpanfile cpanfile.snapshot /app/result\n\nGenerating a new mozillabteam/bmo-perl-slim base image\n------------------------------------------------------\n\nThe mozillabteam/bmo-perl-slim image is stored in the Mozilla B-Team\nDocker Hub repository. It contains just the Perl dependencies in ``/app/local``\nand other Debian packages needed. Whenever the ``cpanfile`` and\n``cpanfile.snapshot`` files have been changed by the above steps after a\nsucccessful merge, a new mozillabteam/bmo-perl-slim image will need to be\nbuilt and pushed to Docker Hub.\n\nA Docker Hub organization administrator with the correct permissions will\nnormally do the ``docker login`` and ``docker push``.\n\nThe ``\u003cDATE\u003e`` value should be the current date in ``YYYYMMDD.X``\nformat with X being the current iteration value. For example, ``20191209.1``.\n\n.. code-block:: bash\n\n  docker build -t mozillabteam/bmo-perl-slim:\u003cDATE\u003e -f Dockerfile.bmo-slim .\n  docker login\n  docker push mozillabteam/bmo-perl-slim:\u003cDATE\u003e\n\nAfter pushing to Docker Hub, you will need to update ``Dockerfile`` to include the new\nbuilt image with correct date. Create a PR, review and commit the new change.\n\n\nSupport\n==============================\n\nYou can chat with the BMO team on `Matrix \u003chttps://chat.mozilla.org/#/room/#bmo:mozilla.org\u003e`_.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmozilla-bteam%2Fbmo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmozilla-bteam%2Fbmo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmozilla-bteam%2Fbmo/lists"}