2014-08-08 16:08:46 +04:00
|
|
|
"""This is the standard development settings file.
|
|
|
|
|
|
|
|
If you need to overload settings, please do so in a local_settings.py file (it
|
|
|
|
won't be tracked in git).
|
|
|
|
|
|
|
|
"""
|
2014-10-01 15:44:44 +04:00
|
|
|
import os
|
2019-07-16 13:01:31 +03:00
|
|
|
from urllib.parse import urlparse
|
2014-10-01 15:44:44 +04:00
|
|
|
|
2015-12-16 11:46:10 +03:00
|
|
|
from olympia.lib.settings_base import * # noqa
|
2014-08-08 16:08:46 +04:00
|
|
|
|
2016-03-15 17:22:16 +03:00
|
|
|
WSGI_APPLICATION = 'olympia.wsgi.application'
|
|
|
|
|
2014-08-08 16:08:46 +04:00
|
|
|
DEBUG = True
|
|
|
|
|
|
|
|
# These apps are great during development.
|
|
|
|
INSTALLED_APPS += (
|
2015-12-16 11:46:10 +03:00
|
|
|
'olympia.landfill',
|
2019-04-16 16:42:42 +03:00
|
|
|
'debug_toolbar',
|
2014-08-08 16:08:46 +04:00
|
|
|
)
|
|
|
|
|
2019-04-16 16:42:42 +03:00
|
|
|
MIDDLEWARE = ('debug_toolbar.middleware.DebugToolbarMiddleware',) + MIDDLEWARE
|
|
|
|
|
|
|
|
DEBUG_TOOLBAR_CONFIG = {
|
|
|
|
# Enable django-debug-toolbar locally, if DEBUG is True.
|
|
|
|
'SHOW_TOOLBAR_CALLBACK': lambda request: DEBUG,
|
|
|
|
}
|
|
|
|
|
2018-03-05 16:34:43 +03:00
|
|
|
FILESYSTEM_CACHE_ROOT = os.path.join(TMP_PATH, 'cache')
|
|
|
|
|
2018-06-17 08:56:10 +03:00
|
|
|
# We are setting memcached here to make sure our local setup is as close
|
|
|
|
# to our production system as possible.
|
2014-08-08 16:08:46 +04:00
|
|
|
CACHES = {
|
|
|
|
'default': {
|
2018-06-17 08:56:10 +03:00
|
|
|
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
|
2014-10-01 15:44:44 +04:00
|
|
|
'LOCATION': os.environ.get('MEMCACHE_LOCATION', 'localhost:11211'),
|
2018-03-05 16:34:43 +03:00
|
|
|
},
|
2014-08-08 16:08:46 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
# If you're not running on SSL you'll want this to be False.
|
|
|
|
SESSION_COOKIE_SECURE = False
|
|
|
|
SESSION_COOKIE_DOMAIN = None
|
|
|
|
|
2017-10-16 12:16:41 +03:00
|
|
|
CELERY_TASK_ALWAYS_EAGER = False
|
2014-08-08 16:08:46 +04:00
|
|
|
|
|
|
|
# Locally we typically don't run more than 1 elasticsearch node. So we set
|
|
|
|
# replicas to zero.
|
|
|
|
ES_DEFAULT_NUM_REPLICAS = 0
|
|
|
|
|
2015-10-30 20:21:04 +03:00
|
|
|
SITE_URL = os.environ.get('OLYMPIA_SITE_URL') or 'http://localhost:8000'
|
2018-10-17 18:52:21 +03:00
|
|
|
DOMAIN = SERVICES_DOMAIN = urlparse(SITE_URL).netloc
|
2016-07-20 12:05:29 +03:00
|
|
|
SERVICES_URL = SITE_URL
|
2019-06-06 13:04:06 +03:00
|
|
|
EXTERNAL_SITE_URL = SITE_URL
|
2014-08-08 16:08:46 +04:00
|
|
|
|
2019-03-29 07:35:03 +03:00
|
|
|
CODE_MANAGER_URL = os.environ.get('CODE_MANAGER_URL') or 'http://localhost:3000'
|
|
|
|
|
2016-11-02 18:56:10 +03:00
|
|
|
ALLOWED_HOSTS = ALLOWED_HOSTS + [SERVICES_DOMAIN]
|
|
|
|
|
2015-03-07 18:22:21 +03:00
|
|
|
# Default AMO user id to use for tasks (from users.json fixture in zadmin).
|
|
|
|
TASK_USER_ID = 10968
|
|
|
|
|
2018-04-09 17:48:02 +03:00
|
|
|
ALLOW_SELF_REVIEWS = True
|
2015-09-22 14:29:46 +03:00
|
|
|
|
2015-10-08 22:45:44 +03:00
|
|
|
AES_KEYS = {
|
2015-12-28 22:08:27 +03:00
|
|
|
'api_key:secret': os.path.join(
|
|
|
|
ROOT, 'src', 'olympia', 'api', 'tests', 'assets', 'test-api-key.txt'),
|
2015-10-08 22:45:44 +03:00
|
|
|
}
|
|
|
|
|
2019-01-18 18:11:31 +03:00
|
|
|
DATABASES = {
|
2019-03-18 13:57:49 +03:00
|
|
|
'default': get_db_config('DATABASES_DEFAULT_URL'),
|
2019-01-18 18:11:31 +03:00
|
|
|
}
|
|
|
|
|
2015-11-10 02:19:15 +03:00
|
|
|
# FxA config for local development only.
|
|
|
|
FXA_CONFIG = {
|
2016-04-21 23:31:31 +03:00
|
|
|
'default': {
|
WIP: Cleanup locustio based performance / smoke tests, add more entities (#8358)
* Port mozilla/amo-loadtest to FXA authentication and WebExtensions.
This is the first part of many to improve our load-tests and allow them
to be run regularly as part of a regression test suite.
This commit primarily ports the existing tests over to our repository,
updates them to use FxA authentication and uses a WebExtension for the
upload test.
This only implements the baseline for more work to come in #7744 but
it's important to have authentication and the basic infrastructure
working correctly.
It's also still using the legacy add-on detail and listing pages,
that'll obviously change - or be only true for SeaMonkey and Thunderbird
related tests since we still have to support them (very low priority though)
It also adds a first step of a summary report that links to new-relic.
That'll need a bit more tooling and testing but it worked quite well in
first tests.
Refs #7744
Next steps:
* Implement most of the read-only tests from #7744
* Check what needs auth in #7744, implement it properly
* Implement database and cache query logging
* Implement a unified merged test-report that uses the database and
cache query logging and merges it with locust logs (using our new
unique request id)
* Fix makefile, show dummy-usage for now.
* Delete generate-summary script for now
* Pin and cleanup dependencies
* Reverse all urls
* Use passed in account for login
* split things up
* Use gevent for waiting, some cleanups, add first version of Dockerfile, running script, disable developer stuff for now
* Add browsing collections and browsing categories
* Add loads more variation, add support for thunderbird, seamonkey, multiple languages
* Decrease size of docker images for local testing
* Get installation and docker image mostly to work, docs, cleanups
* Allow fxa environment variables be overwritten
* Hit legacy site of every variation
* More explicit theme testing
* Add browsing for app-versions and various rss feeds
* More variation in rss feeds, add featured and search tools
* Add a few more response.success() calls
* Test user profile pages, warn for empty collection pages
* More docs
* Add review browsing
2018-05-30 17:46:16 +03:00
|
|
|
'client_id': env('FXA_CLIENT_ID', default='f336377c014eacf0'),
|
|
|
|
'client_secret': env(
|
|
|
|
'FXA_CLIENT_SECRET',
|
|
|
|
default='5a36054059674b09ea56709c85b862c388f2d493d735070868ae8f476e16a80d'), # noqa
|
2016-04-21 23:31:31 +03:00
|
|
|
'content_host': 'https://stable.dev.lcip.org',
|
|
|
|
'oauth_host': 'https://oauth-stable.dev.lcip.org/v1',
|
|
|
|
'profile_host': 'https://stable.dev.lcip.org/profile/v1',
|
2018-01-26 09:08:08 +03:00
|
|
|
'redirect_url': 'http://olympia.test/api/v3/accounts/authenticate/',
|
2016-04-21 23:31:31 +03:00
|
|
|
'scope': 'profile',
|
|
|
|
},
|
2018-04-09 17:48:02 +03:00
|
|
|
'amo': {
|
WIP: Cleanup locustio based performance / smoke tests, add more entities (#8358)
* Port mozilla/amo-loadtest to FXA authentication and WebExtensions.
This is the first part of many to improve our load-tests and allow them
to be run regularly as part of a regression test suite.
This commit primarily ports the existing tests over to our repository,
updates them to use FxA authentication and uses a WebExtension for the
upload test.
This only implements the baseline for more work to come in #7744 but
it's important to have authentication and the basic infrastructure
working correctly.
It's also still using the legacy add-on detail and listing pages,
that'll obviously change - or be only true for SeaMonkey and Thunderbird
related tests since we still have to support them (very low priority though)
It also adds a first step of a summary report that links to new-relic.
That'll need a bit more tooling and testing but it worked quite well in
first tests.
Refs #7744
Next steps:
* Implement most of the read-only tests from #7744
* Check what needs auth in #7744, implement it properly
* Implement database and cache query logging
* Implement a unified merged test-report that uses the database and
cache query logging and merges it with locust logs (using our new
unique request id)
* Fix makefile, show dummy-usage for now.
* Delete generate-summary script for now
* Pin and cleanup dependencies
* Reverse all urls
* Use passed in account for login
* split things up
* Use gevent for waiting, some cleanups, add first version of Dockerfile, running script, disable developer stuff for now
* Add browsing collections and browsing categories
* Add loads more variation, add support for thunderbird, seamonkey, multiple languages
* Decrease size of docker images for local testing
* Get installation and docker image mostly to work, docs, cleanups
* Allow fxa environment variables be overwritten
* Hit legacy site of every variation
* More explicit theme testing
* Add browsing for app-versions and various rss feeds
* More variation in rss feeds, add featured and search tools
* Add a few more response.success() calls
* Test user profile pages, warn for empty collection pages
* More docs
* Add review browsing
2018-05-30 17:46:16 +03:00
|
|
|
'client_id': env('FXA_CLIENT_ID', default='0f95f6474c24c1dc'),
|
|
|
|
'client_secret': env(
|
|
|
|
'FXA_CLIENT_SECRET',
|
|
|
|
default='ca45e503a1b4ec9e2a3d4855d79849e098da18b7dfe42b6bc76dfed420fc1d38'), # noqa
|
2016-04-21 23:31:31 +03:00
|
|
|
'content_host': 'https://stable.dev.lcip.org',
|
|
|
|
'oauth_host': 'https://oauth-stable.dev.lcip.org/v1',
|
|
|
|
'profile_host': 'https://stable.dev.lcip.org/profile/v1',
|
2016-04-27 17:54:15 +03:00
|
|
|
'redirect_url': 'http://localhost:3000/fxa-authenticate',
|
2016-04-21 23:31:31 +03:00
|
|
|
'scope': 'profile',
|
|
|
|
},
|
2017-02-17 19:08:30 +03:00
|
|
|
'local': {
|
WIP: Cleanup locustio based performance / smoke tests, add more entities (#8358)
* Port mozilla/amo-loadtest to FXA authentication and WebExtensions.
This is the first part of many to improve our load-tests and allow them
to be run regularly as part of a regression test suite.
This commit primarily ports the existing tests over to our repository,
updates them to use FxA authentication and uses a WebExtension for the
upload test.
This only implements the baseline for more work to come in #7744 but
it's important to have authentication and the basic infrastructure
working correctly.
It's also still using the legacy add-on detail and listing pages,
that'll obviously change - or be only true for SeaMonkey and Thunderbird
related tests since we still have to support them (very low priority though)
It also adds a first step of a summary report that links to new-relic.
That'll need a bit more tooling and testing but it worked quite well in
first tests.
Refs #7744
Next steps:
* Implement most of the read-only tests from #7744
* Check what needs auth in #7744, implement it properly
* Implement database and cache query logging
* Implement a unified merged test-report that uses the database and
cache query logging and merges it with locust logs (using our new
unique request id)
* Fix makefile, show dummy-usage for now.
* Delete generate-summary script for now
* Pin and cleanup dependencies
* Reverse all urls
* Use passed in account for login
* split things up
* Use gevent for waiting, some cleanups, add first version of Dockerfile, running script, disable developer stuff for now
* Add browsing collections and browsing categories
* Add loads more variation, add support for thunderbird, seamonkey, multiple languages
* Decrease size of docker images for local testing
* Get installation and docker image mostly to work, docs, cleanups
* Allow fxa environment variables be overwritten
* Hit legacy site of every variation
* More explicit theme testing
* Add browsing for app-versions and various rss feeds
* More variation in rss feeds, add featured and search tools
* Add a few more response.success() calls
* Test user profile pages, warn for empty collection pages
* More docs
* Add review browsing
2018-05-30 17:46:16 +03:00
|
|
|
'client_id': env('FXA_CLIENT_ID', default='1778aef72d1adfb3'),
|
|
|
|
'client_secret': env(
|
|
|
|
'FXA_CLIENT_SECRET',
|
|
|
|
default='3feebe3c009c1a0acdedd009f3530eae2b88859f430fa8bb951ea41f2f859b18'), # noqa
|
2017-02-17 19:08:30 +03:00
|
|
|
'content_host': 'https://stable.dev.lcip.org',
|
|
|
|
'oauth_host': 'https://oauth-stable.dev.lcip.org/v1',
|
|
|
|
'profile_host': 'https://stable.dev.lcip.org/profile/v1',
|
2019-03-27 14:24:05 +03:00
|
|
|
'redirect_url': 'http://localhost:3000/api/v3/accounts/authenticate/?config=local', # noqa
|
|
|
|
'scope': 'profile',
|
|
|
|
},
|
|
|
|
'code-manager': {
|
|
|
|
'client_id': env('CODE_MANAGER_FXA_CLIENT_ID', default='a98b671fdd3dfcea'), # noqa
|
|
|
|
'client_secret': env(
|
|
|
|
'CODE_MANAGER_FXA_CLIENT_SECRET',
|
|
|
|
default='d9934865e34bed4739a2dc60046a90d09a5d8336cf92809992dec74a4cff4665'), # noqa
|
|
|
|
'content_host': 'https://stable.dev.lcip.org',
|
|
|
|
'oauth_host': 'https://oauth-stable.dev.lcip.org/v1',
|
|
|
|
'profile_host': 'https://stable.dev.lcip.org/profile/v1',
|
|
|
|
'redirect_url': 'http://olympia.test/api/v4/accounts/authenticate/?config=code-manager', # noqa
|
2017-02-17 19:08:30 +03:00
|
|
|
'scope': 'profile',
|
|
|
|
},
|
2016-04-20 01:24:45 +03:00
|
|
|
}
|
2019-03-27 14:24:05 +03:00
|
|
|
ALLOWED_FXA_CONFIGS = ['default', 'amo', 'local', 'code-manager']
|
2015-10-08 22:45:44 +03:00
|
|
|
|
2016-01-11 20:30:32 +03:00
|
|
|
# CSP report endpoint which returns a 204 from addons-nginx in local dev.
|
|
|
|
CSP_REPORT_URI = '/csp-report'
|
2019-07-18 18:52:11 +03:00
|
|
|
RESTRICTED_DOWNLOAD_CSP['REPORT_URI'] = CSP_REPORT_URI
|
2016-01-11 20:30:32 +03:00
|
|
|
|
2016-01-12 00:00:25 +03:00
|
|
|
# Allow GA over http + www subdomain in local development.
|
|
|
|
HTTP_GA_SRC = 'http://www.google-analytics.com'
|
|
|
|
CSP_IMG_SRC += (HTTP_GA_SRC,)
|
2016-09-09 17:01:25 +03:00
|
|
|
CSP_SCRIPT_SRC += (HTTP_GA_SRC, "'self'")
|
2016-01-12 00:00:25 +03:00
|
|
|
|
2016-08-10 23:04:57 +03:00
|
|
|
# Auth token required to authorize inbound email.
|
2016-10-04 13:53:58 +03:00
|
|
|
INBOUND_EMAIL_SECRET_KEY = 'totally-unsecure-secret-string'
|
|
|
|
# Validation key we need to send in POST response.
|
|
|
|
INBOUND_EMAIL_VALIDATION_KEY = 'totally-unsecure-validation-string'
|
2016-08-10 23:04:57 +03:00
|
|
|
|
2019-08-29 13:21:20 +03:00
|
|
|
# Sectools
|
|
|
|
CUSTOMS_API_URL = 'http://customs:10101/'
|
|
|
|
CUSTOMS_API_KEY = 'customssecret'
|
2019-09-09 14:04:44 +03:00
|
|
|
WAT_API_URL = 'http://wat:10102/'
|
|
|
|
WAT_API_KEY = 'watsecret'
|
2019-08-29 13:21:20 +03:00
|
|
|
|
2014-08-08 16:08:46 +04:00
|
|
|
# If you have settings you want to overload, put them in a local_settings.py.
|
|
|
|
try:
|
|
|
|
from local_settings import * # noqa
|
2019-03-04 18:01:00 +03:00
|
|
|
except ImportError:
|
2018-06-03 14:37:40 +03:00
|
|
|
import warnings
|
|
|
|
import traceback
|
|
|
|
|
|
|
|
warnings.warn('Could not import local_settings module. {}'.format(
|
|
|
|
traceback.format_exc()))
|