blob: a164977d644780414b29500b28a17fc84c1fc86a [file] [log] [blame]
Michal Kobuse7589f72020-09-11 14:29:37 +02001import os
2
Michal Kobus2e85ef82021-06-24 18:01:43 +02003from ..helpers import is_true
4
5
Michal Kobus819cf022018-11-29 16:39:22 +01006VERSION = 'development'
7
Mateusz Matuszkowiak2820c662018-11-21 12:07:25 +01008LOGGING = {
9 'version': 1,
10 'formatters': {'default': {
11 'format': '[%(asctime)s] %(levelname)s in %(module)s: %(message)s',
12 }},
13 'handlers': {'wsgi': {
14 'class': 'logging.StreamHandler',
15 'stream': 'ext://flask.logging.wsgi_errors_stream',
16 'formatter': 'default'
17 }},
18 'loggers': {
Ksawery Dziekoński3861b932021-05-27 14:01:44 +020019 logger: {
20 'level': os.getenv('LOGGER_LEVEL', 'INFO').upper(),
Mateusz Matuszkowiak2820c662018-11-21 12:07:25 +010021 'handlers': ['wsgi']
Ksawery Dziekoński3861b932021-05-27 14:01:44 +020022 } for logger in ['sf_notifier.server', 'sf_notifier.salesforce.client']
Mateusz Matuszkowiak2820c662018-11-21 12:07:25 +010023 }
24}
25
26SIMPLE_SETTINGS = {
27 'OVERRIDE_BY_ENV': True,
28 'CONFIGURE_LOGGING': True,
29}
30
Michal Kobus2e85ef82021-06-24 18:01:43 +020031ADD_LINKS = is_true(os.environ.get('SF_NOTIFIER_ADD_LINKS'))
Michal Kobuse7589f72020-09-11 14:29:37 +020032
Michal Kobus2e85ef82021-06-24 18:01:43 +020033SF_CONFIG = {
34 # Salesforce login params
35 'AUTH_URL': os.environ.get('SFDC_AUTH_URL', 'null'),
36 'USERNAME': os.environ.get('SFDC_USERNAME', 'null'),
37 'PASSWORD': os.environ.get('SFDC_PASSWORD', 'null'),
38 'ORGANIZATION_ID': os.environ.get('SFDC_ORGANIZATION_ID', 'null'),
39 'ENVIRONMENT_ID': os.environ.get('SFDC_ENVIRONMENT_ID', 'null'),
40 'SANDBOX_ENABLED': is_true(os.environ.get(
41 'SFDC_SANDBOX_ENABLED', 'False')),
42 # sf-notifier specific params
43 'FEED_ENABLED': is_true(os.environ.get(
44 'SF_NOTIFIER_FEED_ENABLED', 'True')),
45 'HASH_FUNC': os.environ.get(
46 'SF_NOTIFIER_ALERT_ID_HASH_FUNC', 'sha256'),
47}