diff --git a/config/plugins.d/site.conf b/config/plugins.d/site.conf index 0dad9ff0..2fb468fe 100644 --- a/config/plugins.d/site.conf +++ b/config/plugins.d/site.conf @@ -6,4 +6,3 @@ ### `ee.cli.plugins.example` or from the file path ### `/var/lib/ee/plugins/example.py` enable_plugin = true -db_path = sqlite:////var/lib/ee/ee.sqlite diff --git a/ee/core/database.py b/ee/core/database.py index 8fb0aa0f..573ee099 100644 --- a/ee/core/database.py +++ b/ee/core/database.py @@ -2,9 +2,10 @@ from sqlalchemy import create_engine from sqlalchemy.orm import scoped_session, sessionmaker from sqlalchemy.ext.declarative import declarative_base +from ee.core.variables import EEVariables # db_path = self.app.config.get('site', 'db_path') -engine = create_engine('sqlite:////var/lib/ee/ee.sqlite', convert_unicode=True) +engine = create_engine(EEVariables.ee_db_uri, convert_unicode=True) db_session = scoped_session(sessionmaker(autocommit=False, autoflush=False, bind=engine)) diff --git a/ee/core/variables.py b/ee/core/variables.py index ade26d28..be6cb7f7 100644 --- a/ee/core/variables.py +++ b/ee/core/variables.py @@ -114,6 +114,8 @@ class EEVariables(): # Repo path ee_repo_file = "ee-repo.list" ee_repo_file_path = ("/etc/apt/sources.list.d/" + ee_repo_file) + basedir = os.path.abspath(os.path.dirname('/var/lib/ee/')) + ee_db_uri = 'sqlite:///' + os.path.join(basedir, 'ee.db') def __init__(self): pass