From 1488d7e52e3be1f2db27336e4adbad2b62684f3d Mon Sep 17 00:00:00 2001 From: Rahul Dutta Date: Mon, 20 May 2024 17:02:46 +0530 Subject: [PATCH 1/2] fix(provider): add SSL renegotiation for Gupshup --- packages/providers/src/lib/gupshup/gupshup.provider.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/providers/src/lib/gupshup/gupshup.provider.ts b/packages/providers/src/lib/gupshup/gupshup.provider.ts index 7a7e9b1842d..65b03e89db1 100644 --- a/packages/providers/src/lib/gupshup/gupshup.provider.ts +++ b/packages/providers/src/lib/gupshup/gupshup.provider.ts @@ -5,6 +5,8 @@ import { ISmsProvider, } from '@novu/stateless'; import axios from 'axios'; +import { constants } from "crypto"; +import { Agent } from "https"; if (!globalThis.fetch) { // eslint-disable-next-line global-require @@ -44,7 +46,12 @@ export class GupshupSmsProvider implements ISmsProvider { }), }; - const response = await axios.post(GupshupSmsProvider.BASE_URL, params); + const response = await axios.post(GupshupSmsProvider.BASE_URL, params, { + httpsAgent: new Agent({ + rejectUnauthorized: false, + secureOptions: constants.SSL_OP_LEGACY_SERVER_CONNECT, + }), + }); const body = response.data; const result = body.split(' | '); From 9adef1ed10cac91b5d375d70e3055677d1e52a16 Mon Sep 17 00:00:00 2001 From: Sokratis Vidros Date: Mon, 20 May 2024 18:27:38 +0300 Subject: [PATCH 2/2] chore(root): Rename GH action for uniformity --- .github/workflows/community-releases.yml | 124 ----------------------- 1 file changed, 124 deletions(-) delete mode 100644 .github/workflows/community-releases.yml diff --git a/.github/workflows/community-releases.yml b/.github/workflows/community-releases.yml deleted file mode 100644 index 3faabd86fda..00000000000 --- a/.github/workflows/community-releases.yml +++ /dev/null @@ -1,124 +0,0 @@ -name: Prepare Self-hosted Release - -on: - push: - tags: - - 'v[0-9]+.[0-9]+.[0-9]+' - -permissions: - contents: write - packages: write - deployments: write - id-token: write - -jobs: - prepare: - runs-on: ubuntu-latest - timeout-minutes: 60 - outputs: - latest-version: ${{ steps.get_version.outputs.latest-version }} - steps: - - uses: actions/checkout@v4 - - name: Get Current Lerna Release version and comparing with the Git tag - id: get_version - shell: bash - run: | - LATEST_VERSION="v$(jq -r '.version' lerna.json)" - CURRENT_GIT_TAG="${{ github.ref_name }}" - if [ "$LATEST_VERSION" == "$CURRENT_GIT_TAG" ] - then - echo "latest-version=$(jq -r '.version' lerna.json)" >> $GITHUB_OUTPUT - else - echo "::error::The version in the file lerna.json does not match the git tag. The version in lerna.json is $LATEST_VERSION. The git version is $CURRENT_GIT_TAG" - exit 1 - fi - - build_docker: - runs-on: ubuntu-latest - needs: prepare - timeout-minutes: 90 - environment: Production - strategy: - fail-fast: false - matrix: - name: ['novu/api','novu/worker','novu/inbound-mail','novu/web','novu/webhook','novu/widget','novu/ws','novu/embed','novu/inbound-mail-ee','novu/worker-ee','novu/api-ee','novu/web-ee','novu/widget-ee','novu/embed-ee','novu/ws-ee','novu/webhook-ee'] - steps: - - name: Git Checkout with Submodules - uses: actions/checkout@v4 - if: contains(matrix.name, '-ee') - with: - submodules: true - token: ${{ secrets.SUBMODULES_TOKEN }} - - - name: Git Checkout without Submodules - if: "!contains(matrix.name, '-ee')" - uses: actions/checkout@v4 - - - name: Variables - shell: bash - run: | - echo "The release version is ${{ needs.prepare.outputs.latest-version }}" - service=${{ matrix.name }} - SERVICE_NAME=$(basename "${service//-/-}") - SERVICE_COMMON_NAME=$(echo "$SERVICE_NAME" | sed 's/-ee$//') - echo "SERVICE_NAME=$SERVICE_NAME" >> $GITHUB_ENV - echo "SERVICE_COMMON_NAME=$SERVICE_COMMON_NAME" >> $GITHUB_ENV - echo "REGISTRY_OWNER=novuhq" >> $GITHUB_ENV - - - name: Install pnpm - uses: pnpm/action-setup@v3 - - - name: Use Node.js - uses: actions/setup-node@v4 - with: - node-version: 20.8.1 - cache: 'pnpm' - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Link submodules - if: contains(matrix.name, '-ee') - run: pnpm symlink:submodules - - - uses: ./.github/actions/free-space - - uses: ./.github/actions/setup-qemu - - - name: Login To Registry - shell: bash - env: - GH_ACTOR: ${{ github.actor }} - GH_PASSWORD: ${{ secrets.GH_PACKAGES }} - run: | - echo $GH_PASSWORD | docker login ghcr.io -u $GH_ACTOR --password-stdin - - - name: Set Bull MQ Env variable for EE - if: contains(matrix.name, '-ee') - shell: bash - run: | - echo "BULL_MQ_PRO_NPM_TOKEN=${{ secrets.BULL_MQ_PRO_NPM_TOKEN }}" >> $GITHUB_ENV - - - name: Build ${{ env.SERVICE_NAME }} Community Docker Image - shell: bash - env: - DOCKER_BUILD_ARGUMENTS: > - --cache-from type=registry,ref=ghcr.io/${{ env.REGISTRY_OWNER }}/cache:build-cache-${{ env.SERVICE_NAME }}-community - --cache-to type=registry,ref=ghcr.io/${{ env.REGISTRY_OWNER }}/cache:build-cache-${{ env.SERVICE_NAME }}-community,mode=max - --platform=linux/amd64,linux/arm64 --provenance=false - --output=type=image,name=ghcr.io/${{ env.REGISTRY_OWNER }}/${{ env.SERVICE_NAME }},push-by-digest=true,name-canonical=true - run: | - if [ "${{ env.SERVICE_NAME }}" = "embed" ] || [ "${{ env.SERVICE_NAME }}" = "embed-ee" ]; then - cd libs/$SERVICE_COMMON_NAME - else - cd apps/$SERVICE_COMMON_NAME - fi - pnpm run docker:build - docker images - - - name: Tag and Push docker image - shell: bash - run: | - docker tag novu-$SERVICE_COMMON_NAME ghcr.io/$REGISTRY_OWNER/${{ matrix.name }}:${{ needs.prepare.outputs.latest-version }} - docker tag novu-$SERVICE_COMMON_NAME ghcr.io/$REGISTRY_OWNER/${{ matrix.name }}:latest - docker push ghcr.io/$REGISTRY_OWNER/${{ matrix.name }}:${{ needs.prepare.outputs.latest-version }} - docker push ghcr.io/$REGISTRY_OWNER/${{ matrix.name }}:latest