Private Relay provides generated email addresses to use in place of personal email addresses.
Recipients will still receive emails, but Private Relay keeps their personal email address from being harvested, and then bought, sold, traded, or combined with other data to personally identify, track, and/or target them.
Please refer to our coding standards information for code styles, naming conventions and other methodologies.
- python 3.7 (suggest using virtualenv)
- Postgres - even if you are using sqlite for development, requirements.txt installs
psycopg2 which requires libpq. The
following should work:
- On Ubuntu:
sudo apt install postgresql libpq-dev - On OSX:
brew install postgresql libpq - On Fedora:
sudo dnf install libpq-devel
- On Ubuntu:
- SES if you want to send real emails
- Node 12.X – Needed for front-end SCSS compiling
-
Clone and change to the directory:
git clone https://github.com/mozilla/fx-private-relay.git cd fx-private-relay -
Create and activate a virtual environment:
virtualenv env source env/bin/activate -
Install Python and Node requirements:
pip install -r requirements.txt
npm install
-
Copy
.envfile fordecoupleconfig:cp .env-dist .env
-
Add a
SECRET_KEYvalue to.env:SECRET_KEY=secret-key-should-be-different-for-every-install -
Migrate DB:
python manage.py migrate
-
Create superuser:
python manage.py createsuperuser
-
Run it:
python manage.py runserver
To enable Firefox Accounts authentication on your local server, you can use the "Firefox Private Relay local dev" OAuth app on accounts.stage.mozaws.net.
To do so:
-
Set
ADMIN_ENABLED=Truein your.envfile -
Change
example.comto127.0.0.1:8000and click Save. -
Go to the django-allauth social app admin page, sign in with the superuser account you created above, and add a social app for Firefox Accounts:
| Field | Value |
|---|---|
| Provider | Firefox Accounts |
| Name | accounts.stage.mozaws.net |
| Client id | 9ebfe2c2f9ea3c58 |
| Secret key | Request this from #fx-private-relay-eng Slack channel |
| Sites | 127.0.0.1:8000 -> Chosen sites |
Now you can sign into http://127.0.0.1:8000/ with an FxA.
Note: The add-on is located in a separate repo. See it for additional information on getting started.
The add-on adds Firefox UI to generate and auto-fill email addresses across the web. Running the add-on locally allows it to communicate with your local server (127.0.0.1:8000) instead of the production server (relay.firefox.com).
In addition to the requirements for dev, production environments should use:
- PostgreSQL-compatible DB
Production environments should also set some additional environment variables:
DATABASE_URL=postgresql://<username>:<password>@<host>:<port>/<database>
DJANGO_SECURE_HSTS_SECONDS=15768000
DJANGO_SECURE_SSL_REDIRECT=True