feat: validate database URI
This commit is contained in:
1 parent
00a2a8180e
commit
e2e33366fb
1 file changed
+4
@@ -63,6 +63,10 @@ def create_app(config_name: Optional[str] = None) -> Flask:
|
||||
app.config['SQLALCHEMY_DATABASE_URI'] = database_uri
|
||||
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
|
||||
|
||||
# Validate database URI format
|
||||
if not database_uri.startswith(('sqlite:///')):
|
||||
raise ValueError(f"Invalid database URI format: {database_uri}")
|
||||
|
||||
# Theme configuration
|
||||
app.config['FLADO_THEME'] = os.getenv('FLADO_THEME', 'auto')
|
||||
|
||||
|
||||
Reference in new issue
Block a user