From d877d0fae2e12665d05e6c6ceae348de3a10dbe1 Mon Sep 17 00:00:00 2001 From: "DESKTOP-2S5P7D1\\Windows 10" Date: Wed, 4 Dec 2024 13:03:16 +0700 Subject: [PATCH 1/7] build test --- .github/workflows/release.yml | 1 + Dockerfile => docker/Dockerfile | 15 ++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) rename Dockerfile => docker/Dockerfile (71%) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eb51815..a80e6de 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -49,6 +49,7 @@ jobs: with: context: . platforms: linux/amd64 + file: docker/Dockerfile push: true tags: ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:${{ steps.gen_ver.outputs.image_ver }},${{env.REGISTRY}}/${{env.IMAGE_NAME}}:latest - name: Remote Deployment diff --git a/Dockerfile b/docker/Dockerfile similarity index 71% rename from Dockerfile rename to docker/Dockerfile index 6767e59..6faa727 100644 --- a/Dockerfile +++ b/docker/Dockerfile @@ -1,25 +1,30 @@ -FROM node:20-slim AS base - +# Base stage +FROM node:lts-alpine AS base ENV PNPM_HOME="/pnpm" ENV PATH="$PNPM_HOME:$PATH" RUN corepack enable - WORKDIR /app - COPY . . +# Dependencies stage FROM base AS deps RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile +# Build stage FROM base AS build RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile RUN pnpm run build -FROM base as prod +# Production stage +FROM node:lts-alpine AS prod ENV NODE_ENV="production" +WORKDIR /app + +# Copy necessary files from previous stages COPY --from=deps /app/node_modules /app/node_modules COPY --from=build /app/dist /app/dist COPY --from=base /app/static /app/static +# Start the application CMD ["pnpm", "run", "start"] From e295c13ba3c5f80b233fa60d2c4ae0a98930d2af Mon Sep 17 00:00:00 2001 From: "DESKTOP-2S5P7D1\\Windows 10" Date: Fri, 6 Dec 2024 09:09:43 +0700 Subject: [PATCH 2/7] edit build --- .github/workflows/release.yml | 53 ++++++++++++++++++++++++----------- docker/Dockerfile | 15 ++++------ 2 files changed, 42 insertions(+), 26 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a80e6de..55a6038 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,6 +10,8 @@ env: IMAGE_NAME: ehr/bma-ehr-log-backup DEPLOY_HOST: 49.0.91.80 COMPOSE_PATH: /home/frappet/docker/bma/bma-ehr-log-backup + DISCORD_WEBHOOK: https://discord.com/api/webhooks/1313895135121248377/ph4LEfzvrNKyPKouCfHkKx73E323sAc--f3aIM2N0pvS-lQaGdBOg-yHxSNNFxfvjob7 + jobs: release: runs-on: ubuntu-latest @@ -64,21 +66,40 @@ jobs: docker compose pull docker compose up -d echo "${{ steps.gen_ver.outputs.image_ver }}"> success - - uses: snow-actions/line-notify@v1.1.0 + - name: Notify Discord Success if: success() - with: - access_token: ${{ secrets.TOKEN_LINE }} - message: | - ✅ - Image: ${{ env.IMAGE_NAME }} - Version: ${{ steps.gen_ver.outputs.IMAGE_VER }} - By: ${{github.actor}} - - uses: snow-actions/line-notify@v1.1.0 + run: | + curl -H "Content-Type: application/json" \ + -X POST \ + -d '{ + "embeds": [{ + "title": "✅ Deployment Success!", + "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`", + "color": 3066993, + "footer": { + "text": "Release Notification", + "icon_url": "https://example.com/success-icon.png" + }, + "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" + }] + }' \ + ${{ env.DISCORD_WEBHOOK }} + + - name: Notify Discord Failure if: failure() - with: - access_token: ${{ secrets.TOKEN_LINE }} - message: | - ❌ - Image: ${{ env.IMAGE_NAME }} - Version: ${{ steps.gen_ver.outputs.IMAGE_VER }} - By: ${{github.actor}} + run: | + curl -H "Content-Type: application/json" \ + -X POST \ + -d '{ + "embeds": [{ + "title": "❌ Deployment Failed!", + "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`", + "color": 15158332, + "footer": { + "text": "Release Notification", + "icon_url": "https://example.com/failure-icon.png" + }, + "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" + }] + }' \ + ${{ env.DISCORD_WEBHOOK }} diff --git a/docker/Dockerfile b/docker/Dockerfile index 6faa727..6767e59 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,30 +1,25 @@ -# Base stage -FROM node:lts-alpine AS base +FROM node:20-slim AS base + ENV PNPM_HOME="/pnpm" ENV PATH="$PNPM_HOME:$PATH" RUN corepack enable + WORKDIR /app + COPY . . -# Dependencies stage FROM base AS deps RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile -# Build stage FROM base AS build RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile RUN pnpm run build -# Production stage -FROM node:lts-alpine AS prod +FROM base as prod ENV NODE_ENV="production" -WORKDIR /app - -# Copy necessary files from previous stages COPY --from=deps /app/node_modules /app/node_modules COPY --from=build /app/dist /app/dist COPY --from=base /app/static /app/static -# Start the application CMD ["pnpm", "run", "start"] From e4343b61acddc48d0ac1e0ccd0315d464cc22698 Mon Sep 17 00:00:00 2001 From: "DESKTOP-2S5P7D1\\Windows 10" Date: Sat, 7 Dec 2024 09:31:03 +0700 Subject: [PATCH 3/7] test build discord --- .github/workflows/release.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 55a6038..b52a7ee 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,5 +1,5 @@ name: release -run-name: Release by ${{ github.actor }} +run-name: release ${{ github.actor }} on: push: tags: @@ -8,16 +8,16 @@ on: env: REGISTRY: docker.frappet.com IMAGE_NAME: ehr/bma-ehr-log-backup - DEPLOY_HOST: 49.0.91.80 + DEPLOY_HOST: frappet.com COMPOSE_PATH: /home/frappet/docker/bma/bma-ehr-log-backup - DISCORD_WEBHOOK: https://discord.com/api/webhooks/1313895135121248377/ph4LEfzvrNKyPKouCfHkKx73E323sAc--f3aIM2N0pvS-lQaGdBOg-yHxSNNFxfvjob7 jobs: release: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - + # skip Set up QEMU because it fail on act and container + # Gen Version try to get version from tag or inut - name: Set output tags id: vars run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT @@ -83,7 +83,7 @@ jobs: "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" }] }' \ - ${{ env.DISCORD_WEBHOOK }} + ${{ secrets.DISCORD_WEBHOOK }} - name: Notify Discord Failure if: failure() @@ -102,4 +102,4 @@ jobs: "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" }] }' \ - ${{ env.DISCORD_WEBHOOK }} + ${{ secrets.DISCORD_WEBHOOK }} From 8c69be5bb957e527f23d58a53b0f0a11dfe31026 Mon Sep 17 00:00:00 2001 From: "DESKTOP-2S5P7D1\\Windows 10" Date: Sat, 7 Dec 2024 09:34:25 +0700 Subject: [PATCH 4/7] test build discord --- .github/workflows/{release.yml => release.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{release.yml => release.yaml} (100%) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yaml similarity index 100% rename from .github/workflows/release.yml rename to .github/workflows/release.yaml From b4f54b10b31e80870f4c5990595106064033dc8d Mon Sep 17 00:00:00 2001 From: "DESKTOP-2S5P7D1\\Windows 10" Date: Tue, 10 Dec 2024 15:17:36 +0700 Subject: [PATCH 5/7] edit env --- .env.example | 12 ++-- src/controllers/backup-controller.ts | 70 +++++++++++------------ src/middlewares/auth-provider/keycloak.ts | 12 ++-- 3 files changed, 47 insertions(+), 47 deletions(-) diff --git a/.env.example b/.env.example index dc718a4..1fb634d 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,4 @@ -KC_REALM_URL= +AUTH_REALM_URL= ELASTICSEARCH_PROTOCOL= ELASTICSEARCH_HOST= @@ -29,9 +29,9 @@ MAIN_MINIO_ACCESS_KEY= MAIN_MINIO_SECRET_KEY= MAIN_MINIO_BUCKET= -BACKUP_MINIO_USE_SSL= -BACKUP_MINIO_HOST= -BACKUP_MINIO_PORT= -BACKUP_MINIO_ACCESS_KEY= -BACKUP_MINIO_SECRET_KEY= +MAIN_MINIO_USE_SSL= +MAIN_MINIO_HOST= +MAIN_MINIO_PORT= +MAIN_MINIO_ACCESS_KEY= +MAIN_MINIO_SECRET_KEY= BACKUP_MINIO_BUCKET= diff --git a/src/controllers/backup-controller.ts b/src/controllers/backup-controller.ts index 3b47bf1..a685a05 100644 --- a/src/controllers/backup-controller.ts +++ b/src/controllers/backup-controller.ts @@ -27,11 +27,11 @@ const MAIN_MINIO_PORT = process.env.MAIN_MINIO_PORT; const MAIN_MINIO_ACCESS_KEY = getEnvVar("MAIN_MINIO_ACCESS_KEY"); const MAIN_MINIO_SECRET_KEY = getEnvVar("MAIN_MINIO_SECRET_KEY"); const MAIN_MINIO_BUCKET = getEnvVar("MAIN_MINIO_BUCKET"); -const BACKUP_MINIO_USE_SSL = getEnvVar("BACKUP_MINIO_USE_SSL"); -const BACKUP_MINIO_HOST = getEnvVar("BACKUP_MINIO_HOST"); -const BACKUP_MINIO_PORT = process.env.BACKUP_MINIO_PORT; -const BACKUP_MINIO_ACCESS_KEY = getEnvVar("BACKUP_MINIO_ACCESS_KEY"); -const BACKUP_MINIO_SECRET_KEY = getEnvVar("BACKUP_MINIO_SECRET_KEY"); +const MAIN_MINIO_USE_SSL = getEnvVar("MAIN_MINIO_USE_SSL"); +const MAIN_MINIO_HOST = getEnvVar("MAIN_MINIO_HOST"); +const MAIN_MINIO_PORT = process.env.MAIN_MINIO_PORT; +const MAIN_MINIO_ACCESS_KEY = getEnvVar("MAIN_MINIO_ACCESS_KEY"); +const MAIN_MINIO_SECRET_KEY = getEnvVar("MAIN_MINIO_SECRET_KEY"); const BACKUP_MINIO_BUCKET = getEnvVar("BACKUP_MINIO_BUCKET"); function jsonParseOrPlainText(str: string) { @@ -56,9 +56,9 @@ export class BackupController extends Controller { "Content-Type": "application/json", }, body: JSON.stringify({ - s3_backup_endpoint: `${BACKUP_MINIO_USE_SSL === "true" ? "https://" : "http://"}${BACKUP_MINIO_HOST}${(BACKUP_MINIO_PORT && ":" + BACKUP_MINIO_PORT) || ""}`, - s3_backup_access: BACKUP_MINIO_ACCESS_KEY, - s3_backup_secret: BACKUP_MINIO_SECRET_KEY, + s3_backup_endpoint: `${MAIN_MINIO_USE_SSL === "true" ? "https://" : "http://"}${MAIN_MINIO_HOST}${(MAIN_MINIO_PORT && ":" + MAIN_MINIO_PORT) || ""}`, + s3_backup_access: MAIN_MINIO_ACCESS_KEY, + s3_backup_secret: MAIN_MINIO_SECRET_KEY, s3_backup_bucket: BACKUP_MINIO_BUCKET, }), }, @@ -142,14 +142,14 @@ export class BackupController extends Controller { s3_source_access: MAIN_MINIO_ACCESS_KEY, s3_source_secret: MAIN_MINIO_SECRET_KEY, s3_source_bucket: MAIN_MINIO_BUCKET, - s3_dest_endpoint: `${BACKUP_MINIO_USE_SSL === "true" ? "https://" : "http://"}${BACKUP_MINIO_HOST}${(BACKUP_MINIO_PORT && ":" + BACKUP_MINIO_PORT) || ""}`, - s3_dest_access: BACKUP_MINIO_ACCESS_KEY, - s3_dest_secret: BACKUP_MINIO_SECRET_KEY, + s3_dest_endpoint: `${MAIN_MINIO_USE_SSL === "true" ? "https://" : "http://"}${MAIN_MINIO_HOST}${(MAIN_MINIO_PORT && ":" + MAIN_MINIO_PORT) || ""}`, + s3_dest_access: MAIN_MINIO_ACCESS_KEY, + s3_dest_secret: MAIN_MINIO_SECRET_KEY, }, database: { - s3_endpoint: `${BACKUP_MINIO_USE_SSL === "true" ? "https://" : "http://"}${BACKUP_MINIO_HOST}${(BACKUP_MINIO_PORT && ":" + BACKUP_MINIO_PORT) || ""}`, - s3_access: BACKUP_MINIO_ACCESS_KEY, - s3_secret: BACKUP_MINIO_SECRET_KEY, + s3_endpoint: `${MAIN_MINIO_USE_SSL === "true" ? "https://" : "http://"}${MAIN_MINIO_HOST}${(MAIN_MINIO_PORT && ":" + MAIN_MINIO_PORT) || ""}`, + s3_access: MAIN_MINIO_ACCESS_KEY, + s3_secret: MAIN_MINIO_SECRET_KEY, s3_bucket: BACKUP_MINIO_BUCKET, db_host: DB_HOST, db_port: DB_PORT, @@ -185,14 +185,14 @@ export class BackupController extends Controller { s3_restore_access: MAIN_MINIO_ACCESS_KEY, s3_restore_secret: MAIN_MINIO_SECRET_KEY, s3_restore_bucket: MAIN_MINIO_BUCKET, - s3_backup_endpoint: `${BACKUP_MINIO_USE_SSL === "true" ? "https://" : "http://"}${BACKUP_MINIO_HOST}${(BACKUP_MINIO_PORT && ":" + BACKUP_MINIO_PORT) || ""}`, - s3_backup_access: BACKUP_MINIO_ACCESS_KEY, - s3_backup_secret: BACKUP_MINIO_SECRET_KEY, + s3_backup_endpoint: `${MAIN_MINIO_USE_SSL === "true" ? "https://" : "http://"}${MAIN_MINIO_HOST}${(MAIN_MINIO_PORT && ":" + MAIN_MINIO_PORT) || ""}`, + s3_backup_access: MAIN_MINIO_ACCESS_KEY, + s3_backup_secret: MAIN_MINIO_SECRET_KEY, }, database: { - s3_endpoint: `${BACKUP_MINIO_USE_SSL === "true" ? "https://" : "http://"}${BACKUP_MINIO_HOST}${(BACKUP_MINIO_PORT && ":" + BACKUP_MINIO_PORT) || ""}`, - s3_access: BACKUP_MINIO_ACCESS_KEY, - s3_secret: BACKUP_MINIO_SECRET_KEY, + s3_endpoint: `${MAIN_MINIO_USE_SSL === "true" ? "https://" : "http://"}${MAIN_MINIO_HOST}${(MAIN_MINIO_PORT && ":" + MAIN_MINIO_PORT) || ""}`, + s3_access: MAIN_MINIO_ACCESS_KEY, + s3_secret: MAIN_MINIO_SECRET_KEY, s3_bucket: BACKUP_MINIO_BUCKET, db_host: DB_HOST, db_port: DB_PORT, @@ -216,9 +216,9 @@ export class BackupController extends Controller { }, body: JSON.stringify({ backup_name: body.name, - s3_backup_endpoint: `${BACKUP_MINIO_USE_SSL === "true" ? "https://" : "http://"}${BACKUP_MINIO_HOST}${(BACKUP_MINIO_PORT && ":" + BACKUP_MINIO_PORT) || ""}`, - s3_backup_access: BACKUP_MINIO_ACCESS_KEY, - s3_backup_secret: BACKUP_MINIO_SECRET_KEY, + s3_backup_endpoint: `${MAIN_MINIO_USE_SSL === "true" ? "https://" : "http://"}${MAIN_MINIO_HOST}${(MAIN_MINIO_PORT && ":" + MAIN_MINIO_PORT) || ""}`, + s3_backup_access: MAIN_MINIO_ACCESS_KEY, + s3_backup_secret: MAIN_MINIO_SECRET_KEY, s3_backup_bucket: BACKUP_MINIO_BUCKET, }), }, @@ -285,14 +285,14 @@ export class BackupController extends Controller { s3_source_access: MAIN_MINIO_ACCESS_KEY, s3_source_secret: MAIN_MINIO_SECRET_KEY, s3_source_bucket: MAIN_MINIO_BUCKET, - s3_dest_endpoint: `${BACKUP_MINIO_USE_SSL === "true" ? "https://" : "http://"}${BACKUP_MINIO_HOST}${(BACKUP_MINIO_PORT && ":" + BACKUP_MINIO_PORT) || ""}`, - s3_dest_access: BACKUP_MINIO_ACCESS_KEY, - s3_dest_secret: BACKUP_MINIO_SECRET_KEY, + s3_dest_endpoint: `${MAIN_MINIO_USE_SSL === "true" ? "https://" : "http://"}${MAIN_MINIO_HOST}${(MAIN_MINIO_PORT && ":" + MAIN_MINIO_PORT) || ""}`, + s3_dest_access: MAIN_MINIO_ACCESS_KEY, + s3_dest_secret: MAIN_MINIO_SECRET_KEY, }, database: { - s3_endpoint: `${BACKUP_MINIO_USE_SSL === "true" ? "https://" : "http://"}${BACKUP_MINIO_HOST}${(BACKUP_MINIO_PORT && ":" + BACKUP_MINIO_PORT) || ""}`, - s3_access: BACKUP_MINIO_ACCESS_KEY, - s3_secret: BACKUP_MINIO_SECRET_KEY, + s3_endpoint: `${MAIN_MINIO_USE_SSL === "true" ? "https://" : "http://"}${MAIN_MINIO_HOST}${(MAIN_MINIO_PORT && ":" + MAIN_MINIO_PORT) || ""}`, + s3_access: MAIN_MINIO_ACCESS_KEY, + s3_secret: MAIN_MINIO_SECRET_KEY, s3_bucket: BACKUP_MINIO_BUCKET, db_host: DB_HOST, db_port: DB_PORT, @@ -336,14 +336,14 @@ export class BackupController extends Controller { s3_source_access: MAIN_MINIO_ACCESS_KEY, s3_source_secret: MAIN_MINIO_SECRET_KEY, s3_source_bucket: MAIN_MINIO_BUCKET, - s3_dest_endpoint: `${BACKUP_MINIO_USE_SSL === "true" ? "https://" : "http://"}${BACKUP_MINIO_HOST}${(BACKUP_MINIO_PORT && ":" + BACKUP_MINIO_PORT) || ""}`, - s3_dest_access: BACKUP_MINIO_ACCESS_KEY, - s3_dest_secret: BACKUP_MINIO_SECRET_KEY, + s3_dest_endpoint: `${MAIN_MINIO_USE_SSL === "true" ? "https://" : "http://"}${MAIN_MINIO_HOST}${(MAIN_MINIO_PORT && ":" + MAIN_MINIO_PORT) || ""}`, + s3_dest_access: MAIN_MINIO_ACCESS_KEY, + s3_dest_secret: MAIN_MINIO_SECRET_KEY, }, database: { - s3_endpoint: `${BACKUP_MINIO_USE_SSL === "true" ? "https://" : "http://"}${BACKUP_MINIO_HOST}${(BACKUP_MINIO_PORT && ":" + BACKUP_MINIO_PORT) || ""}`, - s3_access: BACKUP_MINIO_ACCESS_KEY, - s3_secret: BACKUP_MINIO_SECRET_KEY, + s3_endpoint: `${MAIN_MINIO_USE_SSL === "true" ? "https://" : "http://"}${MAIN_MINIO_HOST}${(MAIN_MINIO_PORT && ":" + MAIN_MINIO_PORT) || ""}`, + s3_access: MAIN_MINIO_ACCESS_KEY, + s3_secret: MAIN_MINIO_SECRET_KEY, s3_bucket: BACKUP_MINIO_BUCKET, db_host: DB_HOST, db_port: DB_PORT, diff --git a/src/middlewares/auth-provider/keycloak.ts b/src/middlewares/auth-provider/keycloak.ts index cd4ddef..6bf7597 100644 --- a/src/middlewares/auth-provider/keycloak.ts +++ b/src/middlewares/auth-provider/keycloak.ts @@ -4,12 +4,12 @@ import { createDecoder, createVerifier } from "fast-jwt"; import HttpError from "../../interfaces/http-error"; import HttpStatus from "../../interfaces/http-status"; -if (!process.env.KC_PUBLIC_KEY && !process.env.KC_REALM_URL) { - throw new Error("Require keycloak KC_PUBLIC_KEY or KC_REALM_URL."); +if (!process.env.KC_PUBLIC_KEY && !process.env.AUTH_REALM_URL) { + throw new Error("Require keycloak KC_PUBLIC_KEY or AUTH_REALM_URL."); } -if (process.env.KC_PUBLIC_KEY && process.env.KC_REALM_URL && !process.env.KC_PREFERRED_MODE) { +if (process.env.KC_PUBLIC_KEY && process.env.AUTH_REALM_URL && !process.env.KC_PREFERRED_MODE) { throw new Error( - "AUTH_PREFERRED must be specified if KC_PUBLIC_KEY and KC_REALM_URL is provided.", + "AUTH_PREFERRED must be specified if KC_PUBLIC_KEY and AUTH_REALM_URL is provided.", ); } @@ -44,7 +44,7 @@ export async function keycloakAuth(request: Express.Request) { payload = await verifyOffline(token); break; default: - if (process.env.KC_REALM_URL) payload = await verifyOnline(token); + if (process.env.AUTH_REALM_URL) payload = await verifyOnline(token); if (process.env.KC_PUBLIC_KEY) payload = await verifyOffline(token); break; } @@ -61,7 +61,7 @@ async function verifyOffline(token: string) { } async function verifyOnline(token: string) { - const res = await fetch(`${process.env.KC_REALM_URL}/protocol/openid-connect/userinfo`, { + const res = await fetch(`${process.env.AUTH_REALM_URL}/protocol/openid-connect/userinfo`, { headers: { authorization: `Bearer ${token}` }, }).catch((e) => console.error(e)); From c6c1ebd7c34798107c7778e20d368a9de50b0b7c Mon Sep 17 00:00:00 2001 From: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Date: Tue, 24 Dec 2024 10:32:26 +0700 Subject: [PATCH 6/7] fix: error redeclare var --- src/controllers/backup-controller.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/controllers/backup-controller.ts b/src/controllers/backup-controller.ts index a685a05..552aaf7 100644 --- a/src/controllers/backup-controller.ts +++ b/src/controllers/backup-controller.ts @@ -27,11 +27,6 @@ const MAIN_MINIO_PORT = process.env.MAIN_MINIO_PORT; const MAIN_MINIO_ACCESS_KEY = getEnvVar("MAIN_MINIO_ACCESS_KEY"); const MAIN_MINIO_SECRET_KEY = getEnvVar("MAIN_MINIO_SECRET_KEY"); const MAIN_MINIO_BUCKET = getEnvVar("MAIN_MINIO_BUCKET"); -const MAIN_MINIO_USE_SSL = getEnvVar("MAIN_MINIO_USE_SSL"); -const MAIN_MINIO_HOST = getEnvVar("MAIN_MINIO_HOST"); -const MAIN_MINIO_PORT = process.env.MAIN_MINIO_PORT; -const MAIN_MINIO_ACCESS_KEY = getEnvVar("MAIN_MINIO_ACCESS_KEY"); -const MAIN_MINIO_SECRET_KEY = getEnvVar("MAIN_MINIO_SECRET_KEY"); const BACKUP_MINIO_BUCKET = getEnvVar("BACKUP_MINIO_BUCKET"); function jsonParseOrPlainText(str: string) { From f080854899294aef6a55838e0970ad4bfe827d97 Mon Sep 17 00:00:00 2001 From: "DESKTOP-2S5P7D1\\Windows 10" Date: Tue, 24 Dec 2024 10:50:43 +0700 Subject: [PATCH 7/7] no message --- .github/workflows/release.yaml | 24 ++++++++++++------------ docker/Dockerfile | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b52a7ee..ddfd391 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -54,18 +54,18 @@ jobs: file: docker/Dockerfile push: true tags: ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:${{ steps.gen_ver.outputs.image_ver }},${{env.REGISTRY}}/${{env.IMAGE_NAME}}:latest - - name: Remote Deployment - uses: appleboy/ssh-action@v0.1.8 - with: - host: ${{env.DEPLOY_HOST}} - username: frappet - password: ${{ secrets.SSH_PASSWORD }} - port: 10102 - script: | - cd "${{env.COMPOSE_PATH}}" - docker compose pull - docker compose up -d - echo "${{ steps.gen_ver.outputs.image_ver }}"> success + # - name: Remote Deployment + # uses: appleboy/ssh-action@v0.1.8 + # with: + # host: ${{env.DEPLOY_HOST}} + # username: frappet + # password: ${{ secrets.SSH_PASSWORD }} + # port: 10102 + # script: | + # cd "${{env.COMPOSE_PATH}}" + # docker compose pull + # docker compose up -d + # echo "${{ steps.gen_ver.outputs.image_ver }}"> success - name: Notify Discord Success if: success() run: | diff --git a/docker/Dockerfile b/docker/Dockerfile index 6767e59..e75f5a0 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -22,4 +22,4 @@ COPY --from=deps /app/node_modules /app/node_modules COPY --from=build /app/dist /app/dist COPY --from=base /app/static /app/static -CMD ["pnpm", "run", "start"] +CMD ["npm", "run", "start"]