Skip to content

Commit

Permalink
Pad out the configuration a bit, refs #3.
Browse files Browse the repository at this point in the history
  • Loading branch information
pudo committed Mar 2, 2016
1 parent e095ff9 commit e43643b
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 56 deletions.
30 changes: 24 additions & 6 deletions aleph.env.tmpl
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
### Aleph configuration file.

ALEPH_APP_TITLE=Aleph
# Name needs to be a slug, as it is used e.g. for the ES index, SQS queue name:
ALEPH_APP_NAME=aleph
ALEPH_FAVICON=https://investigativedashboard.org/static/favicon.ico

# Random string:
ALEPH_SECRET_KEY=
# TODO: allow selecting OAuth provider here.
ALEPH_URL_SCHEME=https

# Expects Google OAuth credentials to be set up:
ALEPH_OAUTH_KEY=
ALEPH_OAUTH_SECRET=
ALEPH_APP_TITLE=aleph.grano.cc
ALEPH_APP_NAME=aleph
ALEPH_SPINDLE_API_KEY=
ALEPH_ID_USERNAME=
ALEPH_ID_PASSWORD=

# Where and how to store the underlying files:
ALEPH_ARCHIVE_TYPE=s3
ALEPH_ARCHIVE_BUCKET=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=

# Use Amazon SQS for task queueing:
ALEPH_BROKER_URI=sqs://

# Or, if 'ALEPH_ARCHIVE_TYPE' configuration is 'file':
ALEPH_ARCHIVE_PATH=/var/lib/aleph

# Provide a valid email to send alerts from:
MAIL_FROM=
MAIL_HOST=
MAIL_ADMIN=
Expand Down
43 changes: 13 additions & 30 deletions contrib/docker_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
APP_TITLE = os.environ.get('ALEPH_APP_TITLE', 'Aleph')
APP_NAME = os.environ.get('ALEPH_APP_NAME', 'aleph')
APP_BASEURL = os.environ.get('ALEPH_APP_URL')
FAVICON = 'https://investigativedashboard.org/static/favicon.ico'
FAVICON = os.environ.get('ALEPH_FAVICON')

ELASTICSEARCH_URL = os.environ.get('ALEPH_ELASTICSEARCH_URI')

SQLALCHEMY_DATABASE_URI = os.environ.get('ALEPH_DATABASE_URI')
PREFERRED_URL_SCHEME = 'https'

PREFERRED_URL_SCHEME = os.environ.get('ALEPH_URL_SCHEME')

MAIL_FROM = os.environ.get('MAIL_FROM')
MAIL_HOST = os.environ.get('MAIL_HOST')
Expand All @@ -28,44 +29,26 @@
MAIL_USE_TLS = True
MAIL_PORT = 587


CELERY_BROKER_URL = os.environ.get('ALEPH_BROKER_URI')
BROKER_TRANSPORT_OPTIONS = {
'region': 'eu-west-1',
'queue_name_prefix': 'prod-'
'region': 'eu-west-1'
}

# ADMINS = ((APP_TITLE, MAIL_ADMINS[0]),)
# SERVER_EMAIL = MAIL_FROM
# EMAIL_HOST = MAIL_HOST
# EMAIL_HOST_USER, EMAIL_HOST_PASSWORD = MAIL_CREDENTIALS
# EMAIL_USE_TLS = True

ARCHIVE_TYPE = os.environ.get('ALEPH_ARCHIVE_TYPE')
ARCHIVE_AWS_KEY_ID = os.environ.get('ALEPH_AWS_ACCESS_KEY_ID')
ARCHIVE_AWS_SECRET = os.environ.get('ALEPH_AWS_SECRET_ACCESS_KEY')
ARCHIVE_TYPE = os.environ.get('ALEPH_ARCHIVE_TYPE', 's3')
ARCHIVE_AWS_KEY_ID = os.environ.get('AWS_ACCESS_KEY_ID')
ARCHIVE_AWS_SECRET = os.environ.get('AWS_SECRET_ACCESS_KEY')
ARCHIVE_BUCKET = os.environ.get('ALEPH_ARCHIVE_BUCKET')
ARCHIVE_PATH = os.environ.get('ALEPH_ARCHIVE_PATH')

TWITTER_API_KEY = os.environ.get('ALEPH_TWITTER_API_KEY')
TWITTER_API_SECRET = os.environ.get('ALEPH_TWITTER_API_SECRET')

FACEBOOK_APP_ID = os.environ.get('ALEPH_FACEBOOK_APP_ID')
FACEBOOK_APP_SECRET = os.environ.get('ALEPH_FACEBOOK_APP_SECRET')

SPINDLE_URL = os.environ.get('ALEPH_SPINDLE_HOST', 'https://search.occrp.org/')
SPINDLE_API_KEY = os.environ.get('ALEPH_SPINDLE_API_KEY')

ID_HOST = 'https://www.investigativedashboard.org/'
ID_USERNAME = os.environ.get('ALEPH_ID_USERNAME')
ID_PASSWORD = os.environ.get('ALEPH_ID_PASSWORD')

OAUTH = {
'consumer_key': os.environ.get('ALEPH_OAUTH_KEY'),
'consumer_secret': os.environ.get('ALEPH_OAUTH_SECRET'),
'base_url': 'https://investigativedashboard.org/',
'request_token_params': {
'scope': 'https://www.googleapis.com/auth/userinfo.email'
},
'base_url': 'https://www.googleapis.com/oauth2/v1/',
'request_token_url': None,
'access_token_method': 'POST',
'access_token_url': 'https://investigativedashboard.org/o/token/',
'authorize_url': 'https://investigativedashboard.org/o/authorize',
'access_token_url': 'https://accounts.google.com/o/oauth2/token',
'authorize_url': 'https://accounts.google.com/o/oauth2/auth',
}
24 changes: 4 additions & 20 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,19 @@ elasticsearch:
environment:
ES_HEAP_SIZE: 4g

rabbitmq:
image: rabbitmq:3-management
volumes:
- "/srv/data/rabbitmq/:/var/lib/rabbitmq"
expose:
- "5673"
- "15672"

worker:
build: .
command: celery -A aleph.queue worker -c 10 -l INFO --logfile=/var/log/celery.log
links:
- rabbitmq
- postgres
- elasticsearch
volumes:
- "/srv/data:/srv/data/"
- "/srv/logs/worker:/var/log"
environment:
C_FORCE_ROOT: true
ALEPH_ELASTICSEARCH_URI: http://aleph_elasticsearch:9200/
ALEPH_DATABASE_URI: postgresql://aleph:aleph@aleph_postgres/aleph
ALEPH_BROKER_URI: amqp://guest:guest@aleph_rabbitmq:5672//
ALEPH_ARCHIVE_TYPE: file
ALEPH_ARCHIVE_PATH: /srv/data/aleph
ALEPH_ELASTICSEARCH_URI: http://elasticsearch:9200/
ALEPH_DATABASE_URI: postgresql://aleph:aleph@postgres/aleph
env_file:
- aleph.env

Expand All @@ -55,17 +43,13 @@ web:
ports:
- "13376:8000"
links:
- rabbitmq
- postgres
- elasticsearch
volumes:
- "/srv/data/:/srv/data/"
- "/srv/data/live/aleph-logs/worker:/var/log"
environment:
ALEPH_ELASTICSEARCH_URI: http://aleph_elasticsearch:9200/
ALEPH_DATABASE_URI: postgresql://aleph:aleph@aleph_postgres/aleph
ALEPH_BROKER_URI: amqp://guest:guest@aleph_rabbitmq:5672//
ALEPH_ARCHIVE_TYPE: file
ALEPH_ARCHIVE_PATH: /srv/data/aleph
ALEPH_ELASTICSEARCH_URI: http://elasticsearch:9200/
ALEPH_DATABASE_URI: postgresql://aleph:aleph@postgres/aleph
env_file:
- aleph.env

0 comments on commit e43643b

Please sign in to comment.