2018-05-04 13:44:17 +00:00
|
|
|
import os
|
|
|
|
|
2018-04-25 14:02:29 +00:00
|
|
|
# App configuration
|
2018-10-08 19:08:50 +00:00
|
|
|
DEBUG = os.environ['DEBUG']
|
2018-12-11 19:18:23 +00:00
|
|
|
APP_VERSION = '0.4.6'
|
2018-11-04 12:38:53 +00:00
|
|
|
APP_RELEASE_VERSION_STRING = (os.environ.get('HEROKU_RELEASE_VERSION')
|
|
|
|
or 'Unknown')
|
2018-04-25 14:02:29 +00:00
|
|
|
|
2018-04-26 08:49:09 +00:00
|
|
|
# Define the application directory
|
2018-05-04 13:44:17 +00:00
|
|
|
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
|
2018-04-26 08:49:09 +00:00
|
|
|
|
|
|
|
# Define the database - we are working with
|
2018-04-26 14:45:28 +00:00
|
|
|
SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL']
|
2018-04-27 08:47:24 +00:00
|
|
|
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
2018-04-26 12:51:37 +00:00
|
|
|
DATABASE_CONNECT_OPTIONS = {}
|
2018-04-26 08:49:09 +00:00
|
|
|
|
|
|
|
# Application threads. A common general assumption is
|
|
|
|
# using 2 per available processor cores - to handle
|
|
|
|
# incoming requests using one and performing background
|
|
|
|
# operations using the other.
|
|
|
|
THREADS_PER_PAGE = 2
|
|
|
|
|
|
|
|
# Enable protection agains *Cross-site Request Forgery (CSRF)*
|
|
|
|
CSRF_ENABLED = True
|
|
|
|
|
|
|
|
# Use a secure, unique and absolutely secret key for
|
2018-05-04 13:44:17 +00:00
|
|
|
# signing the data.
|
2018-10-31 20:59:21 +00:00
|
|
|
CSRF_SESSION_KEY = os.environ.get('CSRF_SECRET') or "secret"
|
2018-04-26 08:49:09 +00:00
|
|
|
|
|
|
|
# Secret key for signing cookies
|
2018-10-31 20:59:21 +00:00
|
|
|
SECRET_KEY = (os.environ.get('APP_SECRET_KEY') or
|
|
|
|
"?['Z(Z\x83Y\x06T\x12\x96<\xff\x12\xe0\x1b\xd1J\xe0\xd9ld")
|
|
|
|
SECURITY_PASSWORD_SALT = (os.environ.get('APP_SECRETS_SALT') or
|
|
|
|
"IyoZvOJb4feT3xKlYXyOJveHSIY4GDg6")
|
2018-04-26 08:49:09 +00:00
|
|
|
|
2018-04-25 14:02:29 +00:00
|
|
|
# MQTT configuration
|
2018-10-08 20:48:57 +00:00
|
|
|
MQTT_CLIENT_ID = 'final-iot-backend-server-' + os.environ['MQTT_CLIENT']
|
2018-05-03 18:56:48 +00:00
|
|
|
MQTT_BROKER_URL = 'broker.hivemq.com'
|
2018-04-25 13:51:28 +00:00
|
|
|
MQTT_BROKER_PORT = 1883
|
|
|
|
MQTT_USERNAME = 'user'
|
|
|
|
MQTT_PASSWORD = 'secret'
|
|
|
|
MQTT_REFRESH_TIME = 1.0 # refresh time in seconds
|
2018-05-07 15:17:19 +00:00
|
|
|
|
2018-09-20 20:05:03 +00:00
|
|
|
# Celery config
|
|
|
|
CELERY_BROKER_URL = os.environ['REDIS_URL']
|
|
|
|
CELERY_RESULT_BACKEND = os.environ['REDIS_URL']
|
|
|
|
|
2018-10-10 18:54:38 +00:00
|
|
|
# Mailer config
|
2018-10-22 17:47:44 +00:00
|
|
|
MAIL_SERVER = 'smtp.googlemail.com'
|
|
|
|
MAIL_PORT = 465
|
2018-10-22 17:47:43 +00:00
|
|
|
MAIL_USE_TLS = False
|
2018-10-22 17:47:38 +00:00
|
|
|
MAIL_USE_SSL = True
|
2018-10-10 18:54:38 +00:00
|
|
|
MAIL_DEBUG = False
|
|
|
|
|
|
|
|
# gmail authentication
|
2018-10-22 17:47:44 +00:00
|
|
|
MAIL_USERNAME = os.environ['APP_MAIL_USERNAME']
|
|
|
|
MAIL_PASSWORD = os.environ['APP_MAIL_PASSWORD']
|
2018-10-10 18:54:38 +00:00
|
|
|
|
|
|
|
# mail accounts
|
|
|
|
MAIL_DEFAULT_SENDER = 'final.iot.backend.mailer@gmail.com'
|
2018-11-04 12:38:53 +00:00
|
|
|
MAIL_CONTACT_ACCOUNTS = ['esarajcic1@etf.unsa.ba', 'valjic1@etf.unsa.ba']
|
2018-10-10 18:54:38 +00:00
|
|
|
|
2018-10-31 20:43:27 +00:00
|
|
|
# frontend
|
|
|
|
FRONTEND_URL = (os.environ.get('IOT_FRONTEND_URL') or
|
|
|
|
'http://iot-frontend-app.herokuapp.com/')
|
|
|
|
|
2018-10-08 20:09:01 +00:00
|
|
|
# Flasgger config
|
2018-05-07 15:17:19 +00:00
|
|
|
SWAGGER = {
|
|
|
|
'uiversion': 3
|
|
|
|
}
|