Ejemplo n.º 1
0
def initialize_newrelic():
    license_key = env.get_credential('NEW_RELIC_LICENSE_KEY')
    if license_key:
        import newrelic.agent
        settings = newrelic.agent.global_settings()
        settings.license_key = license_key
        newrelic.agent.initialize()
Ejemplo n.º 2
0
def notify():
    try:
        meta = json.load(open('.cfmeta'))
    except OSError:
        meta = {}
    slack = Slacker(env.get_credential('FEC_SLACK_TOKEN'))
    slack.chat.post_message(
        env.get_credential('FEC_SLACK_CHANNEL', '#fec'),
        'deploying branch {branch} of app {name} to space {space} by {user}'.format(
            name=env.name,
            space=env.space,
            user=meta.get('user'),
            branch=meta.get('branch'),
        ),
        username=env.get_credential('FEC_SLACK_BOT', 'fec-bot'),
    )
Ejemplo n.º 3
0
def initialize_newrelic():
    license_key = env.get_credential('NEW_RELIC_LICENSE_KEY')
    if license_key:
        import newrelic.agent
        settings = newrelic.agent.global_settings()
        settings.license_key = license_key
        newrelic.agent.initialize()
Ejemplo n.º 4
0
import os

from openfecwebapp.env import env

# no trailing slash
api_location = os.getenv('FEC_WEB_API_URL', 'http://localhost:5000')
api_location_public = os.getenv('FEC_WEB_API_URL_PUBLIC', api_location)
api_version = os.getenv('FEC_WEB_API_VERSION', 'v1')
host = os.getenv('FEC_WEB_HOST', '0.0.0.0')
port = os.getenv('FEC_WEB_PORT', '3000')
api_key = env.get_credential('FEC_WEB_API_KEY', '')
api_key_public = env.get_credential('FEC_WEB_API_KEY_PUBLIC', '')
cache = os.getenv('FEC_WEB_CACHE')
cache_size = int(os.getenv('FEC_WEB_CACHE_SIZE', 1000))

cms_url = os.getenv('FEC_CMS_URL', '')

# you can only give a var a string using set-env with Cloud Foundry
# set FEC_WEB_DEBUG to any string but an empty one if you want debug on
debug = bool(os.getenv('FEC_WEB_DEBUG'))

environments = {'dev', 'stage', 'prod'}
environment = (os.getenv('FEC_WEB_ENVIRONMENT')
               if os.getenv('FEC_WEB_ENVIRONMENT') in environments else 'dev')

features = {
    'legal_murs': bool(env.get_credential('FEC_FEATURE_LEGAL_MURS', '')),
    'press': bool(env.get_credential('FEC_FEATURE_PRESS', '')),
    'latest_updates': bool(env.get_credential('FEC_FEATURE_UPDATES', ''))
}
Ejemplo n.º 5
0
import os

from openfecwebapp.env import env

# no trailing slash
api_location = env.get_credential('FEC_WEB_API_URL', 'http://localhost:5000')
api_location_public = env.get_credential('FEC_WEB_API_URL_PUBLIC', api_location)
api_version = env.get_credential('FEC_WEB_API_VERSION', 'v1')
host = env.get_credential('FEC_WEB_HOST', '0.0.0.0')
port = env.get_credential('FEC_WEB_PORT', '3000')
api_key = env.get_credential('FEC_WEB_API_KEY', '')
api_key_public = env.get_credential('FEC_WEB_API_KEY_PUBLIC', '')
cache = env.get_credential('FEC_WEB_CACHE')
cache_size = int(env.get_credential('FEC_WEB_CACHE_SIZE', 1000))
transition_url = env.get_credential('FEC_TRANSITION_URL', 'https://transition.fec.gov')
classic_url = env.get_credential('FEC_CLASSIC_URL', 'http://classic.fec.gov')
cms_url = env.get_credential('FEC_CMS_URL', '')
canonical_base = env.get_credential('CANONICAL_BASE', 'https://www.fec.gov')

site_orientation_banner = bool(env.get_credential('FEC_SITE_ORIENTATION_BANNER'))

# you can only give a var a string using set-env with Cloud Foundry
# set FEC_WEB_DEBUG to any string but an empty one if you want debug on
debug = bool(env.get_credential('FEC_WEB_DEBUG'))

environments = {'dev', 'stage', 'prod'}
environment = (
    env.get_credential('FEC_WEB_ENVIRONMENT')
    if env.get_credential('FEC_WEB_ENVIRONMENT') in environments
    else 'dev'
)
Ejemplo n.º 6
0
import os

from openfecwebapp.env import env

# no trailing slash
api_location = os.getenv('FEC_WEB_API_URL', 'http://localhost:5000')
api_location_public = os.getenv('FEC_WEB_API_URL_PUBLIC', api_location)
api_version = os.getenv('FEC_WEB_API_VERSION', 'v1')
host = os.getenv('FEC_WEB_HOST', '0.0.0.0')
port = os.getenv('FEC_WEB_PORT', '3000')
api_key = env.get_credential('FEC_WEB_API_KEY', '')
api_key_public = env.get_credential('FEC_WEB_API_KEY_PUBLIC', '')
cache = os.getenv('FEC_WEB_CACHE')
cache_size = int(os.getenv('FEC_WEB_CACHE_SIZE', 1000))

style_url = os.getenv('FEC_WEB_STYLE_URL')
cms_url = os.getenv('FEC_CMS_URL', '')

# you can only give a var a string using set-env with Cloud Foundry
# set FEC_WEB_DEBUG to any string but an empty one if you want debug on
debug = bool(os.getenv('FEC_WEB_DEBUG'))

environments = {'dev', 'stage', 'prod'}
environment = (
    os.getenv('FEC_WEB_ENVIRONMENT')
    if os.getenv('FEC_WEB_ENVIRONMENT') in environments
    else 'dev'
)

features = {
    'legal_statutes': bool(env.get_credential('FEC_FEATURE_LEGAL_STATUTES', '')),
Ejemplo n.º 7
0
import os

from openfecwebapp.env import env

# no trailing slash
api_location = os.getenv('FEC_WEB_API_URL', 'http://localhost:5000')
api_location_public = os.getenv('FEC_WEB_API_URL_PUBLIC', api_location)
api_version = os.getenv('FEC_WEB_API_VERSION', 'v1')
host = os.getenv('FEC_WEB_HOST', '0.0.0.0')
port = os.getenv('FEC_WEB_PORT', '3000')
api_key = env.get_credential('FEC_WEB_API_KEY', '')
api_key_public = env.get_credential('FEC_WEB_API_KEY_PUBLIC', '')
cache = os.getenv('FEC_WEB_CACHE')
cache_size = int(os.getenv('FEC_WEB_CACHE_SIZE', 1000))

style_url = os.getenv('FEC_WEB_STYLE_URL')
cms_url = os.getenv('FEC_CMS_URL', '')

# you can only give a var a string using set-env with Cloud Foundry
# set FEC_WEB_DEBUG to any string but an empty one if you want debug on
debug = bool(os.getenv('FEC_WEB_DEBUG'))

environments = {'dev', 'stage', 'prod'}
environment = (
    os.getenv('FEC_WEB_ENVIRONMENT')
    if os.getenv('FEC_WEB_ENVIRONMENT') in environments
    else 'dev'
)

features = {
    'legal': bool(os.getenv('FEC_FEATURE_LEGAL', '')),
Ejemplo n.º 8
0
import os

from openfecwebapp.env import env

# no trailing slash
api_location = os.getenv('FEC_WEB_API_URL', 'http://localhost:5000')
api_location_public = os.getenv('FEC_WEB_API_URL_PUBLIC', api_location)
api_version = os.getenv('FEC_WEB_API_VERSION', 'v1')
host = os.getenv('FEC_WEB_HOST', '0.0.0.0')
port = os.getenv('FEC_WEB_PORT', '3000')
api_key = env.get_credential('FEC_WEB_API_KEY', '')
api_key_public = env.get_credential('FEC_WEB_API_KEY_PUBLIC', '')
cache = os.getenv('FEC_WEB_CACHE')
cache_size = int(os.getenv('FEC_WEB_CACHE_SIZE', 1000))

style_url = os.getenv('FEC_WEB_STYLE_URL')
cms_url = os.getenv('FEC_CMS_URL', '')

# you can only give a var a string using set-env with Cloud Foundry
# set FEC_WEB_DEBUG to any string but an empty one if you want debug on
debug = bool(os.getenv('FEC_WEB_DEBUG'))

environments = {'dev', 'stage', 'prod'}
environment = (os.getenv('FEC_WEB_ENVIRONMENT')
               if os.getenv('FEC_WEB_ENVIRONMENT') in environments else 'dev')

features = {
    'legal': bool(os.getenv('FEC_FEATURE_LEGAL', '')),
}

# Whether the app should force HTTPS/HSTS.