Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@remnawave/node",
"version": "1.5.1",
"version": "1.5.2",
"description": "Remnawave Node",
"private": false,
"type": "commonjs",
Expand Down Expand Up @@ -37,6 +37,7 @@
"@remnawave/supervisord-nestjs": "0.1.1",
"@remnawave/xtls-sdk": "0.3.0",
"@remnawave/xtls-sdk-nestjs": "0.2.2",
"compression": "^1.8.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

style: consider pinning compression version to exact number (1.8.0) for better dependency predictability, matching style of other core dependencies

"enhanced-ms": "^4.1.0",
"helmet": "^8.1.0",
"husky": "9.1.7",
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: husky should be in devDependencies since it's only used during development

Suggested change
"husky": "9.1.7",

Expand Down Expand Up @@ -64,6 +65,7 @@
"devDependencies": {
"@nestjs/cli": "11.0.5",
"@nestjs/schematics": "11.0.2",
"@types/compression": "^1.8.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

style: consider pinning @types/compression version to match compression version exactly

"@types/express": "^5.0.1",
"@types/js-yaml": "^4.0.9",
"@types/jsonwebtoken": "^9.0.9",
Expand Down
2 changes: 1 addition & 1 deletion src/common/utils/get-start-message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export async function getStartMessage(
return table(
[
['Docs → https://remna.st\nCommunity → https://t.me/remnawave'],
[`API Port: ${appPort}\nInternal Port: ${internalPort}`],
[`API Port: ${appPort}\nInternal Ports: 61000, ${internalPort}, 61002`],
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Hardcoding port numbers (61000, 61002) in the message could cause confusion if actual ports change. Consider using constants or configuration values instead.

[`XRay Core: v${xrayInfo.version || 'N/A'}\nXRay Path: ${xrayInfo.path}`],
[
`SI: ${xrayInfo.systemInfo?.cpuCores}C, ${xrayInfo.systemInfo?.cpuModel}, ${xrayInfo.systemInfo?.memoryTotal}`,
Expand Down
3 changes: 3 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { utilities as nestWinstonModuleUtilities, WinstonModule } from 'nest-win
import { ZodValidationPipe } from 'nestjs-zod';
import express, { json } from 'express';
import { createLogger } from 'winston';
import compression from 'compression';
import * as winston from 'winston';
import helmet from 'helmet';
import morgan from 'morgan';
Expand Down Expand Up @@ -56,6 +57,8 @@ async function bootstrap(): Promise<void> {

app.use(json({ limit: '1000mb' }));
Copy link
Contributor

Choose a reason for hiding this comment

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

style: 1000mb limit may be excessive and could expose the server to DoS attacks. Consider a lower limit based on actual requirements


app.use(compression());

const config = app.get(ConfigService);

app.use(helmet());
Expand Down
11 changes: 11 additions & 0 deletions src/modules/stats/stats.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,17 @@ export class StatsService {
response.data.users.filter((user) => user.uplink !== 0 || user.downlink !== 0),
),
};

// const demoRes = Array.from({ length: 160_000 }, (_, i) => ({
// username: String(i + 1),
// uplink: Math.floor(Math.random() * (107374182400 - 10485760) + 10485760), // Random between 10MB and 100GB
// downlink: Math.floor(Math.random() * (107374182400 - 10485760) + 10485760), // Random between 10MB and 100GB
// }));

// return {
// isOk: true,
// response: new GetUsersStatsResponseModel(demoRes),
// };
Comment on lines +96 to +105
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Remove commented-out demo code before merging to main. If needed for testing, move to a separate test file.

} catch (error) {
this.logger.error(error);
return {
Expand Down