Add settings page, PIN manager, and auto-config
- New settings page at /settings (localhost-only) accessible via tray icon - PIN manager with 6-digit codes, 5-min TTL, single-use - API token uses secrets.token_urlsafe(32) for 256-bit entropy - Config auto-creates config.yaml on first run with detected local IP - Default PIN and token generated randomly on first startup - Added pin_ttl setting (default 300s) - Updated build_exe.py for onefile exe with settings assets bundled - Added start.bat and start.sh for easy development startup
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
# PaperDash Server Startup Script
|
||||
# Creates venv if needed, installs dependencies, and starts the server
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
cd "$SCRIPT_DIR"
|
||||
|
||||
# Create venv if it doesn't exist
|
||||
if [ ! -d "venv" ]; then
|
||||
echo "Creating virtual environment..."
|
||||
python3 -m venv venv
|
||||
fi
|
||||
|
||||
# Activate venv
|
||||
source venv/bin/activate
|
||||
|
||||
# Install dependencies
|
||||
echo "Installing dependencies..."
|
||||
pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
|
||||
# Run the server
|
||||
echo "Starting PaperDash server..."
|
||||
echo " Dashboard: http://localhost:8921"
|
||||
echo " API docs: http://localhost:8921/docs"
|
||||
echo ""
|
||||
echo "Set environment variables before starting:"
|
||||
echo " DASHBOARD_PIN=1234"
|
||||
echo " API_TOKEN=your-token"
|
||||
echo ""
|
||||
|
||||
uvicorn main:app --host 0.0.0.0 --port 8921 --reload
|
||||
Reference in New Issue
Block a user