Skip to content

feat: harden security, optimize performance, and add native Docker su… - #43

Open
DevDrake wants to merge 1 commit into
cracker0dks:masterfrom
DevDrake:performance-improvements
Open

DevDrake wants to merge 1 commit into
cracker0dks:masterfrom
DevDrake:performance-improvements

Conversation

@DevDrake

@DevDrake DevDrake commented Sep 7, 2026

Copy link
Copy Markdown

…pport

Security & Supply Chain:

  • Add multi-stage Alpine Dockerfile compiling Darknet natively from source (AlexeyAB/darknet) for AMD64 and ARM64 architectures
  • Strip opaque precompiled Windows binaries (.exe, .dll) from the Docker container
  • Harden checkdeps.sh to prevent dynamic runtime npm package installation during live downloads
  • Parameterize child process execution in ocr.js with cwd options and try/catch error handling
  • Integrate dos2unix sanitization in container startup to prevent Windows CRLF execution failures

Performance & Algorithm Optimizations:

  • Switch yolov4-tiny-custom.cfg to testing mode (batch=1, subdivisions=1), saving ~150MB RAM and speeding up layer initialization
  • Vectorize Keep2Share pixel thresholding in ocr.js via direct Uint8Array buffer iteration, eliminating 56k function calls and 14k heap allocations
  • Eliminate FileJoker disk thrashing (bypassing up to 150 debug PNG writes per solve) and keep transformations entirely in memory
  • Refactor flood-fill (fillBucket) to use flat typed arrays (Uint8Array) and coordinate stacks, eliminating ~50k string/array heap allocations
  • Implement subsecond polling (0.1s) in shell scripts, saving ~500ms idle delay per solve

Stability & Bug Fixes:

  • Fix non-POSIX redirection bashism (&>) in keep2share.cc.sh and filejoker.sh
  • Prevent infinite hang in shell scripts by tracking PID liveness (kill -0) and enforcing a 30s timeout ceiling
  • Add directory resolution across all shell and batch scripts
  • Ensure atomic synchronous file writes (fs.writeFileSync) before process exit

Deployment & Documentation:

  • Add docker-compose.yml and .dockerignore for turnkey homelab deployment
  • Overhaul README.md with comprehensive architecture, configuration, homelab quickstart, and troubleshooting guides

…pport

Security & Supply Chain:
- Add multi-stage Alpine Dockerfile compiling Darknet natively from source (AlexeyAB/darknet) for AMD64 and ARM64 architectures
- Strip opaque precompiled Windows binaries (.exe, .dll) from the Docker container
- Harden checkdeps.sh to prevent dynamic runtime npm package installation during live downloads
- Parameterize child process execution in ocr.js with cwd options and try/catch error handling
- Integrate dos2unix sanitization in container startup to prevent Windows CRLF execution failures

Performance & Algorithm Optimizations:
- Switch yolov4-tiny-custom.cfg to testing mode (batch=1, subdivisions=1), saving ~150MB RAM and speeding up layer initialization
- Vectorize Keep2Share pixel thresholding in ocr.js via direct Uint8Array buffer iteration, eliminating 56k function calls and 14k heap allocations
- Eliminate FileJoker disk thrashing (bypassing up to 150 debug PNG writes per solve) and keep transformations entirely in memory
- Refactor flood-fill (fillBucket) to use flat typed arrays (Uint8Array) and coordinate stacks, eliminating ~50k string/array heap allocations
- Implement subsecond polling (0.1s) in shell scripts, saving ~500ms idle delay per solve

Stability & Bug Fixes:
- Fix non-POSIX redirection bashism (&>) in keep2share.cc.sh and filejoker.sh
- Prevent infinite hang in shell scripts by tracking PID liveness (kill -0) and enforcing a 30s timeout ceiling
- Add directory resolution across all shell and batch scripts
- Ensure atomic synchronous file writes (fs.writeFileSync) before process exit

Deployment & Documentation:
- Add docker-compose.yml and .dockerignore for turnkey homelab deployment
- Overhaul README.md with comprehensive architecture, configuration, homelab quickstart, and troubleshooting guides
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant