Commit Graph

272 Commits

Author SHA1 Message Date
eko ea72b74447 serve from file instead of object 2025-12-02 16:12:01 +07:00
eko 7fd4342405 serve from file instead of object 2025-12-02 16:10:05 +07:00
eko 805d19451c serve from file instead of object 2025-12-02 16:08:22 +07:00
eko 73b03e28ba change to use jszip 2025-12-02 16:03:42 +07:00
eko ae00815f76 add xlsx as raw file 2025-12-02 15:39:21 +07:00
eko 521e90264e revert default action type 2025-11-28 15:34:28 +07:00
eko e8e446ce16 default action check 2025-11-27 22:20:39 +07:00
eko 44d23f6e73 remove unnecessary check 2025-11-27 22:18:13 +07:00
eko a9bbe4dd84 default action type check 2025-11-27 22:13:42 +07:00
eko 0c120e217e list gz and zip 2025-11-27 22:08:44 +07:00
eko bcb8b5fa18 fix 2025-11-27 21:30:39 +07:00
eko 0e85aa93a2 fix 2025-11-27 19:00:42 +07:00
riz 9bf393fee8 Add immediate test response and enhanced debugging
- Return immediate response for root path to test if fetch handler is called
- Add step-by-step debugging through request processing pipeline
- This will isolate exactly where the hanging occurs in the complex logic

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-20 02:29:56 +00:00
riz cf461171e3 Add minimal test server to isolate Bun.serve networking issue
- Create simple test server on port 3001 to test Bun.serve functionality
- If test server works, issue is in complex application logic
- If test server hangs, issue is in Bun.serve or container networking
- This will isolate the root cause of the hanging requests

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-20 02:13:21 +00:00
riz 3c1346bd1a Add comprehensive request debugging to isolate hanging
- Log every incoming request with method, URL, and headers
- Add try-catch around entire fetch handler with stack traces
- Force development mode to false for production behavior
- This will show exactly where requests are failing or hanging

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-20 02:06:04 +00:00
riz cd3fc84db5 Add response debugging to isolate hanging issue
- Debug createResponse response object properties
- Replace with basic Response object to test if service-srv is the cause
- This will help identify if the hang is in createResponse or Bun.serve

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-20 01:49:22 +00:00
riz e137b1df7f Disable real-time compression to fix hanging requests
- Set high_compression: false in createResponse to prevent hanging
- The Brotli compression in service-srv createResponse was causing requests to hang
- Sites will now load instantly without compression overhead

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-20 01:17:52 +00:00
riz 26f277893f Fix Bun.serve port binding and error handling
- Add explicit hostname: '0.0.0.0' to bind all interfaces
- Add try/catch around server creation with proper error logging
- Add server error handler for runtime exceptions
- Add verification timeout to confirm server is actually listening
- Enhanced debugging to identify port binding issues

Fixes issue where server claimed success but wasn't actually listening on port 3000.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-20 01:14:27 +00:00
riz f6630579ba Skip Brotli compression entirely for instant server startup
- Removes blocking compression of 500+ files that caused long delays
- Server starts immediately without waiting for compression
- Sites load faster without pre-compression overhead

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-20 01:00:58 +00:00
riz dcfe331161 Make Brotli compression background to prevent blocking server startup
- Start compression asynchronously after 1 second delay
- Server can start immediately while compression happens in background
- Fixes slow site loading due to synchronous compression of 500+ files

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-20 01:00:17 +00:00
riz 5000dfaa75 Add metadata inflation detection and content tree restoration
- Detect which pages/components cause large content_tree sizes
- Report top 10 biggest offenders with size breakdown
- Support optimized ZIP format with separate content tree files
- Restore content_tree data from content/ directory files
- Provide detailed inflation analysis and recommendations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-20 00:47:46 +00:00
riz 177db0d3e5 Add debugging to serveWeb to identify slow response generation
- Add debug logs for serveWeb calls and timing
- Measure content length and response creation time
- Help identify if createResponse is the bottleneck
- Debug Bad Gateway timeout issues

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-20 00:29:02 +00:00
riz d8e05e58cb Add comprehensive debugging to createServer function
- Add debug logs for API directory scanning
- Add debug logs for server creation phases
- Add debug logs for Bun.serve startup
- Help identify where server startup fails
- Debug potential hanging issues in createServer

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-20 00:13:23 +00:00
riz 37b78f4d74 Fix ZIP DEFLATE decompression - use inflateRaw instead of gunzip
- Replace gunzipAsync with zlib.inflateRaw() for ZIP DEFLATE compression
- gunzipAsync expects GZIP format, but ZIP files use raw DEFLATE streams
- This fixes metadata.json and all compressed file processing
- archiver library creates standard ZIP format with DEFLATE compression

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-19 23:15:49 +00:00
riz d5bf648fe6 Use existing gunzipAsync for DEFLATE decompression
- Replace Bun.gunzip() with existing gunzipAsync utility
- gunzipAsync is already imported and used elsewhere in the codebase
- This should properly handle DEFLATE compression in ZIP files
- Fixes metadata.json and all compressed file processing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-19 23:13:47 +00:00
riz b7346330ff Fix Bun decompression API - use Bun.gunzip instead of Bun.decompress
- Replace Bun.decompress() with Bun.gunzip() for DEFLATE compression
- Bun.decompress() doesn't exist in current Bun version
- This was causing binary data to be returned instead of decompressed JSON
- Fixes metadata.json parsing and all compressed file processing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-19 23:03:36 +00:00
riz 486042aaa5 Add filename debugging to find metadata.json matching issue
- Add quotes around filenames to see exact content
- Add directory skipping debug output
- Add success message when metadata.json entry is found
- Debug why filename comparison is failing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-19 22:58:09 +00:00
riz af7b4c3968 Add detailed debugging for metadata.json processing
- Add file size and content preview debugging
- Track foundMetadata flag state throughout processing
- Add final foundMetadata state logging
- Help identify why metadata.json detection is failing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-19 22:55:58 +00:00
riz 0a39249851 Fix cache initialization and add better error handling
- Initialize g.cache early to prevent undefined access errors
- Add detailed error handling for metadata.json parsing
- Prevent cascade failures when ZIP deployment fails
- Add JSON content preview for debugging parsing issues

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-19 22:51:56 +00:00
riz c13e1118ca Add DEFLATE decompression support to ZIP parser
- Add Bun.decompress() support for compression method 8 (DEFLATE)
- Properly decompress ZIP files instead of returning compressed data
- Fix JSON parsing errors for metadata.json
- Handle decompression errors gracefully with fallbacks
- Remove compression method warnings for supported formats

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-19 22:48:53 +00:00
riz 10dd559c0e Fix ZIP parser to read file sizes from central directory
- Fix compressed/uncompressed size reading from central directory instead of local header
- All files now show correct sizes instead of 0 bytes
- metadata.json correctly identified as 635MB (very large)
- ZIP parser now working properly with Bun-compatible implementation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-19 22:45:17 +00:00
riz 2bd87e614d Add detailed ZIP file debugging
- Show all files in ZIP when metadata.json is not found
- Display file sizes and count
- List JSON files specifically

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-19 22:41:01 +00:00
riz de2537d84a Fix ZIP deployment integration with custom ZIP parser
- Fix import paths in _kv.ts to resolve module resolution errors
- Implement custom ZIP file parser using DataView and ArrayBuffer
- Replace zipFile.entries() with Bun-compatible ZIP parsing
- Add comprehensive debugging for ZIP loading process
- Maintain backward compatibility with legacy msgpack format

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-19 22:37:53 +00:00
riz 2fe9c28729 Fix ZIP extraction compatibility issue with Bun runtime
- Replace unzipper library with Bun's built-in ZIP reading capabilities
- Use zipFile.entries() to read ZIP entries directly in memory
- Process files in memory without filesystem extraction
- Maintain proper file categorization (public, server, site, core)
- Handle binary vs text files correctly with appropriate decoding
- Remove dependency on problematic unzipper library that has mkdir compatibility issues
- Clean up unused file system functions and imports

This fixes the "mkdir is not a function" error and makes ZIP loading fully compatible with Bun.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-19 22:32:11 +00:00
riz 9c92da52d2 Add comprehensive debugging to ZIP deployment loading
- Add detailed debug logging throughout ZIP loading process
- Log ZIP file size, extraction progress, and file counts
- Track metadata parsing and content setup
- Monitor public files, server, site, and core file loading
- Add error logging with stack traces
- Log completion of each deployment step

This will help identify where the server startup is getting stuck during ZIP deployment loading.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-19 22:28:10 +00:00
riz 3630d3f337 Fix readdirAsync import error in deployment system
- Replace non-existent readdirAsync from fs-jetpack with Node.js fs/promises.readdir
- Remove readdirAsync from fs-jetpack imports
- Update loadFilesFromDirectory to use standard readdir function

Fixes SyntaxError: Export named 'readdirAsync' not found in module error when running deployment system.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-19 22:23:19 +00:00
riz 6c452af796 Update prod-zip usage to work with new ZIP file format
- Replace msgpack/gzip download with ZIP file download
- Add loadFromZip() method to extract and process ZIP deployments
- Maintain backward compatibility with legacy msgpack/gzip deployments
- Add proper file loading with binary/text detection
- Update has_gz() to check for both .zip and .gz files
- Clean up extracted directories after processing

New ZIP deployment workflow:
1. Download ZIP file instead of gzipped msgpack data
2. Extract ZIP to temporary directory
3. Load metadata.json for site configuration
4. Load files from public/, server/, site/, core/ directories
5. Set up deploy content structure compatible with existing code
6. Clean up temporary files

Benefits:
- No more buffer overflow issues with large deployments
- Better file organization in ZIP structure
- Easier debugging with extractable files
- Maintains full compatibility with existing deployment system
- Supports both new ZIP and legacy msgpack formats

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-19 22:13:32 +00:00
rizky 9c2d605e5c update bun.lockb
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-10 09:38:53 +07:00
rizky 4af0fc3e52 fix deployed server database access crashes
- Create database proxy for deployed servers to handle null database gracefully
- Pass database connection (or proxy) to deployed server init function
- Deployed servers now get meaningful error messages instead of crashing
- Ensures app stability when database connection is unavailable

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-10 09:37:56 +07:00
rizky 74a70e99ca fix database connection error handling to prevent app crashes
- Add proper error handling in database connection attempts
- Set g.db to null when connection fails to prevent subsequent crashes
- Add null check in execQuery to throw meaningful error when DB unavailable
- Improve API endpoint to return 503 status when database is unavailable
- Enhanced logging for better debugging of connection issues

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-10 09:07:03 +07:00
Rizky a09cf17451 fix record 2024-12-11 16:38:22 +07:00
Rizky 4687513434 fix 2024-12-11 13:18:21 +07:00
Rizky e93779ebf7 fixing compression 2024-12-11 11:17:14 +07:00
Rizky f3d020b031 fix 2024-12-04 14:45:05 +07:00
Rizky 2299073e4a undo csp 2024-11-14 22:13:07 +07:00
Rizky 0ae6dc5743 csp 2024-11-14 21:37:31 +07:00
Rizky 949b61a05a fix 2024-11-14 21:34:15 +07:00
Rizky 6f31086970 fix 2024-11-14 21:33:04 +07:00
Rizky e0c4ce8d01 checkpoint 2024-11-14 21:15:12 +07:00
Rizky ca8ba09889 fix 2024-11-14 18:44:16 +07:00