Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
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
33 changes: 23 additions & 10 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,24 @@ jobs:

⏱️ <code>${{ github.event.head_commit.timestamp }}</code>

build-docker-image:
build-docker-images:
name: Build ${{ matrix.image.name }}
runs-on: ubuntu-latest
strategy:
matrix:
image:
- name: 'Main Image'
tags: |
remnawave/node:latest
remnawave/node:${{github.ref_name}}
ghcr.io/remnawave/node:latest
ghcr.io/remnawave/node:${{github.ref_name}}
build_args: ''
- name: 'SNI Image'
tags: |
remnawave/node:sni-latest
remnawave/node:sni-${{github.ref_name}}
build_args: 'UPSTREAM_REPO=kastov'
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -54,20 +70,17 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.TOKEN_GH_DEPLOY }}

- name: Build and push
- name: Build and push ${{ matrix.image.name }}
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
remnawave/node:latest
remnawave/node:${{github.ref_name}}
ghcr.io/remnawave/node:latest
ghcr.io/remnawave/node:${{github.ref_name}}
build-args: ${{ matrix.image.build_args }}
tags: ${{ matrix.image.tags }}

create-release:
needs: [build-docker-image]
needs: [build-docker-images]
runs-on: ubuntu-latest
steps:
- name: NewTag
Expand Down Expand Up @@ -101,7 +114,7 @@ jobs:

send-telegram-message:
name: Send Telegram message
needs: [build-docker-image, create-release]
needs: [build-docker-images, create-release]
runs-on: ubuntu-latest
steps:
- name: Checkout source code
Expand All @@ -120,7 +133,7 @@ jobs:

notify-on-error:
runs-on: ubuntu-latest
needs: [build-docker-image]
needs: [build-docker-images]
if: failure()
steps:
- name: Checkout source code
Expand Down
24 changes: 17 additions & 7 deletions .github/workflows/build-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,20 @@ jobs:
thread_id: ${{ secrets.TELEGRAM_TOPIC_ID }}
status: pending
notify_fields: 'repo_with_tag,commit,workflow'
title: 'Building docker image.'
title: 'Building docker images.'

build-docker-image:
build-docker-images:
name: Build ${{ matrix.image.name }}
runs-on: ubuntu-latest
strategy:
matrix:
image:
- name: 'Main Image'
tag: 'remnawave/node:dev'
build_args: ''
- name: 'SNI Image'
tag: 'remnawave/node:sni-dev'
build_args: 'UPSTREAM_REPO=kastov'
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -46,18 +56,18 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
- name: Build and push ${{ matrix.image.name }}
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
remnawave/node:dev
build-args: ${{ matrix.image.build_args }}
tags: ${{ matrix.image.tag }}

send-finish-tg-msg:
name: Send TG message
needs: [build-docker-image]
needs: [build-docker-images]
runs-on: ubuntu-latest
steps:
- name: Checkout source code
Expand All @@ -75,7 +85,7 @@ jobs:

notify-on-error:
runs-on: ubuntu-latest
needs: [build-docker-image]
needs: [build-docker-images]
if: failure()
steps:
- name: Checkout source code
Expand Down
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ RUN npm run build --omit=dev

FROM node:22-alpine

RUN mkdir -p /var/log/supervisor /var/lib/rnode/xray \
&& echo '{}' > /var/lib/rnode/xray/xray-config.json
ARG XRAY_CORE_VERSION=v25.8.3
ARG UPSTREAM_REPO=XTLS
ARG XRAY_CORE_INSTALL_SCRIPT=https://raw.githubusercontent.com/remnawave/scripts/main/scripts/install-xray.sh

RUN mkdir -p /var/log/supervisor

WORKDIR /opt/app
COPY --from=build /opt/app/dist ./dist
Expand All @@ -23,7 +25,7 @@ RUN apk add --no-cache \
python3 \
py3-pip \
&& pip3 install --break-system-packages git+https://github.com/Supervisor/supervisor.git@4bf1e57cbf292ce988dc128e0d2c8917f18da9be \
&& curl -L https://raw.githubusercontent.com/remnawave/scripts/main/scripts/install-latest-xray.sh | bash -s -- v25.6.8 \
&& curl -L ${XRAY_CORE_INSTALL_SCRIPT} | bash -s -- ${XRAY_CORE_VERSION} ${UPSTREAM_REPO} \
&& apk del curl git

COPY supervisord.conf /etc/supervisord.conf
Expand Down
39 changes: 0 additions & 39 deletions DockerfileLegacy

This file was deleted.

4 changes: 4 additions & 0 deletions libs/contract/commands/handler/add-user.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ export namespace AddUserCommand {
BaseHttpUser,
]),
),
hashData: z.object({
vlessUuid: z.string().uuid(),
prevVlessUuid: z.optional(z.string().uuid()),
}),
});

export type Request = z.infer<typeof RequestSchema>;
Expand Down
3 changes: 3 additions & 0 deletions libs/contract/commands/handler/remove-user.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ export namespace RemoveUserCommand {

export const RequestSchema = z.object({
username: z.string(),
hashData: z.object({
vlessUuid: z.string().uuid(),
}),
});

export type Request = z.infer<typeof RequestSchema>;
Expand Down
8 changes: 8 additions & 0 deletions libs/contract/constants/hashes/hash-payload.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export interface IHashPayload {
emptyConfig: string;
inbounds: {
usersCount: number;
hash: string;
tag: string;
}[];
}
1 change: 1 addition & 0 deletions libs/contract/constants/hashes/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './hash-payload';
1 change: 1 addition & 0 deletions libs/contract/constants/headers/headers.contants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const X_HASH_PAYLOAD = 'X-Hash-Payload';
1 change: 1 addition & 0 deletions libs/contract/constants/headers/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './headers.contants';
2 changes: 2 additions & 0 deletions libs/contract/constants/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export * from './errors';
export * from './hashes';
export * from './headers';
export * from './internal';
export * from './roles';
export * from './xray';
2 changes: 1 addition & 1 deletion libs/contract/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@remnawave/node-contract",
"version": "0.5.3",
"version": "0.5.8",
"description": "A node-contract library for Remnawave Panel",
"main": "build/index.js",
"types": "build/index.d.ts",
Expand Down
Loading