-
Notifications
You must be signed in to change notification settings - Fork 13
Beta Server
The beta server is at http://browsercompat.herokuapp.com. It runs under Mozilla's Heroku account. If Heroku works well for serving the site, it may be used for the production server as well.
The beta server runs with these processes:
More and better processes may be deployed as needed.
The beta server runs with these add-ons:
- heroku-postgresql - hobby-basic tier ($9/month, expanded storage)
- heroku-redis - hobby-dev tier, free, for Celery broker and results backends
- memcachier - dev tier, free, for caching
Production tier processes may be deployed as needed.
Email goes through jwhitlock's Amazon Simple Email Service account.
Mozilla's New Relic account is used to monitor service performance.
The server is configured through environment variables, following the Heroku/twelve-factor methodology. The following settings are used:
-
ADMIN_EMAILS
: comma-separated list of admin emails -
ADMIN_NAMES
: comma-separated list of admin names, matchesADMIN_EMAILS
-
ALLOWED_HOSTS
: comma-separated list of allowed hostnames, includingbrowsercompat.herokuapp.com
-
BROKER_URL
: set toREDIS_URL
-
CELERY_ALWAYS_EAGER
:0
to use async tasks -
CELERY_RESULT_BACKEND
: set toREDIS_URL
-
DATABASE_URL
: set by heroku-postgresql add-on -
DEFAULT_FROM_EMAIL
: set inFull Name <[email protected]>
form -
DJANGO_DEBUG
:0
to disable debug mode -
EMAIL_HOST
: SES hostname -
EMAIL_HOST_PASSWORD
: SES password -
EMAIL_HOST_USER
: SES username -
EMAIL_PORT
:587
Mail Submission Agent port -
EMAIL_SUBJECT_PREFIX
:[browsercompat]
-
EMAIL_USE_TLS
:1
-
EXTRA_INSTALLED_APPS
:unicorn
-
FXA_OAUTH_ENDPOINT
:https://oauth-latest.dev.lcip.org/v1
, Firefox Accounts dev OAuth endpoint -
FXA_PROFILE_ENDPOINT
:https://latest.dev.lcip.org/profile/v1
, FxA dev profile endpoint -
HEROKU_POSTGRESQL_xxx_URL
: set by heroku-postgresql add-on, same asDATABASE_URL
-
MEMCACHIER_PASSWORD
: set by memcachier add-on -
MEMCACHIER_SERVERS
: set by memcachier add-on -
MEMCACHIER_USERNAME
: set by memcachier add-on -
NEW_RELIC_APP_NAME
:browsercompat.herokuapp.com
-
NEW_RELIC_HIGH_SECURITY
:1
, enforces settings that omit user data from analytics -
NEW_RELIC_LABELS
:Project:Mdn
, groups beta server with developer.mozilla.org -
NEW_RELIC_LICENSE_KEY
: Mozilla's New Relic key -
NEW_RELIC_LOG
:stderr
, allows viewing withheroku logs
-
NEW_RELIC_MONITOR_MODE
:1
enables monitoring -
REDIS_URL
: set by heroku-redis add-on -
SECRET_KEY
: set to random string -
SECURE_PROXY_SSL_HEADER
:HTTP_X_FORWARDED_PROTO,https
, Heroku's SSL header -
SERVER_EMAIL
: set inFull Name <[email protected]>
form -
STATIC_ROOT
:staticfiles
, where Heroku puts files after./manage.py collectstatic
Deploying new code uses the standard Heroku process of pushing to master, assuming you named the git remote browsercompat
:
git checkout master
git pull
git push browsercompat
This will:
- upgrade dependencies in
requirements.txt
- run
./manage.py collect static
- restart the web and worker processes
You'll have to be a collaborator on the browsercompat app in Mozilla's Heroku account to push.
If the push includes migrations, those have to be run manually:
heroku run ./manage.py migrate
To record the deployment in New Relic, you can use tools/newrelic_record_deploy.sh
:
export NEW_RELIC_API_KEY=get_from_new_relic
export NEW_RELIC_DEPLOY_APP_ID=browsercompat.herokuapp.com
export NEW_RELIC_DEPLOYER="My Name"
export NEW_RELIC_BRANCH="remotes/browsercompat/master"
tool/newrelic_record_deployment.sh