File: //proc/1233/root/home/arjun/projects/buyercall/config/settings.py
# -*- coding: utf-8 -*-
from os import path
from datetime import timedelta, datetime
from celery.schedules import crontab
# This value is used for the following properties,
# it really should be your module's name.
# Database name
# Cache redis prefix
APP_NAME = 'buyercall'
APP_ROOT = path.join(path.dirname(path.abspath(__file__)), '..')
ANALYTICS_GOOGLE_UA = 'ANALYTICSGOOGLEUA'
ADMIN_EMAIL = 'admin@buyercall.com'
# Directory to store the uploaded files in
UPLOAD_FOLDER = path.join(APP_ROOT, 'upload')
# App settings, most settings you see here will change in production.
SECRET_KEY = 'MY_SECRETKEYHERE'
DEBUG = 'DEBUGENABLED'
TESTING = False
IS_PRODUCTION = 'ISPRODUCTION'
DEBUG_TB_INTERCEPT_REDIRECTS = 'DEBUGTBINTERCEPTREDIRECTSHERE'
DEBUG_TB_ENABLED = 'DEBUGTBENABLEDHERE'
LOG_LEVEL = 'DEBUG'
PREFERRED_URL_SCHEME = 'https'
MOBILE_APP_TEST_MODE = 'MOBILEAPPTESTMODEHERE'
SERVER_DOMAIN = 'SERVERDOMAINHERE'
# You will need to disable this to get Stripe's webhooks to work because you'll
# likely end up using tunneling tooling such as ngrok so the endpoints are
# reachable outside your private network.
#
# The problem with this is, Flask won't allow any connections to the ngrok
# url with the SERVER_NAME set to localhost:8000. However, if you comment out
# the SERVER_NAME below then webhooks will work but now url_for will not work
# inside of email templates.
#
# A better solution will turn up in the future.
# SERVER_NAME = 'localhost:8000'
# Public build path. Files in this path will be accessible to the internet.
PUBLIC_BUILD_PATH = path.join(APP_ROOT, 'build', 'public')
# Flask-Webpack (assets) settings.
WEBPACK_MANIFEST_PATH = path.join(APP_ROOT, 'build', 'manifest.json')
# Babel i18n translations.
ACCEPT_LANGUAGES = ['en', 'es']
LANGUAGES = {
'en': 'English',
'es': u'EspaƱol'
}
TIMEZONES = {
'US/Eastern': 'US/Eastern',
'US/Central': 'US/Central',
'US/Mountain': 'US/Mountain',
'US/Pacific': 'US/Pacific'
}
BABEL_DEFAULT_LOCALE = 'en'
# Seed settings.
SEED_ADMIN_EMAIL = 'dev@localhost.com'
SEED_PARTNER_EMAIL = 'partner@localhost.com'
# Database settings,
# The username and password must match what's in docker-compose.yml for dev.
db_uri = 'DB_URI'
SQLALCHEMY_DATABASE_URI = db_uri.format(APP_NAME)
SQLALCHEMY_POOL_SIZE = 'SQLALCHEMYPOOLSIZE'
# Cache settings.
CACHE_TYPE = 'redis'
CACHE_REDIS_URL = 'CACHEREDISURL'
CACHE_KEY_PREFIX = APP_NAME
# Redis settings.
REDIS_CONFIG_URL = 'REDISCONFIGURL'
REDIS_CONFIG_PORT = 'REDISCONFIGPORT'
# Celery settings.
CELERY_BROKER_URL = 'CELERYBROKERURL'
CELERY_RESULT_BACKEND = 'CELERYRESULTBACKEND'
CELERY_REDIS_MAX_CONNECTIONS = 'CELERYREDISMAXCONNECTIONS'
CELERYD_MAX_TASKS_PER_CHILD = 1
CELERYD_TASK_SOFT_TIME_LIMIT = 'CELERYDTASKSOFTTIMELIMIT'
CELERY_ACCEPT_CONTENT = ['json']
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
# Enable timezone to be used for celery cron jobs below
TIME_ZONE = 'UTC'
USE_TZ = True
CELERY_ENABLE_UTC = True
CELERY_TIMEZONE = 'US/Eastern'
# Celery recurring scheduled tasks.
CELERYBEAT_SCHEDULE = {
'mark-soon-to-expire-credit-cards': {
'task': 'buyercall.blueprints.billing.tasks.mark_old_credit_cards',
'schedule': crontab(hour=12, minute=1)
},
'mark-invalid-coupons': {
'task': 'buyercall.blueprints.billing.tasks.expire_old_coupons',
'schedule': crontab(hour=12, minute=2)
},
'reset-monthly-usage': {
'task': 'buyercall.blueprints.billing.tasks.reset_monthly_usage',
'schedule': crontab(day_of_month='1', hour=0, minute=0)
},
'call_me_back': {
'task': 'buyercall.blueprints.phonenumbers.tasks.call_me_back',
'schedule': crontab(minute='*/1')
},
'send_daily_report_email': {
'task': 'buyercall.blueprints.reports.tasks.send_daily_report_email',
'schedule': crontab(minute=0, hour=0)
},
'delete_old_activity_logs': {
'task': 'buyercall.blueprints.activity.tasks.delete_old_activity_logs',
'schedule': crontab(minute=0, hour=2)
},
'partnership_account_lead_count': {
'task': 'buyercall.blueprints.partnership.tasks.daily_partnership_account_counts',
'schedule': crontab(minute=30, hour=2)
},
'retention_policy': {
'task': 'buyercall.blueprints.contacts.contact_tasks.contacts_retention_policy',
'schedule': crontab(minute=30, hour=1)
},
'reporting_data_sync': {
'task': 'buyercall.blueprints.reports.tasks.update_reporting_tables',
'schedule': crontab(minute=0, hour=1)
<<<<<<< HEAD
=======
},
'send_password_expiry_email': {
'task': 'buyercall.blueprints.user.tasks.send_password_expiry_email',
'schedule': crontab(minute=0, hour=3),
},
'delete_request_log': {
'task': 'buyercall.blueprints.sysadmin.tasks.delete_request_log',
'schedule': crontab(minute=30, hour=3, day_of_week='sun')
>>>>>>> 2d4ba41568adf348959bbf7b64ffa061df87d07b
}
}
PERMANENT_SESSION_LIFETIME = 'FLASKSESSIONLIFETIME'
# Login settings.
REMEMBER_COOKIE_DURATION = timedelta(days=90)
# Mail settings.
MAIL_DEFAULT_SENDER = 'MAILDEFAULTSENDERHERE'
MAIL_SERVER = 'smtp.mailgun.org'
MAIL_PORT = 587
MAIL_USE_TLS = True
MAIL_USE_SSL = False
MAIL_USERNAME = 'MAILUSERNAMEHERE'
MAIL_PASSWORD = 'MAILPASSWORDHERE'
# External end points.
ENDPOINT_CADVISOR = 'http://localhost:8080/containers/'
ENDPOINT_FLOWER = 'http://localhost:8081'
# Stripe settings.
#
# API keys, NOTE: you should NOT supply them in this config, put them
# in an instance config file, such as: instance/settings.py
#
# They are only listed below to act as documentation.
STRIPE_SECRET_KEY = 'STRIPESECRETKEY'
STRIPE_PUBLISHABLE_KEY = 'STRIPEPUBLISHABLEKEY'
# The Stripe API version to use. More information can be found on their docs:
# https://stripe.com/docs/api/python#versioning
STRIPE_API_VERSION = '2015-01-26'
# Documentation for each plan field below can be found on Stripe's API docs:
# https://stripe.com/docs/api#create_plan
#
# After supplying both API keys and plans, you must sync the plans by running:
# run stripe sync_plans
#
# If you are using TEST keys then the plans will be set to livemode: False
# If you are using REAL keys then the plans be set to livemode: True
#
# What the above means is, when you ship your app in production you must sync
# your plans at least once to activate them on your real keys.
STRIPE_PLANS = {
'0': {
'id': 'invoice',
'name': 'Invoice',
'amount': 0,
'currency': 'usd',
'interval': 'month',
'interval_count': 1,
'trial_period_days': 1,
'statement_descriptor': 'INVOICE MONTHLY',
'metadata': {
'minutes': 500000,
'agents': 1000,
'phonenumbers': 250,
'priority_number': 100,
}
},
'1': {
'id': 'prioritynumber',
'name': 'Single Finance Form',
'amount': 4500,
'currency': 'usd',
'interval': 'month',
'interval_count': 1,
'trial_period_days': 1,
'statement_descriptor': 'FINANCE FORM',
'metadata': {
'minutes': 2500,
'agents': 1000,
'phonenumbers': 5,
'priority_number': 3,
}
},
'2': {
'id': 'starterpackage',
'name': 'Starter Package',
'amount': 19900,
'currency': 'usd',
'interval': 'month',
'interval_count': 1,
'trial_period_days': 0,
'statement_descriptor': 'STARTER PACKAGE',
'metadata': {
'minutes': 1000,
'agents': 1000,
'phonenumbers': 5,
'priority_number': 2,
}
},
'3': {
'id': 'starterpluspackage',
'name': 'Starter Plus Package',
'amount': 29900,
'currency': 'usd',
'interval': 'month',
'interval_count': 1,
'trial_period_days': 0,
'statement_descriptor': 'STARTER PLUS PACKAGE',
'metadata': {
'minutes': 2000,
'agents': 1000,
'phonenumbers': 10,
'priority_number': 4,
}
},
'4': {
'id': 'masterpackage',
'name': 'Master Package',
'amount': 49900,
'currency': 'usd',
'interval': 'month',
'interval_count': 1,
'trial_period_days': 0,
'statement_descriptor': 'MASTER PACKAGE',
'metadata': {
'minutes': 4000,
'agents': 1000,
'phonenumbers': 20,
'priority_number': 8,
}
},
'5': {
'id': 'masterpluspackage',
'name': 'Master Plus Package',
'amount': 69900,
'currency': 'usd',
'interval': 'month',
'interval_count': 1,
'trial_period_days': 0,
'statement_descriptor': 'MASTER PLUS PACKAGE',
'metadata': {
'minutes': 6000,
'agents': 3000,
'phonenumbers': 30,
'priority_number': 12,
}
},
'6': {
'id': 'grandmasterpackage',
'name': 'Grand Master Package',
'amount': 109900,
'currency': 'usd',
'interval': 'month',
'interval_count': 1,
'trial_period_days': 0,
'statement_descriptor': 'GRAND MASTER PACKAGE',
'metadata': {
'minutes': 10000,
'agents': 5000,
'phonenumbers': 50,
'priority_number': 20,
}
},
'7': {
'id': 'smallbusinesspackage',
'name': 'Small Business Package',
'amount': 24900,
'currency': 'usd',
'interval': 'month',
'interval_count': 1,
'trial_period_days': 0,
'statement_descriptor': 'SMALL BUSINESS PACKAGE',
'metadata': {
'minutes': 1000,
'agents': 100,
'phonenumbers': 5,
'priority_number': 2,
}
},
'8': {
'id': 'partnershipsingle',
'name': 'Partnership Single',
'amount': 0,
'currency': 'usd',
'interval': 'month',
'interval_count': 1,
'trial_period_days': 1,
'statement_descriptor': 'PTNR SINGLE MONTHLY',
'metadata': {
'minutes': 1000,
'agents': 10,
'phonenumbers': 1,
'priority_number': 1,
}
},
}
# Twitter settings.
#
# API keys, NOTE: you should NOT supply them in this config, put them
# in an instance config file, such as: instance/settings.py
#
# Broadcast (websocket server) settings.
#
# NOTE: you should NOT supply the PUSH_TOKEN/BROADCAST_INTERNAL_URL here,
# put them in an instance config file, such as: instance/settings.py
BROADCAST_PUBLIC_URL = 'http://localhost:4242/stream'
BROADCAST_INTERNAL_URL = 'BROADCASTINTERNALURL'
BROADCAST_PUSH_TOKEN = 'BROADCASTPUSHTOKEN'
# Twilio settings
TWILIO_ACCOUNT_SID = 'TWILIOACCOUNTSIDHERE'
TWILIO_AUTH_TOKEN = 'TWILIOAUTHTOKENHERE'
TWILIO_CALLER_ID = 'TWILIOCALLERIDHERE'
AMD_DIGIT_PROMPT_TIMEOUT = 5
BANDWIDTH_USER_ID = 'BANDWIDTHUSERIDHERE'
BANDWIDTH_API_TOKEN = 'BANDWIDTHAPITOKENHERE'
BANDWIDTH_API_SECRET = 'BANDWIDTHAPISECRETHERE'
BANDWIDTH_CALLER_ID = 'BANDWIDTHCALLERIDHERE'
BANDWIDTH_CALLER_ID_MOBILE = 'BANDWIDTHCALLERIDMOBILEHERE'
BANDWIDTH_ORDER_ID = 'BANDWIDTHORDERIDHERE'
BANDWIDTH_CALLBACK_USERNAME = 'BANDWIDTHCALLBACKUSERNAMEHERE'
BANDWIDTH_CALLBACK_PASSWORD = 'BANDWIDTHCALLBACKPASSWORDHERE'
SIP_BANDWIDTH_ACCOUNT_ID = 'BANDWIDTHSIPACCOUNTIDHERE'
SIP_BANDWIDTH_SITE_ID = 'BANDWIDTHSIPSITEIDHERE'
SIP_BANDWIDTH_LOCATION_ID = 'BANDWIDTHSIPLOCATIONIDHERE'
SIP_BANDWIDTH_VOICE_APPLICATION_ID = 'BANDWIDTHSIPVOICEAPPIDHERE'
SIP_BANDWIDTH_SMS_APPLICATION_ID = 'BANDWIDTHSIPSMSAPPIDHERE'
SIP_BANDWIDTH_CNAM_PASSWORD = 'BANDWIDTHSIPCNAMPWDHERE'
# Google Recaptcha Keys
RC_SITE_KEY = 'RC_SITEKEYHERE'
RC_SECRET_KEY = 'RC_SECRETKEYHERE'
# The beep sound played to the agent before an inbound call is connected
BEEP_SOUND = 'https://s3.amazonaws.com/buyercall-static-sounds/beep.mp3'
# Swagger and Rest API Plus settings
SWAGGER_UI_DOC_EXPANSION = 'list'
RESTX_VALIDATE = True
# RESTPLUS_MASK_SWAGGER = False
# RESTPLUS_ERROR_404_HELP = False
# AES Encryption Key
CRYPTO_SECRET_KEY = 'CRYPTOSECRETKEY_HERE'
SYM_CRYPTO_SECRET_KEY = 'SYMENCKEY_HERE'
SYM_CRYPTO_NONCE = 'SYMCRYPTONONCE_HERE'
AUTOPAY_SOURCE_KEY = 'AUTOPAYSOURCEKEY_HERE'
AUTOPAY_SECRET_KEY = 'AUTOPAYSECRETKEY_HERE'
AUTOPAY_APPSOURCE = 'AUTOPAYAPPSOURCE_HERE'
AUTOPAY_API_URL = 'https://api.autopay.com/v1/application/?source={}&key={}'
# AWS ACCESS
AMAZON_ACCESS_KEY = 'AMAZONACCESSKEY_HERE'
AMAZON_SECRET_KEY = 'AMAZONSECRETKEY_HERE'
AMAZON_PRESIGNED_URL_FRONTEND_EXPIRY = 'AWSPRESIGNEDURLEXPIREFRONTEND' # Must be in seconds - 900
AMAZON_PRESIGNED_URL_WEBHOOK_EXPIRY = 'AWSPRESIGNEDURLEXPIREWEBHOOK' # Must be in seconds - 300
<<<<<<< HEAD
AMAZON_PRESIGNED_URL_CUSTOM_EXPIRY = 'AMAZONPRESIGNEDURLCUSTOMEXPIRY' # Must be in seconds - 604800
=======
SES_REGION_NAME = 'AMAZONREGIONNAME_HERE'
SES_EMAIL_SOURCE = 'AMAZONSESEMAILSOURCE_HERE'
>>>>>>> 2d4ba41568adf348959bbf7b64ffa061df87d07b
# List of AWS buckets to use for upload
PARTNERSHIP_BUCKET = 'PARTNERSHIPBUCKETHERE'
RECORDING_BUCKET = 'RECORDINGBUCKETHERE'
HOLD_MUSIC_BUCKET = 'HOLDMUSICBUCKETHERE'
WHISPER_BUCKET = 'WHISPERBUCKETHERE'
MMS_BUCKET = 'MMSBUCKETHERE'
QR_BUCKET = 'QRBUCKETHERE'
WIDGET_BUCKET = 'WIDGETBUCKETHERE'
<<<<<<< HEAD
USER_AVATAR_BUCKET = 'USERAVATARBUCKETHERE'
# ElasticSearch
ELASTIC_SEARCH_URL = 'ELASTICSEARCHURLHERE'
ELASTIC_SEARCH_USERNAME = 'ELASTICSEARCHUSERNAMEHERE'
ELASTIC_SEARCH_PASSWORD = 'ELASTICSEARCHPASSWORDHERE'
# PushEngage
PUSH_ENGAGE_ENDPOINT = 'PUSHENGAGEENDPOINTHERE'
PUSH_ENGAGE_API_KEY = 'PUSHENGAGEAPIKEYHERE'
PUSH_ENGAGE_SRC_SCRIPT = 'PUSHENGAGESRCSCRIPTHERE'
# AWS SES
SES_REGION_NAME = 'AMAZONSESREGIONNAMEHERE'
SES_EMAIL_SOURCE = 'AMAZONSESEMAILSOURCEHERE'
# Enable/Disable SQLAlchemy session modification tracking
SQLALCHEMY_TRACK_MODIFICATIONS = 'SQLALCHEMYTRACKMODIFICATIONSHERE'
# CHAT API CREDENTIALS
CHAT_API_USERNAME = 'CHATAPIUSERNAMEHERE'
CHAT_API_PASSWORD = 'CHATAPIPASSWORDHERE'
# RASA API ENDPOINT
RASA_ENDPOINT = 'RASAENDPOINTHERE'
=======
>>>>>>> 2d4ba41568adf348959bbf7b64ffa061df87d07b
EQ_PDF_BUCKET = 'EQPDFBUCKETHERE'
# SMS MOBILE APP CAMPAIGN
SMS_MOBILE_CAMPAIGN_ID = 'SMSMOBILECAMPAIGNIDHERE'
SMS_MOBILE_CAMPAIGN_CLASS = 'SMSMOBILECAMPAINCLASSHERE'
CONDITIONAL_NOTIFICATION_PROCESSOR_DELAY = 'CONDITIONALNOTIFICATIONDELAYHERE'
<<<<<<< HEAD
=======
LOG_REQUESTS_URLS = {
"client_api": ["/api/v1", "/api/v2"],
"form_leads": ["/form_leads"],
"login": ["/login",
"/account/begin_password_reset",
"/account/password_reset"],
"verification": ["/verification"],
"phone_call": [
"/bw/voice",
"/bw/voice/status",
"/bw/voice/fallback"
],
"sms_mms": [
"/bw/sms",
"/bw/sms/status/callback"
]
}
LOG_EXCLUDE_URLS = ['/api/v2/swagger.json']
SUPPORT_EMAILS = ['monitoring@buyercall.com']
REQUEST_RATE_LIMIT = [
{
'url_starts_with': ['/api/v1', ],
'limit': '120 per minute',
'notify_limit': 2
},
{
'url_starts_with': ['/api/v2', ],
'limit': '120 per minute',
'notify_limit': 2
},
{
'url_starts_with': ['/form_leads', ],
'limit': '120 per minute',
'notify_limit': 2
}
]
REQUEST_RATE_LIMIT_EXCLUDE = [
'/api/v1/swagger.json',
'/api/v2/swagger.json'
]
REQUEST_RATE_LIMIT_NOTIFY_EMAILS = ['monitoring@buyercall.com']
REQUEST_FAIL_NOTIFY_INTERVAL = 3600
PASSWORD_EXPIRY_DAYS = 90
# New Google Recaptcha V3 Keys
RC_SITE_KEY_V3 = 'GOOGLERCSITEKEYV3HERE'
RC_SECRET_KEY_V3 = 'GOOGLERCSECRETKEYV3HERE'
# IP-API key to lookup IP details
IP_API_KEY = 'IPAPIKEYHERE'
# AMS Analytics List API details
AMS_LIST_URL = 'AMSLISTURLHERE'
AMS_LIST_CLIENT_KEY = 'AMSLISTCLIENTKEYHERE'
AMS_LIST_CLIENT_SECRET = 'AMSLISTCLIENTSECRETHERE'
>>>>>>> 2d4ba41568adf348959bbf7b64ffa061df87d07b