From f4cfde621e1b453131f95eafa1b713c504367c92 Mon Sep 17 00:00:00 2001 From: jdoe0 Date: Fri, 2 Aug 2013 01:30:04 +0700 Subject: [PATCH] Put authentication database path in ini file --- AnkiServer/apps/sync_app.py | 3 ++- example.ini | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/AnkiServer/apps/sync_app.py b/AnkiServer/apps/sync_app.py index 968497c..5dab146 100644 --- a/AnkiServer/apps/sync_app.py +++ b/AnkiServer/apps/sync_app.py @@ -99,6 +99,7 @@ class SyncApp(object): self.data_root = os.path.abspath(kw.get('data_root', '.')) self.base_url = kw.get('base_url', '/') + self.auth_db_path = os.path.abspath(kw.get('auth_db_path', '.')) self.sessions = {} try: @@ -119,7 +120,7 @@ class SyncApp(object): Override this to change how users are authenticated. """ - conn = sqlite3.connect("auth.db") + conn = sqlite3.connect(self.auth_db_path) cursor = conn.cursor() param = (username,) diff --git a/example.ini b/example.ini index faed172..7d2da25 100644 --- a/example.ini +++ b/example.ini @@ -24,6 +24,7 @@ logging.config_file = logging.conf use = egg:AnkiServer#sync_app data_root = ./collections base_url = /sync/ +auth_db_path = ./auth.db mysql.host = 127.0.0.1 mysql.user = db_user mysql.passwd = db_password