Balrog/Hacking
< Balrog
Jump to navigation
Jump to search
Vagrant
The Balrog repo includes a Vagrantfile and everything else required to have a functioning Balrog installation on a local VM. To use it, follow these steps:
- install vagrant
- Open a command line/terminal and browse to your Balrog clone
- Type "vagrant up" to bring up the development environment
- Add this to your hosts file
127.0.0.1 balrog.mozilla.dev 127.0.0.1 balrog-admin.mozilla.dev
- After "vagrant up" returns successfully, you can access the Balrog applications at the following URLs:
- Admin application - http://balrog-admin.mozilla.dev:9000/rules.html
- User-facing application - http://balrog.mozilla.dev:9000
When making non-trivial changes to Balrog it's always a good idea to have a look at both applications, even just briefly. If you're making frontend changes to the admin application this will be your primary way of testing them.
The Code
There's four general areas of the Balrog code:
- The business logic - This code is used to match an update request to an update, process rules, throttling, et. al. Most decisions about what update to give a specific request are made in here.
- The database layer - This layer sits between the database and the applications. It defines the database schema, performs permissions checking, and ensures all changes are written to history tables.
- Admin application - The frontend and backend code for the admin application. Accessible through http://balrog-admin.mozilla.dev:9000 when vagrant is running.
- User-facing application - The code that handles requests from applications looking for updates. Accessible through http://balrog.mozilla.dev:9000 when vagrant is running.