Review Board
To run the Review Board code review tool using Unit:
-
Install Unit with a Python 2.7 language module.
-
Install and configure Review Board’s prerequisites
We’ll use Unit as the web server, so you can skip the corresponding step. -
Install the core files and create a site. Here, it’s /path/to/app/; use a real path in your configuration:
rb-site install /path/to/app/ # Path to the application directory; use a real path in your configuration * Welcome to the Review Board site installation wizard This will prepare a Review Board site installation in: /path/to/app We need to know a few things before we can prepare your site for installation. This will only take a few minutes. ...
-
Add the .py extension to the WSGI module’s name to make it discoverable by Unit, for example:
mv /path/to/app/htdocs/reviewboard.wsgi \ /path/to/app/htdocs/wsgi.py # Path to the application directory; use a real path in your configuration
-
Change ownership:
Run the following command (as root) so Unit can access the application directory (If the application uses several directories, run the command for each one):
# chown -R unit:unit /path/to/app/ # User and group that Unit's router runs as by default
The unit:unit user-group pair is available only with official packages , Docker images, and some third-party repos. Otherwise, account names may differ; run theps aux | grep unitd
command to be sure.For further details, including permissions, see the security checklist.
Also, make sure the following directories are writable:
chmod u+w /path/to/app/htdocs/media/uploaded/ # Path to the application directory; use a real path in your configuration
chmod u+w /path/to/app/data/ # Path to the application directory; use a real path in your configuration
-
Next, prepare the Review Board configuration for Unit (use real values for share and path):
{ "listeners": { "*:80": { "pass": "routes" } }, "routes": [ { "match": { "uri": [ "/media/*", "/static/*", "/errordocs/*" ] }, "_comment_match": "Static file directories", "action": { "share": "/path/to/app/htdocs$uri" }, "_comment_action": "Serves matching static files" }, { "action": { "pass": "applications/rb" } } ], "applications": { "rb": { "type": "python 2", "path": "/path/to/app/htdocs/", "_comment_path": "Path to the application directory; use a real path in your configuration", "module": "wsgi", "_comment_module": "WSGI module basename with extension omitted" } } }
-
Upload the updated configuration.
Assuming the JSON above was added to
config.json
. Run the following command as root:# curl -X PUT --data-binary @config.json --unix-socket \ /path/to/control.unit.sock \ # Path to Unit's control socket in your installation http://localhost/config/ # Path to the config section in Unit's control API
After a successful update, browse to http://localhost and set up your Review Board installation: