Move client key to database with admin UI for key management and QR code generation

- Store client key in SQLite database instead of environment variable
- Add database migration from CLIENT_KEY environment variable to preserve existing keys
- Add admin UI with tabbed interface (Configuration and QR Code tabs)
- Implement QR code generation containing server config (address, port, key) for Android app
- Add functionality to regenerate client key with warning dialog
- Add buttons to download QR code as PNG and copy QR image to clipboard
- Add manual input fields for server address and port configuration
- Update requirements.txt with pyotp and qrcode dependencies
This commit is contained in:
2025-12-27 14:29:58 -05:00
parent 872ae74668
commit 164e2162a2
7 changed files with 786 additions and 32 deletions

View File

@@ -1,7 +1,7 @@
from .file_metadata import FileMetadata
# Database initialization
from .database import init_db, get_db_connection, migrate_from_json
from .database import init_db, get_db_connection, migrate_from_json, migrate_client_key_to_db
# Admin model functions
from .admin_model import (
@@ -33,3 +33,13 @@ from .chunk_model import (
cleanup_abandoned,
update_received_chunks
)
# Config model functions
from .config_model import (
get_config,
get_client_key,
init_config,
update_server_address,
update_server_port,
regenerate_client_key
)