Skip to content

Conversation

@kastov
Copy link
Collaborator

@kastov kastov commented Aug 22, 2025

CaseConsole and others added 12 commits August 16, 2025 23:32
chore: drop several modules that are not used
chore: rename Dockerfile extensions to match standard naming convention
- Adds mutex-based locks for inbound user management
- Implements parallel processing for user extraction with concurrency limits
- Improves error handling and logging across core services
- Moves Xray version detection to environment variable
…ing conventions

- Renamed images in build-and-push.yml to 'Core Latest' and 'Core v25.6.8'
- Updated tags for the new 'Core v25.6.8' image to include xray versioning
- Bumped version to 0.5.9 in package.json
- Added X-Force-Restart header constant
- Updated XrayController and XrayService to handle force restart functionality
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Summary

This release (v2.1.4) represents a significant code modernization and performance optimization effort for the Remnawave Node project. The changes include several key areas of improvement:

Performance Enhancements: The InternalService has been upgraded with semaphore-based mutex locking for thread-safe user operations and parallel processing using pMap with 20 concurrent operations, dramatically improving performance when handling large numbers of inbounds. The service methods addUserToInbound and removeUserFromInbound are now properly async with mutex protection.

Force Restart Feature: A new administrative capability has been added through the X-Force-Restart header and corresponding @XForceRestart() decorator. This allows operators to force Xray restarts even when the system appears healthy, bypassing normal configuration checks.

Code Organization: Extensive refactoring to implement barrel exports (index.ts files) across the codebase, replacing direct file imports with cleaner module-level imports. This affects multiple controllers and services, improving maintainability and following TypeScript best practices.

Error Handling Improvements: Enhanced environment configuration validation with user-friendly Zod error messages, including emojis and clear formatting while removing stack traces to reduce log noise.

Docker and Runtime Optimizations: Standardized Docker file naming conventions (e.g., Dockerfile.devdev.Dockerfile), improved Bun runtime support with multi-stage builds, and enhanced container logging with structured [Entrypoint] prefixes.

XrayService Refactoring: Significant changes to remove direct Xray executable calls in favor of environment variable-based version detection, elimination of the OnModuleInit lifecycle hook, and simplified process management through supervisord.

Dependency Cleanup: Removed multiple unused dependencies (@cjs-exporter/execa, nanoid, node-object-hash, selfsigned) and added new utilities for concurrency control (@henrygd/semaphore, p-map). Added knip for dead code elimination.

Unused Code Removal: Cleaned up obsolete interfaces (ICrud, IConverter) and legacy ESLint configuration, removing technical debt from the codebase.

Confidence score: 3/5

  • This PR contains significant architectural changes that improve the codebase but introduce some risk areas that require attention
  • Score reflects substantial improvements offset by critical issues like typos in import paths and removal of error logging that could impact debugging
  • Pay close attention to the exception handling file and XrayService changes which modify critical system behavior

28 files reviewed, 2 comments

Edit Code Review Bot Settings | Greptile

@kastov kastov merged commit 235425a into main Aug 25, 2025
4 checks passed
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.

4 participants