A secure web-based SQLite database viewer that provides a user-friendly interface for exploring and managing SQLite databases with role-based access control.
- Secure Access Control: Role-based user authentication with customizable permissions
- Table Management: View and explore database tables with a clean interface
- User Management: Configure user access levels and permissions per table
- Auto Logout: Automatic session timeout for enhanced security
- Configurable Settings: Easy configuration through
settings.json
- Python 3.10 or higher
- SQLite3
- uv (recommended for faster dependency management)
-
Clone the repository:
git clone https://github.com/404-5971/sqliteDatabaseWebviewer.git cd sqliteDatabaseWebviewer
-
Configure the
settings.json
file:{ "DATABASE_FILEPATH": "./data/your_database.db", "PASSWORD_PROTECTION": true, "LOG_OUT_USERS": true, "LOG_OUT_USERS_AFTER": 3600, "users": { "admin": { "password": "admin", "tables": ["*"], "permissions": ["*"] } }, "HOST": "default", "PORT": "default", "DEBUG": false }
-
Start the application:
./run.sh
or
.\run.bat
-
Open your browser and navigate to:
http://localhost:5000
-
Log in with your configured credentials and start exploring your database.
sqliteDatabaseWebviewer/
βββ src/ # Source code directory
β βββ app.py # Main Flask application
β βββ helperFunctions.py # Helper functions and utilities
β βββ static/ # Static assets
β βββ templates/ # HTML templates
βββ data/ # Database storage directory
βββ .python-version # Python version specification
βββ pyproject.toml # Project dependencies and metadata
βββ uv.lock # uv dependency lock file
βββ run.sh # Setup and run script
βββ settings.json # Application configuration
Configure user access in settings.json
:
"users": {
"username": {
"password": "user_password",
"tables": ["table1", "table2"], // or "*" for all tables
"permissions": ["*"] // or specific permissions
}
}
PASSWORD_PROTECTION
: Enable/disable authenticationLOG_OUT_USERS
: Enable automatic logoutLOG_OUT_USERS_AFTER
: Set timeout in seconds
Licensed under the GNU General Public License v3.0.
Contributions are welcome! Follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Commit your changes:
git commit -m 'Add some amazing feature'
- Push to the branch:
git push origin feature/amazing-feature
- Open a Pull Request
Happy database exploring! π
This document provides an explanation of all fields in the settings.json
file.
DATABASE_FILEPATH
(string): Specifies the file path to the SQLite database file.PASSWORD_PROTECTION
(boolean): Enables (true
) or disables (false
) password protection for the system.LOG_OUT_USERS
(boolean): Determines whether users should be logged out after a set time of inactivity.LOG_OUT_USERS_AFTER
(integer): Defines the logout timeout in seconds ifLOG_OUT_USERS
is set totrue
.
The users
object contains configurations for individual users. Each user has the following properties:
password
(string): The user's password.tables
(array): Lists the database tables the user has access to. A value of"*"
grants access to all tables, whilenull
means no access. You can also specify individual tables by name.permissions
(array): Lists the SQL operations the user is allowed to perform. A value of"*"
grants all permissions, whilenull
means no permissions. You can also specify individual permissions by name. BUT THIS IS NOT IMPLEMENTED YET.
- Password:
admin
- Tables: All (
"*"
) - Permissions: All (
"*"
)
- Password:
user
- Tables: None (
null
) - Permissions: None (
null
)
HOST
(string): Defines the hostname or IP address for the server. The value"default"
means it uses the default host configuration.PORT
(string): Defines the port number for the server. The value"default"
means it uses the default port.DEBUG
(boolean): Enables (true
) or disables (false
) debug mode for the server.