feat: Implement SQLCipher support for database encryption
- Added sqlcipher3 dependency to requirements.txt for SQLCipher integration. - Modified database connection handling in wrappers.py to support encrypted SQLite databases using the new sqlite+sqlcipher:// URL protocol. - Updated db.py to handle SQLCipher URLs for SQLAlchemy connections. - Enhanced Alembic migration environment to support SQLCipher URLs.
This commit is contained in:
@@ -288,6 +288,9 @@ DB_VARS = {
|
||||
|
||||
if all(DB_VARS.values()):
|
||||
DATABASE_URL = f"{DB_VARS['db_type']}://{DB_VARS['db_cred']}@{DB_VARS['db_host']}:{DB_VARS['db_port']}/{DB_VARS['db_name']}"
|
||||
elif DATABASE_TYPE == "sqlite+sqlcipher" and not os.environ.get("DATABASE_URL"):
|
||||
# Handle SQLCipher with local file when DATABASE_URL wasn't explicitly set
|
||||
DATABASE_URL = f"sqlite+sqlcipher:///{DATA_DIR}/webui.db"
|
||||
|
||||
# Replace the postgres:// with postgresql://
|
||||
if "postgres://" in DATABASE_URL:
|
||||
|
||||
Reference in New Issue
Block a user