From aa53eb8cdc10afef63ef5bbbd8cef618ba7828fc Mon Sep 17 00:00:00 2001 From: Peng Peng Date: Mon, 9 Dec 2024 16:54:40 +0800 Subject: [PATCH] feat: add profile in settings (#67) 1. update ci tag detect logic 2. add profile Controller in settings erver --- .github/workflows/release-editor.yml | 5 ++--- .github/workflows/release-preview.yml | 5 ++--- .github/workflows/release-server.yml | 4 +--- .github/workflows/release-settings.yml | 4 +--- packages/server/src/app.module.ts | 4 ++++ packages/server/src/profile.controller.ts | 4 ++-- 6 files changed, 12 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release-editor.yml b/.github/workflows/release-editor.yml index 15cacf7..663147b 100644 --- a/.github/workflows/release-editor.yml +++ b/.github/workflows/release-editor.yml @@ -28,8 +28,7 @@ jobs: - name: get latest tag uses: "WyriHaximus/github-action-get-previous-tag@v1" id: get-latest-tag - with: - fallback: latest + - name: Setup Node uses: actions/setup-node@v1 with: @@ -55,7 +54,7 @@ jobs: - name: Build and push uses: docker/build-push-action@v3 env: - TAG: ${{ steps.get-latest-tag.outputs.tag || github.event.inputs.tags}} + TAG: ${{ steps.get-latest-tag.outputs.tag || github.event.inputs.tags || 'latest'}} with: context: . file: ./docker/profile/Dockerfile-profile-frontend diff --git a/.github/workflows/release-preview.yml b/.github/workflows/release-preview.yml index 285e635..516474b 100644 --- a/.github/workflows/release-preview.yml +++ b/.github/workflows/release-preview.yml @@ -28,8 +28,7 @@ jobs: - name: get latest tag uses: "WyriHaximus/github-action-get-previous-tag@v1" id: get-latest-tag - with: - fallback: latest + - name: Setup Node uses: actions/setup-node@v1 with: @@ -41,7 +40,7 @@ jobs: - name: Build and push uses: docker/build-push-action@v3 env: - TAG: ${{ steps.get-latest-tag.outputs.tag || github.event.inputs.tags}} + TAG: ${{ steps.get-latest-tag.outputs.tag || github.event.inputs.tags || 'latest'}} with: context: . file: ./docker/profile/Dockerfile-profile-preview diff --git a/.github/workflows/release-server.yml b/.github/workflows/release-server.yml index 785864e..de16a8b 100644 --- a/.github/workflows/release-server.yml +++ b/.github/workflows/release-server.yml @@ -30,12 +30,10 @@ jobs: - name: get latest tag uses: "WyriHaximus/github-action-get-previous-tag@v1" id: get-latest-tag - with: - fallback: latest - name: Build and push uses: docker/build-push-action@v3 env: - TAG: ${{ steps.get-latest-tag.outputs.tag || github.event.inputs.tags}} + TAG: ${{ steps.get-latest-tag.outputs.tag || github.event.inputs.tags || 'latest'}} with: context: . file: ./docker/Dockerfile-server diff --git a/.github/workflows/release-settings.yml b/.github/workflows/release-settings.yml index 1a525e8..e5489d2 100644 --- a/.github/workflows/release-settings.yml +++ b/.github/workflows/release-settings.yml @@ -33,8 +33,6 @@ jobs: - name: get latest tag uses: "WyriHaximus/github-action-get-previous-tag@v1" id: get-latest-tag - with: - fallback: latest - name: Setup Node uses: actions/setup-node@v1 @@ -72,7 +70,7 @@ jobs: - name: Build and push uses: docker/build-push-action@v3 env: - TAG: ${{ steps.get-latest-tag.outputs.tag || github.event.inputs.tags}} + TAG: ${{ steps.get-latest-tag.outputs.tag || github.event.inputs.tags || 'latest'}} with: context: . file: ./docker/settings/Dockerfile-settings-frontend diff --git a/packages/server/src/app.module.ts b/packages/server/src/app.module.ts index bdceafb..4f49eb8 100644 --- a/packages/server/src/app.module.ts +++ b/packages/server/src/app.module.ts @@ -22,6 +22,8 @@ import { CookieController } from './cookie.controller'; import { AppController } from './app.controller'; import { EventController } from './event.controller'; import { TerminusdController } from './terminusd.controller'; +import { ProfileController } from './profile.controller'; +import { TerminusInfoController } from './terminus.controller'; @Module({ imports: [BFLModule, HeadScaleModule, ScheduleModule.forRoot()], @@ -39,6 +41,8 @@ import { TerminusdController } from './terminusd.controller'; EventController, CookieController, TerminusdController, + ProfileController, + TerminusInfoController, ], providers: [ SecretService, diff --git a/packages/server/src/profile.controller.ts b/packages/server/src/profile.controller.ts index c1257fb..ff684ce 100644 --- a/packages/server/src/profile.controller.ts +++ b/packages/server/src/profile.controller.ts @@ -177,8 +177,8 @@ function stringToIntHash(str: string, lowerbound: number, upperbound: number) { } @Controller('/api/profile') -export class UserController { - private readonly logger = new Logger(UserController.name); +export class ProfileController { + private readonly logger = new Logger(ProfileController.name); private key = 'profile_user_info_v2';