Some checks failed
CI / skip-ci-check (pull_request) Successful in 1m4s
CI / lint-and-type-check (pull_request) Has been cancelled
CI / python-lint (pull_request) Has been cancelled
CI / test-backend (pull_request) Has been cancelled
CI / build (pull_request) Has been cancelled
CI / secret-scanning (pull_request) Has been cancelled
CI / dependency-scan (pull_request) Has been cancelled
CI / sast-scan (pull_request) Has been cancelled
CI / workflow-summary (pull_request) Has been cancelled
Add on-demand H.264/AAC web playback (RQ, ffmpeg) with API routes and Next.js proxies; extend admin UI with WebPlaybackVideo and shared hooks. Store transcode cache beside pending-photos (WEB_VIDEO_CACHE_DIR / UPLOAD_DIR) and ignore data/web_videos. Centralize FastAPI URL helpers, optional Vite and Next base paths for subfolder deploy, and fix modal reopen by using router.replace when closing the home photo viewer. Include migration, install scripts, deployment doc updates, and CI admin build env tweak. Made-with: Cursor
Scripts Directory
This directory contains utility scripts organized by purpose.
Directory Structure
db/ - Database Utilities
Database management and migration scripts:
drop_all_tables.py- Drop all database tablesdrop_all_tables_web.py- Drop all web database tablesgrant_auth_db_permissions.py- Grant permissions on auth databasemigrate_sqlite_to_postgresql.py- Migrate from SQLite to PostgreSQLrecreate_tables_web.py- Recreate web database tablesshow_db_tables.py- Display database table information
debug/ - Debug and Analysis Scripts
Debugging and analysis tools:
analyze_all_faces.py- Analyze all faces in databaseanalyze_pose_matching.py- Analyze face pose matchinganalyze_poses.py- Analyze face posescheck_database_tables.py- Check database table structurecheck_identified_poses_web.py- Check identified poses in web databasecheck_two_faces_pose.py- Compare poses of two facescheck_yaw_angles.py- Check face yaw anglesdebug_pose_classification.py- Debug pose classificationdiagnose_frontend_issues.py- Diagnose frontend issuestest_eye_visibility.py- Test eye visibility detectiontest_pose_calculation.py- Test pose calculation
utils/ - Utility Scripts
General utility scripts:
fix_admin_password.py- Fix admin user passwordupdate_reported_photo_status.py- Update reported photo status
Root-Level Scripts
Project-specific scripts remain in the repository root:
install.sh- Installation scriptrun_api_with_worker.sh- Start API with workerstart_backend.sh- Start backend serverstop_backend.sh- Stop backend serverrun_worker.sh- Run RQ workerdemo.sh- Demo helper script
Database Shell Scripts
Database-related shell scripts remain in scripts/:
drop_auth_database.sh- Drop auth databasegrant_auth_db_delete_permission.sh- Grant delete permissionssetup_postgresql.sh- Set up PostgreSQL
Log Management Scripts
Quick access to service logs for troubleshooting:
check-logs.sh- Check recent errors from all servicestail-errors.sh- Follow error logs in real-timeview-recent-errors.sh- View errors from the last N minutes (default: 10)setup-log-rotation.sh- Configure PM2 log rotation to prevent log bloat
Quick Usage
# Check all service logs for recent errors
./scripts/check-logs.sh
# Follow error logs in real-time (Ctrl+C to exit)
./scripts/tail-errors.sh
# View errors from last 10 minutes
./scripts/view-recent-errors.sh
# View errors from last 30 minutes
./scripts/view-recent-errors.sh 30
# Setup log rotation (run once)
./scripts/setup-log-rotation.sh
Log Locations:
- All logs:
/home/appuser/.pm2/logs/ - API errors:
/home/appuser/.pm2/logs/punimtag-api-error.log - Worker errors:
/home/appuser/.pm2/logs/punimtag-worker-error.log - Admin errors:
/home/appuser/.pm2/logs/punimtag-admin-error.log - Viewer errors:
/home/appuser/.pm2/logs/punimtag-viewer-error.log
Usage
Most scripts can be run directly:
# Database utilities
python scripts/db/show_db_tables.py
# Debug scripts
python scripts/debug/analyze_all_faces.py
# Utility scripts
python scripts/utils/fix_admin_password.py
Some scripts may require environment variables or database connections. Check individual script documentation or comments for specific requirements.