Skip to content

Commit e3b8ae0

Browse files
authored
chore: release v1.6.1
chore: release v1.6.1
2 parents 054c86a + bb521a2 commit e3b8ae0

File tree

20 files changed

+360
-16
lines changed

20 files changed

+360
-16
lines changed

libs/contract/constants/events/events.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,16 @@ export const EVENTS = {
2626
CONNECTION_RESTORED: 'node.connection_restored',
2727
TRAFFIC_NOTIFY: 'node.traffic_notify',
2828
},
29+
SERVICE: {
30+
PANEL_STARTED: 'service.panel_started',
31+
LOGIN_ATTEMPT_FAILED: 'service.login_attempt_failed',
32+
LOGIN_ATTEMPT_SUCCESS: 'service.login_attempt_success',
33+
},
2934
CATCH_ALL_USER_EVENTS: 'user.*',
3035
CATCH_ALL_NODE_EVENTS: 'node.*',
36+
CATCH_ALL_SERVICE_EVENTS: 'service.*',
3137
} as const;
3238

3339
export type TNodeEvents = (typeof EVENTS.NODE)[keyof typeof EVENTS.NODE];
3440
export type TUserEvents = (typeof EVENTS.USER)[keyof typeof EVENTS.USER];
41+
export type TServiceEvents = (typeof EVENTS.SERVICE)[keyof typeof EVENTS.SERVICE];

libs/contract/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@remnawave/backend-contract",
3-
"version": "0.7.0",
3+
"version": "0.7.1",
44
"public": true,
55
"license": "AGPL-3.0-only",
66
"description": "A contract library for Remnawave Backend. It can be used in backend and frontend.",

package-lock.json

Lines changed: 20 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@remnawave/backend",
3-
"version": "1.6.0",
3+
"version": "1.6.1",
44
"description": "Remnawave Panel Backend",
55
"private": false,
66
"type": "commonjs",
@@ -101,6 +101,7 @@
101101
"prisma": "6.5.0",
102102
"prom-client": "^15.1.3",
103103
"reflect-metadata": "0.2.2",
104+
"request-ip": "^3.3.0",
104105
"rxjs": "7.8.2",
105106
"semver": "^7.7.1",
106107
"superjson": "2.2.2",
@@ -125,6 +126,7 @@
125126
"@types/node": "^22.15.14",
126127
"@types/passport-http": "^0.3.11",
127128
"@types/passport-jwt": "^4.0.1",
129+
"@types/request-ip": "^0.0.41",
128130
"@types/semver": "^7.7.0",
129131
"@typescript-eslint/eslint-plugin": "^8.32.0",
130132
"@typescript-eslint/parser": "^8.32.0",
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1+
import requestIp from 'request-ip';
2+
13
import { createParamDecorator, ExecutionContext } from '@nestjs/common';
24

3-
export const ClientIp = createParamDecorator((data: unknown, ctx: ExecutionContext): string => {
5+
export const IpAddress = createParamDecorator((data, ctx: ExecutionContext) => {
46
const request = ctx.switchToHttp().getRequest();
5-
const ip = request.headers['cf-connecting-ip'] as string;
67

7-
return Array.isArray(ip) ? ip[0] : ip.split(',')[0].trim();
8+
if (request.clientIp) {
9+
return request.clientIp;
10+
}
11+
12+
const ip = requestIp.getClientIp(request);
13+
return ip || 'Unknown';
814
});
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { createParamDecorator, ExecutionContext } from '@nestjs/common';
2+
3+
export const UserAgent = createParamDecorator((data, ctx: ExecutionContext) => {
4+
const request = ctx.switchToHttp().getRequest();
5+
6+
if (request.headers['user-agent']) {
7+
return request.headers['user-agent'];
8+
}
9+
10+
return 'Unknown';
11+
});
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './get-useragent';
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1+
import { ServiceEvents } from './service/service.events';
12
import { UsersEvents } from './users/users.events';
23
import { NodesEvents } from './nodes';
34

4-
export const TELEGRAM_BOT_EVENTS = [UsersEvents, NodesEvents];
5+
export const TELEGRAM_BOT_EVENTS = [UsersEvents, NodesEvents, ServiceEvents];
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './service.events';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './service.event.interface';

0 commit comments

Comments
 (0)