When the app runs behind a reverse proxy (NPM), SERVER_PORT was 8080
(the backend port) causing asset URLs to include :8080 even though
clients access via HTTPS on port 443.
Priority: if APP_URL is set in the environment, use it directly.
Fallback: honour X-Forwarded-Proto and X-Forwarded-Port headers before
falling back to the raw SERVER vars.
Fixes crm-moneyflix.bitreport.pt asset URLs generating :8080 suffix.
Co-Authored-By: Paperclip <[email protected]>
findRootPath() fell back to /opt/bitreport when composer.json lives
under crm/ with Modules/, breaking auth layout resolution and /login 500.
Co-authored-by: Cursor <[email protected]>
Lab bootstrap scripts exercise CRM PHP, Node redirector, health endpoints, and
MySQL analytics on 10.10.50.17. Bearer auth is checked before session dev-login;
redirector reads CRM_API_URL at fetch time so dotenv applies correctly.
Paperclip-Task: BIT-24693
Paperclip-Run: 3467cbf0-a91f-4cb0-808a-ccb043de28d3
Co-authored-by: Cursor <[email protected]>
- Substituir "usando" por "com" ou "através de" onde apropriado
- Corrigir "adicionar à fila para depois" para "adicionar à fila para processamento posterior"
- Melhorar clareza e correção gramatical nos comentários
- Add apiResolveAllErrors endpoint to resolve all open errors at once
- Add apiClearAllErrors endpoint to clear all errors
- Update ErrorLog model with new methods
- Add migration for raw_request column in redirect_stats
- Complete view/click tracking functionality
- Add source maps and license files for compiled assets
- Add debug and test files for development
- Complete Git repository with all necessary files for MoneyFlix project
- Add complete Auth module with login, logout, lock screen functionality
- Fix 401 error on error monitoring page by adding /error-monitoring/ to public patterns
- Improve lock screen with proper form handling and unlock functionality
- Add RoleModel and role management views
- Add BaseModel for common model functionality
- Update authentication system and middleware
- Add troubleshooting documentation
- Update assets and build tools
- Create UserActivitiesTable migration for tracking user activities
- Create UserActivityModel for managing activity data
- Replace mock data in apiGetRecentActivity with real database data
- Remove all mock/fake data from the project
- Create migration AddLastLoginToUsers to add last_login column
- Revert UserModel to use last_login column in queries
- Proper solution: add missing column instead of removing from code
- Add analytics_slug column to redirects table
- Generate unique analytics slugs using CUID2
- Update PublicCampaignsController to use analytics_slug
- Update views to use analytics_slug in analytics links
- Add migration and population scripts
- Improve security by separating public redirect and analytics URLs
- Add PublicCampaignsController for public campaign analytics
- Add public routes for /public/analytics/{slug} and /api/campaigns/{slug}
- Add public campaign analytics view with charts and KPIs
- Support for campaign sharing via custom slugs
- Real-time analytics with ApexCharts integration
- Created separate MoneyFlix project directory
- Copied Node.js redirector from production server
- Added CRM PHP code (Redirects module, Core classes, Config, Routes, Views)
- Created comprehensive documentation (README_MONEYFLIX.md)
- Added sync script to keep CRM code updated (sync-from-crm.sh)
- Configured .gitignore for Node.js and PHP
- Set up proper project structure for multi-client isolation
This separates MoneyFlix from the main CRM to avoid confusion
between different client systems and provides a dedicated
environment for MoneyFlix-specific development and maintenance.