- Change totals display to single horizontal line using shared CSS
- Rename column headers from "Sold Prec" to "Sume Prec" (correct terminology)
- Add class totals (TOTAL CLASA 1-7) and grand total to PDF export
- Style class totals with light gray background, grand total with darker gray
- Update CLAUDE.md with rule to use shared CSS instead of creating new styles
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
The totals PL/SQL block was generating invalid SQL with duplicate WHERE clauses
when bank/cash filters were applied (e.g., "WHERE bank_account=X WHERE dataact IS NULL").
Now properly uses AND when where_clause exists, WHERE otherwise.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Previously, totals were computed client-side from only the current page data,
which gave incorrect results when paginating. Now the backend calculates totals
across ALL filtered records and returns them in the API response.
- Invoice: Add total_sold_all field for sum of all filtered invoice balances
- Treasury: Add sold_precedent_all, total_incasari_all, total_plati_all, sold_final_all
- Trial Balance: Add 6-column totals (debit/credit for each balance type)
- Frontend stores and views updated to use backend totals
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add PeriodSelectorMini component for global period selection
- Add accountingPeriod store for shared period state
- Add calendar service/router/model for available periods API
- Update Dashboard, Invoices, Trial Balance, Bank/Cash Register views
to respect selected period
- Fix Trial Balance navigation sync bug (period now syncs on mount)
- Update backend services to accept luna/an parameters
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Truncate explicatia field to 100 characters in table, Excel, and PDF exports
- Fix summary stats to separate opening balance from transactions:
- Show Sold Precedent (from rows with null date)
- Show Încasări and Plăți (only from actual transactions)
- Show Sold Final (calculated correctly)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Move menuOpen state from DashboardHeader to App.vue for proper state management
- Pass menuOpen as prop to DashboardHeader component
- Translate hamburger menu labels to Romanian (Navigation, Invoices, Bank & Cash, System, Cache Statistics)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Move DataTable striped rows and hover styling to global primevue-overrides.css
- Add .summary-stats-inline pattern to shared stats.css
- Refactor BankCashRegisterView.vue: CSS reduced from ~210 to 45 lines (78%)
- Refactor TrialBalanceView.vue: CSS reduced from ~100 to 42 lines (58%)
- Remove :deep() violations by using global DataTable overrides
- Update templates to use shared classes (.table-empty, .loading-state, .form-actions)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add bancasa as third sorting criterion (date, number, bank name)
- Sort null-date rows (previous balances) alphabetically by bank name
- Sort bank names alphabetically in PDF export
- Improve window function for cumulative balance calculation
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
The singleton BackendAPIClient was failing with "Cannot send a request,
as the client has been closed" error when used after async context
manager closed it in linking.py. Changed all client checks from
`if not self.client` to `if not self.client or self.client.is_closed`
to properly recreate the AsyncClient when needed.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add .env.test with test credentials and company config
- Add pytest fixtures for cache initialization (temp SQLite)
- Add test_api_real.py (18 tests) - API endpoint tests
- Add test_cache_real.py (8 tests) - Cache system tests
- Add test_services_real.py (9 tests) - Service layer tests
- Use company 110 (MARIUSM_AUTO) - only schema with full data in TEST
All 35 backend tests pass.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Frontend:
- Refactored CSS architecture with new utility classes
- Updated dashboard components styling
- Improved responsive grid system
- Enhanced typography and variables
- Updated E2E and integration tests
Added:
- Claude Code slash commands for validation
- SSH tunnel and start test scripts
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Optimize PDF export layout with compact columns and more space for partner names.
Add accounting period display to invoices matching Trial Balance format. Fix date
filtering to use local timezone instead of UTC. Update invoice ordering to
chronological sequence (DATAACT, NRACT, NUME).
**Backend changes:**
- Add accounting period query from calendar table
- Add currency (valuta) and cont filter support
- Change invoice ordering to chronological (DATAACT ASC, NRACT ASC, NUME)
- Add accounting_period field to InvoiceListResponse model
**Frontend changes:**
- Optimize PDF column widths (37% for partner names, compact numeric columns)
- Add custom column width support in exportUtils
- Fix date conversion from UTC to local timezone (prevents day shift)
- Add accounting period display in PDF exports
- Enhance E2E test coverage
**Cleanup:**
- Remove obsolete Trial Balance feature documentation
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add multi-line header: company name, centered title, centered period
- Implement pagination with page numbers in footer
- Add generation timestamp in footer
- Optimize column width distribution (Cont: 7%, Denumire: 33%, Values: 10% each)
- Align Cont column to left, all numeric columns to right
- Remove debug console.log statements
- Fix company name property (.firma → .name)
- Use full page width for table (281mm on A4 landscape)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Refactor table columns from grouped (Debit+Credit vertical) to separate columns for better scannability
- Replace custom HTML buttons with PrimeVue Button components (icon + label)
- Move filter action buttons to separate row below filters (matches InvoicesView pattern)
- Add Excel and PDF export functionality that fetches ALL data (not just current page)
- Update CSS_PATTERNS.md with unified table column structure and filter button patterns
- Update CLAUDE.md with table styling requirements and anti-patterns
This ensures visual consistency across all table views in the application.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
After database verification, VBAL is a VIEW (not a table) that exists
in each company schema with a different structure than initially assumed.
Backend Changes:
- Updated models (trial_balance.py):
- Changed column names to match real VBAL VIEW
- CONT (account number)
- DENUMIRE (account description, not DCONT)
- PRECDEB/PRECCRED (previous balance, not SD_PREC/SC_PREC)
- RULDEB/RULCRED (monthly movement, not RD_LUNA/RC_LUNA)
- SOLDDEB/SOLDCRED (final balance, not SD_FINAL/SC_FINAL)
- Made DENUMIRE optional (can be NULL in VIEW)
- Updated router (trial_balance.py):
- Removed COD_FIRMA filter (not in VIEW)
- Query now uses: {schema}.VBAL WHERE AN = :an AND LUNA = :luna
- Fixed column names in SELECT (DENUMIRE instead of DCONT)
- Updated sort columns validation
- Fixed result processing to match new column order
Frontend Changes:
- Updated TrialBalanceView.vue:
- Changed field from 'dcont' to 'denumire' in DataTable column
Database Verification:
- VBAL VIEW confirmed in ROMFAST schema (24,217 records)
- Current data available up to November 2025
- Structure verified with 22 columns
- VIEW exists in all company schemas
Testing Notes:
- Backend endpoint ready for testing
- Frontend field names now match API response
- Ready for manual testing with real company data
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Major documentation refactoring to eliminate duplications and improve maintainability:
CLAUDE.md (562→230 lines, 59% reduction):
- Eliminated duplicate content with README.md
- Added smart references to detailed documentation
- Streamlined "Common Development Tasks" with golden rules
- Created comprehensive "Documentation Index" as single source of truth
- Focused on AI-friendly quick reference patterns
README.md (402→251 lines, 37% reduction):
- Simplified Quick Start to single command
- Condensed Tech Stack to one-line summary with CLAUDE.md reference
- Merged "Development Commands" + "Testing" into compact section
- Updated Production Deployment with modern workflow (Publish-And-Deploy.ps1, ROA2WEB-Console.ps1)
- Added Frontend Styling & CSS documentation references
Key improvements:
- Zero duplications across documentation files
- Clear separation: README.md = quick start, CLAUDE.md = development guide
- Smart cross-references between docs
- Updated deployment section with current scripts
- Maintained all essential information while reducing context by 446 lines
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Update PROGRESS_TRACKER.md: 25% complete (2/7 phases)
- Mark Phase 2 as complete in phase-2-foundation.md
- Update current sprint status and achievements
- Next: Phase 3 - PrimeVue Centralizare
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Remove TELEGRAM_EMAIL_AUTH_PLAN.md as email authentication feature
was not implemented. The current authentication method via web app
linking code remains the only supported method.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Implements VAT (TVA) balance tracking for both previous and current month with
mutually exclusive calculations (either payable OR recoverable per period).
Backend Changes:
- Add 4 TVA fields to DashboardSummary model
- Implement TVA query from vbal table (accounts 4423, 4424, 4426, 4427)
- Add exclusive calculation logic:
* Previous month: difference between account 4423 (payable) OR 4424 (recoverable)
* Current month: difference 4427-4426 (payable if >0, recoverable if <0)
Telegram Bot Changes:
- Add compact TVA section to dashboard formatter
- Display only when values > 0
- Format: "TVA de plată/recuperat precedent/curent"
Example output:
**Solduri TVA:**
- TVA de plată precedent: 7,284 RON
- TVA de recuperat curent: 3,200 RON
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit introduces a complete deployment automation system for Windows Server deployment:
New Features:
- Publish-And-Deploy.ps1: Interactive console for building locally and transferring to server
* Supports auto-detection of transfer method (Windows Share or SSH)
* Configurable via deploy-config.json
* Integrated with Build-ROA2WEB.ps1 for consistent builds
- Check-And-Deploy.ps1: Server-side auto-deployment script
* Monitors transfer directory for new packages
* Automatically deploys when new version detected
* Integrates with ROA2WEB-Console.ps1 for deployment
- Setup-AutoDeploy.ps1: Configures scheduled task for auto-deployment
- DEPLOYMENT_AUTOMATION.md: Complete documentation for automation workflow
Bug Fixes:
- Fix path resolution in Publish-And-Deploy.ps1: Added Resolve-FullPath function to correctly resolve ../deploy-package path
- Fix ROA2WEB-Console.ps1 exit codes: Properly return boolean values and exit codes in non-interactive mode
- Fix Build-ROA2WEB.ps1 script copying: Added debug output and force deletion to avoid caching issues
Enhancements:
- ROA2WEB-Console.ps1: Support for ROA2WEB_SOURCE environment variable for flexible source paths
- Build-ROA2WEB.ps1: Enhanced debug output for troubleshooting script copying issues
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Fixed critical runtime error where backend service couldn't import
shared modules (ModuleNotFoundError: No module named 'database').
Changes:
- Updated Install-BackendFirstTime: Set PYTHONPATH to shared directory
instead of parent directory
- Added Fix-BackendPythonPath.ps1: Quick fix script for existing
installations
The backend imports 'from database.oracle_pool' which requires the
database module to be in PYTHONPATH. Previously PYTHONPATH pointed to
C:\inetpub\wwwroot\roa2web but the database module is located at
C:\inetpub\wwwroot\roa2web\shared\database. Now PYTHONPATH correctly
points to the shared directory.
For existing installations, run Fix-BackendPythonPath.ps1 as Administrator
to update the service configuration without reinstalling.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
## Bug Fix
### Problem
IIS configuration failed with error:
```
[INSTALLATION FAILED] Cannot validate argument on parameter 'Name'.
The argument is null. Provide a valid value for the argument, and then try running the command again.
at Install-BackendFirstTime, line 643
```
The error occurred at line 643:
```powershell
Remove-WebAppPool -Name $Config.IISAppPoolName -ErrorAction SilentlyContinue
```
### Root Cause
Global configuration was missing IIS-related properties used in the IIS setup section:
- `$Config.IISAppPoolName` - used for Application Pool name (line 643, 646, 647)
- `$Config.IISSiteName` - used for IIS Site name (line 651, 653, 657)
- `$Config.IISAppName` - used for Web Application name (line 651, 653, 656)
When the script tried to use these null values, PowerShell validation failed.
### Solution
Added IIS configuration properties to `$script:Config` hashtable (lines 81-84):
```powershell
# IIS Configuration
IISSiteName = "Default Web Site"
IISAppName = "roa2web"
IISAppPoolName = "ROA2WEB-AppPool"
```
### Impact
- IIS Application Pool creation now works correctly
- Web Application is created under "Default Web Site" with path "/roa2web"
- Frontend files are served through IIS with proper app pool isolation
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
## Bug Fix
### Problem
Deployment failed with error:
```
[INSTALLATION FAILED] You cannot call a method on a null-valued expression.
at Install-BackendFirstTime, line 611
```
The error occurred at line 611:
```powershell
& nssm install $Config.BackendServiceName $pythonPath "-m" "uvicorn" ... "--port" $Config.BackendPort.ToString()
```
### Root Cause
Global configuration was missing required properties used by service installation functions:
- `$Config.BackendPort` - used in NSSM service creation (line 611)
- `$Config.BackendServiceDisplayName` - used for service display name (line 612)
- `$Config.BackendServiceDescription` - used for service description (line 613)
- `$Config.TelegramBotServiceDisplayName` - used in telegram bot service (line 816)
- `$Config.TelegramBotServiceDescription` - used in telegram bot service (line 817)
- `$Config.TelegramBotPort` - added for consistency (not yet used)
When the script tried to call `.ToString()` on `$Config.BackendPort`, it was null, causing the error.
### Solution
Added missing properties to `$script:Config` hashtable (lines 63-96):
**Backend properties:**
- `BackendPort = 8000`
- `BackendServiceDisplayName = "ROA2WEB Backend API"`
- `BackendServiceDescription = "FastAPI backend service for ROA2WEB application"`
**Telegram Bot properties:**
- `TelegramBotPort = 8002`
- `TelegramBotServiceDisplayName = "ROA2WEB Telegram Bot"`
- `TelegramBotServiceDescription = "Telegram bot frontend for ROA2WEB application"`
### Impact
- Backend service creation now works correctly with proper port configuration
- Service display names and descriptions are properly set in Windows Services
- Configuration is now complete and consistent
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
## Bug Fix
### Problem
Backend deployment failed with error:
```
[INSTALLATION FAILED] You cannot call a method on a null-valued expression.
at Install-BackendFirstTime, line 609
```
The error occurred because `$pythonPath` was being used in service creation (line 609), but it was defined inside the `if (Test-Path $requirementsPath)` block. If requirements.txt didn't exist (or for any reason the block was skipped), the variable would be null when used later.
### Root Cause
Variable scope issue - paths were defined inside the requirements check block:
```powershell
# Before (WRONG):
if (Test-Path $requirementsPath) {
$pipPath = Join-Path $venvPath "Scripts\pip.exe"
$pythonPath = Join-Path $venvPath "Scripts\python.exe" # Only defined if requirements exists!
...
}
# Later:
& nssm install ... $pythonPath ... # ERROR: $pythonPath is null!
```
### Solution
Moved path definitions BEFORE the if block to ensure they're always available:
```powershell
# After (CORRECT):
$pipPath = Join-Path $venvPath "Scripts\pip.exe"
$pythonPath = Join-Path $venvPath "Scripts\python.exe" # Always defined
$requirementsPath = Join-Path $Config.BackendPath "requirements.txt"
if (Test-Path $requirementsPath) {
# Use the paths here
}
# Later:
& nssm install ... $pythonPath ... # OK: $pythonPath is defined
```
### Changes
- `Install-BackendFirstTime`: Moved `$pipPath`, `$pythonPath`, `$requirementsPath` definitions outside the if block
- `Install-TelegramBotFirstTime`: Applied the same fix to prevent future issues
### Tested
This ensures paths are always available for service creation, regardless of whether requirements.txt exists or the if block executes.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit completes the unified Windows deployment console with automatic detection of first-time install vs update, eliminating the need for separate Install-*.ps1 scripts.
## Changes
### Added Detection Functions
- `Test-BackendInstalled`: Checks if backend is installed (venv + service + requirements.txt)
- `Test-TelegramBotInstalled`: Checks if telegram bot is installed (venv + service + app files)
### Added Prerequisite Installation Functions
- `Install-Chocolatey`: Automated Chocolatey package manager installation
- `Install-Python`: Python 3.11 installation via Chocolatey
- `Install-NSSM`: NSSM (Windows service manager) installation via Chocolatey
- `Install-IISModules`: IIS and required modules (URL Rewrite, Application Initialization)
### Added First-Time Installation Functions
- `Install-BackendFirstTime`: Complete backend first-time installation (~240 lines)
- Directory structure creation
- Backend, frontend, shared files copying with exclusions
- .env.example template copying
- Virtual environment creation with proper pip installation
- Windows Service creation via NSSM
- IIS Application Pool and Web Application configuration
- `Install-TelegramBotFirstTime`: Complete telegram bot first-time installation (~155 lines)
- Directory structure (app, data, logs, temp, backups)
- App files and requirements.txt copying
- Virtual environment creation
- Windows Service creation via NSSM
### Updated Deployment Functions with Auto-Routing
- `Deploy-Backend`: Now calls `Test-BackendInstalled` first
- If NOT installed → routes to `Install-BackendFirstTime`
- If installed → proceeds with existing UPDATE logic (backup, stop, update, start)
- `Deploy-TelegramBot`: Now calls `Test-TelegramBotInstalled` first
- If NOT installed → routes to `Install-TelegramBotFirstTime`
- If installed → proceeds with existing UPDATE logic (backup, stop, update, start)
## Benefits
1. **Single Entry Point**: Users can run the same deploy command for both first-time install and updates
2. **No Separate Install Scripts**: Eliminates confusion between Install-*.ps1 and Deploy-*.ps1
3. **Automatic Detection**: Intelligently detects what needs to be done
4. **Safer Updates**: Always checks if components exist before attempting updates
5. **Better UX**: Clear warnings about first-time installation vs updates
## Usage
```powershell
# Interactive (auto-detects install vs update)
.\ROA2WEB-Console.ps1
# Select: Deploy Components > Backend + Frontend
# Command line (auto-detects install vs update)
.\ROA2WEB-Console.ps1 -NonInteractive -Action DeployBackend
.\ROA2WEB-Console.ps1 -NonInteractive -Action DeployTelegramBot
.\ROA2WEB-Console.ps1 -NonInteractive -Action DeployAll
```
The console will automatically:
- Detect if backend/telegram-bot are installed
- Perform first-time installation if needed (including prerequisites)
- Perform updates if already installed (with automatic backups)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Major improvements to deployment workflow with unified scripts and interactive menus.
New unified scripts:
- Build-ROA2WEB.ps1: Interactive menu for building all components
* Isolated temp directory for frontend builds (prevents WSL node_modules corruption)
* Automatic devDependencies installation (fixes Vite not found issue)
* Auto-cleanup after build
* Supports both interactive menu and non-interactive CLI
- ROA2WEB-Console.ps1: All-in-one deployment and management console
* Interactive menus for deploy, manage services, and status checks
* Automatic backups before deployment
* Smart dependency updates (only if requirements.txt changed)
* Health checks after service operations
* Color-coded status output
* Both interactive and non-interactive modes
Removed deprecated scripts (replaced by unified tools):
- Build-Frontend.ps1 → Use Build-ROA2WEB.ps1 -Component Frontend
- Build-TelegramBot.ps1 → Use Build-ROA2WEB.ps1 -Component TelegramBot
- Deploy-ROA2WEB.ps1 → Use ROA2WEB-Console.ps1 [Deploy menu]
- Deploy-TelegramBot.ps1 → Use ROA2WEB-Console.ps1 [Deploy menu]
- Manage-ROA2WEB.ps1 → Use ROA2WEB-Console.ps1 [Manage menu]
Updated documentation:
- Complete rewrite of scripts/README.md
- Clear workflow guides for first-time deployment and updates
- Comparison table v1.0 vs v2.0
- Updated best practices and troubleshooting
Benefits:
✅ Reduced from 13 to 8 scripts (better maintainability)
✅ Interactive menus for better UX
✅ Fixed WSL node_modules corruption issue
✅ Smart dependency management (faster deployments)
✅ Unified interface reduces learning curve
✅ Better error handling and health checks
🤖 Generated with Claude Code (https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Remove FakeMessage wrapper class and implement consistent message editing
for web app code login flow. User-submitted code is now deleted immediately
and instructions message transforms in-place to show menu, matching the
email login UX pattern.
Changes:
- Remove FakeMessage class from start_command handler
- Use direct edit_message_text for all message updates
- Delete user's code message for cleaner chat interface
- Preserve web_login_message_id in context throughout flow
- Apply same pattern to handle_text_message (8-char code handler)
- Ensure single editable message from instructions to menu
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Consolidate login flow to use single message that edits in place
- Auto-delete all user messages (email, code, password, /start command)
- Remove all emojis from bot messages for cleaner interface
- Fix "Retrimite Cod" bug - buttons now persist after resending code
- Replace "Oracle" with "ROA" in all user-facing messages
- Add clear instructions for each step (email input, code input, password)
- Implement message tracking with context.user_data['login_message_id']
- Clean chat history - only menu message remains visible
Files modified:
- app/bot/email_handlers.py: Complete refactor of email login flow
- app/bot/handlers.py: Update /start command to delete user message and edit existing message
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Initial encrypted backup of all sensitive configuration files and SSH keys
for version control and disaster recovery.
Contents:
- backend/.env and .env.prod (development and production config)
- telegram-bot/.env and .env.prod (bot configuration)
- secrets/ directory (SSH keys for Oracle server access)
Encryption: AES-256-CBC with PBKDF2 using OpenSSL
Total: 5 encrypted items (4 files + 1 directory archive)
Backup date: 2025-11-11 14:46:50
⚠️ IMPORTANT: Decryption password required for restore
Password format: ROA2WEB_Backup_2024_Secure_Key_YYYYMMDD
To restore:
./scripts/restore-secrets.sh 2025-11-11_14-46-50
All files are safely encrypted and can be committed to git without
exposing sensitive credentials. Decryption password must be stored
separately in password manager.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Extended backup and restore utilities to include the secrets/ directory
containing SSH keys for Oracle server access.
Changes:
- backup-secrets.sh: Added SECRET_DIRS array to backup entire directories as tar archives
- restore-secrets.sh: Added logic to detect and restore tar.enc directory archives
- Both scripts now handle:
* Individual .env files (as before)
* Complete directories (new: secrets/ with SSH keys)
Technical implementation:
- Directories are archived with tar and piped directly to openssl for encryption
- Uses tar -cf - to output to stdout, then pipes to openssl enc
- Restore decrypts and extracts in one step: openssl | tar -xf -
- Preserves directory structure and file permissions
Files backed up:
- reports-app/backend/.env and .env.prod
- reports-app/telegram-bot/.env and .env.prod
- secrets/ directory (SSH keys: roa_oracle_server, *.pub, .gitkeep)
Backup structure now includes:
- *.env.enc (individual encrypted files)
- secrets.tar.enc (encrypted tar archive of directory)
Tested successfully with encryption/decryption cycle.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>