Skip to content

Configuration Guide

Alfred Gutierrez edited this page Nov 27, 2016 · 5 revisions

Work in progress

Use this guide as a reference for configuring settings.py. See comments for description of each configuration option.

settings.py - Default settings.

Application Settings

# -*- coding: utf-8 -*-
import os

APP_HOST = '0.0.0.0'  # Application bind address.
APP_PORT = 5000  # Application port.
APP_DEBUG = True  # Output debug stacktrace. Disable this for production.

# Secret key for storing sessions. The secret key should be randomly generated.
# See: http://flask.pocoo.org/docs/0.11/quickstart/#sessions for best practice.
APP_SESSION_KEY = 'super-secret'

CSRF_ENABLED = True  # Enable Cross-Site Request Forgery tokens for form submission.
ASSETS_DEBUG = True  # Enable debug-mode for Flask-Assets. See: https://flask-assets.readthedocs.io/en/latest/

# Base directory for project root used in other settings. This should be left as default.
BASE_DIR = os.path.abspath(os.path.dirname(__file__))

Database/Storage/Cache/Message Queue Settings

REDIS_HOST = os.environ.get('REDIS_HOST', 'localhost:6379')  ## Redis host/port from environment variable. Defaults to localhost.

# Database Engine URI. This should be in the form of the dialect and driver URI supported by SQLAlchemy.
# See: http://docs.sqlalchemy.org/en/latest/core/engines.html#database-urls
DATABASE_URI = 'sqlite:////tmp/test.db'

# Celery Settings using the redis host as the broker and celery result backend.
# See: http://docs.celeryproject.org/en/latest/getting-started/first-steps-with-celery.html#configuration
BROKER_URL = 'redis://%s/0' % REDIS_HOST
CELERY_RESULT_BACKEND = 'redis://%s/0' % REDIS_HOST
CACHE_BACKEND = 'simple'  ## Simple for in-memory cache. You can also use 'redis' here for redis-based caching.

Mumble virtual server defaults.

# Murmur default settings
DEFAULT_MAX_USERS = 15
DEFAULT_CHANNEL_NAME = 'GuildBit.com Mumble Server'

# Murmur server default port. All virtual servers created will be a next available port over 50000.
DEFAULT_MURMUR_PORT = 50000 

Email Settings.

MAIL_SERVER = 'email-smtp.us-east-1.amazonaws.com'
MAIL_PORT = 587
MAIL_USE_TLS = True
MAIL_USE_SSL = True
MAIL_USERNAME = ''
MAIL_PASSWORD = ''
DEFAULT_MAIL_SENDER = 'alf.g.jr@gmail.com'
EMAIL_RECIPIENTS = ['alf.g.jr@gmail.com']

OPENID_PROVIDERS = [
    {'name': 'Steam', 'url': 'http://steamcommunity.com/openid'}
]

STEAM_API_KEY = 'XXXXXX'

LANGUAGES = {
    'en': 'English',
    'es': 'Español'
}

MURMUR_HOSTS = [
    {
        'name': 'localhost',
        'address': 'localhost:5000',
        'uri': 'http://localhost:5000',
        'hostname': 'localhost',
        'http_uri': 'http://localhost:4000/static/img',
        'monitor_uri': 'http://localhost:5555',
        'contact': 'alf.g.jr@gmail.com',
        'location': 'local',
        'location_name': 'Local',
        'status': 'active',
        'capacity': 100,
        'username': '',
        'password': ''
    }
]

# Use only if in test docker environment.
DOCKER_TEST = os.environ.get('DOCKER_TEST', False)
if DOCKER_TEST:
    MURMUR_HOSTS = [{
        'name': 'Test Server',
        'address': 'murmur-rest:5000',
        'uri': 'http://murmur-rest:5000',
        'hostname': 'murmur-rest',
        'http_uri': 'http://localhost:4000/static/img',
        'monitor_uri': 'http://localhost:5555',
        'location': 'local',
        'location_name': 'Local',
        'status': 'active',
        'capacity': 100,
        'username': '',
        'password': ''
    }]

PACKAGES = [
    {
        'name': 'PACKAGE-Test',
        'slots': 10,
        'duration': 48  # Days in hours
    },
    {
        'name': 'PACKAGE-A',
        'slots': 25,
        'duration': 168  # Days in hours
    },
    {
        'name': 'PACKAGE-B',
        'slots': 25,
        'duration': 336  # Days in hours
    },
    {
        'name': 'PACKAGE-C',
        'slots': 25,
        'duration': 720 # Days in hours
    }
]
Clone this wiki locally