Exemplo n.º 1
0
def init_app(app):
    if not app.config.get('STATISTICS_MONGO_DBNAME'):
        app.config['STATISTICS_MONGO_DBNAME'] = env('STATISTICS_MONGO_DBNAME',
                                                    'statistics')

    db_name = app.config['STATISTICS_MONGO_DBNAME']

    if not app.config.get('STATISTICS_MONGO_URI'):
        app.config['STATISTICS_MONGO_URI'] = env(
            'STATISTICS_MONGO_URI', 'mongodb://localhost/%s' % db_name)

    if not app.config.get('STATISTICS_ELASTIC_URL'):
        app.config['STATISTICS_ELASTIC_URL'] = env(
            'STATISTICS_ELASTIC_URL', app.config['ELASTICSEARCH_URL'])

    if not app.config.get('STATISTICS_ELASTIC_INDEX'):
        app.config['STATISTICS_ELASTIC_INDEX'] = env(
            'STATISTICS_ELASTIC_INDEX', db_name)

    init_gen_stats_task(app)

    endpoint_name = ArchiveStatisticsResource.endpoint_name
    service = ArchiveStatisticsService(endpoint_name,
                                       backend=superdesk.get_backend())
    ArchiveStatisticsResource(endpoint_name, app=app, service=service)
Exemplo n.º 2
0
            'height': 1400
        },
    },
    'avatar': {
        'thumbnail': {
            'width': 60,
            'height': 60
        },
        'viewImage': {
            'width': 200,
            'height': 200
        },
    }
}

WS_HOST = env('WSHOST', '0.0.0.0')
WS_PORT = env('WSPORT', '5100')

LOG_CONFIG_FILE = env('LOG_CONFIG_FILE', 'logging_config.yml')

REDIS_URL = env('REDIS_URL', 'redis://localhost:6379')
if env('REDIS_PORT'):
    REDIS_URL = env('REDIS_PORT').replace('tcp:', 'redis:')
BROKER_URL = env('CELERY_BROKER_URL', REDIS_URL)

SECRET_KEY = env('SECRET_KEY', '')

# Highcharts Export Server - default settings
ANALYTICS_ENABLE_SCHEDULED_REPORTS = strtobool(
    env('ANALYTICS_ENABLE_SCHEDULED_REPORTS', 'true'))
HIGHCHARTS_SERVER_HOST = env('HIGHCHARTS_SERVER_HOST', 'localhost')
Exemplo n.º 3
0
if init_data.exists():
    INIT_DATA_PATH = init_data

INSTALLED_APPS.extend([
    'analytics',
    'apps.languages',
    'planning',
    'belga.search_providers',
    'belga.io',
    'belga.command',
    'belga.publish',
    'belga.macros',
    'belga.signals'
])

SECRET_KEY = env('SECRET_KEY', '')

DEFAULT_TIMEZONE = "Europe/Brussels"

DEFAULT_LANGUAGE = 'nl'
LANGUAGES = [
    {'language': 'nl', 'label': 'Dutch', 'source': True, 'destination': True},
    {'language': 'fr', 'label': 'French', 'source': True, 'destination': True},
    {'language': 'en', 'label': 'English', 'source': False, 'destination': False},
    {'language': 'de', 'label': 'German', 'source': False, 'destination': False},
    {'language': 'ja', 'label': 'Japanese', 'source': False, 'destination': False},
    {'language': 'es', 'label': 'Spanish', 'source': False, 'destination': False},
    {'language': 'ru', 'label': 'Russian', 'source': False, 'destination': False}
]

TIMEZONE_CODE = {
Exemplo n.º 4
0
init_data = Path(ABS_PATH) / 'data'
if init_data.exists():
    INIT_DATA_PATH = init_data

INSTALLED_APPS.extend([
    'analytics',
    'apps.languages',
    'planning',
    'belga.image',
    'belga.io',
    'belga.command',
    'belga.publish'
])

SECRET_KEY = env('SECRET_KEY', '')

DEFAULT_TIMEZONE = "Europe/Brussels"

DEFAULT_LANGUAGE = 'nl'
LANGUAGES = [
    {'language': 'nl', 'label': 'Dutch', 'source': True, 'destination': True},
    {'language': 'fr', 'label': 'French', 'source': True, 'destination': True},
    {'language': 'en', 'label': 'English', 'source': False, 'destination': False},
    {'language': 'de', 'label': 'German', 'source': False, 'destination': False},
    {'language': 'ja', 'label': 'Japanese', 'source': False, 'destination': False},
    {'language': 'es', 'label': 'Spanish', 'source': False, 'destination': False},
    {'language': 'ru', 'label': 'Russian', 'source': False, 'destination': False}
]

TIMEZONE_CODE = {
Exemplo n.º 5
0
    CONTENTAPI_MONGO_DBNAME, CONTENTAPI_MONGO_URI,
    CONTENTAPI_ELASTICSEARCH_URL, CONTENTAPI_ELASTICSEARCH_INDEX,
    AMAZON_ACCESS_KEY_ID, AMAZON_SECRET_ACCESS_KEY, AMAZON_REGION,
    AMAZON_CONTAINER_NAME, AMAZON_S3_SUBFOLDER, AMAZON_OBJECT_ACL,
)

CONTENTAPI_INSTALLED_APPS = [
    'content_api.items',
    'content_api.packages',
    'content_api.assets',
    'content_api.tokens',
    'content_api.items_versions',
    'content_api.packages_versions',
    'content_api.api_audit',
]

CONTENTAPI_DOMAIN = {}

# NOTE: no trailing slash for the CONTENTAPI_URL setting!
CONTENTAPI_URL = env('CONTENTAPI_URL', 'http://localhost:5400')
MEDIA_PREFIX = env('MEDIA_PREFIX', '%s/assets' % CONTENTAPI_URL.rstrip('/'))
server_url = urlparse(CONTENTAPI_URL)
URL_PREFIX = env('CONTENTAPI_URL_PREFIX', server_url.path.strip('/')) or ''
VERSION = '_current_version'

XML = False
PUBLIC_RESOURCES = []
DATE_FORMAT = '%Y-%m-%dT%H:%M:%S+0000'
ELASTIC_DATE_FORMAT = '%Y-%m-%d'
BCRYPT_GENSALT_WORK_FACTOR = 12
Exemplo n.º 6
0
A module containing configuration of the Superdesk's production API.

The meaning of configuration options is described in the Eve framework
`documentation <http://python-eve.org/config.html#global-configuration>`_.
"""

from superdesk.default_settings import env, urlparse

from superdesk.default_settings import (  # noqa
    DEBUG, SUPERDESK_TESTING, MONGO_URI, ELASTICSEARCH_INDEX,
    ELASTICSEARCH_URL, AMAZON_ACCESS_KEY_ID, AMAZON_SECRET_ACCESS_KEY,
    AMAZON_REGION, AMAZON_CONTAINER_NAME, AMAZON_S3_SUBFOLDER,
    AMAZON_OBJECT_ACL, AMAZON_ENDPOINT_URL, strtobool,
)

SECRET_KEY = env("PRODAPI_SECRET_KEY", "")

PRODAPI_INSTALLED_APPS = (
    "prod_api.items",
    "prod_api.assets",
    "prod_api.desks",
    "prod_api.planning",
    "prod_api.contacts",
    "prod_api.users",
)

# NOTE: no trailing slash for the PRODAPI_URL setting!
PRODAPI_URL = env("PRODAPI_URL", "http://localhost:5500")
URL_PREFIX = env("PRODAPI_URL_PREFIX", "prodapi")
API_VERSION = "v1"
MEDIA_PREFIX = env(
Exemplo n.º 7
0
if init_data.exists():
    INIT_DATA_PATH = init_data

INSTALLED_APPS.extend([
    'analytics',
    'apps.languages',
    'planning',
    'belga.search_providers',
    'belga.io',
    'belga.command',
    'belga.publish',
    'belga.macros',
    'belga.signals'
])

SECRET_KEY = env('SECRET_KEY', '')

DEFAULT_TIMEZONE = "Europe/Brussels"

DEFAULT_LANGUAGE = 'en'
LANGUAGES = [
    {'language': 'nl', 'label': 'Dutch', 'source': True, 'destination': True},
    {'language': 'fr', 'label': 'French', 'source': True, 'destination': True},
    {'language': 'en', 'label': 'English', 'source': False, 'destination': False},
    {'language': 'de', 'label': 'German', 'source': False, 'destination': False},
    {'language': 'ja', 'label': 'Japanese', 'source': False, 'destination': False},
    {'language': 'es', 'label': 'Spanish', 'source': False, 'destination': False},
    {'language': 'ru', 'label': 'Russian', 'source': False, 'destination': False}
]

TIMEZONE_CODE = {
Exemplo n.º 8
0
from superdesk.default_settings import env


ABS_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../"))
BEHAVE_TESTS_FIXTURES_PATH = os.path.join(
    ABS_PATH, "features", "steps", "fixtures"  # default value: `features/steps/fixtures`
)

XML = False
IF_MATCH = True
BANDWIDTH_SAVER = False
DATE_FORMAT = "%Y-%m-%dT%H:%M:%S+0000"
PAGINATION_LIMIT = 200

LOG_CONFIG_FILE = env("LOG_CONFIG_FILE")

APPLICATION_NAME = env("APP_NAME", "Superdesk")
server_url = urlparse(env("SUPERDESK_URL", "http://localhost:5000/api"))
CLIENT_URL = env("SUPERDESK_CLIENT_URL", "http://localhost:9000")
URL_PROTOCOL = server_url.scheme or None
SERVER_NAME = server_url.netloc or None
URL_PREFIX = server_url.path.lstrip("/") or ""
if SERVER_NAME.endswith(":80"):
    SERVER_NAME = SERVER_NAME[:-3]

VALIDATION_ERROR_STATUS = 400
JSON_SORT_KEYS = True

CACHE_CONTROL = "max-age=0, no-cache"
Exemplo n.º 9
0
    CONTENTAPI_MONGO_URI, CONTENTAPI_ELASTICSEARCH_URL,
    CONTENTAPI_ELASTICSEARCH_INDEX, AMAZON_ACCESS_KEY_ID,
    AMAZON_SECRET_ACCESS_KEY, AMAZON_REGION, AMAZON_CONTAINER_NAME,
    AMAZON_S3_SUBFOLDER, AMAZON_OBJECT_ACL,
)

CONTENTAPI_INSTALLED_APPS = [
    'content_api.items',
    'content_api.packages',
    'content_api.assets',
    'content_api.tokens',
    'content_api.items_versions',
    'content_api.packages_versions',
    'content_api.api_audit',
]

CONTENTAPI_DOMAIN = {}

# NOTE: no trailing slash for the CONTENTAPI_URL setting!
CONTENTAPI_URL = env('CONTENTAPI_URL', 'http://localhost:5400')
MEDIA_PREFIX = env('MEDIA_PREFIX', '%s/assets' % CONTENTAPI_URL.rstrip('/'))
server_url = urlparse(CONTENTAPI_URL)
URL_PREFIX = env('CONTENTAPI_URL_PREFIX', server_url.path.strip('/')) or ''
VERSION = '_current_version'

XML = False
PUBLIC_RESOURCES = []
DATE_FORMAT = '%Y-%m-%dT%H:%M:%S+0000'
ELASTIC_DATE_FORMAT = '%Y-%m-%d'
BCRYPT_GENSALT_WORK_FACTOR = 12
Exemplo n.º 10
0
from pathlib import Path

from superdesk.default_settings import env, strtobool  # noqa
from newsroom.web.default_settings import CORE_APPS, BLUEPRINTS

ABS_PATH = Path(__file__).resolve().parent

# extend apps
CORE_APPS.extend([])
BLUEPRINTS.extend([])

# logging
LOG_CONFIG_FILE = env('LOG_CONFIG_FILE', ABS_PATH / 'logging_config.yml')
Exemplo n.º 11
0
            "height": 1400
        },
    },
    "avatar": {
        "thumbnail": {
            "width": 60,
            "height": 60
        },
        "viewImage": {
            "width": 200,
            "height": 200
        },
    },
}

WS_HOST = env("WSHOST", "0.0.0.0")
WS_PORT = env("WSPORT", "5100")

LOG_CONFIG_FILE = env("LOG_CONFIG_FILE", "logging_config.yml")

REDIS_URL = env("REDIS_URL", "redis://localhost:6379")
if env("REDIS_PORT"):
    REDIS_URL = env("REDIS_PORT").replace("tcp:", "redis:")
BROKER_URL = env("CELERY_BROKER_URL", REDIS_URL)

SECRET_KEY = env("SECRET_KEY", "")

# Highcharts Export Server - default settings
ANALYTICS_ENABLE_SCHEDULED_REPORTS = strtobool(
    env('ANALYTICS_ENABLE_SCHEDULED_REPORTS', 'true'))
Exemplo n.º 12
0
A module containing configuration of the Superdesk's production API.

The meaning of configuration options is described in the Eve framework
`documentation <http://python-eve.org/config.html#global-configuration>`_.
"""

from superdesk.default_settings import env, urlparse

from superdesk.default_settings import (  # noqa
    DEBUG, SUPERDESK_TESTING, MONGO_URI, ELASTICSEARCH_INDEX,
    ELASTICSEARCH_URL, AMAZON_ACCESS_KEY_ID, AMAZON_SECRET_ACCESS_KEY,
    AMAZON_REGION, AMAZON_CONTAINER_NAME, AMAZON_S3_SUBFOLDER,
    AMAZON_OBJECT_ACL,
)

SECRET_KEY = env('PRODAPI_SECRET_KEY', '')

PRODAPI_INSTALLED_APPS = (
    'prod_api.items',
    'prod_api.assets',
    'prod_api.desks',
    'prod_api.planning',
    'prod_api.contacts',
    'prod_api.users',
)

# NOTE: no trailing slash for the PRODAPI_URL setting!
PRODAPI_URL = env('PRODAPI_URL', 'http://localhost:5500')
URL_PREFIX = env('PRODAPI_URL_PREFIX', 'prodapi')
API_VERSION = 'v1'
MEDIA_PREFIX = env(
Exemplo n.º 13
0
        'queue': celery_queue('newsroom'),
        'routing_key': 'newsroom.task',
    }
}

#: celery beat config
CELERY_BEAT_SCHEDULE = {
    'newsroom:company_expiry': {
        'task': 'newsroom.company_expiry_alerts.company_expiry',
        'schedule': crontab(hour=local_to_utc_hour(0),
                            minute=0),  # Runs every day at midnight
    },
    'newsroom:monitoring_schedule_alerts': {
        'task': 'newsroom.monitoring.email_alerts.monitoring_schedule_alerts',
        'schedule': timedelta(seconds=60),
    },
    'newsroom:monitoring_immediate_alerts': {
        'task': 'newsroom.monitoring.email_alerts.monitoring_immediate_alerts',
        'schedule': timedelta(seconds=60),
    }
}

MAX_EXPIRY_QUERY_LIMIT = os.environ.get('MAX_EXPIRY_QUERY_LIMIT', 100)
CONTENT_API_EXPIRY_DAYS = os.environ.get('CONTENT_API_EXPIRY_DAYS', 180)

NEWS_API_ENABLED = strtobool(env('NEWS_API_ENABLED', 'false'))

# Enables the application of product filtering to image references in the API and ATOM responses
NEWS_API_IMAGE_PERMISSIONS_ENABLED = strtobool(
    env('NEWS_API_IMAGE_PERMISSIONS_ENABLED', 'false'))
Exemplo n.º 14
0
The meaning of configuration options is described in the Eve framework
`documentation <http://python-eve.org/config.html#global-configuration>`_.
"""

from superdesk.default_settings import env, urlparse

from superdesk.default_settings import SECRET_KEY, MONGO_DBNAME, MONGO_URI  # noqa
from superdesk.default_settings import AMAZON_CONTAINER_NAME, AMAZON_ACCESS_KEY_ID  # noqa
from superdesk.default_settings import AMAZON_SECRET_ACCESS_KEY, AMAZON_REGION  # noqa
from superdesk.default_settings import AMAZON_SERVE_DIRECT_LINKS, AMAZON_S3_USE_HTTPS  # noqa
from superdesk.default_settings import AMAZON_SERVER, AMAZON_PROXY_SERVER, AMAZON_URL_GENERATOR  # noqa


CONTENTAPI_MONGO_DBNAME = "contentapi"
CONTENTAPI_MONGO_URI = env("CONTENTAPI_MONGO_URI", "mongodb://localhost/%s" % CONTENTAPI_MONGO_DBNAME)

CONTENTAPI_ELASTICSEARCH_URL = env("CONTENTAPI_ELASTICSEARCH_URL", "http://localhost:9200")
CONTENTAPI_ELASTICSEARCH_INDEX = env("CONTENTAPI_ELASTICSEARCH_INDEX", CONTENTAPI_MONGO_DBNAME)

CONTENTAPI_INSTALLED_APPS = ["content_api.items", "content_api.packages", "content_api.assets"]

CONTENTAPI_DOMAIN = {}

# NOTE: no trailing slash for the CONTENTAPI_URL setting!
CONTENTAPI_URL = env("CONTENTAPI_URL", "http://localhost:5400")
server_url = urlparse(CONTENTAPI_URL)
URL_PREFIX = server_url.path.strip("/")

XML = False
PUBLIC_RESOURCES = []
Exemplo n.º 15
0
    CONTENTAPI_ELASTICSEARCH_INDEX, AMAZON_ACCESS_KEY_ID,
    AMAZON_SECRET_ACCESS_KEY, AMAZON_REGION, AMAZON_CONTAINER_NAME,
    AMAZON_S3_SUBFOLDER, AMAZON_OBJECT_ACL, AMAZON_ENDPOINT_URL,
    PAGINATION_LIMIT, APM_SERVER_URL, APM_SECRET_TOKEN, DEBUG,
)

CONTENTAPI_INSTALLED_APPS = [
    "content_api.items",
    "content_api.packages",
    "content_api.assets",
    "content_api.tokens",
    "content_api.items_versions",
    "content_api.packages_versions",
    "content_api.api_audit",
]

CONTENTAPI_DOMAIN = {}

# NOTE: no trailing slash for the CONTENTAPI_URL setting!
CONTENTAPI_URL = env("CONTENTAPI_URL", "http://localhost:5400")
MEDIA_PREFIX = env("MEDIA_PREFIX", "%s/assets" % CONTENTAPI_URL.rstrip("/"))
server_url = urlparse(CONTENTAPI_URL)
URL_PREFIX = env("CONTENTAPI_URL_PREFIX", server_url.path.strip("/")) or ""
VERSION = "_current_version"
XML = False

PUBLIC_RESOURCES = []
DATE_FORMAT = "%Y-%m-%dT%H:%M:%S+0000"
ELASTIC_DATE_FORMAT = "%Y-%m-%d"
BCRYPT_GENSALT_WORK_FACTOR = 12
Exemplo n.º 16
0
                            routing_key='newsroom.#'), )

CELERY_TASK_ROUTES = {
    'newsroom.*': {
        'queue': celery_queue('newsroom'),
        'routing_key': 'newsroom.task',
    }
}

#: celery beat config
CELERY_BEAT_SCHEDULE = {
    'newsroom:company_expiry': {
        'task': 'newsroom.company_expiry_alerts.company_expiry',
        'schedule': crontab(hour=local_to_utc_hour(0),
                            minute=0),  # Runs every day at midnight
    },
    'newsroom:monitoring_schedule_alerts': {
        'task': 'newsroom.monitoring.email_alerts.monitoring_schedule_alerts',
        'schedule': timedelta(seconds=60),
    },
    'newsroom:monitoring_immediate_alerts': {
        'task': 'newsroom.monitoring.email_alerts.monitoring_immediate_alerts',
        'schedule': timedelta(seconds=60),
    }
}

MAX_EXPIRY_QUERY_LIMIT = os.environ.get('MAX_EXPIRY_QUERY_LIMIT', 100)
CONTENT_API_EXPIRY_DAYS = os.environ.get('CONTENT_API_EXPIRY_DAYS', 180)

NEWS_API_ENABLED = strtobool(env('NEWS_API_ENABLED', 'false'))
Exemplo n.º 17
0
            'height': 1400
        },
    },
    'avatar': {
        'thumbnail': {
            'width': 60,
            'height': 60
        },
        'viewImage': {
            'width': 200,
            'height': 200
        },
    }
}

WS_HOST = env('WSHOST', '0.0.0.0')
WS_PORT = env('WSPORT', '5100')

LOG_CONFIG_FILE = env('LOG_CONFIG_FILE', 'logging_config.yml')

REDIS_URL = env('REDIS_URL', 'redis://localhost:6379')
if env('REDIS_PORT'):
    REDIS_URL = env('REDIS_PORT').replace('tcp:', 'redis:')
BROKER_URL = env('CELERY_BROKER_URL', REDIS_URL)

SECRET_KEY = env('SECRET_KEY', os.urandom(32))

# Highcharts Export Server - default settings
ANALYTICS_ENABLE_SCHEDULED_REPORTS = strtobool(
    env('ANALYTICS_ENABLE_SCHEDULED_REPORTS', 'true'))
HIGHCHARTS_SERVER_HOST = env('HIGHCHARTS_SERVER_HOST', 'localhost')
Exemplo n.º 18
0
    CONTENTAPI_ELASTICSEARCH_URL, CONTENTAPI_ELASTICSEARCH_INDEX,
    AMAZON_CONTAINER_NAME, AMAZON_ACCESS_KEY_ID,
    AMAZON_SECRET_ACCESS_KEY, AMAZON_REGION,
    AMAZON_SERVE_DIRECT_LINKS, AMAZON_S3_USE_HTTPS,
    AMAZON_SERVER, AMAZON_PROXY_SERVER, AMAZON_URL_GENERATOR,
)

CONTENTAPI_INSTALLED_APPS = [
    'content_api.items',
    'content_api.packages',
    'content_api.assets',
    'content_api.tokens',
    'content_api.items_versions',
    'content_api.packages_versions',
    'content_api.api_audit',
]

CONTENTAPI_DOMAIN = {}

# NOTE: no trailing slash for the CONTENTAPI_URL setting!
CONTENTAPI_URL = env('CONTENTAPI_URL', 'http://localhost:5400')
server_url = urlparse(CONTENTAPI_URL)
URL_PREFIX = server_url.path.strip('/')
VERSION = '_current_version'

XML = False
PUBLIC_RESOURCES = []
DATE_FORMAT = '%Y-%m-%dT%H:%M:%S+0000'
ELASTIC_DATE_FORMAT = '%Y-%m-%d'
BCRYPT_GENSALT_WORK_FACTOR = 12
Exemplo n.º 19
0
    'newsroom.news_api.products',
    'newsroom.news_api.formatters',
    'newsroom.news_api.news',
    'newsroom.news_api.news.item.item',
    'newsroom.news_api.news.search',
    'newsroom.news_api.news.feed',
    'newsroom.products',
    'newsroom.news_api.api_audit',
    'newsroom.news_api.news.assets.assets',
    'newsroom.upload',
]

INSTALLED_APPS = []

#: mongo db name, only used when mongo_uri is not set
MONGO_DBNAME = env('MONGO_DBNAME', 'newsroom')

#: full mongodb connection uri, overrides ``MONGO_DBNAME`` if set
MONGO_URI = env('MONGO_URI', 'mongodb://localhost/%s' % MONGO_DBNAME)

CONTENTAPI_MONGO_DBNAME = 'newsroom'
CONTENTAPI_MONGO_URI = env('CONTENTAPI_MONGO_URI',
                           'mongodb://localhost/%s' % CONTENTAPI_MONGO_DBNAME)

#: elastic url
ELASTICSEARCH_URL = env('ELASTICSEARCH_URL', 'http://localhost:9200')
CONTENTAPI_ELASTICSEARCH_URL = env('CONTENTAPI_ELASTICSEARCH_URL',
                                   ELASTICSEARCH_URL)

#: elastic index name
ELASTICSEARCH_INDEX = env('ELASTICSEARCH_INDEX', 'superdesk')
Exemplo n.º 20
0
    SECRET_KEY, MONGO_DBNAME, MONGO_URI,
    CONTENTAPI_MONGO_DBNAME, CONTENTAPI_MONGO_URI,
    CONTENTAPI_ELASTICSEARCH_URL, CONTENTAPI_ELASTICSEARCH_INDEX,
    AMAZON_ACCESS_KEY_ID, AMAZON_SECRET_ACCESS_KEY, AMAZON_REGION,
    AMAZON_CONTAINER_NAME, AMAZON_S3_SUBFOLDER, AMAZON_OBJECT_ACL,
)

CONTENTAPI_INSTALLED_APPS = [
    'content_api.items',
    'content_api.packages',
    'content_api.assets',
    'content_api.tokens',
    'content_api.items_versions',
    'content_api.packages_versions',
    'content_api.api_audit',
]

CONTENTAPI_DOMAIN = {}

# NOTE: no trailing slash for the CONTENTAPI_URL setting!
CONTENTAPI_URL = env('CONTENTAPI_URL', 'http://localhost:5400')
server_url = urlparse(CONTENTAPI_URL)
URL_PREFIX = server_url.path.strip('/')
VERSION = '_current_version'

XML = False
PUBLIC_RESOURCES = []
DATE_FORMAT = '%Y-%m-%dT%H:%M:%S+0000'
ELASTIC_DATE_FORMAT = '%Y-%m-%d'
BCRYPT_GENSALT_WORK_FACTOR = 12
Exemplo n.º 21
0
            "height": 1400
        },
    },
    "avatar": {
        "thumbnail": {
            "width": 60,
            "height": 60
        },
        "viewImage": {
            "width": 200,
            "height": 200
        },
    },
}

WS_HOST = env("WSHOST", "0.0.0.0")
WS_PORT = env("WSPORT", "5100")

LOG_CONFIG_FILE = env("LOG_CONFIG_FILE", "logging_config.yml")

REDIS_URL = env("REDIS_URL", "redis://localhost:6379")
if env("REDIS_PORT"):
    REDIS_URL = env("REDIS_PORT").replace("tcp:", "redis:")
BROKER_URL = env("CELERY_BROKER_URL", REDIS_URL)

SECRET_KEY = env("SECRET_KEY", os.urandom(32))

# Highcharts Export Server - default settings
ANALYTICS_ENABLE_SCHEDULED_REPORTS = strtobool(
    env("ANALYTICS_ENABLE_SCHEDULED_REPORTS", "true"))
HIGHCHARTS_SERVER_HOST = env("HIGHCHARTS_SERVER_HOST", "localhost")
Exemplo n.º 22
0
#!/usr/bin/env python
# -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014, 2015 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license

from pathlib import Path
from superdesk.default_settings import INSTALLED_APPS, env

ABS_PATH = str(Path(__file__).resolve().parent)

init_data = Path(ABS_PATH) / 'data'
if init_data.exists():
    INIT_DATA_PATH = init_data

INSTALLED_APPS.extend([
    'analytics',
    'apps.languages',
    'planning',
    'belga.image',
])

SECRET_KEY = env('SECRET_KEY', '')
Exemplo n.º 23
0
            'height': 1400
        },
    },
    'avatar': {
        'thumbnail': {
            'width': 60,
            'height': 60
        },
        'viewImage': {
            'width': 200,
            'height': 200
        },
    }
}

MACROS_MODULE = env('MACROS_MODULE', 'ntb.macros')

WS_HOST = env('WSHOST', '0.0.0.0')
WS_PORT = env('WSPORT', '5100')

# Determines if the ODBC publishing mechanism will be used, If enabled then pyodbc must be installed along with it's
# dependencies
ODBC_PUBLISH = env('ODBC_PUBLISH', None)
# ODBC test server connection string
ODBC_TEST_CONNECTION_STRING = env(
    'ODBC_TEST_CONNECTION_STRING',
    'DRIVER=FreeTDS;DSN=NEWSDB;UID=???;PWD=???;DATABASE=News')

DEFAULT_SOURCE_VALUE_FOR_MANUAL_ARTICLES = 'NTB'
DEFAULT_URGENCY_VALUE_FOR_MANUAL_ARTICLES = 3
DEFAULT_GENRE_VALUE_FOR_MANUAL_ARTICLES = []
Exemplo n.º 24
0
"""
A module containing configuration of the Superdesk's production API.

The meaning of configuration options is described in the Eve framework
`documentation <http://python-eve.org/config.html#global-configuration>`_.
"""

from superdesk.default_settings import env, urlparse

from superdesk.default_settings import (  # noqa
    DEBUG, SUPERDESK_TESTING, MONGO_URI, ELASTICSEARCH_INDEX,
    ELASTICSEARCH_URL, AMAZON_ACCESS_KEY_ID, AMAZON_SECRET_ACCESS_KEY,
    AMAZON_REGION, AMAZON_CONTAINER_NAME, AMAZON_S3_SUBFOLDER,
    AMAZON_OBJECT_ACL, AMAZON_ENDPOINT_URL, strtobool)

SECRET_KEY = env('PRODAPI_SECRET_KEY', '')

PRODAPI_INSTALLED_APPS = (
    'prod_api.items',
    'prod_api.assets',
    'prod_api.desks',
    'prod_api.planning',
    'prod_api.contacts',
    'prod_api.users',
)

# NOTE: no trailing slash for the PRODAPI_URL setting!
PRODAPI_URL = env('PRODAPI_URL', 'http://localhost:5500')
URL_PREFIX = env('PRODAPI_URL_PREFIX', 'prodapi')
API_VERSION = 'v1'
MEDIA_PREFIX = env(