Repository navigation
Releases: dhannyjsb/CTM
Release list
v1.0.5
🔒 Advanced Duplicate Prevention System
✨ Fitur Baru
- Multi-Layer Subdomain Validation
- Backend Database Check: Prevent subdomain conflicts antar device
- Cloudflare DNS Check: Detect existing DNS records dengan smart caching
- Local Duplicate Check: Validate dalam mapping yang sama
- Pre-validation sebelum kirim ke API (prevent unnecessary API calls)
- Smart DNS Record Caching System
- DNS records cache dengan 30 detik TTL
- Reduced API calls hingga 90%+ (rate limit protection)
- Automatic cache invalidation setelah create/delete operations
- Fallback ke stale cache saat API error
- Optimized untuk Cloudflare API rate limits (1200 req/5min)
- Transaction Rollback Mechanism
- Automatic rollback jika DNS record creation gagal
- State management dengan optimistic updates
- Error collection untuk multiple mapping failures
- Clean state restoration pada failure
🎨 UI/UX Improvements
- Enhanced Error Messages
- Display full hostname (subdomain + domain) dalam error messages
- Specific error source indicators:
⚠️ Subdomain "app.domain.com" sudah digunakan oleh device lain!⚠️ Subdomain "app.domain.com" sudah terdaftar di Cloudflare DNS!
- Real-time validation feedback dengan loading indicator
- Clear distinction antara backend dan DNS conflicts
- Visual Feedback System
🔍 Checking subdomain availability...loading state- Error messages dengan emoji indicators untuk quick recognition
- Color-coded status badges di mapping table
- Informative error messages dengan actionable suggestions
🔧 Technical Improvements
- DNS Record Detection Enhancement
// Get ALL records dengan smart filtering - Case-insensitive hostname matching - Multiple match strategies (exact, prefix, suffix) - Support subdomain-only dan full hostname searches - Reduced per_page from 5000 → 100 (optimized)
- Validation Flow Optimization
1. Local duplicate check (instant) 2. Backend database check (JWT authenticated) 3. Cloudflare DNS check (cached, 30s TTL) 4. ABORT if ANY check fails 5. Proceed to API calls only if ALL checks pass - Error Handling Strategy
- Changed from optimistic (allow on error) to pessimistic (block on error)
- DNS record creation MUST succeed for ALL mappings
- Transaction-like behavior dengan complete rollback
- Better error propagation ke user interface
🐛 Bug Fixes
- Fixed
getCredentials is not definederror di TunnelList component - Fixed duplicate
deviceobject di preload.cjs (method override issue) - Fixed
ensureValidTokenvsensureAuthenticatedmethod mismatch - Fixed DNS records not detected karena filter API parameter
- Fixed duplicate entries ke database saat DNS creation failed
- Fixed subdomain check tidak detect existing records
🔒 Security Enhancements
- Strict Validation Policy
- Zero tolerance untuk duplicate subdomains
- Multiple validation layers untuk maximum safety
- JWT authentication untuk backend checks
- Prevent race conditions dengan proper state management
- Safe API Operations
- All checks MUST pass sebelum API modifications
- Automatic rollback mechanism untuk data integrity
- Error boundary implementation untuk graceful failures
- Cache invalidation untuk fresh data after mutations
📦 Performance Optimizations
- DNS Cache System
- 30-second cache TTL untuk balance freshness vs performance
- Reduced Cloudflare API calls dari N requests → 1 request per 30s
- Smart cache invalidation setelah mutations
- Memory-efficient Map-based caching
- API Call Reduction
Before: 10 subdomain checks = 10 API calls (5000 records each) After: 10 subdomain checks = 1 API call (100 records, cached) Reduction: 90%+ less API calls
🎯 User Experience Flow
- Add Mapping Validation:
User enters subdomain ↓ 🔍 Checking availability... ↓ Check local duplicates → Check backend → Check DNS ↓ ✅ Available → Proceed ❌ Taken → Show detailed error with source - Error Prevention:
- No API calls until ALL validations pass
- Clear error messages dengan full hostname
- Actionable feedback (pilih subdomain lain)
- State preserved untuk easy retry
- Transaction Safety:
- DNS creation errors → Rollback state
- Form data preserved on error
- Clear indication of what failed
- No partial updates di database
💡 Benefits
✅ Zero Duplicate Risk: Multi-layer validation prevents all conflicts
✅ Rate Limit Safe: Smart caching protects against API limits
✅ Better UX: Clear error messages dengan full context
✅ Data Integrity: Transaction rollback prevents partial updates
✅ Performance: 90%+ reduction dalam API calls
✅ Developer Friendly: Enhanced logging untuk debugging
✅ Production Ready: Pessimistic error handling untuk stability
v1.0.4
🎓 Erapor 2025 Integration
✨ Fitur Baru
- Smart Port 8239 Detection
- Automatic detection port 8239 untuk Erapor 2025 application
- Check keberadaan file
C:\appraporsmaref25\wwwroot\app\Config\App.php - Validasi konfigurasi baseURL di CodeIgniter App.php
- Real-time monitoring changes pada port mappings
- Auto-Configuration System
- Banner notification saat port 8239 terdeteksi dan file App.php ditemukan
- One-click apply configuration dengan tombol "Apply Erapor 2025"
- Automatic backup file sebelum modification (
.backup.{timestamp}) - Domain matching validation: pastikan hostname mapping = baseURL config
- Insert/update public
__construct()method dengan markers
- Auto-Cleanup on Delete
- Automatic restore ke default config saat mapping port 8239 dihapus
- Marker-based precise block detection dan removal
- START/END markers untuk clean deletion tanpa code fragments
- Restore backup dengan timestamp sebelum cleanup
- Visual Status Indicators
- Yellow Banner: Muncul saat port 8239 aktif tapi config belum applied
- Menampilkan domain comparison (Expected vs Current)
- Tombol "Apply Erapor 2025" dan "Dismiss"
- Green Badge: Muncul di tabel mapping saat konfigurasi sudah benar
- Badge "Erapor Online ✓" dengan checkmark icon
- Ditampilkan di sebelah hostname untuk port 8239
- Hanya muncul saat configuration verified dan match
- Yellow Banner: Muncul saat port 8239 aktif tapi config belum applied
🎨 UI/UX Improvements
- Non-Intrusive Banner Design
- Positioned di bawah tombol "Add Mapping"
- Dapat di-dismiss tanpa apply jika belum siap
- Shows clear comparison antara expected vs current baseURL
- Loading state pada tombol apply
- Success/error messages dengan auto-hide
- Status Badge in Mapping Table
- Compact green badge dengan border dan subtle background
- Icon checkmark (✓) untuk visual confirmation
- Badge text: "Erapor Online ✓"
- Only visible when port 8239 properly configured
- Professional color scheme: green-500/20 background, green-400 text
🔧 Technical Implementation
- IPC Handlers (
electron/main/ipcHandlers.js):portMapping:checkErapor2025Config- Validate config vs mappingportMapping:applyErapor2025Config- Apply constructor with markersportMapping:restoreErapor2025Config- Clean removal of config block
- PHP File Parsing:
- Regex-based detection of existing constructor
- Marker detection:
//AUTO-CONFIG-FROM-CTM-STARTdanEND - baseURL extraction dan domain comparison
- Safe file operations dengan backup mechanism
- React Components:
Erapor2025Banner.jsx- Configuration prompt banner- Enhanced
PortMappingManager.jsxdengan auto-check dan badge rendering - State management untuk config status
- Auto-refresh after apply/restore operations
🔒 Security & Reliability
- File Safety:
- Automatic backup sebelum ANY modification
- Backup naming:
App.php.backup.{timestamp} - Restore capability jika terjadi error
- Validation:
- File existence check sebelum operations
- Domain format validation
- Config integrity verification
- Marker presence validation
- Error Handling:
- Graceful degradation jika file tidak accessible
- Clear error messages untuk user
- Logging untuk debugging
- Rollback capability via backups
📦 User Experience Flow
- Detection Phase:
- User create mapping dengan port 8239
- System check file App.php existence
- Validate current configuration
- Configuration Phase:
- Yellow banner appears jika config needed
- User click "Apply Erapor 2025"
- System backup file → insert constructor → refresh UI
- Green badge appears confirming success
- Active Phase:
- Green "Erapor Online ✓" badge visible di table
- Configuration active dan working
- No banner shown (clean UI)
- Cleanup Phase:
- User delete port 8239 mapping
- System auto-restore ke default config
- Remove constructor block cleanly
- Create restore backup
🎯 Benefits
✅ Zero manual PHP file editing
✅ One-click configuration management
✅ Automatic backup protection
✅ Visual confirmation of status
✅ Clean auto-cleanup on delete
✅ No code fragments left behind
✅ Professional visual indicators
✅ Seamless integration dengan existing workflow
v1.0.3
🔐 Cloudflared Binary Security & Update System
✨ Fitur Baru
- Hash-Based Version Detection
- Sistem deteksi versi cloudflared berdasarkan SHA-256 hash
- Automatic search melalui semua GitHub releases untuk identify versi lama
- Backend proxy
/cloudflared-releasesdengan cache 12 jam - Helper function
detectCloudflaredVersionByHash()untuk reusable detection
- Binary Security Verification
- Tiga status verification: Verified, Outdated, Corrupted
- Verified: Hash cocok dengan latest GitHub release (hijau)
- Outdated: Hash ditemukan di old releases (kuning, show version → latest)
- Corrupted: Hash TIDAK ditemukan di ANY release (merah, security warning!)
- Real-time hash comparison: Actual vs GitHub official
- Update System Enhancement
- Auto re-verify binary setelah update selesai
- Progress tracking: Download → Verify → Install → Complete
- Initial progress indicator (0.00 / 0.00 MB) sebelum download mulai
- Auto refresh info 3 detik setelah update completed
- Support status:
downloading,verifying,installing,completed
🎨 UI/UX Improvements
- Compact Hash Display
- Shortened hash: 16 chars → 12 chars (40% space reduction)
- Short labels: "Actual:" → "A:", "GitHub:" → "G:"
- Removed duplicate "Local" hash display
- Info button (ⓘ) di sebelah Cloudflared status
- Click untuk popup dialog dengan full hash verification details
- Hash Verification Dialog
- Full actual hash (installed binary)
- Full GitHub official hash
- Match indicator (✓ Match / ✗ Mismatch)
- Installed vs Latest version comparison
- File size & last modified info
- "Download & Install Update" button jika perlu update
- Status badge dengan warna sesuai kondisi
- One-Line Status Display
- Verified:
✓ 2025.11.1 (65.32 MB) - Outdated:
⚠ 2025.7.0 (65.32 MB) → 2025.11.1 - Corrupted:
🔴 Corrupted (0.12 MB)(red pulsing animation) - Removed verbose messages dan update buttons dari dashboard
- Cleaner, more professional look
- Verified:
🐛 Bug Fixes
- Fixed "Download undefined" saat cloudflared update dimulai
- Fixed version display showing wrong version (latest instead of installed)
- Fixed
latestVersionfield missing dari state - Fixed status mismatch: backend send
completed, frontend listencomplete - Fixed re-verification tidak jalan setelah update selesai
- Fixed JSX structure error (orphaned hash block)
🔧 Technical Improvements
- Backend Proxy Architecture
/cloudflared-latest: Single latest release (12h cache)/cloudflared-releases: All releases array (12h cache)- JWT authentication untuk all backend requests
- No GitHub rate limits dengan smart caching
- Version Detection Logic
1. Calculate SHA-256 hash of installed binary 2. Compare with latest release hash from backend 3. If mismatch → Search all releases for matching hash 4. Three outcomes: - Match latest → Verified ✓ - Match old release → Outdated ⚠ (show detected version) - No match → Corrupted 🔴 (security alert!) - Update Progress Enhancement
- Added
downloadedandtotalfields to initial progress - Support both
completedandcompletestatus - Increased post-update delay: 2s → 3s (file system settle time)
- Enhanced logging untuk debugging
- Added
🔒 Security Enhancements
- Corrupted Binary Detection
- Distinguish legitimate old version vs tampered binary
- Hash NOT found in official releases → Security warning
- Red pulsing animation untuk visual alert
- Prevents execution of potentially malicious binaries
- Progressive Disclosure Pattern
- Brief info in dashboard (space-efficient)
- Full details available via info button
- Tooltip shows full hash on hover
- Security-conscious UI design
📦 Build System
- Removed
prebuildhook yang auto-download cloudflared - Build lebih cepat (tidak download 65MB setiap build)
- Manual download via:
npm run update-cloudflaredatau app UI - Cloudflared management sepenuhnya via app interface
🔐 Sistem Autentikasi JWT (UPDATE BESAR)
✨ Fitur Baru
- Autentikasi Berbasis Device
- Registrasi dan autentikasi device otomatis
- Keamanan berbasis hardware fingerprint
- Zero configuration untuk end user
- Manajemen Token
- Access token jangka pendek (1 jam)
- Refresh token jangka panjang (7 hari)
- Mekanisme refresh token otomatis
- Kebijakan satu token aktif per device
- Auto-cleanup token expired dan revoked
- Fitur Keamanan
- Isolasi token per device
- Penyimpanan token lokal terenkripsi
- Autentikasi terikat hardware
- Expired dan cleanup token otomatis
- Validasi token yang ditingkatkan
🐛 Bug Fixes
- Fixed masalah pengiriman token autentikasi di beberapa hosting provider
- Resolved akumulasi token di database
- Optimasi logging untuk production environment
🔒 Peningkatan Keamanan
- Security Score: 9/10 (peningkatan signifikan)
- Enforce satu token aktif per device
- Validasi hardware fingerprint
- Penyimpanan credential terenkripsi
- Manajemen lifecycle credential otomatis
- Isolasi autentikasi per device
🎯 Keuntungan
✅ Zero configuration untuk user
✅ Autentikasi otomatis saat first launch
✅ Kontrol akses berbasis device yang aman
✅ Credential auto-expiring
✅ Keamanan hardware-bound
✅ Backward compatible dengan instalasi existing
✨ Fitur Lainnya
- Sistem changelog dinamis dengan integrasi GitHub
- Limit port mapping berdasarkan subscription tier
- Monitoring health check backend
- Indikator status koneksi real-time
🎨 UI/UX Improvements
- Enhanced quick actions di Dashboard
- Improved tombol kontrol service dengan status dinamis
- Indikator penggunaan port dengan color-coding
- Status koneksi backend real-time (🟢 Connected / 🔴 Disconnected)
🔧 Improvements
- Integrasi auto-release script
- Optimasi query port mapping
- Enhanced error handling dan user feedback
v1.0.2
✨ New Features
- Modern sidebar design with icon-only navigation
- Added Dashboard page with quick stats overview
- Connection status indicator with animated pulse
- Changelog page for version history
🎨 UI/UX Improvements
- Enhanced header and footer layout spanning full width
- Improved sidebar with subtle active state indication
- Consistent gradient color scheme across components
- Better spacing and typography hierarchy
- Fixed border alignment issues throughout app
🔧 Improvements
- Optimized title bar with Cloudflare icon
- Reduced header text size for cleaner look
- Tighter spacing in sidebar menu items
1.0.1
[1.0.2] - 2025-12-08
✨ New Features
- Modern sidebar design with icon-only navigation
- Added Dashboard page with quick stats overview
- Connection status indicator with animated pulse
- Changelog page for version history
🎨 UI/UX Improvements
- Enhanced header and footer layout spanning full width
- Improved sidebar with subtle active state indication
- Consistent gradient color scheme across components
- Better spacing and typography hierarchy
- Fixed border alignment issues throughout app
🔧 Improvements
- Optimized title bar with Cloudflare icon
- Reduced header text size for cleaner look
- Tighter spacing in sidebar menu items
1.0.0
[1.0.0] - 2025-12-07
🚀 Initial Release
- Cloudflare API integration for tunnel management
- Windows service management (install/start/stop/restart)
- Basic tunnel configuration with YAML generation
- Port mapping management (domain → local port)
- DNS record creation for tunnel domains
- Service status monitoring
- Auto-start on Windows boot option
- Electron-based desktop application
- Custom title bar with window controls
- Modern dark theme UI with Tailwind CSS