Security: Remove Demo Data, Fix Vulnerabilities, Add Performance Indexes #20
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "security-cleanup-and-optimization"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Comprehensive security cleanup, demo data removal, and performance optimization for Arctic Wolves Production.
Security Fixes (Phase A)
New Files
deployment/nginx_security.conf— Nginx security configuration with:server_tokens offto hide server version.env,.sql,.ht*,/deployment/,/config/,/logs/,/backups/,/receipts/,.gitdeployment/php_security.ini— PHP security settings:expose_php = Offto hide PHP versionModified Files
db_config.php— Added direct-access guard preventing HTTP accessconfig/session.php— Added direct-access guard preventing HTTP accessviews/pwa/messages.php— Fixed innerHTML XSS vulnerability (3 locations: renderThreadMessages, send button, chat polling)lib/cdn_resources.php— Addeddeferattribute to non-critical CDN scripts (chart-js, sortable-js, qrcode, html2canvas, jsqr)Demo Data & Dead File Cleanup (Phase B)
Deleted Files (25 files)
process_testing.phpviews/testing.phpviews/pwa/testing.phpcss/pwa-tablet-aurora.cssdeployment/schema.sqldeployment/goals_tables.sqldeployment/sql/remove_nextcloud_settings.sqlrink_images_migration.sqlmigrations/001_add_video_export_url.sqllbracket_test_preview.htmlihs_rink_preview.pngtest_rink_preview.pngdocs/lbracket_test.png.gitkeepfilesModified Files — Demo Data Removed
views/sessions_upcoming.phpviews/pwa/sessions.phpviews/drills_library.phpviews/sessions_booking.phpviews/video_drill_review.phpviews/coach_calendar.phpdatabase_schema.sqldashboard.phppwa.phppwa_tablet.phpPerformance Quick Wins (Phase C)
Database Indexes Added (
database_schema.sql)7 composite indexes for high-traffic query patterns:
bookingsidx_session_status(session_id, status)performance_statsidx_athlete_stat_type(athlete_id, stat_type)evaluation_scoresidx_athlete_date(athlete_id, evaluation_date)messagesidx_to_read(to_user_id, is_read)user_packagesidx_user_expiry_credits(user_id, expiry_date, credits_remaining)goal_stepsidx_goal_completed(goal_id, is_completed)session_attendanceidx_session_status(session_id, attendance_status)Other Performance Fixes
db_config.php— Enabled gzip output buffering (ob_start("ob_gzhandler"))views/gameplan/gp_whiteboard.php— Commented out missingjs/ice_canvas.jsreference (was causing 404)lib/cdn_resources.php— Added SRI hash for dash.js CDN resourceImpact Summary
Testing
nginx_security.confin server blockNext Steps (Future PRs)
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.