diff --git a/.github/.DIRETRIZES_DESENVOLVIMENTO_v5 b/.github/.DIRETRIZES_DESENVOLVIMENTO_v5 old mode 100644 new mode 100755 diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md old mode 100644 new mode 100755 index e654160..ddfb34d --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -1,15 +1,34 @@ # Copilot Instructions +## 🖥️ AMBIENTE DE DESENVOLVIMENTO - SERVIDOR DE PRODUÇÃO + +**IMPORTANTE:** Estamos trabalhando diretamente no servidor de produção. + +- **Hostname:** mail.cnxifly.com +- **IP:** 213.165.93.60 +- **Sistema:** Ubuntu 24.04.3 LTS +- **Workspace:** `/root/webmoney` (symlink: `/var/www/webmoney`) + +### ⚠️ Consequências + +Como trabalhamos diretamente em produção: +- Mudanças em arquivos PHP **afetam imediatamente** o site +- Mudanças no Frontend **requerem build** (`npm run build`) +- **NÃO** é necessário usar SSH, sshpass ou scripts de deploy +- **Testar sempre** antes de fazer commit + +--- + ## 🔄 REPOSITÓRIO GIT - GITEA (Self-Hosted) -**IMPORTANTE:** O repositório principal é o Gitea no nosso servidor, NÃO o GitHub. +O repositório está em nosso Gitea, NÃO no GitHub. -### Configuração do Repositório +### Configuração ```bash -# Repositório principal (Gitea) +# Remote configurado git remote -v -# gitea https://git.cnxifly.com/marco/webmoney.git +# origin https://git.cnxifly.com/marco/webmoney.git # URL Web https://git.cnxifly.com/marco/webmoney @@ -19,97 +38,108 @@ Usuário: marco Senha: M@ster9354 ``` -### Comandos Git +### 📋 Workflow de Desenvolvimento ```bash -# Push para Gitea (SEMPRE usar este) -git push gitea main +# 1. Fazer alterações no código -# Pull do Gitea -git pull gitea main +# 2. Para Frontend (React) - OBRIGATÓRIO build: +cd /root/webmoney/frontend && npm run build -# Commit padrão -git add -A && git commit -m "descrição" && git push gitea main +# 3. Para Backend (PHP) - Apenas se necessário: +cd /root/webmoney/backend && php artisan config:clear && php artisan cache:clear + +# 4. Testar em https://webmoney.cnxifly.com + +# 5. Se OK, commit e push: +cd /root/webmoney +git add -A && git commit -m "descrição" && git push origin main + +# 6. Atualizar VERSION e CHANGELOG.md se necessário ``` ### ❌ Proibições Git -- NUNCA usar `git push origin` (GitHub foi descontinuado) -- NUNCA criar repositórios no GitHub para este projeto +- NUNCA usar GitHub (repositório descontinuado) +- NUNCA fazer push sem testar antes --- -## 🚨 REGRA CRÍTICA DE DEPLOY +## 🏗️ Estrutura do Projeto -**NUNCA envie arquivos manualmente com scp/rsync para o servidor.** - -### Deploy Obrigatório - -Sempre que precisar enviar código para produção, USE OS SCRIPTS: - -```bash -# Para mudanças no BACKEND (PHP/Laravel) -cd /workspaces/webmoney/backend && ./deploy.sh - -# Para mudanças no FRONTEND (React/JS) -cd /workspaces/webmoney/frontend && ./deploy.sh +``` +/root/webmoney/ ← Workspace (VS Code) + ↓ symlink +/var/www/webmoney/ ← Servido pelo Nginx +├── backend/ # Laravel API +│ ├── app/ +│ ├── config/ +│ ├── database/ +│ ├── routes/api.php +│ ├── storage/logs/ +│ └── .env # Configuração produção +└── frontend/ + ├── src/ # Código React + └── dist/ # Build (servido pelo Nginx) ``` -### Por que usar os scripts? +--- -Os scripts de deploy: -1. **Backend (deploy.sh)**: - - Sincroniza arquivos com rsync - - Instala dependências com composer - - Executa migrações - - Limpa e regenera cache - - Reinicia PHP-FPM - - Ajusta permissões +## 🔧 Serviços do Servidor -2. **Frontend (deploy.sh)**: - - Faz build do React (npm run build) - - Envia para /var/www/webmoney/frontend/**dist** (não /frontend!) - - Verifica se deploy funcionou +| Serviço | Versão | Status | +|---------|--------|--------| +| Nginx | latest | ✅ Ativo | +| PHP-FPM | 8.4.15 | ✅ Ativo | +| MariaDB | 11.4.9 | ✅ Ativo | +| Redis | 7.0.15 | ✅ Ativo | +| Node.js | 22.21.0 | ✅ Disponível | +| Postfix | - | ✅ Ativo | +| Dovecot | - | ✅ Ativo | +| Gitea | - | ✅ Ativo | -### Proibições +### Comandos Úteis -❌ `scp arquivo root@213.165.93.60:/var/www/webmoney/...` -❌ `rsync arquivo root@213.165.93.60:/var/www/webmoney/...` -❌ Copiar arquivos individuais manualmente +```bash +# Reiniciar PHP-FPM (após mudanças em config) +systemctl restart php8.4-fpm -### Workflow +# Ver logs Laravel +tail -f /root/webmoney/backend/storage/logs/laravel.log -1. Editar código -2. `cd backend && ./deploy.sh` ou `cd frontend && ./deploy.sh` -3. Testar em https://webmoney.cnxifly.com -4. Se OK: - - `VERSION++` (incrementar versão) - - Atualizar `CHANGELOG.md` (documentar mudanças) - - Atualizar `README.md` (sempre que necessário - novas features, requisitos, comandos, etc.) -5. Commit e push para Gitea: - ```bash - git add -A && git commit -m "descrição" && git push gitea main - ``` +# Ver logs Nginx +tail -f /var/log/nginx/webmoney_subdomain_error.log -### 📝 Quando atualizar README.md +# Limpar cache Laravel +cd /root/webmoney/backend && php artisan optimize:clear -- Nova funcionalidade importante -- Mudança de requisitos (versão PHP, Node, etc.) -- Novos endpoints de API -- Alteração de variáveis de ambiente -- Novos comandos artisan -- Mudança na estrutura do projeto +# Build frontend +cd /root/webmoney/frontend && npm run build + +# Tinker (debug PHP) +cd /root/webmoney/backend && php artisan tinker + +# MySQL +mysql -u webmoney -p'M@ster9354' webmoney -e "QUERY" +``` + +--- + +## 🔐 Credenciais + +| Serviço | Usuário | Senha | +|---------|---------|-------| +| Servidor (root) | root | Master9354 | +| MySQL | webmoney | M@ster9354 | +| WebMoney App | marco@cnxifly.com | M@ster9354 | +| Gitea | marco | M@ster9354 | + +--- ## 🚫 Regras de UI/UX **NUNCA use alert(), confirm() ou prompt() do navegador.** -Sempre usar componentes modais ou toast: -- Para erros: `toast.error('mensagem')` -- Para sucesso: `toast.success('mensagem')` -- Para confirmação: Usar `` component -- Para formulários: Criar modal customizado - ```jsx // ❌ PROIBIDO alert('Erro!'); @@ -124,44 +154,17 @@ toast.error('Erro!'); toast.success('Sucesso!'); ``` -## Estrutura do Servidor +--- -``` -/var/www/webmoney/ -├── backend/ # Laravel (Nginx → PHP-FPM) -└── frontend/ - └── dist/ # React build (Nginx root) -``` +## �� Padrão Visual de Modais -## Credenciais +**TODOS os modais de formulário devem seguir este padrão:** -- **Servidor**: root@213.165.93.60 (senha: Master9354) -- **Banco**: webmoney / M@ster9354 -- **Usuário WebMoney**: marco@cnxifly.com / M@ster9354 - -## 🔑 Acesso SSH - SEMPRE usar sshpass - -**OBRIGATÓRIO:** Sempre usar `sshpass` para comandos SSH/SCP/RSYNC. - -```bash -# SSH para executar comandos -sshpass -p 'Master9354' ssh -o StrictHostKeyChecking=no root@213.165.93.60 "comando" - -# Ver logs do Laravel -sshpass -p 'Master9354' ssh -o StrictHostKeyChecking=no root@213.165.93.60 "tail -50 /var/www/webmoney/backend/storage/logs/laravel.log" - -# Executar tinker -sshpass -p 'Master9354' ssh -o StrictHostKeyChecking=no root@213.165.93.60 "cd /var/www/webmoney/backend && php artisan tinker --execute='codigo'" - -# MySQL -sshpass -p 'Master9354' ssh -o StrictHostKeyChecking=no root@213.165.93.60 "mysql -u webmoney -p'M@ster9354' webmoney -e 'QUERY'" -``` - -❌ NUNCA usar `ssh root@213.165.93.60` sem sshpass (vai travar esperando senha) - -## 🎨 Padrão Visual de Modais - -**TODOS os modais de formulário devem seguir este padrão elegante:** +### Cores do Sistema +- **Background modal**: `#1e293b` +- **Background campos/cards**: `#0f172a` +- **Texto principal**: `text-white` +- **Texto secundário**: `text-slate-400` ### Estrutura Base ```jsx @@ -171,26 +174,16 @@ sshpass -p 'Master9354' ssh -o StrictHostKeyChecking=no root@213.165.93.60 "mysq {/* Header sem borda */}
-
-
- - Título -
-

Subtítulo

-
+
+ + Título +
{/* Body com scroll */}
- {/* Preview Card - SEMPRE no topo */} -
- {/* Preview visual do item sendo criado/editado */} -
- - {/* Campos em cards com background #0f172a */} - {/* Labels com ícones coloridos */} - {/* Badges "Opcional" quando necessário */} + {/* Conteúdo */}
{/* Footer sem borda */} @@ -203,71 +196,32 @@ sshpass -p 'Master9354' ssh -o StrictHostKeyChecking=no root@213.165.93.60 "mysq ``` -### Cores do Sistema -- **Background modal**: `#1e293b` -- **Background campos/cards**: `#0f172a` -- **Texto principal**: `text-white` -- **Texto secundário**: `text-slate-400` -- **Texto desabilitado**: `text-slate-500` +--- -### Labels com Ícones -```jsx - -``` +## 📝 Quando Atualizar Documentação -### Badge Opcional -```jsx - - {t('common.optional')} - -``` +### VERSION +- Após cada funcionalidade completa +- Formato: X.Y.Z (Major.Minor.Patch) -### Seleção Visual com Cards -Para seleções (categorias, ícones), usar cards clicáveis: -```jsx -
handleSelect(item)} - className="p-2 rounded text-center" - style={{ - background: isSelected ? 'rgba(59, 130, 246, 0.15)' : '#0f172a', - cursor: 'pointer', - border: isSelected ? '2px solid #3b82f6' : '2px solid transparent' - }} -> - - {label} -
-``` +### CHANGELOG.md +- Toda mudança significativa +- Formato: data, tipo, descrição -### Seção de Keywords/Tags -```jsx -
-
- - -
-
- {/* Tags com cor do item */} -
-
-``` +### README.md +- Nova funcionalidade importante +- Mudança de requisitos +- Novos endpoints de API +- Novos comandos -### Switch de Status -```jsx -
- - -
-``` +--- -## Documentação +## 🌐 URLs do Projeto -Consulte `.DIRETRIZES_DESENVOLVIMENTO_v5` para regras completas. +| Serviço | URL | +|---------|-----| +| WebMoney App | https://webmoney.cnxifly.com | +| WebMoney API | https://webmoney.cnxifly.com/api | +| Gitea | https://git.cnxifly.com | +| phpMyAdmin | https://pma.cnxifly.com | +| Webmail | https://mail.cnxifly.com | diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/ANALISE_CONTRATO_PRICE.md b/ANALISE_CONTRATO_PRICE.md old mode 100644 new mode 100755 diff --git a/ANALISE_CONTRATO_PRICE.txt b/ANALISE_CONTRATO_PRICE.txt old mode 100644 new mode 100755 diff --git a/ANALISE_PRECIFICACAO.md b/ANALISE_PRECIFICACAO.md old mode 100644 new mode 100755 diff --git a/APRENDIZADOS_TECNICOS.md b/APRENDIZADOS_TECNICOS.md old mode 100644 new mode 100755 diff --git a/CHANGELOG.md b/CHANGELOG.md old mode 100644 new mode 100755 diff --git a/CONFIGURACION_LOCAL.md b/CONFIGURACION_LOCAL.md old mode 100644 new mode 100755 diff --git a/CREDENCIAIS_SERVIDOR.md b/CREDENCIAIS_SERVIDOR.md old mode 100644 new mode 100755 diff --git a/DKIM_DNS_RECORD.txt b/DKIM_DNS_RECORD.txt old mode 100644 new mode 100755 diff --git a/ESPECIFICACIONES_WEBMONEY.md b/ESPECIFICACIONES_WEBMONEY.md old mode 100644 new mode 100755 diff --git a/ESTRUTURA_PROJETO.md b/ESTRUTURA_PROJETO.md old mode 100644 new mode 100755 diff --git a/IMPLEMENTACAO_ORCAMENTOS_SUBCATEGORIA.md b/IMPLEMENTACAO_ORCAMENTOS_SUBCATEGORIA.md old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/ROTEIRO_INSTALACAO_SERVIDOR.md b/ROTEIRO_INSTALACAO_SERVIDOR.md old mode 100644 new mode 100755 diff --git a/VERSION b/VERSION old mode 100644 new mode 100755 diff --git a/Wanna.xlsx b/Wanna.xlsx old mode 100644 new mode 100755 diff --git a/backend/.editorconfig b/backend/.editorconfig old mode 100644 new mode 100755 diff --git a/backend/.env.example b/backend/.env.example old mode 100644 new mode 100755 diff --git a/backend/.gitattributes b/backend/.gitattributes old mode 100644 new mode 100755 diff --git a/backend/.gitignore b/backend/.gitignore old mode 100644 new mode 100755 diff --git a/backend/README.md b/backend/README.md deleted file mode 100644 index 0165a77..0000000 --- a/backend/README.md +++ /dev/null @@ -1,59 +0,0 @@ -

Laravel Logo

- -

-Build Status -Total Downloads -Latest Stable Version -License -

- -## About Laravel - -Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as: - -- [Simple, fast routing engine](https://laravel.com/docs/routing). -- [Powerful dependency injection container](https://laravel.com/docs/container). -- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage. -- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent). -- Database agnostic [schema migrations](https://laravel.com/docs/migrations). -- [Robust background job processing](https://laravel.com/docs/queues). -- [Real-time event broadcasting](https://laravel.com/docs/broadcasting). - -Laravel is accessible, powerful, and provides tools required for large, robust applications. - -## Learning Laravel - -Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework. You can also check out [Laravel Learn](https://laravel.com/learn), where you will be guided through building a modern Laravel application. - -If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains thousands of video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library. - -## Laravel Sponsors - -We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the [Laravel Partners program](https://partners.laravel.com). - -### Premium Partners - -- **[Vehikl](https://vehikl.com)** -- **[Tighten Co.](https://tighten.co)** -- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)** -- **[64 Robots](https://64robots.com)** -- **[Curotec](https://www.curotec.com/services/technologies/laravel)** -- **[DevSquad](https://devsquad.com/hire-laravel-developers)** -- **[Redberry](https://redberry.international/laravel-development)** -- **[Active Logic](https://activelogic.com)** - -## Contributing - -Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions). - -## Code of Conduct - -In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct). - -## Security Vulnerabilities - -If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed. - -## License - -The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). diff --git a/backend/app/Console/Commands/FixBatchCategorization.php b/backend/app/Console/Commands/FixBatchCategorization.php old mode 100644 new mode 100755 diff --git a/backend/app/Console/Commands/GenerateDemoInstallments.php b/backend/app/Console/Commands/GenerateDemoInstallments.php old mode 100644 new mode 100755 diff --git a/backend/app/Console/Commands/PopulateDemoData.php b/backend/app/Console/Commands/PopulateDemoData.php old mode 100644 new mode 100755 diff --git a/backend/app/Console/Commands/SendDuePaymentsAlert.php b/backend/app/Console/Commands/SendDuePaymentsAlert.php old mode 100644 new mode 100755 diff --git a/backend/app/Console/Commands/SetupPayPalPlans.php b/backend/app/Console/Commands/SetupPayPalPlans.php old mode 100644 new mode 100755 diff --git a/backend/app/Http/Controllers/Api/AccountController.php b/backend/app/Http/Controllers/Api/AccountController.php old mode 100644 new mode 100755 diff --git a/backend/app/Http/Controllers/Api/AssetAccountController.php b/backend/app/Http/Controllers/Api/AssetAccountController.php old mode 100644 new mode 100755 diff --git a/backend/app/Http/Controllers/Api/AuthController.php b/backend/app/Http/Controllers/Api/AuthController.php old mode 100644 new mode 100755 diff --git a/backend/app/Http/Controllers/Api/BudgetController.php b/backend/app/Http/Controllers/Api/BudgetController.php old mode 100644 new mode 100755 diff --git a/backend/app/Http/Controllers/Api/BusinessSettingController.php b/backend/app/Http/Controllers/Api/BusinessSettingController.php old mode 100644 new mode 100755 diff --git a/backend/app/Http/Controllers/Api/CategoryController.php b/backend/app/Http/Controllers/Api/CategoryController.php old mode 100644 new mode 100755 diff --git a/backend/app/Http/Controllers/Api/CostCenterController.php b/backend/app/Http/Controllers/Api/CostCenterController.php old mode 100644 new mode 100755 diff --git a/backend/app/Http/Controllers/Api/DashboardController.php b/backend/app/Http/Controllers/Api/DashboardController.php old mode 100644 new mode 100755 diff --git a/backend/app/Http/Controllers/Api/EmailTestController.php b/backend/app/Http/Controllers/Api/EmailTestController.php old mode 100644 new mode 100755 diff --git a/backend/app/Http/Controllers/Api/FinancialGoalController.php b/backend/app/Http/Controllers/Api/FinancialGoalController.php old mode 100644 new mode 100755 diff --git a/backend/app/Http/Controllers/Api/FinancialHealthController.php b/backend/app/Http/Controllers/Api/FinancialHealthController.php old mode 100644 new mode 100755 diff --git a/backend/app/Http/Controllers/Api/ImportController.php b/backend/app/Http/Controllers/Api/ImportController.php old mode 100644 new mode 100755 diff --git a/backend/app/Http/Controllers/Api/LiabilityAccountController.php b/backend/app/Http/Controllers/Api/LiabilityAccountController.php old mode 100644 new mode 100755 diff --git a/backend/app/Http/Controllers/Api/PlanController.php b/backend/app/Http/Controllers/Api/PlanController.php old mode 100644 new mode 100755 diff --git a/backend/app/Http/Controllers/Api/ProductSheetController.php b/backend/app/Http/Controllers/Api/ProductSheetController.php old mode 100644 new mode 100755 diff --git a/backend/app/Http/Controllers/Api/PromotionalCampaignController.php b/backend/app/Http/Controllers/Api/PromotionalCampaignController.php old mode 100644 new mode 100755 diff --git a/backend/app/Http/Controllers/Api/RecurringTemplateController.php b/backend/app/Http/Controllers/Api/RecurringTemplateController.php old mode 100644 new mode 100755 diff --git a/backend/app/Http/Controllers/Api/ReportController.php b/backend/app/Http/Controllers/Api/ReportController.php old mode 100644 new mode 100755 diff --git a/backend/app/Http/Controllers/Api/ServiceSheetController.php b/backend/app/Http/Controllers/Api/ServiceSheetController.php old mode 100644 new mode 100755 diff --git a/backend/app/Http/Controllers/Api/SiteSettingsController.php b/backend/app/Http/Controllers/Api/SiteSettingsController.php old mode 100644 new mode 100755 diff --git a/backend/app/Http/Controllers/Api/SubscriptionController.php b/backend/app/Http/Controllers/Api/SubscriptionController.php old mode 100644 new mode 100755 diff --git a/backend/app/Http/Controllers/Api/TransactionController.php b/backend/app/Http/Controllers/Api/TransactionController.php old mode 100644 new mode 100755 diff --git a/backend/app/Http/Controllers/Api/TransferDetectionController.php b/backend/app/Http/Controllers/Api/TransferDetectionController.php old mode 100644 new mode 100755 diff --git a/backend/app/Http/Controllers/Api/UserManagementController.php b/backend/app/Http/Controllers/Api/UserManagementController.php old mode 100644 new mode 100755 diff --git a/backend/app/Http/Controllers/Api/UserPreferenceController.php b/backend/app/Http/Controllers/Api/UserPreferenceController.php old mode 100644 new mode 100755 diff --git a/backend/app/Http/Controllers/Controller.php b/backend/app/Http/Controllers/Controller.php old mode 100644 new mode 100755 diff --git a/backend/app/Http/Middleware/AdminOnly.php b/backend/app/Http/Middleware/AdminOnly.php old mode 100644 new mode 100755 diff --git a/backend/app/Http/Middleware/CheckPlanLimits.php b/backend/app/Http/Middleware/CheckPlanLimits.php old mode 100644 new mode 100755 diff --git a/backend/app/Http/Middleware/DemoProtection.php b/backend/app/Http/Middleware/DemoProtection.php old mode 100644 new mode 100755 diff --git a/backend/app/Http/Middleware/SecurityHeaders.php b/backend/app/Http/Middleware/SecurityHeaders.php old mode 100644 new mode 100755 diff --git a/backend/app/Mail/AccountActivationMail.php b/backend/app/Mail/AccountActivationMail.php old mode 100644 new mode 100755 diff --git a/backend/app/Mail/DuePaymentsAlert.php b/backend/app/Mail/DuePaymentsAlert.php old mode 100644 new mode 100755 diff --git a/backend/app/Mail/SubscriptionCancelledMail.php b/backend/app/Mail/SubscriptionCancelledMail.php old mode 100644 new mode 100755 diff --git a/backend/app/Mail/WelcomeEmail.php b/backend/app/Mail/WelcomeEmail.php old mode 100644 new mode 100755 diff --git a/backend/app/Mail/WelcomeNewUser.php b/backend/app/Mail/WelcomeNewUser.php old mode 100644 new mode 100755 diff --git a/backend/app/Models/Account.php b/backend/app/Models/Account.php old mode 100644 new mode 100755 diff --git a/backend/app/Models/AssetAccount.php b/backend/app/Models/AssetAccount.php old mode 100644 new mode 100755 diff --git a/backend/app/Models/Budget.php b/backend/app/Models/Budget.php old mode 100644 new mode 100755 diff --git a/backend/app/Models/BusinessSetting.php b/backend/app/Models/BusinessSetting.php old mode 100644 new mode 100755 diff --git a/backend/app/Models/Category.php b/backend/app/Models/Category.php old mode 100644 new mode 100755 diff --git a/backend/app/Models/CategoryKeyword.php b/backend/app/Models/CategoryKeyword.php old mode 100644 new mode 100755 diff --git a/backend/app/Models/CostCenter.php b/backend/app/Models/CostCenter.php old mode 100644 new mode 100755 diff --git a/backend/app/Models/CostCenterKeyword.php b/backend/app/Models/CostCenterKeyword.php old mode 100644 new mode 100755 diff --git a/backend/app/Models/EmailVerificationToken.php b/backend/app/Models/EmailVerificationToken.php old mode 100644 new mode 100755 diff --git a/backend/app/Models/FinancialGoal.php b/backend/app/Models/FinancialGoal.php old mode 100644 new mode 100755 diff --git a/backend/app/Models/GoalContribution.php b/backend/app/Models/GoalContribution.php old mode 100644 new mode 100755 diff --git a/backend/app/Models/ImportLog.php b/backend/app/Models/ImportLog.php old mode 100644 new mode 100755 diff --git a/backend/app/Models/ImportMapping.php b/backend/app/Models/ImportMapping.php old mode 100644 new mode 100755 diff --git a/backend/app/Models/Invoice.php b/backend/app/Models/Invoice.php old mode 100644 new mode 100755 diff --git a/backend/app/Models/LiabilityAccount.php b/backend/app/Models/LiabilityAccount.php old mode 100644 new mode 100755 diff --git a/backend/app/Models/LiabilityInstallment.php b/backend/app/Models/LiabilityInstallment.php old mode 100644 new mode 100755 diff --git a/backend/app/Models/Plan.php b/backend/app/Models/Plan.php old mode 100644 new mode 100755 diff --git a/backend/app/Models/ProductSheet.php b/backend/app/Models/ProductSheet.php old mode 100644 new mode 100755 diff --git a/backend/app/Models/ProductSheetItem.php b/backend/app/Models/ProductSheetItem.php old mode 100644 new mode 100755 diff --git a/backend/app/Models/ProductVariant.php b/backend/app/Models/ProductVariant.php old mode 100644 new mode 100755 diff --git a/backend/app/Models/PromotionalCampaign.php b/backend/app/Models/PromotionalCampaign.php old mode 100644 new mode 100755 diff --git a/backend/app/Models/RecurringInstance.php b/backend/app/Models/RecurringInstance.php old mode 100644 new mode 100755 diff --git a/backend/app/Models/RecurringTemplate.php b/backend/app/Models/RecurringTemplate.php old mode 100644 new mode 100755 diff --git a/backend/app/Models/ServiceSheet.php b/backend/app/Models/ServiceSheet.php old mode 100644 new mode 100755 diff --git a/backend/app/Models/ServiceSheetItem.php b/backend/app/Models/ServiceSheetItem.php old mode 100644 new mode 100755 diff --git a/backend/app/Models/SiteSetting.php b/backend/app/Models/SiteSetting.php old mode 100644 new mode 100755 diff --git a/backend/app/Models/Subscription.php b/backend/app/Models/Subscription.php old mode 100644 new mode 100755 diff --git a/backend/app/Models/Transaction.php b/backend/app/Models/Transaction.php old mode 100644 new mode 100755 diff --git a/backend/app/Models/User.php b/backend/app/Models/User.php old mode 100644 new mode 100755 diff --git a/backend/app/Models/UserPreference.php b/backend/app/Models/UserPreference.php old mode 100644 new mode 100755 diff --git a/backend/app/Policies/RecurringTemplatePolicy.php b/backend/app/Policies/RecurringTemplatePolicy.php old mode 100644 new mode 100755 diff --git a/backend/app/Providers/AppServiceProvider.php b/backend/app/Providers/AppServiceProvider.php old mode 100644 new mode 100755 diff --git a/backend/app/Services/Import/CsvParser.php b/backend/app/Services/Import/CsvParser.php old mode 100644 new mode 100755 diff --git a/backend/app/Services/Import/ExcelParser.php b/backend/app/Services/Import/ExcelParser.php old mode 100644 new mode 100755 diff --git a/backend/app/Services/Import/FileParserInterface.php b/backend/app/Services/Import/FileParserInterface.php old mode 100644 new mode 100755 diff --git a/backend/app/Services/Import/ImportService.php b/backend/app/Services/Import/ImportService.php old mode 100644 new mode 100755 diff --git a/backend/app/Services/Import/OfxParser.php b/backend/app/Services/Import/OfxParser.php old mode 100644 new mode 100755 diff --git a/backend/app/Services/Import/PdfParser.php b/backend/app/Services/Import/PdfParser.php old mode 100644 new mode 100755 diff --git a/backend/app/Services/LiabilityTemplateService.php b/backend/app/Services/LiabilityTemplateService.php old mode 100644 new mode 100755 diff --git a/backend/app/Services/PayPalService.php b/backend/app/Services/PayPalService.php old mode 100644 new mode 100755 diff --git a/backend/app/Services/RecurringService.php b/backend/app/Services/RecurringService.php old mode 100644 new mode 100755 diff --git a/backend/app/Services/UserSetupService.php b/backend/app/Services/UserSetupService.php old mode 100644 new mode 100755 diff --git a/backend/artisan b/backend/artisan old mode 100644 new mode 100755 diff --git a/backend/bootstrap/app.php b/backend/bootstrap/app.php old mode 100644 new mode 100755 diff --git a/backend/bootstrap/cache/.gitignore b/backend/bootstrap/cache/.gitignore old mode 100644 new mode 100755 diff --git a/backend/bootstrap/providers.php b/backend/bootstrap/providers.php old mode 100644 new mode 100755 diff --git a/backend/composer.json b/backend/composer.json old mode 100644 new mode 100755 diff --git a/backend/composer.lock b/backend/composer.lock old mode 100644 new mode 100755 diff --git a/backend/config/app.php b/backend/config/app.php old mode 100644 new mode 100755 diff --git a/backend/config/auth.php b/backend/config/auth.php old mode 100644 new mode 100755 diff --git a/backend/config/cache.php b/backend/config/cache.php old mode 100644 new mode 100755 diff --git a/backend/config/cors.php b/backend/config/cors.php old mode 100644 new mode 100755 diff --git a/backend/config/database.php b/backend/config/database.php old mode 100644 new mode 100755 diff --git a/backend/config/filesystems.php b/backend/config/filesystems.php old mode 100644 new mode 100755 diff --git a/backend/config/logging.php b/backend/config/logging.php old mode 100644 new mode 100755 diff --git a/backend/config/mail.php b/backend/config/mail.php old mode 100644 new mode 100755 diff --git a/backend/config/queue.php b/backend/config/queue.php old mode 100644 new mode 100755 diff --git a/backend/config/sanctum.php b/backend/config/sanctum.php old mode 100644 new mode 100755 diff --git a/backend/config/services.php b/backend/config/services.php old mode 100644 new mode 100755 diff --git a/backend/config/session.php b/backend/config/session.php old mode 100644 new mode 100755 diff --git a/backend/database/.gitignore b/backend/database/.gitignore old mode 100644 new mode 100755 diff --git a/backend/database/factories/UserFactory.php b/backend/database/factories/UserFactory.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/0001_01_01_000000_create_users_table.php b/backend/database/migrations/0001_01_01_000000_create_users_table.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/0001_01_01_000001_create_cache_table.php b/backend/database/migrations/0001_01_01_000001_create_cache_table.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/0001_01_01_000002_create_jobs_table.php b/backend/database/migrations/0001_01_01_000002_create_jobs_table.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_01_15_000001_create_site_settings_table.php b/backend/database/migrations/2025_01_15_000001_create_site_settings_table.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_06_18_120000_add_contract_type_to_liability_accounts_table.php b/backend/database/migrations/2025_06_18_120000_add_contract_type_to_liability_accounts_table.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_06_18_170000_add_advanced_fields_to_liability_accounts_table.php b/backend/database/migrations/2025_06_18_170000_add_advanced_fields_to_liability_accounts_table.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_07_195622_create_personal_access_tokens_table.php b/backend/database/migrations/2025_12_07_195622_create_personal_access_tokens_table.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_08_000001_create_accounts_table.php b/backend/database/migrations/2025_12_08_000001_create_accounts_table.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_08_000002_create_cost_centers_table.php b/backend/database/migrations/2025_12_08_000002_create_cost_centers_table.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_08_000003_create_categories_table.php b/backend/database/migrations/2025_12_08_000003_create_categories_table.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_08_100534_add_is_system_to_cost_centers_table.php b/backend/database/migrations/2025_12_08_100534_add_is_system_to_cost_centers_table.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_08_102524_add_is_admin_to_users_table.php b/backend/database/migrations/2025_12_08_102524_add_is_admin_to_users_table.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_08_170001_add_transfer_and_split_fields_to_transactions.php b/backend/database/migrations/2025_12_08_170001_add_transfer_and_split_fields_to_transactions.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_08_181427_add_transfer_fields_to_transactions_table.php b/backend/database/migrations/2025_12_08_181427_add_transfer_fields_to_transactions_table.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_08_200001_create_liability_accounts_table.php b/backend/database/migrations/2025_12_08_200001_create_liability_accounts_table.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_08_200002_create_liability_installments_table.php b/backend/database/migrations/2025_12_08_200002_create_liability_installments_table.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_08_210001_create_transactions_table.php b/backend/database/migrations/2025_12_08_210001_create_transactions_table.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_08_230001_add_duplicate_ignored_with_to_transactions.php b/backend/database/migrations/2025_12_08_230001_add_duplicate_ignored_with_to_transactions.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_09_100001_create_import_mappings_table.php b/backend/database/migrations/2025_12_09_100001_create_import_mappings_table.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_09_150001_add_import_hash_to_transactions_table.php b/backend/database/migrations/2025_12_09_150001_add_import_hash_to_transactions_table.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_09_160001_remove_balance_after_from_transactions_table.php b/backend/database/migrations/2025_12_09_160001_remove_balance_after_from_transactions_table.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_10_000001_optimize_database_for_scalability.php b/backend/database/migrations/2025_12_10_000001_optimize_database_for_scalability.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_10_100001_create_recurring_templates_table.php b/backend/database/migrations/2025_12_10_100001_create_recurring_templates_table.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_10_100002_create_recurring_instances_table.php b/backend/database/migrations/2025_12_10_100002_create_recurring_instances_table.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_11_100001_add_refund_fields_to_transactions.php b/backend/database/migrations/2025_12_11_100001_add_refund_fields_to_transactions.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_14_000001_create_business_settings_table.php b/backend/database/migrations/2025_12_14_000001_create_business_settings_table.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_14_000002_create_product_sheets_table.php b/backend/database/migrations/2025_12_14_000002_create_product_sheets_table.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_14_000003_create_product_sheet_items_table.php b/backend/database/migrations/2025_12_14_000003_create_product_sheet_items_table.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_14_100001_add_strategic_pricing_to_product_sheets.php b/backend/database/migrations/2025_12_14_100001_add_strategic_pricing_to_product_sheets.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_14_100002_create_promotional_campaigns_table.php b/backend/database/migrations/2025_12_14_100002_create_promotional_campaigns_table.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_14_100003_add_profitability_protection_to_campaigns.php b/backend/database/migrations/2025_12_14_100003_add_profitability_protection_to_campaigns.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_14_110001_add_price_includes_tax_to_business_settings.php b/backend/database/migrations/2025_12_14_110001_add_price_includes_tax_to_business_settings.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_14_120001_add_service_pricing_to_business_settings.php b/backend/database/migrations/2025_12_14_120001_add_service_pricing_to_business_settings.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_14_120002_create_service_sheets_tables.php b/backend/database/migrations/2025_12_14_120002_create_service_sheets_tables.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_14_130001_change_hours_per_day_to_hours_per_week.php b/backend/database/migrations/2025_12_14_130001_change_hours_per_day_to_hours_per_week.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_14_140001_create_product_variants_table.php b/backend/database/migrations/2025_12_14_140001_create_product_variants_table.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_14_161644_create_financial_goals_table.php b/backend/database/migrations/2025_12_14_161644_create_financial_goals_table.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_14_161655_create_budgets_table.php b/backend/database/migrations/2025_12_14_161655_create_budgets_table.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_16_211102_add_subcategory_to_budgets_table.php b/backend/database/migrations/2025_12_16_211102_add_subcategory_to_budgets_table.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_16_224751_add_is_cumulative_to_budgets_table.php b/backend/database/migrations/2025_12_16_224751_add_is_cumulative_to_budgets_table.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_17_000001_add_cost_center_and_update_periods_to_budgets.php b/backend/database/migrations/2025_12_17_000001_add_cost_center_and_update_periods_to_budgets.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_17_103338_add_profile_fields_to_users_table.php b/backend/database/migrations/2025_12_17_103338_add_profile_fields_to_users_table.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_17_114500_create_plans_table.php b/backend/database/migrations/2025_12_17_114500_create_plans_table.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_17_114501_create_subscriptions_table.php b/backend/database/migrations/2025_12_17_114501_create_subscriptions_table.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_17_114502_create_invoices_table.php b/backend/database/migrations/2025_12_17_114502_create_invoices_table.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_17_155312_add_language_currency_to_users_table.php b/backend/database/migrations/2025_12_17_155312_add_language_currency_to_users_table.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_17_200001_create_user_preferences_table.php b/backend/database/migrations/2025_12_17_200001_create_user_preferences_table.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_17_230000_create_email_verification_tokens_table.php b/backend/database/migrations/2025_12_17_230000_create_email_verification_tokens_table.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_17_232000_add_pending_status_to_subscriptions.php b/backend/database/migrations/2025_12_17_232000_add_pending_status_to_subscriptions.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_18_160430_add_is_demo_to_users_table.php b/backend/database/migrations/2025_12_18_160430_add_is_demo_to_users_table.php old mode 100644 new mode 100755 diff --git a/backend/database/migrations/2025_12_18_170000_create_asset_accounts_table.php b/backend/database/migrations/2025_12_18_170000_create_asset_accounts_table.php old mode 100644 new mode 100755 diff --git a/backend/database/seeders/BusinessExampleSeeder.php b/backend/database/seeders/BusinessExampleSeeder.php old mode 100644 new mode 100755 diff --git a/backend/database/seeders/BusinessSeeder.php b/backend/database/seeders/BusinessSeeder.php old mode 100644 new mode 100755 diff --git a/backend/database/seeders/CategoriesOnlySeeder.php b/backend/database/seeders/CategoriesOnlySeeder.php old mode 100644 new mode 100755 diff --git a/backend/database/seeders/CategoriesSeeder.php b/backend/database/seeders/CategoriesSeeder.php old mode 100644 new mode 100755 diff --git a/backend/database/seeders/DatabaseSeeder.php b/backend/database/seeders/DatabaseSeeder.php old mode 100644 new mode 100755 diff --git a/backend/database/seeders/DemoUserSeeder.php b/backend/database/seeders/DemoUserSeeder.php old mode 100644 new mode 100755 diff --git a/backend/database/seeders/MadridCategoriesSeeder.php b/backend/database/seeders/MadridCategoriesSeeder.php old mode 100644 new mode 100755 diff --git a/backend/database/seeders/PlansSeeder.php b/backend/database/seeders/PlansSeeder.php old mode 100644 new mode 100755 diff --git a/backend/deploy.ps1 b/backend/deploy.ps1 deleted file mode 100644 index 382676b..0000000 --- a/backend/deploy.ps1 +++ /dev/null @@ -1,86 +0,0 @@ -# ============================================================================= -# WEBMoney Backend - Script de Deploy para Windows -# ============================================================================= -# Este script sincroniza e deploya o backend Laravel para o servidor -# Uso: .\deploy.ps1 -# Requer: PuTTY (pscp, plink) instalados no PATH -# ============================================================================= - -$ErrorActionPreference = "Stop" - -# Configuracoes -$SERVER_USER = "root" -$SERVER_HOST = "213.165.93.60" -$SERVER_PASS = "Master9354" -$SERVER_PATH = "/var/www/webmoney/backend" -$LOCAL_PATH = $PSScriptRoot - -# Cores -function Write-Color { - param([string]$Text, [string]$Color = "White") - Write-Host $Text -ForegroundColor $Color -} - -Write-Host "" -Write-Color "========================================" "Cyan" -Write-Color " WEBMoney Backend - Deploy Script " "Cyan" -Write-Color "========================================" "Cyan" -Write-Host "" - -# 1. Sincronizar pastas principais -Write-Color "[1/5] Enviando pastas do backend..." "Yellow" - -$folders = @("app", "bootstrap", "config", "database", "public", "resources", "routes") - -foreach ($folder in $folders) { - if (Test-Path "$LOCAL_PATH\$folder") { - Write-Host " -> $folder" - pscp -r -batch -pw $SERVER_PASS "$LOCAL_PATH\$folder" "${SERVER_USER}@${SERVER_HOST}:${SERVER_PATH}/" - } -} - -Write-Color "Pastas enviadas" "Green" -Write-Host "" - -# 2. Enviar arquivos principais -Write-Color "[2/5] Enviando arquivos..." "Yellow" - -$files = @("artisan", "composer.json", "composer.lock") - -foreach ($file in $files) { - if (Test-Path "$LOCAL_PATH\$file") { - Write-Host " -> $file" - pscp -batch -pw $SERVER_PASS "$LOCAL_PATH\$file" "${SERVER_USER}@${SERVER_HOST}:${SERVER_PATH}/" - } -} - -Write-Color "Arquivos enviados" "Green" -Write-Host "" - -# 3. Instalar dependencias e configurar -Write-Color "[3/5] Instalando dependencias no servidor..." "Yellow" -plink -batch -pw $SERVER_PASS "$SERVER_USER@$SERVER_HOST" "cd $SERVER_PATH; composer install --no-dev --optimize-autoloader 2>&1 | tail -5" - -Write-Color "Dependencias instaladas" "Green" -Write-Host "" - -# 4. Migracoes e otimizacoes -Write-Color "[4/5] Executando migracoes e otimizacoes..." "Yellow" -plink -batch -pw $SERVER_PASS "$SERVER_USER@$SERVER_HOST" "cd $SERVER_PATH; php artisan migrate --force; php artisan optimize:clear; php artisan config:cache; php artisan route:cache; php artisan view:cache" - -Write-Color "Migracoes e caches OK" "Green" -Write-Host "" - -# 5. Permissoes e reiniciar PHP-FPM (CRITICO para evitar cache de opcodes) -Write-Color "[5/5] Ajustando permissoes e reiniciando PHP-FPM..." "Yellow" -plink -batch -pw $SERVER_PASS "$SERVER_USER@$SERVER_HOST" "chown -R www-data:www-data $SERVER_PATH/storage $SERVER_PATH/bootstrap/cache; chmod -R 775 $SERVER_PATH/storage $SERVER_PATH/bootstrap/cache; systemctl restart php8.4-fpm" - -Write-Color "Permissoes e PHP-FPM OK" "Green" -Write-Host "" - -Write-Color "========================================" "Green" -Write-Color " Deploy concluido com sucesso! " "Green" -Write-Color "========================================" "Green" -Write-Host "" -Write-Host "API disponivel em: https://webmoney.cnxifly.com/api" -Write-Host "" diff --git a/backend/deploy.sh b/backend/deploy.sh deleted file mode 100755 index 2a8a1b7..0000000 --- a/backend/deploy.sh +++ /dev/null @@ -1,118 +0,0 @@ -#!/bin/bash - -############################################################################### -# SCRIPT DE DEPLOY - WEBMoney Backend Laravel -# Servidor: 213.165.93.60 -# Domínio: https://webmoney.cnxifly.com -# Repositório: https://git.cnxifly.com/marco/webmoney -# Versão: 1.1.0 -############################################################################### - -set -e # Exit on error - -# Colors para output -RED='\033[0;31m' -GREEN='\033[0;32m' -YELLOW='\033[1;33m' -BLUE='\033[0;34m' -NC='\033[0m' # No Color - -# Configurações -SERVER_USER="root" -SERVER_HOST="213.165.93.60" -SERVER_PASSWORD="Master9354" -SERVER_PATH="/var/www/webmoney/backend" -LOCAL_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -PROJECT_ROOT="$(dirname "$LOCAL_PATH")" - -echo -e "${GREEN}╔═══════════════════════════════════════════════════════╗${NC}" -echo -e "${GREEN}║ WEBMoney Laravel - Deploy para Produção ║${NC}" -echo -e "${GREEN}╚═══════════════════════════════════════════════════════╝${NC}" -echo "" - -# Função para executar comandos no servidor remoto -remote_exec() { - sshpass -p "$SERVER_PASSWORD" ssh -o StrictHostKeyChecking=no "$SERVER_USER@$SERVER_HOST" "$1" -} - -# 1. Build local (se necessário) -echo -e "${YELLOW}[1/8]${NC} Verificando dependências locais..." -if [ ! -d "$LOCAL_PATH/vendor" ]; then - echo "Instalando dependências do Composer..." - composer install --no-dev --optimize-autoloader -fi - -# 2. Sync arquivos via rsync -echo -e "${YELLOW}[2/8]${NC} Sincronizando arquivos para o servidor..." -sshpass -p "$SERVER_PASSWORD" rsync -avz --delete \ - --exclude='.git' \ - --exclude='node_modules' \ - --exclude='storage/logs/*' \ - --exclude='storage/framework/cache/*' \ - --exclude='storage/framework/sessions/*' \ - --exclude='storage/framework/views/*' \ - --exclude='.env' \ - --exclude='database/database.sqlite' \ - "$LOCAL_PATH/" "$SERVER_USER@$SERVER_HOST:$SERVER_PATH/" - -echo -e "${GREEN}✓${NC} Arquivos sincronizados" - -# 3. Copiar .env de produção -echo -e "${YELLOW}[3/8]${NC} Configurando .env de produção..." -sshpass -p "$SERVER_PASSWORD" ssh -o StrictHostKeyChecking=no "$SERVER_USER@$SERVER_HOST" \ - "cp $SERVER_PATH/.env.production $SERVER_PATH/.env" -echo -e "${GREEN}✓${NC} .env configurado" - -# 4. Instalar dependências no servidor -echo -e "${YELLOW}[4/8]${NC} Instalando dependências no servidor..." -remote_exec "cd $SERVER_PATH && composer install --no-dev --optimize-autoloader" -echo -e "${GREEN}✓${NC} Dependências instaladas" - -# 5. Ajustar permissões -echo -e "${YELLOW}[5/8]${NC} Ajustando permissões..." -remote_exec "chown -R www-data:www-data $SERVER_PATH/storage $SERVER_PATH/bootstrap/cache" -remote_exec "chmod -R 775 $SERVER_PATH/storage $SERVER_PATH/bootstrap/cache" -echo -e "${GREEN}✓${NC} Permissões ajustadas" - -# 6. Executar migrações -echo -e "${YELLOW}[6/8]${NC} Executando migrações de banco de dados..." -remote_exec "cd $SERVER_PATH && php artisan migrate --force" -echo -e "${GREEN}✓${NC} Migrações executadas" - -# 7. Cache e otimizações -echo -e "${YELLOW}[7/8]${NC} Otimizando aplicação..." -remote_exec "cd $SERVER_PATH && php artisan config:cache" -remote_exec "cd $SERVER_PATH && php artisan route:cache" -remote_exec "cd $SERVER_PATH && php artisan view:cache" -echo -e "${GREEN}✓${NC} Caches gerados" - -# 8. Reload PHP-FPM -echo -e "${YELLOW}[8/8]${NC} Recarregando PHP-FPM..." -remote_exec "systemctl reload php8.4-fpm" -echo -e "${GREEN}✓${NC} PHP-FPM recarregado" - -echo "" -echo -e "${GREEN}╔═══════════════════════════════════════════════════════╗${NC}" -echo -e "${GREEN}║ ✓ DEPLOY CONCLUÍDO COM SUCESSO! ║${NC}" -echo -e "${GREEN}╚═══════════════════════════════════════════════════════╝${NC}" -echo "" -echo -e "URL: ${GREEN}https://webmoney.cnxifly.com${NC}" -echo -e "API: ${GREEN}https://webmoney.cnxifly.com/api${NC}" -echo "" -echo -e "${YELLOW}Endpoints disponíveis:${NC}" -echo -e " POST /api/register - Registrar usuário" -echo -e " POST /api/login - Login" -echo -e " POST /api/logout - Logout (auth)" -echo -e " GET /api/me - Dados do usuário (auth)" -echo "" - -# Lembrete de commit -echo -e "${BLUE}═══════════════════════════════════════════════════════${NC}" -echo -e "${YELLOW}📝 Não esqueça de fazer commit das alterações:${NC}" -echo -e "" -echo -e " cd $PROJECT_ROOT" -echo -e " git add -A && git commit -m \"deploy: backend\" && git push gitea main" -echo -e "" -echo -e "${BLUE} Repositório: ${NC}https://git.cnxifly.com/marco/webmoney" -echo -e "${BLUE}═══════════════════════════════════════════════════════${NC}" -echo "" diff --git a/backend/package.json b/backend/package.json old mode 100644 new mode 100755 diff --git a/backend/phpunit.xml b/backend/phpunit.xml old mode 100644 new mode 100755 diff --git a/backend/public/.htaccess b/backend/public/.htaccess old mode 100644 new mode 100755 diff --git a/backend/public/favicon.ico b/backend/public/favicon.ico old mode 100644 new mode 100755 diff --git a/backend/public/index.php b/backend/public/index.php old mode 100644 new mode 100755 diff --git a/backend/public/robots.txt b/backend/public/robots.txt old mode 100644 new mode 100755 diff --git a/backend/resources/css/app.css b/backend/resources/css/app.css old mode 100644 new mode 100755 diff --git a/backend/resources/js/app.js b/backend/resources/js/app.js old mode 100644 new mode 100755 diff --git a/backend/resources/js/bootstrap.js b/backend/resources/js/bootstrap.js old mode 100644 new mode 100755 diff --git a/backend/resources/views/emails/account-activation.blade.php b/backend/resources/views/emails/account-activation.blade.php old mode 100644 new mode 100755 diff --git a/backend/resources/views/emails/due-payments-alert-text.blade.php b/backend/resources/views/emails/due-payments-alert-text.blade.php old mode 100644 new mode 100755 diff --git a/backend/resources/views/emails/due-payments-alert.blade.php b/backend/resources/views/emails/due-payments-alert.blade.php old mode 100644 new mode 100755 diff --git a/backend/resources/views/emails/layouts/base.blade.php b/backend/resources/views/emails/layouts/base.blade.php old mode 100644 new mode 100755 diff --git a/backend/resources/views/emails/subscription-cancelled-text.blade.php b/backend/resources/views/emails/subscription-cancelled-text.blade.php old mode 100644 new mode 100755 diff --git a/backend/resources/views/emails/subscription-cancelled.blade.php b/backend/resources/views/emails/subscription-cancelled.blade.php old mode 100644 new mode 100755 diff --git a/backend/resources/views/emails/welcome-new-user-text.blade.php b/backend/resources/views/emails/welcome-new-user-text.blade.php old mode 100644 new mode 100755 diff --git a/backend/resources/views/emails/welcome-new-user.blade.php b/backend/resources/views/emails/welcome-new-user.blade.php old mode 100644 new mode 100755 diff --git a/backend/resources/views/emails/welcome-text.blade.php b/backend/resources/views/emails/welcome-text.blade.php old mode 100644 new mode 100755 diff --git a/backend/resources/views/emails/welcome.blade.php b/backend/resources/views/emails/welcome.blade.php old mode 100644 new mode 100755 diff --git a/backend/resources/views/welcome.blade.php b/backend/resources/views/welcome.blade.php old mode 100644 new mode 100755 diff --git a/backend/routes/api.php b/backend/routes/api.php old mode 100644 new mode 100755 diff --git a/backend/routes/console.php b/backend/routes/console.php old mode 100644 new mode 100755 diff --git a/backend/routes/web.php b/backend/routes/web.php old mode 100644 new mode 100755 diff --git a/backend/storage/app/.gitignore b/backend/storage/app/.gitignore old mode 100644 new mode 100755 diff --git a/backend/storage/app/private/.gitignore b/backend/storage/app/private/.gitignore old mode 100644 new mode 100755 diff --git a/backend/storage/app/public/.gitignore b/backend/storage/app/public/.gitignore old mode 100644 new mode 100755 diff --git a/backend/storage/framework/.gitignore b/backend/storage/framework/.gitignore old mode 100644 new mode 100755 diff --git a/backend/storage/framework/cache/.gitignore b/backend/storage/framework/cache/.gitignore old mode 100644 new mode 100755 diff --git a/backend/storage/framework/cache/data/.gitignore b/backend/storage/framework/cache/data/.gitignore old mode 100644 new mode 100755 diff --git a/backend/storage/framework/sessions/.gitignore b/backend/storage/framework/sessions/.gitignore old mode 100644 new mode 100755 diff --git a/backend/storage/framework/testing/.gitignore b/backend/storage/framework/testing/.gitignore old mode 100644 new mode 100755 diff --git a/backend/storage/framework/views/.gitignore b/backend/storage/framework/views/.gitignore old mode 100644 new mode 100755 diff --git a/backend/storage/logs/.gitignore b/backend/storage/logs/.gitignore old mode 100644 new mode 100755 diff --git a/backend/tests/Feature/ExampleTest.php b/backend/tests/Feature/ExampleTest.php old mode 100644 new mode 100755 diff --git a/backend/tests/TestCase.php b/backend/tests/TestCase.php old mode 100644 new mode 100755 diff --git a/backend/tests/Unit/ExampleTest.php b/backend/tests/Unit/ExampleTest.php old mode 100644 new mode 100755 diff --git a/backend/vite.config.js b/backend/vite.config.js old mode 100644 new mode 100755 diff --git a/cats_main.sql b/cats_main.sql old mode 100644 new mode 100755 diff --git a/deploy-landing.sh b/deploy-landing.sh deleted file mode 100755 index 4c45bbc..0000000 --- a/deploy-landing.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash - -# Deploy landing page to cnxifly.com -# Usage: ./deploy-landing.sh [live|maintenance] - -MODE=${1:-live} -SERVER="root@213.165.93.60" -PASSWORD="Master9354" -DEST="/var/www/cnxifly" - -echo "🚀 Deploying cnxifly.com landing page in mode: $MODE" - -if [ "$MODE" = "live" ]; then - SOURCE="landing/index.html" -elif [ "$MODE" = "maintenance" ]; then - SOURCE="landing/maintenance.html" -else - echo "❌ Invalid mode. Use: live or maintenance" - exit 1 -fi - -# Check if source file exists -if [ ! -f "$SOURCE" ]; then - echo "❌ Source file not found: $SOURCE" - exit 1 -fi - -echo "📁 Copying $SOURCE to server..." - -# Deploy the file -sshpass -p "$PASSWORD" scp -o StrictHostKeyChecking=no "$SOURCE" "$SERVER:$DEST/index.html" - -if [ $? -eq 0 ]; then - echo "✅ Landing page deployed successfully!" - echo "🌐 Visit: https://cnxifly.com" -else - echo "❌ Deploy failed!" - exit 1 -fi diff --git a/deploy.ps1 b/deploy.ps1 deleted file mode 100644 index df4d91b..0000000 --- a/deploy.ps1 +++ /dev/null @@ -1,219 +0,0 @@ -# ============================================================================= -# WEBMoney - Script de Deploy Unificado -# ============================================================================= -# Este script faz deploy do frontend, backend ou ambos para o servidor -# -# Uso: -# .\deploy.ps1 # Deploy de ambos (frontend + backend) -# .\deploy.ps1 -Target frontend # Apenas frontend -# .\deploy.ps1 -Target backend # Apenas backend -# .\deploy.ps1 -Target both # Ambos (padrao) -# -# Requer: Node.js, npm, PuTTY (pscp, plink) instalados no PATH -# ============================================================================= - -param( - [ValidateSet('frontend', 'backend', 'both')] - [string]$Target = 'both' -) - -$ErrorActionPreference = "Stop" - -# Configuracoes -$SERVER_USER = "root" -$SERVER_HOST = "213.165.93.60" -$SERVER_PASS = "Master9354" -$PROJECT_ROOT = $PSScriptRoot - -# Paths -$FRONTEND_LOCAL = "$PROJECT_ROOT\frontend" -$FRONTEND_DIST = "$FRONTEND_LOCAL\dist" -$FRONTEND_REMOTE = "/var/www/webmoney/frontend/dist" - -$BACKEND_LOCAL = "$PROJECT_ROOT\backend" -$BACKEND_REMOTE = "/var/www/webmoney/backend" - -# Cores -function Write-Color { - param([string]$Text, [string]$Color = "White") - Write-Host $Text -ForegroundColor $Color -} - -function Write-Header { - param([string]$Text) - Write-Host "" - Write-Color "========================================" "Cyan" - Write-Color " $Text" "Cyan" - Write-Color "========================================" "Cyan" - Write-Host "" -} - -function Write-Step { - param([string]$Step, [string]$Text) - Write-Color "[$Step] $Text" "Yellow" -} - -function Write-OK { - param([string]$Text) - Write-Color "[OK] $Text" "Green" -} - -function Write-Fail { - param([string]$Text) - Write-Color "[ERRO] $Text" "Red" -} - -# ============================================================================= -# DEPLOY FRONTEND -# ============================================================================= -function Deploy-Frontend { - Write-Header "DEPLOY FRONTEND" - - # 1. Build - Write-Step "1/4" "Fazendo build do frontend..." - Set-Location $FRONTEND_LOCAL - - if (Test-Path $FRONTEND_DIST) { - Remove-Item -Recurse -Force $FRONTEND_DIST - } - - npm run build - - if (-not (Test-Path $FRONTEND_DIST)) { - Write-Fail "Build falhou - pasta dist nao encontrada" - exit 1 - } - Write-OK "Build concluido" - Write-Host "" - - # 2. Limpar diretorio remoto - Write-Step "2/4" "Limpando diretorio remoto..." - plink -batch -pw $SERVER_PASS "$SERVER_USER@$SERVER_HOST" "rm -rf $FRONTEND_REMOTE/*" - Write-OK "Diretorio limpo" - Write-Host "" - - # 3. Enviar arquivos - Write-Step "3/4" "Enviando arquivos..." - pscp -r -batch -pw $SERVER_PASS "$FRONTEND_DIST\*" "${SERVER_USER}@${SERVER_HOST}:${FRONTEND_REMOTE}/" - Write-OK "Arquivos enviados" - Write-Host "" - - # 4. Verificar - Write-Step "4/4" "Verificando deploy..." - $result = plink -batch -pw $SERVER_PASS "$SERVER_USER@$SERVER_HOST" "ls $FRONTEND_REMOTE/index.html 2>/dev/null" - - if (-not $result) { - Write-Fail "index.html nao encontrado" - exit 1 - } - Write-OK "Frontend deployado com sucesso" - Write-Host "" - - Set-Location $PROJECT_ROOT -} - -# ============================================================================= -# DEPLOY BACKEND -# ============================================================================= -function Deploy-Backend { - Write-Header "DEPLOY BACKEND" - - # 1. Enviar pastas - Write-Step "1/5" "Enviando pastas do backend..." - $folders = @("app", "bootstrap", "config", "database", "public", "resources", "routes") - - foreach ($folder in $folders) { - $folderPath = "$BACKEND_LOCAL\$folder" - if (Test-Path $folderPath) { - Write-Host " -> $folder" - pscp -r -batch -pw $SERVER_PASS "$folderPath" "${SERVER_USER}@${SERVER_HOST}:${BACKEND_REMOTE}/" - } - } - Write-OK "Pastas enviadas" - Write-Host "" - - # 2. Enviar arquivos - Write-Step "2/5" "Enviando arquivos..." - $files = @("artisan", "composer.json", "composer.lock") - - foreach ($file in $files) { - $filePath = "$BACKEND_LOCAL\$file" - if (Test-Path $filePath) { - Write-Host " -> $file" - pscp -batch -pw $SERVER_PASS "$filePath" "${SERVER_USER}@${SERVER_HOST}:${BACKEND_REMOTE}/" - } - } - Write-OK "Arquivos enviados" - Write-Host "" - - # 3. Composer install - Write-Step "3/5" "Instalando dependencias..." - plink -batch -pw $SERVER_PASS "$SERVER_USER@$SERVER_HOST" "cd $BACKEND_REMOTE && composer install --no-dev --optimize-autoloader 2>&1 | tail -3" - Write-OK "Dependencias instaladas" - Write-Host "" - - # 4. Migracoes e cache - Write-Step "4/5" "Executando migracoes e otimizacoes..." - plink -batch -pw $SERVER_PASS "$SERVER_USER@$SERVER_HOST" "cd $BACKEND_REMOTE && php artisan migrate --force && php artisan optimize:clear && php artisan config:cache && php artisan route:cache && php artisan view:cache" - Write-OK "Migracoes e caches OK" - Write-Host "" - - # 5. Permissoes e PHP-FPM - Write-Step "5/5" "Ajustando permissoes e reiniciando PHP-FPM..." - plink -batch -pw $SERVER_PASS "$SERVER_USER@$SERVER_HOST" "chown -R www-data:www-data $BACKEND_REMOTE/storage $BACKEND_REMOTE/bootstrap/cache && chmod -R 775 $BACKEND_REMOTE/storage $BACKEND_REMOTE/bootstrap/cache && systemctl restart php8.4-fpm" - Write-OK "Backend deployado com sucesso" - Write-Host "" -} - -# ============================================================================= -# REINICIAR NGINX (sempre ao final) -# ============================================================================= -function Restart-Nginx { - Write-Step "FINAL" "Reiniciando Nginx para limpar cache..." - plink -batch -pw $SERVER_PASS "$SERVER_USER@$SERVER_HOST" "systemctl restart nginx" - Write-OK "Nginx reiniciado" - Write-Host "" -} - -# ============================================================================= -# MAIN -# ============================================================================= -Write-Host "" -Write-Color "========================================" "Magenta" -Write-Color " WEBMoney - Deploy Unificado " "Magenta" -Write-Color " Target: $Target " "Magenta" -Write-Color "========================================" "Magenta" -Write-Host "" - -$startTime = Get-Date - -# Executar deploy conforme target -switch ($Target) { - 'frontend' { - Deploy-Frontend - } - 'backend' { - Deploy-Backend - } - 'both' { - Deploy-Backend - Deploy-Frontend - } -} - -# Sempre reiniciar Nginx ao final -Restart-Nginx - -$endTime = Get-Date -$duration = $endTime - $startTime - -Write-Color "========================================" "Green" -Write-Color " DEPLOY CONCLUIDO COM SUCESSO! " "Green" -Write-Color "========================================" "Green" -Write-Host "" -Write-Host " Target: $Target" -Write-Host " Duracao: $($duration.TotalSeconds.ToString('F1')) segundos" -Write-Host " URL: https://webmoney.cnxifly.com" -Write-Host "" -Write-Host " Dica: Use Ctrl+Shift+R no navegador para limpar cache local" -Write-Host "" diff --git a/deploy_budgets_subcategory.sh b/deploy_budgets_subcategory.sh deleted file mode 100644 index 5747a62..0000000 --- a/deploy_budgets_subcategory.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -# Deploy de mudanças de orçamentos com subcategorias - -SERVER="root@213.165.93.60" -PASS="Master9354" - -echo "📦 Enviando arquivos..." - -# Enviar migration -sshpass -p "$PASS" scp -o StrictHostKeyChecking=no \ - /workspaces/webmoney/backend/database/migrations/2025_12_16_211102_add_subcategory_to_budgets_table.php \ - $SERVER:/var/www/webmoney/backend/database/migrations/ - -# Enviar Model -sshpass -p "$PASS" scp -o StrictHostKeyChecking=no \ - /workspaces/webmoney/backend/app/Models/Budget.php \ - $SERVER:/var/www/webmoney/backend/app/Models/ - -# Enviar Controller -sshpass -p "$PASS" scp -o StrictHostKeyChecking=no \ - /workspaces/webmoney/backend/app/Http/Controllers/Api/BudgetController.php \ - $SERVER:/var/www/webmoney/backend/app/Http/Controllers/Api/ - -echo "✅ Arquivos enviados" -echo "" - -echo "🔄 Executando migration..." -sshpass -p "$PASS" ssh -o StrictHostKeyChecking=no $SERVER "cd /var/www/webmoney/backend && php artisan migrate --force" - -echo "" -echo "🎯 Limpando cache..." -sshpass -p "$PASS" ssh -o StrictHostKeyChecking=no $SERVER "cd /var/www/webmoney/backend && php artisan config:clear && php artisan cache:clear && php artisan route:clear" - -echo "" -echo "✅ Deploy do backend concluído!" diff --git a/deploy_correto.sh b/deploy_correto.sh deleted file mode 100644 index c118847..0000000 --- a/deploy_correto.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -# Deploy correto usando os scripts oficiais - -echo "🚀 Deploy de Orçamentos com Subcategorias" -echo "" - -# Backend -echo "📦 Deploy Backend..." -cd /workspaces/webmoney/backend && ./deploy.sh - -echo "" -echo "📦 Deploy Frontend..." -cd /workspaces/webmoney/frontend && ./deploy.sh - -echo "" -echo "✅ Deploy completo!" -echo "🌐 Teste em: https://webmoney.cnxifly.com" diff --git a/deploy_subcategory_budgets.sh b/deploy_subcategory_budgets.sh deleted file mode 100644 index 062d891..0000000 --- a/deploy_subcategory_budgets.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash - -echo "🚀 Deploy completo: Orçamentos com Subcategorias" -echo "" - -# === BACKEND === -echo "📦 Enviando backend..." - -sshpass -p 'Master9354' scp -o StrictHostKeyChecking=no \ - backend/database/migrations/2025_12_16_211102_add_subcategory_to_budgets_table.php \ - root@213.165.93.60:/var/www/webmoney/backend/database/migrations/ - -sshpass -p 'Master9354' scp -o StrictHostKeyChecking=no \ - backend/app/Models/Budget.php \ - root@213.165.93.60:/var/www/webmoney/backend/app/Models/ - -sshpass -p 'Master9354' scp -o StrictHostKeyChecking=no \ - backend/app/Http/Controllers/Api/BudgetController.php \ - root@213.165.93.60:/var/www/webmoney/backend/app/Http/Controllers/Api/ - -echo "✅ Arquivos backend enviados" -echo "" - -echo "🔄 Executando migration..." -sshpass -p 'Master9354' ssh -o StrictHostKeyChecking=no root@213.165.93.60 \ - "cd /var/www/webmoney/backend && php artisan migrate --force" -echo "" - -echo "🧹 Limpando cache..." -sshpass -p 'Master9354' ssh -o StrictHostKeyChecking=no root@213.165.93.60 \ - "cd /var/www/webmoney/backend && php artisan config:clear && php artisan cache:clear && php artisan route:clear" -echo "" - -# === FRONTEND === -echo "📦 Deploy frontend..." -cd frontend && ./deploy.sh - -echo "" -echo "✅ Deploy completo!" -echo "🌐 Acesse: https://webmoney.cnxifly.com" diff --git a/docs/API_REFERENCE.md b/docs/API_REFERENCE.md old mode 100644 new mode 100755 diff --git a/docs/DOCUMENTO_INSTITUCIONAL.md b/docs/DOCUMENTO_INSTITUCIONAL.md old mode 100644 new mode 100755 diff --git a/docs/INSTALACAO_iOS.md b/docs/INSTALACAO_iOS.md old mode 100644 new mode 100755 diff --git a/docs/MANUAL_USUARIO.md b/docs/MANUAL_USUARIO.md old mode 100644 new mode 100755 diff --git a/docs/MODULO_NEGOCIOS.txt b/docs/MODULO_NEGOCIOS.txt old mode 100644 new mode 100755 diff --git a/docs/README.md b/docs/README.md old mode 100644 new mode 100755 diff --git a/docs/SAAS_STATUS.md b/docs/SAAS_STATUS.md old mode 100644 new mode 100755 diff --git a/docs/SERVIDOR_AUDITORIA.md b/docs/SERVIDOR_AUDITORIA.md new file mode 100644 index 0000000..4be4c4a --- /dev/null +++ b/docs/SERVIDOR_AUDITORIA.md @@ -0,0 +1,200 @@ +# Auditoria do Servidor - WebMoney + +**Data:** 19 de Dezembro de 2025 +**Servidor:** mail.cnxifly.com (213.165.93.60) + +--- + +## 📊 Hardware e Sistema + +| Componente | Especificação | +|------------|---------------| +| **Sistema** | Ubuntu 24.04.3 LTS (Noble Numbat) | +| **CPU** | AMD EPYC-Milan (4 cores @ 2.0GHz) | +| **RAM** | 7.7 GB (1.7 GB usado, 6.1 GB disponível) | +| **Swap** | 1.0 GB (não utilizado) | +| **Disco** | 232 GB (7.3 GB usado, 225 GB livre - 4%) | + +--- + +## 🔧 Serviços Instalados e Ativos + +### Web Server +| Serviço | Versão | Status | Porta | +|---------|--------|--------|-------| +| Nginx | latest | ✅ Ativo | 80, 443 | +| PHP-FPM | 8.4.15 | ✅ Ativo | socket | + +### Banco de Dados +| Serviço | Versão | Status | Porta | +|---------|--------|--------|-------| +| MariaDB | 11.4.9 | ✅ Ativo | 3306 | +| Redis | 7.0.15 | ✅ Ativo | 6379 | + +### E-mail +| Serviço | Status | Porta | +|---------|--------|-------| +| Postfix (SMTP) | ✅ Ativo | 25, 465, 587 | +| Dovecot (IMAP) | ✅ Ativo | 143, 993 | +| OpenDKIM | ✅ Ativo | - | + +### Outros +| Serviço | Status | Descrição | +|---------|--------|-----------| +| Gitea | ✅ Ativo | Git self-hosted | +| SSH | ✅ Ativo | Acesso remoto | + +--- + +## 🔒 Firewall (UFW) + +**Status:** Ativo +**Default:** deny (incoming), allow (outgoing) + +### Portas Abertas +| Porta | Serviço | +|-------|---------| +| 22 | SSH | +| 25 | SMTP | +| 80 | HTTP | +| 143 | IMAP | +| 443 | HTTPS | +| 465 | SMTPS | +| 587 | Submission | +| 993 | IMAPS | +| 3000 | Gitea/Dev | + +--- + +## 🌐 Sites Configurados (Nginx) + +| Arquivo | Domínio | Root | +|---------|---------|------| +| webmoney-subdomain | webmoney.cnxifly.com | /var/www/webmoney/frontend/dist | +| webmoney | cnxifly.com | /var/www/cnxifly | +| gitea | git.cnxifly.com | proxy Gitea | +| mail | mail.cnxifly.com | Roundcube | +| phpmyadmin | pma.cnxifly.com | phpMyAdmin | +| webmail | Roundcube webmail | - | +| ezpool | ezpool.cnxifly.com | Mining pool | + +--- + +## 📜 Certificados SSL (Let's Encrypt) + +| Domínio | Status | +|---------|--------| +| cnxifly.com | ✅ Válido | +| git.cnxifly.com | ✅ Válido | +| ezpool.cnxifly.com | ✅ Válido | +| britemaster.ezpool.cnxifly.com | ✅ Válido | +| vscode.cnxifly.com | ✅ Válido | + +**Nota:** webmoney.cnxifly.com usa o certificado de cnxifly.com (wildcard/SAN) + +--- + +## 📦 PHP Módulos Instalados + +``` +bcmath, curl, gd, json, libxml, mbstring, mysqli, +mysqlnd, PDO, pdo_mysql, pdo_pgsql, pdo_sqlite, +redis, SimpleXML, xml, xmlreader, xmlwriter, zip +``` + +--- + +## 🗄️ Banco de Dados WebMoney + +| Propriedade | Valor | +|-------------|-------| +| **Database** | webmoney | +| **Usuário** | webmoney | +| **Tabelas** | 42 | +| **Engine** | MariaDB 11.4.9 | + +--- + +## ⏰ Cron Jobs + +```bash +# Laravel Scheduler - executa a cada minuto +* * * * * cd /var/www/webmoney/backend && php artisan schedule:run >> /dev/null 2>&1 +``` + +--- + +## 📂 Estrutura de Arquivos + +``` +/root/webmoney/ ← Workspace de desenvolvimento + ↓ (symlink) +/var/www/webmoney/ ← Servido pelo Nginx +├── backend/ +│ ├── app/ # Código PHP Laravel +│ ├── config/ # Configurações +│ ├── database/ # Migrations e seeders +│ ├── routes/ # api.php, web.php +│ ├── storage/ # Logs, cache, uploads +│ ├── vendor/ # Dependências Composer +│ └── .env # Variáveis de ambiente +└── frontend/ + ├── src/ # Código React + ├── dist/ # Build de produção + └── node_modules/ # Dependências NPM +``` + +--- + +## 📈 Performance + +### Uptime +- **Status:** 1h15min desde último boot +- **Load Average:** 0.32, 0.26, 0.17 (baixa carga) + +### Uso de Memória por Processo +| Processo | Memória | +|----------|---------| +| VS Code Server | ~625 MB | +| Gitea | ~250 MB | +| MariaDB | ~150 MB | +| PHP-FPM (pool) | ~200 MB (total) | + +### PHP-FPM Status +- **Processos ativos:** 0 +- **Processos idle:** 3 +- **Requests atendidos:** 82 +- **Slow requests:** 0 + +--- + +## ✅ Verificações de Saúde + +| Teste | Resultado | +|-------|-----------| +| Frontend (HTTPS) | ✅ HTTP 200 | +| API Login | ✅ Funcionando | +| Redis PING | ✅ PONG | +| MySQL Connection | ✅ OK | +| Nginx Config | ✅ Syntax OK | +| PHP-FPM | ✅ Running | + +--- + +## ⚠️ Avisos (Não críticos) + +1. **Nginx deprecation warnings** - Sintaxe `listen ... http2` deprecada em alguns vhosts (ezpool, gitea) +2. **Composer como root** - Aviso padrão ao rodar como root + +--- + +## 🔄 Recomendações + +1. ✅ Configurar backup automático do banco de dados +2. ✅ Monitorar espaço em disco periodicamente +3. ✅ Atualizar certificados SSL (auto-renovação Let's Encrypt) +4. ✅ Manter logs limpos (logrotate) + +--- + +**Última atualização:** 19/12/2025 11:45 CET diff --git a/fix_migration.sh b/fix_migration.sh deleted file mode 100644 index c862b42..0000000 --- a/fix_migration.sh +++ /dev/null @@ -1,2 +0,0 @@ -mysql -u webmoney -p'M@ster9354' webmoney -e "INSERT INTO migrations (migration, batch) VALUES ('2025_12_08_000004_create_transactions_table', 1)" -php artisan migrate --force \ No newline at end of file diff --git a/frontend/.gitignore b/frontend/.gitignore old mode 100644 new mode 100755 diff --git a/frontend/README.md b/frontend/README.md old mode 100644 new mode 100755 diff --git a/frontend/deploy.ps1 b/frontend/deploy.ps1 deleted file mode 100644 index 37e87d6..0000000 --- a/frontend/deploy.ps1 +++ /dev/null @@ -1,90 +0,0 @@ -# ============================================================================= -# WEBMoney Frontend - Script de Deploy para Windows -# ============================================================================= -# Este script faz build e deploy do frontend para o servidor de producao -# Uso: .\deploy.ps1 -# Requer: Node.js, npm, PuTTY (pscp, plink) instalados no PATH -# ============================================================================= - -$ErrorActionPreference = "Stop" - -# Configuracoes -$SERVER_USER = "root" -$SERVER_HOST = "213.165.93.60" -$SERVER_PASS = "Master9354" -$REMOTE_PATH = "/var/www/webmoney/frontend/dist" -$LOCAL_DIST = ".\dist" - -# Cores -function Write-Color { - param([string]$Text, [string]$Color = "White") - Write-Host $Text -ForegroundColor $Color -} - -Write-Host "" -Write-Color "========================================" "Cyan" -Write-Color " WEBMoney Frontend - Deploy Script " "Cyan" -Write-Color "========================================" "Cyan" -Write-Host "" - -# 1. Build -Write-Color "[1/4] Fazendo build do frontend..." "Yellow" - -if (Test-Path $LOCAL_DIST) { - Remove-Item -Recurse -Force $LOCAL_DIST -} - -npm run build - -if (-not (Test-Path $LOCAL_DIST)) { - Write-Color "ERRO: Build falhou - pasta dist nao encontrada" "Red" - exit 1 -} - -Write-Color "Build concluido" "Green" -Write-Host "" - -# 2. Limpar diretorio remoto -Write-Color "[2/4] Limpando diretorio remoto..." "Yellow" -plink -batch -pw $SERVER_PASS "$SERVER_USER@$SERVER_HOST" "rm -rf $REMOTE_PATH/*" - -Write-Color "Diretorio remoto limpo" "Green" -Write-Host "" - -# 3. Enviar arquivos -Write-Color "[3/4] Enviando arquivos para $REMOTE_PATH ..." "Yellow" -pscp -r -batch -pw $SERVER_PASS "$LOCAL_DIST\*" "${SERVER_USER}@${SERVER_HOST}:${REMOTE_PATH}/" - -Write-Color "Arquivos enviados" "Green" -Write-Host "" - -# 4. Verificar deploy -Write-Color "[4/5] Verificando deploy..." "Yellow" -$result = plink -batch -pw $SERVER_PASS "$SERVER_USER@$SERVER_HOST" "ls $REMOTE_PATH/index.html 2>/dev/null" - -if (-not $result) { - Write-Color "========================================" "Red" - Write-Color " ERRO: index.html nao encontrado " "Red" - Write-Color "========================================" "Red" - exit 1 -} - -Write-Color "Arquivos verificados" "Green" -Write-Host "" - -# 5. Reiniciar Nginx para limpar cache -Write-Color "[5/5] Reiniciando Nginx para limpar cache..." "Yellow" -plink -batch -pw $SERVER_PASS "$SERVER_USER@$SERVER_HOST" "systemctl restart nginx" - -Write-Color "Nginx reiniciado" "Green" -Write-Host "" - -Write-Host "" -Write-Color "========================================" "Green" -Write-Color " Deploy concluido com sucesso! " "Green" -Write-Color "========================================" "Green" -Write-Host "" -Write-Host "Acesse: https://webmoney.cnxifly.com" -Write-Host "" -Write-Host "Dica: Use Ctrl+Shift+R no navegador para limpar o cache local" -Write-Host "" diff --git a/frontend/deploy.sh b/frontend/deploy.sh deleted file mode 100755 index 05a7679..0000000 --- a/frontend/deploy.sh +++ /dev/null @@ -1,94 +0,0 @@ -#!/bin/bash -# ============================================================================= -# WEBMoney Frontend - Script de Deploy -# ============================================================================= -# Este script faz build e deploy do frontend para o servidor de produção -# Uso: ./deploy.sh -# Repositório: https://git.cnxifly.com/marco/webmoney -# ============================================================================= - -set -e # Sair em caso de erro - -# Configurações - CAMINHO CORRETO! -SERVER_USER="root" -SERVER_HOST="213.165.93.60" -SERVER_PASS="Master9354" -REMOTE_PATH="/var/www/webmoney/frontend/dist" # <<< IMPORTANTE: Sempre /dist -LOCAL_DIST="./dist" -PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" - -# Cores para output -RED='\033[0;31m' -GREEN='\033[0;32m' -YELLOW='\033[1;33m' -BLUE='\033[0;34m' -NC='\033[0m' # No Color - -echo -e "${BLUE}========================================${NC}" -echo -e "${BLUE} WEBMoney Frontend - Deploy Script ${NC}" -echo -e "${BLUE}========================================${NC}" -echo "" - -# 1. Build -echo -e "${YELLOW}[1/4]${NC} Fazendo build do frontend..." -rm -rf dist -npm run build - -if [ ! -d "$LOCAL_DIST" ]; then - echo -e "${RED}ERRO: Build falhou - pasta dist não encontrada${NC}" - exit 1 -fi - -echo -e "${GREEN}✓ Build concluído${NC}" -echo "" - -# 2. Limpar diretório remoto -echo -e "${YELLOW}[2/4]${NC} Limpando diretório remoto..." -sshpass -p "$SERVER_PASS" ssh -o StrictHostKeyChecking=no "$SERVER_USER@$SERVER_HOST" \ - "rm -rf $REMOTE_PATH/* && echo 'Diretório limpo'" - -echo -e "${GREEN}✓ Diretório remoto limpo${NC}" -echo "" - -# 3. Enviar arquivos para o caminho CORRETO -echo -e "${YELLOW}[3/4]${NC} Enviando arquivos para $REMOTE_PATH ..." -sshpass -p "$SERVER_PASS" scp -o StrictHostKeyChecking=no -r $LOCAL_DIST/* \ - "$SERVER_USER@$SERVER_HOST:$REMOTE_PATH/" - -echo -e "${GREEN}✓ Arquivos enviados${NC}" -echo "" - -# 4. Verificar deploy -echo -e "${YELLOW}[4/4]${NC} Verificando deploy..." -REMOTE_FILES=$(sshpass -p "$SERVER_PASS" ssh -o StrictHostKeyChecking=no "$SERVER_USER@$SERVER_HOST" \ - "ls -la $REMOTE_PATH/") - -echo "$REMOTE_FILES" -echo "" - -# Verificar se index.html existe -if sshpass -p "$SERVER_PASS" ssh -o StrictHostKeyChecking=no "$SERVER_USER@$SERVER_HOST" \ - "test -f $REMOTE_PATH/index.html"; then - echo -e "${GREEN}========================================${NC}" - echo -e "${GREEN} ✓ Deploy concluído com sucesso! ${NC}" - echo -e "${GREEN}========================================${NC}" - echo "" - echo -e "Acesse: ${BLUE}https://webmoney.cnxifly.com${NC}" - echo "" - - # Lembrete de commit - echo -e "${BLUE}════════════════════════════════════════${NC}" - echo -e "${YELLOW}📝 Não esqueça de fazer commit:${NC}" - echo -e "" - echo -e " cd $PROJECT_ROOT" - echo -e " git add -A && git commit -m \"deploy: frontend\" && git push gitea main" - echo -e "" - echo -e "${BLUE} Repositório: ${NC}https://git.cnxifly.com/marco/webmoney" - echo -e "${BLUE}════════════════════════════════════════${NC}" - echo "" -else - echo -e "${RED}========================================${NC}" - echo -e "${RED} ✗ ERRO: index.html não encontrado ${NC}" - echo -e "${RED}========================================${NC}" - exit 1 -fi diff --git a/frontend/eslint.config.js b/frontend/eslint.config.js old mode 100644 new mode 100755 diff --git a/frontend/index.html b/frontend/index.html old mode 100644 new mode 100755 diff --git a/frontend/package-lock.json b/frontend/package-lock.json old mode 100644 new mode 100755 diff --git a/frontend/package.json b/frontend/package.json old mode 100644 new mode 100755 diff --git a/frontend/public/apple-touch-icon.png b/frontend/public/apple-touch-icon.png old mode 100644 new mode 100755 diff --git a/frontend/public/favicon-16x16.png b/frontend/public/favicon-16x16.png old mode 100644 new mode 100755 diff --git a/frontend/public/favicon-32x32.png b/frontend/public/favicon-32x32.png old mode 100644 new mode 100755 diff --git a/frontend/public/favicon.ico b/frontend/public/favicon.ico old mode 100644 new mode 100755 diff --git a/frontend/public/logo-192.png b/frontend/public/logo-192.png old mode 100644 new mode 100755 diff --git a/frontend/public/logo-512.png b/frontend/public/logo-512.png old mode 100644 new mode 100755 diff --git a/frontend/public/logo.png b/frontend/public/logo.png old mode 100644 new mode 100755 diff --git a/frontend/public/manifest.json b/frontend/public/manifest.json old mode 100644 new mode 100755 diff --git a/frontend/public/sw.js b/frontend/public/sw.js old mode 100644 new mode 100755 diff --git a/frontend/src/App.css b/frontend/src/App.css old mode 100644 new mode 100755 diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/assets/logo-white.png b/frontend/src/assets/logo-white.png old mode 100644 new mode 100755 diff --git a/frontend/src/assets/logo.png b/frontend/src/assets/logo.png old mode 100644 new mode 100755 diff --git a/frontend/src/components/AccountWizard.jsx b/frontend/src/components/AccountWizard.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/components/AssetWizard.jsx b/frontend/src/components/AssetWizard.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/components/BudgetWizard.jsx b/frontend/src/components/BudgetWizard.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/components/CategorySelector.jsx b/frontend/src/components/CategorySelector.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/components/ConfirmModal.jsx b/frontend/src/components/ConfirmModal.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/components/CookieConsent.jsx b/frontend/src/components/CookieConsent.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/components/CreateRecurrenceModal.jsx b/frontend/src/components/CreateRecurrenceModal.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/components/CurrencySelector.jsx b/frontend/src/components/CurrencySelector.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/components/Footer.jsx b/frontend/src/components/Footer.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/components/IconSelector.jsx b/frontend/src/components/IconSelector.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/components/LanguageSelector.jsx b/frontend/src/components/LanguageSelector.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/components/Layout.jsx b/frontend/src/components/Layout.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/components/LiabilityWizard.jsx b/frontend/src/components/LiabilityWizard.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/components/Modal.jsx b/frontend/src/components/Modal.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/components/ProtectedRoute.jsx b/frontend/src/components/ProtectedRoute.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/components/Toast.jsx b/frontend/src/components/Toast.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/components/business/BusinessSettingModal.jsx b/frontend/src/components/business/BusinessSettingModal.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/components/business/BusinessSettingsTab.jsx b/frontend/src/components/business/BusinessSettingsTab.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/components/business/CampaignModal.jsx b/frontend/src/components/business/CampaignModal.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/components/business/CampaignsTab.jsx b/frontend/src/components/business/CampaignsTab.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/components/business/PriceCalculatorTab.jsx b/frontend/src/components/business/PriceCalculatorTab.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/components/business/ProductSheetModal.jsx b/frontend/src/components/business/ProductSheetModal.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/components/business/ProductSheetsTab.jsx b/frontend/src/components/business/ProductSheetsTab.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/components/business/ServiceSheetModal.jsx b/frontend/src/components/business/ServiceSheetModal.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/components/business/ServiceSheetsTab.jsx b/frontend/src/components/business/ServiceSheetsTab.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/components/dashboard/BalanceProjectionChart.jsx b/frontend/src/components/dashboard/BalanceProjectionChart.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/components/dashboard/CalendarWidget.jsx b/frontend/src/components/dashboard/CalendarWidget.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/components/dashboard/CashflowChart.jsx b/frontend/src/components/dashboard/CashflowChart.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/components/dashboard/OverdueWidget.jsx b/frontend/src/components/dashboard/OverdueWidget.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/components/dashboard/OverpaymentsAnalysis.jsx b/frontend/src/components/dashboard/OverpaymentsAnalysis.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/components/dashboard/PaymentVariancesChart.jsx b/frontend/src/components/dashboard/PaymentVariancesChart.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/components/dashboard/PlanUsageWidget.jsx b/frontend/src/components/dashboard/PlanUsageWidget.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/components/dashboard/UpcomingWidget.jsx b/frontend/src/components/dashboard/UpcomingWidget.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/config/api.js b/frontend/src/config/api.js old mode 100644 new mode 100755 diff --git a/frontend/src/config/currencies.js b/frontend/src/config/currencies.js old mode 100644 new mode 100755 diff --git a/frontend/src/config/icons.js b/frontend/src/config/icons.js old mode 100644 new mode 100755 diff --git a/frontend/src/context/AuthContext.jsx b/frontend/src/context/AuthContext.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/hooks/index.js b/frontend/src/hooks/index.js old mode 100644 new mode 100755 diff --git a/frontend/src/hooks/useFormatters.js b/frontend/src/hooks/useFormatters.js old mode 100644 new mode 100755 diff --git a/frontend/src/i18n/index.js b/frontend/src/i18n/index.js old mode 100644 new mode 100755 diff --git a/frontend/src/i18n/locales/en.json b/frontend/src/i18n/locales/en.json old mode 100644 new mode 100755 diff --git a/frontend/src/i18n/locales/es.json b/frontend/src/i18n/locales/es.json old mode 100644 new mode 100755 diff --git a/frontend/src/i18n/locales/pt-BR.json b/frontend/src/i18n/locales/pt-BR.json old mode 100644 new mode 100755 diff --git a/frontend/src/index.css b/frontend/src/index.css old mode 100644 new mode 100755 diff --git a/frontend/src/main.jsx b/frontend/src/main.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/pages/Accounts.jsx b/frontend/src/pages/Accounts.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/pages/ActivateAccount.jsx b/frontend/src/pages/ActivateAccount.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/pages/Billing.jsx b/frontend/src/pages/Billing.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/pages/Budgets.jsx b/frontend/src/pages/Budgets.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/pages/Business.jsx b/frontend/src/pages/Business.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/pages/Categories.jsx b/frontend/src/pages/Categories.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/pages/CostCenters.jsx b/frontend/src/pages/CostCenters.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/pages/Dashboard.jsx b/frontend/src/pages/Dashboard.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/pages/FinancialHealth.jsx b/frontend/src/pages/FinancialHealth.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/pages/Goals.jsx b/frontend/src/pages/Goals.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/pages/ImportTransactions.jsx b/frontend/src/pages/ImportTransactions.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/pages/Landing.css b/frontend/src/pages/Landing.css old mode 100644 new mode 100755 diff --git a/frontend/src/pages/Landing.jsx b/frontend/src/pages/Landing.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/pages/LiabilityAccounts.jsx b/frontend/src/pages/LiabilityAccounts.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/pages/Login.jsx b/frontend/src/pages/Login.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/pages/PaymentSuccess.jsx b/frontend/src/pages/PaymentSuccess.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/pages/Preferences.jsx b/frontend/src/pages/Preferences.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/pages/Pricing.jsx b/frontend/src/pages/Pricing.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/pages/Profile.jsx b/frontend/src/pages/Profile.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/pages/RecurringTransactions.jsx b/frontend/src/pages/RecurringTransactions.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/pages/RefundDetection.jsx b/frontend/src/pages/RefundDetection.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/pages/Register.jsx b/frontend/src/pages/Register.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/pages/Reports.jsx b/frontend/src/pages/Reports.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/pages/SiteSettings.jsx b/frontend/src/pages/SiteSettings.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/pages/TransactionsByWeek.jsx b/frontend/src/pages/TransactionsByWeek.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/pages/TransferDetection.jsx b/frontend/src/pages/TransferDetection.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/pages/Users.jsx b/frontend/src/pages/Users.jsx old mode 100644 new mode 100755 diff --git a/frontend/src/services/api.js b/frontend/src/services/api.js old mode 100644 new mode 100755 diff --git a/frontend/vite.config.js b/frontend/vite.config.js old mode 100644 new mode 100755 diff --git a/import_transactions.py b/import_transactions.py old mode 100644 new mode 100755 diff --git a/landing/index.html b/landing/index.html old mode 100644 new mode 100755 diff --git a/landing/maintenance.html b/landing/maintenance.html old mode 100644 new mode 100755 diff --git a/remote_migrate.sh b/remote_migrate.sh deleted file mode 100644 index 49cf89a..0000000 --- a/remote_migrate.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -cd /var/www/webmoney - -# Check if tables exist -echo "=== Checking tables ===" -mysql -u webmoney -p'M@ster9354' webmoney -e "SHOW TABLES LIKE '%service%';" - -# Run migrations -echo "=== Running migrations ===" -php artisan migrate --force - -# Clear caches -echo "=== Clearing caches ===" -php artisan config:clear -php artisan cache:clear -php artisan route:clear - -echo "=== Done ===" diff --git a/scripts/dev.ps1 b/scripts/dev.ps1 deleted file mode 100644 index 0bfc784..0000000 --- a/scripts/dev.ps1 +++ /dev/null @@ -1,65 +0,0 @@ -# ============================================================================= -# WEBMoney - Servidor de Desenvolvimento Local -# ============================================================================= - -param( - [switch]$FrontendOnly, - [switch]$BackendOnly -) - -$ProjectRoot = "c:\Users\marco\OneDrive\Documents\WebMoney" - -Write-Host "" -Write-Host "╔═══════════════════════════════════════════════════════╗" -ForegroundColor Cyan -Write-Host "║ WEBMoney - Ambiente de Desenvolvimento ║" -ForegroundColor Cyan -Write-Host "╚═══════════════════════════════════════════════════════╝" -ForegroundColor Cyan -Write-Host "" - -if (-not $FrontendOnly) { - Write-Host "[Backend] " -NoNewline -ForegroundColor Yellow - Write-Host "Iniciando em http://localhost:8000" -ForegroundColor White - - Start-Process powershell -ArgumentList "-NoExit", "-Command", @" - `$Host.UI.RawUI.WindowTitle = 'WebMoney Backend' - Set-Location '$ProjectRoot\backend' - Write-Host 'Laravel Development Server' -ForegroundColor Green - Write-Host 'http://localhost:8000' -ForegroundColor Cyan - Write-Host '' - php artisan serve --host=localhost --port=8000 -"@ -} - -if (-not $BackendOnly) { - Start-Sleep 1 - - Write-Host "[Frontend] " -NoNewline -ForegroundColor Yellow - Write-Host "Iniciando em http://localhost:5173" -ForegroundColor White - - Start-Process powershell -ArgumentList "-NoExit", "-Command", @" - `$Host.UI.RawUI.WindowTitle = 'WebMoney Frontend' - Set-Location '$ProjectRoot\frontend' - Write-Host 'Vite Development Server' -ForegroundColor Green - Write-Host 'http://localhost:5173' -ForegroundColor Cyan - Write-Host '' - npm run dev -"@ -} - -Write-Host "" -Write-Host "═══════════════════════════════════════════════════════" -ForegroundColor Green -Write-Host "" -Write-Host " Servidores iniciados em janelas separadas:" -ForegroundColor White - -if (-not $FrontendOnly) { - Write-Host " Backend: " -NoNewline; Write-Host "http://localhost:8000/api" -ForegroundColor Cyan -} -if (-not $BackendOnly) { - Write-Host " Frontend: " -NoNewline; Write-Host "http://localhost:5173" -ForegroundColor Cyan -} - -Write-Host "" -Write-Host " Comandos disponíveis:" -ForegroundColor White -Write-Host " .\scripts\quick-deploy.ps1 -Target frontend" -ForegroundColor Gray -Write-Host " .\scripts\quick-deploy.ps1 -Target backend" -ForegroundColor Gray -Write-Host " .\scripts\release.ps1 -VersionType patch -ChangeDescription 'desc'" -ForegroundColor Gray -Write-Host "" diff --git a/scripts/lib/diretrizes.psm1 b/scripts/lib/diretrizes.psm1 deleted file mode 100644 index 7d3689c..0000000 --- a/scripts/lib/diretrizes.psm1 +++ /dev/null @@ -1,172 +0,0 @@ -# ============================================================================= -# WEBMoney - Validador de Directrices (v3.0) -# ============================================================================= -# Este modulo es importado por todos los scripts para garantizar compliance -# ============================================================================= - -$Script:ProjectRoot = "c:\Users\marco\OneDrive\Documents\WebMoney" -$Script:Server = "root@213.165.93.60" -$Script:ProductionUrl = "https://webmoney.cnxifly.com" - -# Cargar directrices -function Get-Diretrizes { - $diretrizesFile = Join-Path $Script:ProjectRoot ".DIRETRIZES_DESENVOLVIMENTO_v3" - if (-not (Test-Path $diretrizesFile)) { - throw "ERRO FATAL: Arquivo de diretrizes nao encontrado!" - } - return Get-Content $diretrizesFile -Raw -} - -# Validar que no hay cambios sin commit (Regra #6) -function Assert-NoUncommittedChanges { - Push-Location $Script:ProjectRoot - $status = git status --porcelain 2>$null - Pop-Location - - if ($status) { - $count = @($status | Where-Object { $_ }).Count - return @{ - Valid = $false - Message = "Existem $count arquivos modificados sem commit" - Files = $status - } - } - return @{ Valid = $true } -} - -# Validar VERSION existe e esta correto -function Assert-VersionFile { - $versionFile = Join-Path $Script:ProjectRoot "VERSION" - if (-not (Test-Path $versionFile)) { - return @{ Valid = $false; Message = "Arquivo VERSION nao encontrado" } - } - - $version = (Get-Content $versionFile).Trim() - if ($version -notmatch '^\d+\.\d+\.\d+$') { - return @{ Valid = $false; Message = "VERSION invalido: $version (deve ser X.Y.Z)" } - } - - return @{ Valid = $true; Version = $version } -} - -# Validar CHANGELOG tem entrada para versao atual -function Assert-ChangelogUpdated { - param([string]$Version) - - $changelogFile = Join-Path $Script:ProjectRoot "CHANGELOG.md" - if (-not (Test-Path $changelogFile)) { - return @{ Valid = $false; Message = "Arquivo CHANGELOG.md nao encontrado" } - } - - $content = Get-Content $changelogFile -Raw - if ($content -notmatch "\[$Version\]") { - return @{ Valid = $false; Message = "CHANGELOG nao contem entrada para versao $Version" } - } - - return @{ Valid = $true } -} - -# Validar conexao SSH com servidor -function Assert-ServerConnection { - $result = ssh -o ConnectTimeout=5 -o BatchMode=yes $Script:Server "echo OK" 2>$null - if ($result -ne "OK") { - return @{ - Valid = $false - Message = "Nao foi possivel conectar ao servidor. Execute: .\scripts\setup-ssh.ps1" - } - } - return @{ Valid = $true } -} - -# Validar que producao esta acessivel -function Assert-ProductionAccessible { - try { - $response = Invoke-WebRequest -Uri $Script:ProductionUrl -TimeoutSec 10 -UseBasicParsing - if ($response.StatusCode -eq 200) { - return @{ Valid = $true } - } - } catch {} - - return @{ - Valid = $false - Message = "Producao nao acessivel em $Script:ProductionUrl" - } -} - -# Incrementar versao semantica -function Get-NextVersion { - param( - [string]$Current, - [ValidateSet('patch', 'minor', 'major')] - [string]$Type - ) - - $parts = $Current.Split('.') - $major = [int]$parts[0] - $minor = [int]$parts[1] - $patch = [int]$parts[2] - - switch ($Type) { - 'major' { $major++; $minor = 0; $patch = 0 } - 'minor' { $minor++; $patch = 0 } - 'patch' { $patch++ } - } - - return "$major.$minor.$patch" -} - -# Atualizar arquivo VERSION -function Update-VersionFile { - param([string]$NewVersion) - - $versionFile = Join-Path $Script:ProjectRoot "VERSION" - Set-Content -Path $versionFile -Value $NewVersion -NoNewline -} - -# Atualizar CHANGELOG -function Update-Changelog { - param( - [string]$Version, - [ValidateSet('Added', 'Changed', 'Fixed', 'Removed', 'Security')] - [string]$ChangeType, - [string]$Description - ) - - $changelogFile = Join-Path $Script:ProjectRoot "CHANGELOG.md" - $date = Get-Date -Format "yyyy-MM-dd" - - $content = Get-Content $changelogFile -Raw - - # Encontrar posicao para inserir - $insertPos = $content.IndexOf("`n## [") - if ($insertPos -eq -1) { - $insertPos = $content.IndexOf("---") + 4 - } - - $newEntry = @" - -## [$Version] - $date - -### $ChangeType -- $Description -"@ - - $newContent = $content.Insert($insertPos, $newEntry) - Set-Content -Path $changelogFile -Value $newContent -NoNewline -} - -# Mostrar regras das directrizes -function Show-DiretrizesReminder { - Write-Host "" - Write-Host " DIRETRIZES v3.0 - REGRAS OBRIGATORIAS:" -ForegroundColor Yellow - Write-Host " ----------------------------------------" -ForegroundColor Yellow - Write-Host " 1. VERSION incrementado em cada commit" -ForegroundColor Gray - Write-Host " 2. CHANGELOG atualizado em cada commit" -ForegroundColor Gray - Write-Host " 3. Deploy via scripts (NUNCA manual)" -ForegroundColor Gray - Write-Host " 4. Teste em producao OBRIGATORIO" -ForegroundColor Gray - Write-Host " 5. Commit somente apos teste OK" -ForegroundColor Gray - Write-Host "" -} - -# Exportar funcoes -Export-ModuleMember -Function * diff --git a/scripts/quick-deploy.ps1 b/scripts/quick-deploy.ps1 deleted file mode 100644 index 618399b..0000000 --- a/scripts/quick-deploy.ps1 +++ /dev/null @@ -1,82 +0,0 @@ -# ============================================================================= -# WEBMoney - Quick Deploy (Conforme Diretrizes v3.0) -# ============================================================================= -# AVISO: Este script faz deploy SEM commit -# Use apenas para iteracoes rapidas durante desenvolvimento -# Para release oficial, use SEMPRE: .\scripts\release.ps1 -# ============================================================================= - -param( - [Parameter(Mandatory=$true)] - [ValidateSet('frontend', 'backend', 'both')] - [string]$Target -) - -$ErrorActionPreference = "Stop" -$ProjectRoot = "c:\Users\marco\OneDrive\Documents\WebMoney" -$Server = "root@213.165.93.60" -$ProductionUrl = "https://webmoney.cnxifly.com" - -Write-Host "" -Write-Host "=======================================================" -ForegroundColor Yellow -Write-Host " QUICK DEPLOY - Apenas para desenvolvimento" -ForegroundColor Yellow -Write-Host "=======================================================" -ForegroundColor Yellow -Write-Host "" -Write-Host " AVISO: Este deploy NAO incrementa versao nem faz commit" -ForegroundColor Red -Write-Host " Para release oficial use: .\scripts\release.ps1" -ForegroundColor Red -Write-Host "" - -# Validar SSH -Write-Host "[1/3] Verificando conexao SSH..." -ForegroundColor Gray -$sshTest = ssh -o ConnectTimeout=5 -o BatchMode=yes $Server "echo OK" 2>$null -if ($sshTest -ne "OK") { - Write-Host "[ERRO] SSH falhou. Execute: .\scripts\setup-ssh.ps1" -ForegroundColor Red - exit 1 -} -Write-Host "[OK] SSH conectado" -ForegroundColor Green - -$startTime = Get-Date - -# Frontend -if ($Target -eq 'frontend' -or $Target -eq 'both') { - Write-Host "[2/3] Deploy Frontend..." -ForegroundColor Yellow - - Push-Location (Join-Path $ProjectRoot "frontend") - npm run build 2>&1 | Out-Null - ssh $Server "rm -rf /var/www/webmoney/frontend/dist/*" 2>&1 | Out-Null - scp -r ".\dist\*" "${Server}:/var/www/webmoney/frontend/dist/" 2>&1 | Out-Null - Pop-Location - - Write-Host "[OK] Frontend deployed" -ForegroundColor Green -} - -# Backend -if ($Target -eq 'backend' -or $Target -eq 'both') { - Write-Host "[2/3] Deploy Backend..." -ForegroundColor Yellow - - Push-Location (Join-Path $ProjectRoot "backend") - $tar = "$env:TEMP\wm-backend.tar.gz" - tar -czf $tar --exclude='.git' --exclude='node_modules' --exclude='vendor' --exclude='storage/logs/*' --exclude='.env' . 2>&1 | Out-Null - scp $tar "${Server}:/tmp/wm-backend.tar.gz" 2>&1 | Out-Null - ssh $Server "cd /var/www/webmoney/backend && tar -xzf /tmp/wm-backend.tar.gz && rm /tmp/wm-backend.tar.gz && composer install --no-dev -q && php artisan config:cache && systemctl restart php8.4-fpm" 2>&1 | Out-Null - Remove-Item $tar -ErrorAction SilentlyContinue - Pop-Location - - Write-Host "[OK] Backend deployed" -ForegroundColor Green -} - -# Teste obrigatorio -Write-Host "[3/3] Abrindo para teste..." -ForegroundColor Yellow -Start-Process $ProductionUrl - -$elapsed = ((Get-Date) - $startTime).TotalSeconds - -Write-Host "" -Write-Host "=======================================================" -ForegroundColor Green -Write-Host " Deploy em $([math]::Round($elapsed, 1))s - $ProductionUrl" -ForegroundColor Green -Write-Host "=======================================================" -ForegroundColor Green -Write-Host "" -Write-Host " LEMBRE-SE (Diretriz v3.0):" -ForegroundColor Yellow -Write-Host " Apos finalizar desenvolvimento, faca release oficial:" -ForegroundColor Gray -Write-Host " .\scripts\release.ps1 -VersionType patch -ChangeDescription '...'" -ForegroundColor White -Write-Host "" diff --git a/scripts/release.ps1 b/scripts/release.ps1 deleted file mode 100644 index 3a492fb..0000000 --- a/scripts/release.ps1 +++ /dev/null @@ -1,244 +0,0 @@ -# ============================================================================= -# WEBMoney - Release Script (Conforme Diretrizes v3.0) -# ============================================================================= -# ESTE SCRIPT SEGUE ESTRITAMENTE AS DIRETRIZES DE DESENVOLVIMENTO -# Qualquer violacao resulta em ERRO e aborta a execucao -# ============================================================================= - -param( - [Parameter(Mandatory=$true)] - [ValidateSet('patch', 'minor', 'major')] - [string]$VersionType, - - [Parameter(Mandatory=$true)] - [string]$ChangeDescription, - - [ValidateSet('frontend', 'backend', 'both')] - [string]$Deploy = 'both', - - [ValidateSet('Added', 'Changed', 'Fixed', 'Removed', 'Security')] - [string]$ChangeType = 'Changed' -) - -$ErrorActionPreference = "Stop" -$ProjectRoot = "c:\Users\marco\OneDrive\Documents\WebMoney" -$Server = "root@213.165.93.60" -$ProductionUrl = "https://webmoney.cnxifly.com" - -# ============================================================================= -# FUNCOES AUXILIARES -# ============================================================================= - -function Write-Header { param([string]$Text) - Write-Host "" - Write-Host "=======================================================" -ForegroundColor Cyan - Write-Host " $Text" -ForegroundColor Cyan - Write-Host "=======================================================" -ForegroundColor Cyan - Write-Host "" -} - -function Write-Step { param([int]$N, [int]$T, [string]$Text) - Write-Host "[$N/$T] $Text" -ForegroundColor Yellow -} - -function Write-OK { param([string]$Text) - Write-Host "[OK] $Text" -ForegroundColor Green -} - -function Write-FAIL { param([string]$Text) - Write-Host "[ERRO] $Text" -ForegroundColor Red -} - -function Get-CurrentVersion { - return (Get-Content (Join-Path $ProjectRoot "VERSION")).Trim() -} - -function Get-NextVersion { - param([string]$Current, [string]$Type) - $p = $Current.Split('.'); $ma=[int]$p[0]; $mi=[int]$p[1]; $pa=[int]$p[2] - switch($Type) { 'major'{$ma++;$mi=0;$pa=0} 'minor'{$mi++;$pa=0} 'patch'{$pa++} } - return "$ma.$mi.$pa" -} - -# ============================================================================= -# DIRETRIZES - VALIDACOES OBRIGATORIAS -# ============================================================================= - -Write-Header "DIRETRIZES v3.0 - Validacao Obrigatoria" - -# Diretriz: Verificar conexao SSH (necessario para deploy) -Write-Step 1 6 "Verificando conexao SSH..." -$sshTest = ssh -o ConnectTimeout=5 -o BatchMode=yes $Server "echo OK" 2>$null -if ($sshTest -ne "OK") { - Write-FAIL "Conexao SSH falhou. Execute primeiro: .\scripts\setup-ssh.ps1" - Write-Host " Password do servidor: Master9354" -ForegroundColor Gray - exit 1 -} -Write-OK "Conexao SSH OK" - -# Diretriz: Verificar VERSION existe -Write-Step 2 6 "Verificando arquivo VERSION..." -$versionFile = Join-Path $ProjectRoot "VERSION" -if (-not (Test-Path $versionFile)) { - Write-FAIL "Arquivo VERSION nao encontrado" - exit 1 -} -$currentVersion = Get-CurrentVersion -$newVersion = Get-NextVersion -Current $currentVersion -Type $VersionType -Write-OK "VERSION: $currentVersion -> $newVersion" - -# Diretriz: Verificar CHANGELOG existe -Write-Step 3 6 "Verificando CHANGELOG.md..." -$changelogFile = Join-Path $ProjectRoot "CHANGELOG.md" -if (-not (Test-Path $changelogFile)) { - Write-FAIL "Arquivo CHANGELOG.md nao encontrado" - exit 1 -} -Write-OK "CHANGELOG.md existe" - -# Diretriz: Verificar producao acessivel -Write-Step 4 6 "Verificando producao..." -try { - $null = Invoke-WebRequest -Uri $ProductionUrl -TimeoutSec 10 -UseBasicParsing - Write-OK "Producao acessivel" -} catch { - Write-FAIL "Producao nao acessivel em $ProductionUrl" - exit 1 -} - -# Diretriz: Verificar Git configurado -Write-Step 5 6 "Verificando Git..." -Push-Location $ProjectRoot -$gitOK = git rev-parse --git-dir 2>$null -Pop-Location -if (-not $gitOK) { - Write-FAIL "Repositorio Git nao inicializado" - exit 1 -} -Write-OK "Git OK" - -# Mostrar resumo -Write-Step 6 6 "Resumo da release..." -Write-Host "" -Write-Host " Versao: $currentVersion -> " -NoNewline; Write-Host $newVersion -ForegroundColor Green -Write-Host " Tipo: $ChangeType" -ForegroundColor White -Write-Host " Descricao: $ChangeDescription" -ForegroundColor White -Write-Host " Deploy: $Deploy" -ForegroundColor White -Write-Host "" - -$confirm = Read-Host " Confirmar release? (s/n)" -if ($confirm -ne 's' -and $confirm -ne 'S') { - Write-Host " Abortado pelo usuario" -ForegroundColor Yellow - exit 0 -} - -# ============================================================================= -# EXECUCAO DO WORKFLOW (Diretrizes v3.0) -# ============================================================================= - -Write-Header "Executando Release v$newVersion" - -# REGRA #1: Atualizar VERSION -Write-Step 1 7 "Atualizando VERSION (Regra #1)..." -Set-Content -Path $versionFile -Value $newVersion -NoNewline -Write-OK "VERSION = $newVersion" - -# REGRA #1: Atualizar CHANGELOG -Write-Step 2 7 "Atualizando CHANGELOG (Regra #1)..." -$date = Get-Date -Format "yyyy-MM-dd" -$changelog = Get-Content $changelogFile -Raw -$insertPos = $changelog.IndexOf("`n## [") -if ($insertPos -eq -1) { $insertPos = 0 } -$entry = "`n`n## [$newVersion] - $date`n`n### $ChangeType`n- $ChangeDescription" -$newChangelog = $changelog.Insert($insertPos, $entry) -Set-Content -Path $changelogFile -Value $newChangelog -NoNewline -Write-OK "CHANGELOG atualizado" - -# REGRA #4: Deploy via script - FRONTEND -if ($Deploy -eq 'frontend' -or $Deploy -eq 'both') { - Write-Step 3 7 "Deploy Frontend (Regra #4)..." - Push-Location (Join-Path $ProjectRoot "frontend") - npm run build 2>&1 | Out-Null - ssh $Server "rm -rf /var/www/webmoney/frontend/dist/*" 2>&1 | Out-Null - scp -r ".\dist\*" "${Server}:/var/www/webmoney/frontend/dist/" 2>&1 | Out-Null - Pop-Location - Write-OK "Frontend deployed" -} else { - Write-Step 3 7 "Frontend: pulado" -} - -# REGRA #4: Deploy via script - BACKEND -if ($Deploy -eq 'backend' -or $Deploy -eq 'both') { - Write-Step 4 7 "Deploy Backend (Regra #4)..." - Push-Location (Join-Path $ProjectRoot "backend") - $tar = "$env:TEMP\wm-backend.tar.gz" - tar -czf $tar --exclude='.git' --exclude='node_modules' --exclude='vendor' --exclude='storage/logs/*' --exclude='.env' . 2>&1 | Out-Null - scp $tar "${Server}:/tmp/wm-backend.tar.gz" 2>&1 | Out-Null - ssh $Server "cd /var/www/webmoney/backend && tar -xzf /tmp/wm-backend.tar.gz && rm /tmp/wm-backend.tar.gz && composer install --no-dev -q && php artisan config:cache && php artisan route:cache && systemctl restart php8.4-fpm" 2>&1 | Out-Null - Remove-Item $tar -ErrorAction SilentlyContinue - Pop-Location - Write-OK "Backend deployed" -} else { - Write-Step 4 7 "Backend: pulado" -} - -# REGRA #2: Teste em producao OBRIGATORIO -Write-Step 5 7 "Teste em Producao (Regra #2 - OBRIGATORIO)..." -Start-Process $ProductionUrl -Write-Host "" -Write-Host " =============================================" -ForegroundColor Yellow -Write-Host " TESTE EM PRODUCAO OBRIGATORIO (Diretriz #2)" -ForegroundColor Yellow -Write-Host " =============================================" -ForegroundColor Yellow -Write-Host "" -Write-Host " URL: $ProductionUrl" -ForegroundColor Cyan -Write-Host "" -Write-Host " Checklist:" -ForegroundColor White -Write-Host " [ ] Site carrega corretamente" -ForegroundColor Gray -Write-Host " [ ] Console sem erros (F12)" -ForegroundColor Gray -Write-Host " [ ] Funcionalidade testada OK" -ForegroundColor Gray -Write-Host "" - -$testOK = Read-Host " TESTES OK? (s/n)" -if ($testOK -ne 's' -and $testOK -ne 'S') { - Write-FAIL "Testes nao confirmados - COMMIT BLOQUEADO (Diretriz #2)" - Write-Host "" - Write-Host " As alteracoes de VERSION e CHANGELOG foram feitas." -ForegroundColor Yellow - Write-Host " Corrija o problema e execute novamente." -ForegroundColor Yellow - exit 1 -} -Write-OK "Testes confirmados pelo usuario" - -# REGRA #5: Commit -Write-Step 6 7 "Git Commit (Regra #5)..." -Push-Location $ProjectRoot -$env:WEBMONEY_RELEASE = "true" -git add -A 2>&1 | Out-Null -git commit -m "v$newVersion - $ChangeDescription" 2>&1 | Out-Null -$env:WEBMONEY_RELEASE = $null -Pop-Location -Write-OK "Commit: v$newVersion - $ChangeDescription" - -# Push -Write-Step 7 7 "Git Push..." -Push-Location $ProjectRoot -git push 2>&1 | Out-Null -Pop-Location -Write-OK "Push realizado" - -# ============================================================================= -# CONCLUSAO -# ============================================================================= - -Write-Header "Release v$newVersion Concluida" - -Write-Host " VERSION: $newVersion" -ForegroundColor Green -Write-Host " CHANGELOG: Atualizado" -ForegroundColor Green -Write-Host " DEPLOY: $Deploy" -ForegroundColor Green -Write-Host " TESTE: Confirmado" -ForegroundColor Green -Write-Host " COMMIT: OK" -ForegroundColor Green -Write-Host " PUSH: OK" -ForegroundColor Green -Write-Host "" -Write-Host " $ProductionUrl" -ForegroundColor Cyan -Write-Host "" -Write-Host " Todas as diretrizes v3.0 foram seguidas." -ForegroundColor Green -Write-Host "" diff --git a/scripts/setup-ssh.ps1 b/scripts/setup-ssh.ps1 deleted file mode 100644 index efef8d6..0000000 --- a/scripts/setup-ssh.ps1 +++ /dev/null @@ -1,62 +0,0 @@ -# ============================================================================= -# WEBMoney - Configuração Inicial SSH (Executar apenas UMA vez) -# ============================================================================= -# Copia a chave pública SSH para o servidor, permitindo conexões sem senha -# ============================================================================= - -$Server = "213.165.93.60" -$User = "root" -$Password = "Master9354" - -Write-Host "" -Write-Host "╔═══════════════════════════════════════════════════════════════╗" -ForegroundColor Cyan -Write-Host "║ CONFIGURAÇÃO SSH SEM SENHA - WebMoney ║" -ForegroundColor Cyan -Write-Host "╚═══════════════════════════════════════════════════════════════╝" -ForegroundColor Cyan -Write-Host "" - -# Verificar se já existe chave SSH -$sshKeyPath = "$env:USERPROFILE\.ssh\id_rsa.pub" - -if (-not (Test-Path $sshKeyPath)) { - Write-Host "Gerando par de chaves SSH..." -ForegroundColor Yellow - ssh-keygen -t rsa -b 4096 -f "$env:USERPROFILE\.ssh\id_rsa" -N '""' -q - Write-Host "✓ Chaves geradas" -ForegroundColor Green -} - -$pubKey = Get-Content $sshKeyPath - -Write-Host "" -Write-Host "Servidor: $Server" -ForegroundColor White -Write-Host "Usuário: $User" -ForegroundColor White -Write-Host "" -Write-Host "A contraseña do servidor será solicitada: " -NoNewline -ForegroundColor Yellow -Write-Host $Password -ForegroundColor Red -Write-Host "" - -# Comando para adicionar a chave no servidor -$sshCommand = "mkdir -p ~/.ssh && chmod 700 ~/.ssh && echo '$pubKey' >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys && echo 'OK'" - -Write-Host "Copiando chave pública para o servidor..." -ForegroundColor Yellow -Write-Host "(Digite a senha quando solicitado)" -ForegroundColor Gray -Write-Host "" - -# Executar -$result = ssh -o StrictHostKeyChecking=no "$User@$Server" $sshCommand - -if ($result -eq "OK") { - Write-Host "" - Write-Host "╔═══════════════════════════════════════════════════════════════╗" -ForegroundColor Green - Write-Host "║ ✓ SSH CONFIGURADO COM SUCESSO! ║" -ForegroundColor Green - Write-Host "╚═══════════════════════════════════════════════════════════════╝" -ForegroundColor Green - Write-Host "" - Write-Host "Agora você pode conectar sem senha:" -ForegroundColor White - Write-Host " ssh root@$Server" -ForegroundColor Cyan - Write-Host "" - Write-Host "Os scripts de deploy funcionarão automaticamente." -ForegroundColor White - Write-Host "" -} else { - Write-Host "" - Write-Host "⚠ Algo pode ter dado errado. Teste a conexão:" -ForegroundColor Yellow - Write-Host " ssh root@$Server" -ForegroundColor Cyan - Write-Host "" -} diff --git a/scripts/status.ps1 b/scripts/status.ps1 deleted file mode 100644 index 09b5885..0000000 --- a/scripts/status.ps1 +++ /dev/null @@ -1,96 +0,0 @@ -# ============================================================================= -# WEBMoney - Status do Projeto (Conforme Diretrizes v3.0) -# ============================================================================= - -$ProjectRoot = "c:\Users\marco\OneDrive\Documents\WebMoney" - -Write-Host "" -Write-Host "=======================================================" -ForegroundColor Cyan -Write-Host " WEBMoney - Status (Diretrizes v3.0)" -ForegroundColor Cyan -Write-Host "=======================================================" -ForegroundColor Cyan -Write-Host "" - -# Versao -$version = (Get-Content (Join-Path $ProjectRoot "VERSION")).Trim() -Write-Host " Versao: " -NoNewline -Write-Host $version -ForegroundColor Green - -# Ultima entrada do CHANGELOG -$changelog = Get-Content (Join-Path $ProjectRoot "CHANGELOG.md") -Raw -if ($changelog -match '\[(\d+\.\d+\.\d+)\] - (\d{4}-\d{2}-\d{2})') { - Write-Host " Ultimo commit: " -NoNewline - Write-Host "$($Matches[1]) ($($Matches[2]))" -ForegroundColor White -} - -# Git status -Push-Location $ProjectRoot -$gitBranch = git branch --show-current 2>$null -$gitStatus = git status --porcelain 2>$null -Pop-Location - -Write-Host " Branch: " -NoNewline -Write-Host $gitBranch -ForegroundColor Yellow - -# Status de mudancas -$changedFiles = @($gitStatus | Where-Object { $_ }).Count -if ($changedFiles -gt 0) { - Write-Host " Mudancas: " -NoNewline - Write-Host "$changedFiles arquivos modificados" -ForegroundColor Red - Write-Host "" - Write-Host " AVISO: Existem mudancas nao commitadas!" -ForegroundColor Yellow - Write-Host " Execute release.ps1 para seguir as diretrizes." -ForegroundColor Yellow -} else { - Write-Host " Mudancas: " -NoNewline - Write-Host "Nenhuma (working tree clean)" -ForegroundColor Green -} - -Write-Host "" -Write-Host "-------------------------------------------------------" -ForegroundColor Gray - -# SSH Status -Write-Host "" -$sshTest = ssh -o ConnectTimeout=3 -o BatchMode=yes root@213.165.93.60 "echo OK" 2>$null -if ($sshTest -eq "OK") { - Write-Host " SSH: " -NoNewline - Write-Host "Conectado (sem senha)" -ForegroundColor Green -} else { - Write-Host " SSH: " -NoNewline - Write-Host "Requer configuracao" -ForegroundColor Red - Write-Host " Execute: .\scripts\setup-ssh.ps1" -ForegroundColor Gray -} - -Write-Host "" -Write-Host "-------------------------------------------------------" -ForegroundColor Gray -Write-Host "" - -# Diretrizes -Write-Host " DIRETRIZES v3.0 (Sempre seguir):" -ForegroundColor Yellow -Write-Host " 1. VERSION + CHANGELOG em cada commit" -ForegroundColor Gray -Write-Host " 2. Deploy via scripts (nunca manual)" -ForegroundColor Gray -Write-Host " 3. Teste em producao OBRIGATORIO" -ForegroundColor Gray -Write-Host " 4. Commit somente apos teste OK" -ForegroundColor Gray - -Write-Host "" -Write-Host "-------------------------------------------------------" -ForegroundColor Gray -Write-Host "" - -# URLs -Write-Host " URLs:" -ForegroundColor White -Write-Host " Producao: https://webmoney.cnxifly.com" -ForegroundColor Cyan -Write-Host " API: https://webmoney.cnxifly.com/api" -ForegroundColor Cyan - -Write-Host "" -Write-Host "-------------------------------------------------------" -ForegroundColor Gray -Write-Host "" - -# Comandos -Write-Host " Comandos:" -ForegroundColor White -Write-Host " .\scripts\dev.ps1 " -NoNewline -ForegroundColor Yellow -Write-Host "Desenvolvimento local" -ForegroundColor Gray -Write-Host " .\scripts\quick-deploy.ps1 " -NoNewline -ForegroundColor Yellow -Write-Host "Deploy rapido (dev)" -ForegroundColor Gray -Write-Host " .\scripts\release.ps1 " -NoNewline -ForegroundColor Yellow -Write-Host "Release oficial" -ForegroundColor Green -Write-Host "" - -Write-Host ""