Skip to content
This repository has been archived by the owner on May 24, 2019. It is now read-only.

Commit

Permalink
Remove sensitive settings #219
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredlockhart committed Jan 6, 2016
1 parent 7007093 commit e5c49c0
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 25 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
FROM python:2.7
ENV PYTHONUNBUFFERED 1
ENV DOCKER_BUILD 1
WORKDIR /leaderboard
EXPOSE 7001
RUN apt-get update && apt-get install -y binutils libproj-dev gdal-bin && apt-get -y clean
COPY ./requirements.txt ./
RUN pip install -r requirements.txt --no-cache-dir --disable-pip-version-check
COPY . /leaderboard
RUN mkdir /leaderboard/leaderboard/served/ && mkdir /leaderboard/leaderboard/served/static/ && python manage.py collectstatic -c --noinput
RUN mkdir /leaderboard/leaderboard/served/;mkdir /leaderboard/leaderboard/served/static/;python manage.py collectstatic -c --noinput
47 changes: 25 additions & 22 deletions leaderboard/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '3nx!_1%6g@!uo&9efusb++j!=w(=pe1wrsp99+uz+8%hltyatl'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False

Expand Down Expand Up @@ -109,20 +106,6 @@
)


# Database configuration for travis tests
# Should be overridden by a local settings file for actual deployments
if 'TRAVIS' in os.environ:
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'leaderboard_test',
'USER': 'postgres',
'PASSWORD': '',
'HOST': 'localhost',
'PORT': '',
}
}

# Django Rest Framework settings
REST_FRAMEWORK = {
'DEFAULT_PAGINATION_CLASS': (
Expand Down Expand Up @@ -152,11 +135,31 @@
# observations within that tile for a 24 hour period
CONTRIBUTION_RECORD_DURATION = 24 * 60 * 60

# Firefox Accounts
FXA_CLIENT_ID = 'TODO'
FXA_SECRET = 'TODO'
FXA_OAUTH_URI = 'TODO'
FXA_PROFILE_URI = 'TODO'
if 'TRAVIS' in os.environ:
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'travis'

# Database configuration for travis tests
# Should be overridden by a local settings file for actual deployments
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'leaderboard_test',
'USER': 'postgres',
'PASSWORD': '',
'HOST': 'localhost',
'PORT': '',
}
}

# Firefox Accounts
FXA_CLIENT_ID = 'travis'
FXA_SECRET = 'travis'
FXA_OAUTH_URI = 'travis'
FXA_PROFILE_URI = 'travis'

if 'DOCKER_BUILD' in os.environ:
SECRET_KEY = 'docker'

try:
from settings_local import *
Expand Down
7 changes: 5 additions & 2 deletions leaderboard/settings_local.py.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# PRODUCTION #
##############

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'TODO'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False

Expand Down Expand Up @@ -50,5 +53,5 @@ DATABASES = {
# Firefox Accounts
FXA_CLIENT_ID = 'TODO'
FXA_SECRET = 'TODO'
FXA_OAUTH_URI = 'https://oauth-stable.dev.lcip.org/v1/'
FXA_PROFILE_URI = 'https://stable.dev.lcip.org/profile/v1/'
FXA_OAUTH_URI = 'TODO'
FXA_PROFILE_URI = 'TODO'

0 comments on commit e5c49c0

Please sign in to comment.