Improving code style and some security issues
This commit is contained in:
parent
fa7b003549
commit
56d75c925c
2 changed files with 4 additions and 3 deletions
|
@ -17,6 +17,7 @@
|
||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
import logging
|
import logging
|
||||||
|
import tempfile
|
||||||
from logging.handlers import SysLogHandler
|
from logging.handlers import SysLogHandler
|
||||||
from src.models import db
|
from src.models import db
|
||||||
|
|
||||||
|
@ -34,7 +35,7 @@ class Config:
|
||||||
# Server Settings
|
# Server Settings
|
||||||
ADMIN_EMAIL = "metonymy@fedoraproject.org"
|
ADMIN_EMAIL = "metonymy@fedoraproject.org"
|
||||||
ADMIN_NAME = "Metonymy"
|
ADMIN_NAME = "Metonymy"
|
||||||
BIND_IP = "0.0.0.0"
|
BIND_IP = ""
|
||||||
BIND_PORT = 5000
|
BIND_PORT = 5000
|
||||||
CACHE_TYPE = "memcached"
|
CACHE_TYPE = "memcached"
|
||||||
CACHE_DEFAULT_TIMEOUT = 60
|
CACHE_DEFAULT_TIMEOUT = 60
|
||||||
|
@ -55,7 +56,7 @@ class Config:
|
||||||
class DevelopmentConfig(Config):
|
class DevelopmentConfig(Config):
|
||||||
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'database.sqlite')
|
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'database.sqlite')
|
||||||
CACHE_TYPE = "filesystem"
|
CACHE_TYPE = "filesystem"
|
||||||
CACHE_DIR = "/tmp"
|
CACHE_DIR = tempfile.gettempdir()
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def init_app(app):
|
def init_app(app):
|
||||||
|
|
|
@ -52,7 +52,7 @@ def get_env_variable(variable, fallback):
|
||||||
"""
|
"""
|
||||||
Will try to retrieve the environment variable from the system and if it fails
|
Will try to retrieve the environment variable from the system and if it fails
|
||||||
it returns the fallback value.
|
it returns the fallback value.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
variable: The environment variable that should be retrieved
|
variable: The environment variable that should be retrieved
|
||||||
fallback: The default return value in case the environment variable is not retrieved
|
fallback: The default return value in case the environment variable is not retrieved
|
||||||
|
|
Loading…
Reference in a new issue