diff --git a/docs/components.rst b/docs/components.rst index 0b98615a2..9af3c801e 100644 --- a/docs/components.rst +++ b/docs/components.rst @@ -4,5 +4,5 @@ Components .. toctree:: profiles - mentorship + reports events diff --git a/docs/conf.py b/docs/conf.py index efbdba5df..f2c4aec23 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -41,16 +41,16 @@ # General information about the project. project = u'ReMo Portal' -copyright = u'2011, ReMo Team' +copyright = u'2011-2012, ReMo Team' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. -version = '0.1' +version = '0.2.5' # The full version, including alpha/beta/rc tags. -release = '0.1' +release = '0.2.5' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/index.rst b/docs/index.rst index 344d1c2c2..2ff957417 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -17,6 +17,10 @@ practices and tools of mozillians around the world. To learn more about it and the release schedule visit `ReMo Portal project page `_. +For comments and/or questions about ReMo Portal or this documentation +please ping us on `#remo-dev +`_. + Contents -------- @@ -24,7 +28,6 @@ Contents :maxdepth: 2 installation - components Indices and tables ------------------ diff --git a/docs/installation.rst b/docs/installation.rst index 4404c635d..7f2643c5d 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -2,4 +2,190 @@ Installation ============ +Getting our own development environment. +Preparing Your System +--------------------- + +#. **Install Vagrant.** + + Vagrant is a manager of VMs for development. It streamlines and + simplifies the procedure to get your own development environment + for each project you are working on. + + Based on a configuration file, it creates Virtual Machines based on + VirtualBox and configures folder and port sharing among your host + machine and guest machine for easier access. It works nicely along + with tools like puppet and automatically install and configures all + the required programs and services (e.g. MySQL, Apache, etc) needed + for development. + + This way all developers of a single project share the same + environment. + + Most Linux distributions come with vagrant packaged, so probably + you need to just install the package. + + - For Debian based systems:: + + ~$ sudo apt-get install vagrant + + For other Linux distributions or operating systems visit `Vagrant's + download page `_. + + +#. **Install git.** + + Our code is revisioned using `git `. You can + install it on your Linux machine through your package manager. + + - For Debian based systems:: + + ~$ sudo apt-get install git + + For other Linux distributions or operating systems visit `Git's + download page `_. + + + +Build The Environment +--------------------- + +#. **Clone ReMo repository.** + + Mozilla Reps Portal is hosted on ``_. + + Clone the repository locally:: + + ~$ git clone --recursive http://github.com/mozilla/remo + + .. note:: + + Note the `--recursive` flag in the clone command. We make heavy + use of *git submodules* and this flag clones the required + submodules along with remo code. + +#. **Fire up vagrant.** + + Now you need to build the virtual machine where ReMo portal will + live. Change into the cloned directory and run vagrant:: + + ~$ cd remo + ~/remo$ vagrant up + + .. note:: + + The first time you run vagrant an VM image will be downloaded + and the guest machine will be configured. You will be + downloading more than 300Mb. A (decent) internet connection is + required. + + +#. **Connect to your vagrant machine.** + + You can connect to your vagrant machine, when it's running, using:: + + ~/remo$ vagrant ssh + + +#. **Create an admin account.** + + Within your vagrant machine, create your own admin account:: + + ~/project$ ./manage.py createsuperuser + + + .. note:: + + We are using `BrowserID `_, so a valid + email address is required for your admin account. + + +#. **Choose a HMAC_KEY.** + + For development purposes you can uncomment the key '2012-06-15' + with HMAC_KEYS dictionary in your local.py:: + + HMAC_KEYS = { + '2012-06-15': 'some key', + } + + + +#. **Activate MailHide.** + + We use `MailHide + `_ to + protect our users from spam. Open `local.py` under `settings` + directory and uncomment the following lines:: + + # MAILHIDE_PUB_KEY = '02Ni54q--g1yltekhaSmPYHQ==' + # MAILHIDE_PRIV_KEY = 'fe55a9921917184732077e3fed19d0be' + + These keys are `demo` keys and will not decrypt emails on your + local installation but that's OK if you are not working on a + related bug. + + If you are to work on a MailHide related bug, register on + `MailHide's website + `_ for a valid + pair of keys. + + +#. **Update product_details package.** + + Package `product_details` provides information about countries. We + use it in Country selection lists. The information get pulled form + mozilla's SVN, so we need to fetch it at least once. To update run:: + + ~/project$ ./manage.py update_product_details + + +#. **Load demo data (optional).** + + Depending on what you are going to develop you may need to have + some demo data. + + To load *demo users* run (within your VM):: + + ~/project$ ./manage.py loaddata demo_users + + To load *demo reports* run:: + + ~/project$ ./manage.py loaddata demo_reports + + To fetch *bugzilla bugs* run:: + + ~/project$ ./manage.py fetch_bugs + + .. note:: + + Fetching bugzilla bug requires a Mozilla Reps Admin account on + Bugzilla. Ping `giorgos` on #remo-dev to give you access if + your project requires it. + +#. **Start django devserver.** + + Within your vagrant machine you can start django devserver by + running:: + + $ cd project + ~/project$ ./manage.py runserver 0.0.0.0:8000 + + .. note:: + + The `~/project` directory within the VM mirrors the contents of + the `~/remo/` directory in you machine. So you can hack on your + machine, using your favorite editor and your changes get + reflected to the VM immediately. + + .. note:: + + Since we are running the django webserver inside a VM it's + required that bind the server on all network interfaces, so it's + accessible from the host machine. Thus the use of *0.0.0.0:8000* + in the command. + +#. **Visit our local installation of the ReMo Portal.** + + You are done! Point Firefox to ``_. diff --git a/docs/mentorship.rst b/docs/reports.rst similarity index 100% rename from docs/mentorship.rst rename to docs/reports.rst diff --git a/puppet/manifests/classes/python.pp b/puppet/manifests/classes/python.pp index c7fc00b2c..9ecd1fb1f 100644 --- a/puppet/manifests/classes/python.pp +++ b/puppet/manifests/classes/python.pp @@ -17,6 +17,11 @@ command => "pip install -r $PROJ_DIR/requirements/compiled.txt", require => Exec['pip-install'] } + + exec { "pip-install-dev": + command => "pip install -r $PROJ_DIR/requirements/dev.txt", + require => Exec['pip-install'] + } } ubuntu: { @@ -29,6 +34,11 @@ command => "pip install -r $PROJ_DIR/requirements/compiled.txt", require => Package['python-pip'] } + + exec { "pip-install-dev": + command => "pip install -r $PROJ_DIR/requirements/dev.txt", + require => Package['python-pip'] + } } } } diff --git a/remo/base/tests.py b/remo/base/tests.py index ca889bd0a..f4ab8360f 100644 --- a/remo/base/tests.py +++ b/remo/base/tests.py @@ -1,9 +1,11 @@ import base64 +from django.conf import settings from django.core import mail from django.core.urlresolvers import reverse from django.test.client import Client from jinja2 import Markup +from nose.exc import SkipTest from nose.tools import eq_ from test_utils import TestCase @@ -96,6 +98,10 @@ def test_view_faq_page(self): def test_mailhide_encryption(self): """Test email encryption function.""" + if (getattr(settings, 'MAILHIDE_PUB_KEY', None) != + '01Ni54q--g1yltekhaSmPYHQ=='): + raise SkipTest('Skipping test due to different MailHide pub key.') + test_strings = [('foo@example.com', '3m5HgumLI4YSLSY-YP9HQA=='), ('bar@example.net', '9o38o8PEvGrP6V5HSDg_FA=='), ('test@mozilla.org', ('ABBkk5Aj2-PJ_izt9yU8pMzt' @@ -109,6 +115,10 @@ def test_mailhide_encryption(self): def test_mailhide_helper(self): """Test mailhide helper.""" + if (getattr(settings, 'MAILHIDE_PUB_KEY', None) != + '01Ni54q--g1yltekhaSmPYHQ=='): + raise SkipTest('Skipping test due to different MailHide pub key.') + m1 = Markup(u'