Keep your email safe from hackers and trackers. Make an email alias with 1 click, and keep your address to yourself.
Перейти к файлу
Se Yeon Kim c6edf1faff
Default to premium disabled
2021-05-11 15:29:53 -05:00
.circleci Modified filter to match "addon-". 2020-07-20 14:53:42 -04:00
emails Rename variables 2021-05-10 13:58:20 -05:00
extension bump addon to 1.5.1 2021-02-03 12:38:35 -06:00
phones use same proxy number for 2nd participant 2019-12-30 11:41:53 -06:00
privaterelay Add ON_HEROKU var to settings 2021-05-06 10:48:21 -05:00
static Fix #826 - Restore removed message styles 2021-05-04 15:29:19 -05:00
.dockerignore for #79: pytest on circle 2020-04-07 10:47:26 -05:00
.env-dist Default to premium disabled 2021-05-11 15:29:53 -05:00
.eslintignore add "env" dir to .eslintignore 2020-10-21 11:07:14 -05:00
.eslintrc.js Add ESLint 2020-09-10 17:31:55 -07:00
.gitignore don't .gitignore CACHE/; .gitignore all files in it 2020-10-22 09:03:05 -05:00
Dockerfile fix #395: pause email forwarding for bounced addresses 2021-01-26 10:47:39 -06:00
LICENSE add LICENSE file 2021-01-25 11:35:32 -06:00
METRICS.md remove waitlist and invitations from back-end 2020-08-12 11:14:49 -05:00
Procfile initial commit 2019-06-05 04:40:03 -05:00
README.md Fix Client ID in dev instructions 2021-01-06 09:28:23 -06:00
gunicorn.conf use PORT env var for gunicorn binding 2020-03-05 12:10:53 -06:00
manage.py initial commit 2019-06-05 04:40:03 -05:00
package.json Add ESLint 2020-09-10 17:31:55 -07:00
pytest.ini for #79: pytest on circle 2020-04-07 10:47:26 -05:00
requirements.txt Bump django-debug-toolbar from 2.2 to 2.2.1 2021-04-16 20:29:38 +00:00
runtime.txt fix address header encoding for python 3.7.9 2021-01-27 17:25:21 -06:00

README.md

Private Relay

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.

Development

Requirements

  • 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
  • SES if you want to send real emails

Install and Run the Site Locally

  1. Clone and change to the directory:

    git clone https://github.com/mozilla/fx-private-relay.git
    cd fx-private-relay
    
  2. Create and activate a virtual environment:

    virtualenv env
    source env/bin/activate
    
  3. Install requirements:

    pip install -r requirements.txt
    
  4. Copy .env file for decouple config:

    cp .env-dist .env
    
  5. Add a SECRET_KEY value to .env:

    SECRET_KEY=secret-key-should-be-different-for-every-install
    
  6. Migrate DB:

    python manage.py migrate
    
  7. Create superuser:

    python manage.py createsuperuser
    
  8. Run it:

    python manage.py runserver
    

Next you'll need to enable Firefox Accounts auth ...

Enable Firefox Accounts Auth

To enable Firefox Accounts authentication on your local server, you can use the "private-relay (local)" OAuth app on oauth-stable.dev.lcip.org.

To do so:

  1. Set ADMIN_ENABLED=True in your .env file

  2. Go to the django admin page to change the default site.

  3. Change example.com to 127.0.0.1:8000 and click Save.

  4. 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:

    • Provider: Firefox Accounts
    • Name: oauth-stable.dev.lcip.org
    • Client id: 9ebfe2c2f9ea3c58
    • Secret key: ping groovecoder for this
    • Sites: 127.0.0.1:8000 -> Chosen sites

Now you can sign into http://127.0.0.1:8000/ with an FxA. Remember: you'll need to use an account on oauth-stable.dev.lcip.org, not the production accounts.firefox.com.

Enable SES

TODO

Install and run the add-on locally

The add-on adds Firefox UI to generate and auto-fill email addresses. You may want to build the add-on so that it communicates with your 127.0.0.1:8000 server instead of the production relay.firefox.com server:

  1. In the extension/ directory, run npm install and then npm run build

  2. Use about:debugging to install the resulting static/downloads/addon/latest/private_relay.zip file.

Production Environments

Requirements

In addition to the requirements for dev, production environments should use:

Environment Variables

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