Michal Kobus | e7589f7 | 2020-09-11 14:29:37 +0200 | [diff] [blame] | 1 | import os |
| 2 | |
Michal Kobus | 2e85ef8 | 2021-06-24 18:01:43 +0200 | [diff] [blame^] | 3 | from ..helpers import is_true |
| 4 | |
| 5 | |
Michal Kobus | 819cf02 | 2018-11-29 16:39:22 +0100 | [diff] [blame] | 6 | VERSION = 'development' |
| 7 | |
Mateusz Matuszkowiak | 2820c66 | 2018-11-21 12:07:25 +0100 | [diff] [blame] | 8 | LOGGING = { |
| 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ński | 3861b93 | 2021-05-27 14:01:44 +0200 | [diff] [blame] | 19 | logger: { |
| 20 | 'level': os.getenv('LOGGER_LEVEL', 'INFO').upper(), |
Mateusz Matuszkowiak | 2820c66 | 2018-11-21 12:07:25 +0100 | [diff] [blame] | 21 | 'handlers': ['wsgi'] |
Ksawery Dziekoński | 3861b93 | 2021-05-27 14:01:44 +0200 | [diff] [blame] | 22 | } for logger in ['sf_notifier.server', 'sf_notifier.salesforce.client'] |
Mateusz Matuszkowiak | 2820c66 | 2018-11-21 12:07:25 +0100 | [diff] [blame] | 23 | } |
| 24 | } |
| 25 | |
| 26 | SIMPLE_SETTINGS = { |
| 27 | 'OVERRIDE_BY_ENV': True, |
| 28 | 'CONFIGURE_LOGGING': True, |
| 29 | } |
| 30 | |
Michal Kobus | 2e85ef8 | 2021-06-24 18:01:43 +0200 | [diff] [blame^] | 31 | ADD_LINKS = is_true(os.environ.get('SF_NOTIFIER_ADD_LINKS')) |
Michal Kobus | e7589f7 | 2020-09-11 14:29:37 +0200 | [diff] [blame] | 32 | |
Michal Kobus | 2e85ef8 | 2021-06-24 18:01:43 +0200 | [diff] [blame^] | 33 | SF_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 | } |