Put authentication database path in ini file
This commit is contained in:
		
							parent
							
								
									f17ccd954c
								
							
						
					
					
						commit
						f4cfde621e
					
				@ -99,6 +99,7 @@ class SyncApp(object):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        self.data_root = os.path.abspath(kw.get('data_root', '.'))
 | 
					        self.data_root = os.path.abspath(kw.get('data_root', '.'))
 | 
				
			||||||
        self.base_url  = kw.get('base_url', '/')
 | 
					        self.base_url  = kw.get('base_url', '/')
 | 
				
			||||||
 | 
						self.auth_db_path = os.path.abspath(kw.get('auth_db_path', '.'))
 | 
				
			||||||
        self.sessions = {}
 | 
					        self.sessions = {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        try:
 | 
					        try:
 | 
				
			||||||
@ -119,7 +120,7 @@ class SyncApp(object):
 | 
				
			|||||||
        Override this to change how users are authenticated.
 | 
					        Override this to change how users are authenticated.
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        conn = sqlite3.connect("auth.db")
 | 
					        conn = sqlite3.connect(self.auth_db_path)
 | 
				
			||||||
        cursor = conn.cursor()
 | 
					        cursor = conn.cursor()
 | 
				
			||||||
        param = (username,)
 | 
					        param = (username,)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -24,6 +24,7 @@ logging.config_file = logging.conf
 | 
				
			|||||||
use = egg:AnkiServer#sync_app
 | 
					use = egg:AnkiServer#sync_app
 | 
				
			||||||
data_root = ./collections
 | 
					data_root = ./collections
 | 
				
			||||||
base_url = /sync/
 | 
					base_url = /sync/
 | 
				
			||||||
 | 
					auth_db_path = ./auth.db
 | 
				
			||||||
mysql.host = 127.0.0.1
 | 
					mysql.host = 127.0.0.1
 | 
				
			||||||
mysql.user = db_user
 | 
					mysql.user = db_user
 | 
				
			||||||
mysql.passwd = db_password
 | 
					mysql.passwd = db_password
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user