Commit Graph
85 Commits
Author SHA1 Message Date
David Santos 0a62a2dd80 docs: align MoneyFlix ops docs to CT 241 / LXC (BIT-28102)
Retire 94.23.75.89/PM2 guidance in product docs; point operators at
systemd moneyflix-redirector, NPM CT 102, the LXC runbook, and smoke script.
Redact inline MariaDB password from redirector deploy notes.

Paperclip-Issue: BIT-28102
Paperclip-Run: c3d1f836-ff51-40fa-a3be-c43a5b452ba1
2026-08-04 21:30:45 +01:00
spark 7509f0685c Merge pull request 'feat(error-monitoring): paperclip_project_id no payload hub (BIT-25538)' (#5) from feat/bit-25538-paperclip-project-id into master 2026-06-18 04:03:43 +01:00
Xika 44b75d9d2e feat(error-monitoring): enviar paperclip_project_id no payload hub (BIT-25538)
- ErrorReporter::reportMessage: inclui paperclip_project_id de ERROR_REPORTING_PAPERCLIP_PROJECT_ID env
- Adiciona método privado paperclipProjectId() para leitura limpa do env

Paperclip-Issue: BIT-25538
2026-06-18 02:40:08 +00:00
spark 0c5eec84ba Merge pull request 'fix(error-hub): re-enable hub ingest via canonical drop-in (BIT-25023)' (#4) from task/BIT-25023-error-hub-reporters into master 2026-06-12 18:03:41 +01:00
Xika 988eaebc67 fix(error-hub): re-enable hub ingest via canonical drop-in (BIT-25023)
Paperclip-Issue: BIT-25023
Paperclip-Run: f1482381-ca8c-43d6-889f-effd16f8a314
2026-06-12 11:07:21 +00:00
sparkandPaperclip 1036e77574 Merge pull request 'fix(nginx): ^~ /assets/ alias for Views/assets/ — BIT-24927' (#3) from fix/bit-24925-crm-admin-pathmanager into master
fix(nginx): ^~ /assets/ alias for Views/assets/ — BIT-24927

Co-Authored-By: Paperclip <[email protected]>
2026-06-10 20:04:55 +01:00
XikaandPaperclip 6f5d68eefd fix(nginx): add ^~ /assets/ alias to serve Views/assets/ — BIT-24927
Without ^~ the generic ~* regex block for static extensions matched
first, falling back to root /opt/moneyflix/crm where no assets/ dir
exists → 404 for all CSS/JS.

^~ /assets/ takes precedence over regex blocks, aliasing to
crm/Views/assets/ where the complete asset set lives.

Co-Authored-By: Paperclip <[email protected]>
2026-06-10 19:04:40 +00:00
sparkandPaperclip 872ad2d1c6 Merge pull request 'fix(view): respect APP_URL and X-Forwarded-* in getBaseUrl() — BIT-24927' (#2) from fix/bit-24925-crm-admin-pathmanager into master
fix(view): respect APP_URL and X-Forwarded-* in getBaseUrl() — BIT-24927

Co-Authored-By: Paperclip <[email protected]>
2026-06-10 19:59:30 +01:00
XikaandPaperclip 7a6f91f7b6 fix(view): respect APP_URL and X-Forwarded-* headers in getBaseUrl()
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]>
2026-06-10 18:57:48 +00:00
spark d7dc1e7f43 Merge pull request 'fix(crm): resolve PathManager root for MoneyFlix standalone clone (BIT-24925)' (#1) from fix/bit-24925-crm-admin-pathmanager into master
Merge fix/bit-24925-crm-admin-pathmanager → master: fix PathManager root for MoneyFlix standalone clone (BIT-24925)
2026-06-10 18:56:46 +01:00
XikaandCursor a5e2e0623b fix(crm): resolve PathManager root for MoneyFlix standalone clone
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]>
2026-06-10 17:54:57 +00:00
Xika 293b764799 fix(BIT-24694): downgrade symfony/filesystem to PHP 8.1-compatible v6.x
Lock file was pinned to symfony/filesystem v7.3.2 which requires PHP >= 8.2.
LXC runs PHP 8.1.34 (Ubuntu 22.04 PPA). Ran composer update on production CT
to resolve v6.4.39 (compatible with PHP 8.1+).

Smoke: all 5 checks pass on CT 241 (10.10.50.37).

Paperclip-Issue: BIT-24694
2026-06-09 13:53:09 +00:00
Xika da978374a1 infra(BIT-24694): add PBS DB extraction script and prod dump import support
- tools/proxmox/extract_db_from_pbs.sh: restores a PBS backup to an
  air-gapped temp CT (no net0), dumps MariaDB to a .sql.gz, then destroys
  the temp CT. Handles root no-pass, moneyflix.env creds, and --list mode.
- tools/proxmox/install_moneyflix_stack.sh: adds PROD_DB_DUMP env var;
  when set to a .sql.gz dump from PBS extraction, imports production data
  instead of applying the empty lab schema. Strips DEFINER clauses for
  clean import under a different user.

Paperclip-Issue: BIT-24694
Paperclip-Run: fda0935a-f525-46a5-81a0-6d63da4188cf
2026-06-08 13:30:41 +00:00
Xika e570468610 infra(BIT-24694): add MoneyFlix prod LXC install and smoke scripts
- tools/proxmox/install_moneyflix_stack.sh: guest-side stack installer
  (MariaDB, PHP 8.1, nginx, Node.js 20, systemd unit moneyflix-redirector)
  Reads /etc/moneyflix/moneyflix.env; rejects placeholder credentials.
- tools/proxmox/smoke_moneyflix_prod.sh: post-deploy smoke from Paperclip host
  Checks redirector /health, /status, /test-db and CRM /system/status.

Paperclip-Issue: BIT-24694
Paperclip-Agent: devops
2026-06-08 13:14:25 +00:00
XikaandCursor 1c67b0744f feat: add MoneyFlix lab smoke stack and fix redirector env loading (BIT-24693)
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]>
2026-06-08 13:06:03 +00:00
Xika 58f25eef54 docs: add final handoff summary for BIT-24692
Completes Fase 1 credential hygiene audit.
All acceptance criteria met.

Paperclip-*:
- Issue: BIT-24692
- Agent: e34f1b0f-62db-487c-8584-f6a47203f7b5
- UrlKey: nelson-baptista
2026-06-08 12:46:36 +00:00
Xika e40db9d94f docs: update execution summary with final results
Added commit 4 for PHP view fix.
Updated totals to reflect 11 credentials removed.

Paperclip-*:
- Issue: BIT-24692
- Agent: e34f1b0f-62db-487c-8584-f6a47203f7b5
- UrlKey: nelson-baptista
2026-06-08 12:45:17 +00:00
Xika 44e31c8617 fix: remove hardcoded API key from PHP view (BIT-1876)
SEV-1: Remove hardcoded bearer token from client-side JavaScript.
Authorization should be handled server-side.

Paperclip-*:
- Issue: BIT-24692
- Agent: e34f1b0f-62db-487c-8584-f6a47203f7b5
- UrlKey: nelson-baptista
2026-06-08 12:44:47 +00:00
Xika c39023a721 docs: add execution summary for BIT-24692
Completes BIT-24692 - MoneyFlix Fase 1 credential hygiene.

Paperclip-*:
- Issue: BIT-24692
- Agent: e34f1b0f-62db-487c-8584-f6a47203f7b5
- UrlKey: nelson-baptista
2026-06-08 12:44:07 +00:00
Xika 5c6a642af1 docs: update credentials hygiene plan status to done
Paperclip-*:
- Issue: BIT-24692
- Agent: e34f1b0f-62db-487c-8584-f6a47203f7b5
- UrlKey: nelson-baptista
2026-06-08 12:43:27 +00:00
Xika 03e0e557ef fix: remove hardcoded credentials from Git (BIT-1876)
SEV-1: Remove hardcoded credentials per BIT-1876 credential safety rules.

Changes:
- moneyflix.config: Remove DB_PASS and API_KEY plaintext values
- nodejs-redirector/ecosystem.config.cjs: Use process.env for sensitive credentials
- README_MONEYFLIX.md: Replace real credentials with placeholders
- nodejs-redirector/README.md: Replace real credentials with placeholders
- README.md: Replace real credentials with placeholders
- docs/MONEYFLIX_CLIENT_CONFIGURATION.md: Replace real credentials with placeholders
- docs/README.md: Replace real credentials with placeholders
- crm/README.md: Replace real credentials with placeholders
- Add credentials-hygiene-plan.md for reference

Note: This removes credentials from Git but does NOT change production values.
Production credential rotation requires explicit human approval.

Paperclip-*:
- Issue: BIT-24692
- Agent: e34f1b0f-62db-487c-8584-f6a47203f7b5
- UrlKey: nelson-baptista
2026-06-08 12:43:01 +00:00
Diana Neves 5319c851f8 docs(governance): add root CODEOWNERS baseline (BIT-3492)
Paperclip-Agent: Diana Neves (urlKey diana-neves; id 4427016d-7e8f-46e9-9694-3d062e78cc3a)
Paperclip-Issue: BIT-3492
Paperclip-Run: 9280060a-beda-4265-ac1e-c080464cbbd8
2026-05-07 01:27:25 +00:00
1sonhador c1ddf3548d fix: Corrigir comentários em Português - remover gerúndio incorreto
- 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
2025-10-30 10:03:01 +00:00
1sonhador 46b20cb1e2 fix: Remove WDMI-specific CSS blocks instead of replacing condition
- Remove entire conditional CSS blocks that were WDMI-specific
- These gradient styles were not needed for MoneyFlix
- Clean up main.php and public-blank.php layouts
2025-10-30 10:01:43 +00:00
1sonhador c2fecefa55 refactor: Remove BetZoo and WDMI references, standardize to MoneyFlix
- Replace "BetZoo CRM" with "MoneyFlix" in Advertising module description
- Replace "Betzoo" option with "MoneyFlix" in ErrorMonitoring project filter
- Update GoogleSheetsService to use environment variable for credentials path
- Update CDN config from betzoo.app to moneyflix.com
- Remove WDMI-specific checks in layouts (topbar, sidebar, main, public-blank)
- Update database profile examples from wdmi_importer to moneyflix_importer
- Keep BitReport references (company/product name)
2025-10-30 10:00:46 +00:00
1sonhador 956b0547e8 fix: Resolve PHP syntax errors and deprecation warnings
- Fix syntax error in coming/soon.php (missing closing parenthesis)
- Fix JavaScript syntax errors in coming/soon.php
- Fix nullable parameter deprecation warnings in ErrorLog.php
- Fix nullable parameter deprecation warnings in LandingTemplateModel.php
- All PHP files now pass syntax validation
- No more deprecated parameter warnings
2025-10-28 16:26:34 +00:00
1sonhador 831145b2c4 refactor: Remove ScriptBuilderService from MoneyFlix
- Remove ScriptBuilderService and ScriptBuilderIntegrationService (CRM-specific)
- Update controllers to use GoogleSheetsService instead
- Disable script generation/deployment functionality temporarily
- Fix creative count TODO in AdvertisingController
- Clean up module service registrations
- Restore clean User Views files

ScriptBuilder functionality is specific to the main CRM and not needed for MoneyFlix.
2025-10-28 16:18:30 +00:00
1sonhador 381ac55f6c feat: Add ErrorMonitoring API endpoints and raw_request migration
- 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
2025-10-28 15:52:09 +00:00
1sonhador 0283e966a9 MoneyFlix: Add remaining assets and source maps
- 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
2025-10-22 18:09:55 +01:00
1sonhador 97eca96f83 MoneyFlix: Add Auth module, fix error monitoring, improve lock screen functionality
- 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
2025-10-22 18:09:43 +01:00
1sonhador 10176fd47e feat: Add real user activity tracking system
- 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
2025-10-15 14:37:59 +01:00
1sonhador c4189cefa7 cleanup: Remove test files
- Remove test_auth.php and test_auth_middleware.php
- These were temporary debugging files
2025-10-15 14:34:15 +01:00
1sonhador f75573768c fix: Allow API key access to UserController::apiGetRecentActivity
- Apply same fix as apiGetUsers to allow API key authentication
- Check if user is logged in and admin, OR if using valid API key
2025-10-15 14:33:41 +01:00
1sonhador 298ed9cf32 fix: Allow API key access to UserController::apiGetUsers
- Check if user is logged in and admin, OR if using valid API key
- This allows API access with Bearer token authentication
- Fixes 'Acesso negado' error for API key requests
2025-10-15 14:33:03 +01:00
1sonhador f88fc2412b fix: Remove requireAuth call from UserController::apiGetUsers
- Remove redundant requireAuth call since apiOrAuth middleware handles authentication
- This was causing 'Authentication required' error even with valid API key
2025-10-15 14:32:28 +01:00
1sonhador c8e92ead2e fix: Use apiOrAuth instead of requireAuth for user API routes
- Change all user API routes to use apiOrAuth middleware
- This allows API access with Bearer token authentication
- Fixes 302 redirects for API endpoints
2025-10-15 14:30:11 +01:00
1sonhador 4656a0877b fix: Add last_login column to users table
- 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
2025-10-15 14:27:23 +01:00
1sonhador 57f9a715c2 fix: Remove non-existent last_login column from UserModel queries
- Fix getAllForAdmin method to not select last_login column
- Fix findForAdmin method to not select last_login column
- Users table doesn't have last_login column
2025-10-15 14:26:26 +01:00
1sonhador f670e9301a fix: Add missing API routes and methods
- Add recent-activity route to Users module
- Add apiGetRecentActivity method to UserController
- Fix composer autoloader path in index.php
- Install composer dependencies on server
2025-10-15 14:23:57 +01:00
1sonhador 362d2f9488 fix: Correct user permissions and UserModel query
- Fix storage permissions to use 'www' user instead of 'www-data'
- Fix UserModel getAllForAdmin query to avoid placeholders in LIMIT/OFFSET
- Update deploy script to use correct user permissions
- Clean up test files
2025-10-15 14:17:55 +01:00
1sonhador 88a5659fe8 fix: Correct user permissions and UserModel query
- Fix storage permissions to use 'www' user instead of 'www-data'
- Fix UserModel getAllForAdmin query to avoid placeholders in LIMIT/OFFSET
- Import missing modules: Advertising, Dashboard, Analytics
- Update deploy script to copy files to public directory
2025-10-15 14:14:00 +01:00
1sonhador 08223585f7 test: Add olamundo.php to verify deploy path 2025-10-15 13:50:04 +01:00
1sonhador 968e7b3451 feat: Import ErrorMonitoring module from old CRM
- Add complete ErrorMonitoring module with controllers, models, services
- Include error dashboard, error detail views, and error import functionality
- Add error monitoring API endpoints and error collection services
- Fix missing error monitoring system for critical error tracking
2025-10-15 13:48:48 +01:00
1sonhador 2cab67b1ab fix: Add missing Auth class and UserModel methods
- Import Auth.php from old CRM to fix authentication
- Add getAllForAdmin, getTotalForAdmin, findForAdmin methods to UserModel
- Fix admin users API endpoints functionality
- Resolve 'Erro ao carregar utilizadores' error
2025-10-15 13:45:44 +01:00
1sonhador 0d76c40980 feat: Import Users module from old CRM
- Copy complete Users module from CRM_Project
- Fix syntax error in UserController.php (trailing whitespace)
- Add admin users management functionality
- Include user profiles, roles, and permissions
- Add API endpoints for user management
2025-10-15 13:42:07 +01:00
1sonhador 11d9bf8e4f fix: Add redirectsList JavaScript function to redirects index page
- Add complete redirectsList() function with API integration
- Include analytics_slug support in JavaScript
- Fix missing function that was causing page to not load
- Add proper error handling and loading states
2025-10-15 13:39:13 +01:00
1sonhador 3f66fcf984 fix: Add analytics_slug to API redirects endpoint
- Include analytics_slug in apiRedirects() query
- Fix missing analytics_slug in Vue.js data
- Ensure analytics links appear in redirects list
2025-10-15 13:33:17 +01:00
1sonhador 490d54f41d fix: Add debug check for analytics_slug in view page
- Add conditional check to show warning if analytics_slug is missing
- Improve error handling for missing analytics data
- Add visual feedback for debugging
2025-10-15 13:30:49 +01:00
1sonhador 151bac0e20 fix: Add analytics URL copy functionality and fix delete redirect error
- Add analytics public URL input with copy button in redirect view
- Fix deleteCreativeByRedirectId to handle missing creatives gracefully
- Add copyAnalyticsUrl JavaScript function with visual feedback
- Improve error handling in redirect deletion process
2025-10-15 13:28:07 +01:00
1sonhador 4c08a83707 feat: Add secure analytics slug system
- 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
2025-10-15 13:19:51 +01:00