diff --git a/.cspell.json b/.cspell.json index 49b1776adb6..bb3156f50f4 100644 --- a/.cspell.json +++ b/.cspell.json @@ -500,6 +500,8 @@ "nextjs", "vanillajs", "errmsg", + "devcontainer", + "INITDB", "springboot", "errmsg", "shelljs", diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index ed6ad8ce3f0..a7b9f9f3d05 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,5 +1,5 @@ # [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 16, 14, 12, 16-bullseye, 14-bullseye, 12-bullseye, 16-buster, 14-buster, 12-buster -ARG VARIANT=16-bullseye +ARG VARIANT=20-bullseye FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT} # Install MongoDB command line tools if on buster and x86_64 (arm64 not supported) @@ -23,6 +23,3 @@ RUN . /etc/os-release \ # [Optional] Uncomment if you want to install more global node modules RUN su node -c "npm install -g pnpm@8.9.0" - - - diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 30c8a74bae2..9a5217e90a2 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -9,7 +9,7 @@ services: # Update 'VARIANT' to pick an LTS version of Node.js: 16, 14, 12. # Append -bullseye or -buster to pin to an OS version. # Use -bullseye variants on local arm64/Apple Silicon. - VARIANT: 16-bullseye + VARIANT: 20-bullseye volumes: - ..:/workspace:cached @@ -21,7 +21,7 @@ services: # Uncomment the next line to use a non-root user for all processes. # user: node - # Use "forwardPorts" in **devcontainer.json** to forward an app port locally. + # Use "forwardPorts" in **devcontainer.json** to forward an app port locally. # (Adding the "ports" property to this file will not forward from a Codespace.) db: diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index a5ea37cd2e3..c0b29ba2813 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -64,7 +64,7 @@ body: attributes: label: node version description: In case of self-hosting or local installation mention the node version. If using our cloud-managed solution, mention NA. - placeholder: 16.0.0 + placeholder: 20.0.0 - type: textarea id: additional-context validations: diff --git a/.github/actions/docker/build-api/action.yml b/.github/actions/docker/build-api/action.yml index 4566e4981ba..2c4a51b1b2b 100644 --- a/.github/actions/docker/build-api/action.yml +++ b/.github/actions/docker/build-api/action.yml @@ -101,7 +101,7 @@ runs: docker tag novu-api ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG docker run --network=host --name api -dit --env NODE_ENV=test ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG - docker run --network=host appropriate/curl --retry 10 --retry-delay 5 --retry-connrefused http://localhost:1337/v1/health-check | grep 'ok' + docker run --network=host appropriate/curl --retry 10 --retry-delay 5 --retry-connrefused http://127.0.0.1:1337/v1/health-check | grep 'ok' echo "IMAGE=ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG" >> $GITHUB_OUTPUT diff --git a/.github/actions/docker/build-worker/action.yml b/.github/actions/docker/build-worker/action.yml index c2cf91bd604..0ee74b07421 100644 --- a/.github/actions/docker/build-worker/action.yml +++ b/.github/actions/docker/build-worker/action.yml @@ -104,7 +104,7 @@ runs: echo "Run image" docker run --network=host --name worker -dit --env NODE_ENV=test ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG - docker run --network=host appropriate/curl --retry 10 --retry-delay 5 --retry-connrefused http://localhost:1342/v1/health-check | grep 'ok' + docker run --network=host appropriate/curl --retry 10 --retry-delay 5 --retry-connrefused http://127.0.0.1:1342/v1/health-check | grep 'ok' echo "IMAGE=ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG" >> $GITHUB_OUTPUT diff --git a/.github/actions/run-api/action.yml b/.github/actions/run-api/action.yml index a1e2ecb2f1c..9714366fe32 100644 --- a/.github/actions/run-api/action.yml +++ b/.github/actions/run-api/action.yml @@ -24,4 +24,4 @@ runs: - name: Wait on API shell: bash - run: wait-on --timeout=180000 http://localhost:1336/v1/health-check + run: wait-on --timeout=180000 http://127.0.0.1:1336/v1/health-check diff --git a/.github/actions/run-backend/action.yml b/.github/actions/run-backend/action.yml index b102b92e500..998f96eb84e 100644 --- a/.github/actions/run-backend/action.yml +++ b/.github/actions/run-backend/action.yml @@ -26,7 +26,7 @@ runs: NODE_ENV: "test" PORT: "1336" TZ: "UTC" - GITHUB_OAUTH_REDIRECT: "http://localhost:1336/v1/auth/github/callback" + GITHUB_OAUTH_REDIRECT: "http://127.0.0.1:1336/v1/auth/github/callback" LAUNCH_DARKLY_SDK_KEY: ${{ inputs.launch_darkly_sdk_key }} run: cd apps/api && pnpm start:build & @@ -41,4 +41,4 @@ runs: - name: Wait on API and Worker shell: bash - run: wait-on --timeout=180000 http://localhost:1336/v1/health-check http://localhost:1342/v1/health-check + run: wait-on --timeout=180000 http://127.0.0.1:1336/v1/health-check http://127.0.0.1:1342/v1/health-check diff --git a/.github/actions/run-worker/action.yml b/.github/actions/run-worker/action.yml index 1aa1d2379a9..49df4aa1855 100644 --- a/.github/actions/run-worker/action.yml +++ b/.github/actions/run-worker/action.yml @@ -25,4 +25,4 @@ runs: - name: Wait on worker shell: bash - run: wait-on --timeout=180000 http://localhost:1342/v1/health-check + run: wait-on --timeout=180000 http://127.0.0.1:1342/v1/health-check diff --git a/.github/actions/setup-project/action.yml b/.github/actions/setup-project/action.yml index 4ee4cc03acd..b4dd1a89884 100644 --- a/.github/actions/setup-project/action.yml +++ b/.github/actions/setup-project/action.yml @@ -32,7 +32,7 @@ runs: - uses: actions/setup-node@v3 name: ⚙️ Setup Node Version with: - node-version: '16.15.1' + node-version: '20.8.1' cache: 'pnpm' - name: 💵 Start Redis diff --git a/.github/actions/start-localstack/action.yml b/.github/actions/start-localstack/action.yml index 7f99da25234..e7a2a8a32be 100644 --- a/.github/actions/start-localstack/action.yml +++ b/.github/actions/start-localstack/action.yml @@ -24,9 +24,9 @@ runs: do sleep 1 [[ counter -eq $max_retry ]] && echo "Failed!" && exit 1 - aws --endpoint-url=http://localhost:4566 s3 ls + aws --endpoint-url=http://127.0.0.1:4566 s3 ls echo "Trying again. Try #$counter" ((counter++)) done docker-compose -f docker-compose.localstack.yml logs --tail="all" - aws --endpoint-url=http://localhost:4566 --cli-connect-timeout 600 s3 mb s3://novu-test + aws --endpoint-url=http://127.0.0.1:4566 --cli-connect-timeout 600 s3 mb s3://novu-test diff --git a/.github/actions/validate-swagger/action.yml b/.github/actions/validate-swagger/action.yml new file mode 100644 index 00000000000..e69de29bb2d diff --git a/.github/workflows/community-label.yml b/.github/workflows/community-label.yml index a7b9f508300..bac384db43b 100644 --- a/.github/workflows/community-label.yml +++ b/.github/workflows/community-label.yml @@ -17,7 +17,7 @@ jobs: - uses: actions/setup-node@v3 with: - node-version: 18 + node-version: 20.8.1 - name: Install Octokit run: npm --prefix .github/workflows/scripts install @octokit/action diff --git a/.github/workflows/dev-deploy-ws.yml b/.github/workflows/dev-deploy-ws.yml index 223deee78e6..fd9f714c534 100644 --- a/.github/workflows/dev-deploy-ws.yml +++ b/.github/workflows/dev-deploy-ws.yml @@ -102,7 +102,7 @@ jobs: echo $GH_PASSWORD | docker login ghcr.io -u $GH_ACTOR --password-stdin docker build -t ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG --build-arg BULL_MQ_PRO_TOKEN=${BULL_MQ_PRO_NPM_TOKEN} -f apps/ws/Dockerfile . docker run --network=host --name api -dit --env NODE_ENV=test ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG - docker run --network=host appropriate/curl --retry 10 --retry-delay 5 --retry-connrefused http://localhost:1340/v1/health-check | grep 'ok' + docker run --network=host appropriate/curl --retry 10 --retry-delay 5 --retry-connrefused http://127.0.0.1:1340/v1/health-check | grep 'ok' docker tag ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:dev docker push ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:dev docker push ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG diff --git a/.github/workflows/issue-label.yml b/.github/workflows/issue-label.yml index a5b107db6f3..9c07d7ed6ee 100644 --- a/.github/workflows/issue-label.yml +++ b/.github/workflows/issue-label.yml @@ -17,7 +17,7 @@ jobs: - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 20.8.1 - name: Install Octokit run: npm --prefix .github/workflows/scripts install @octokit/action diff --git a/.github/workflows/milestone-assign.yml b/.github/workflows/milestone-assign.yml index e1e48065dab..517fef45c76 100644 --- a/.github/workflows/milestone-assign.yml +++ b/.github/workflows/milestone-assign.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 20.8.1 - name: Install Octokit run: npm --prefix .github/workflows/scripts install @octokit/action diff --git a/.github/workflows/prod-deploy-api.yml b/.github/workflows/prod-deploy-api.yml index f229c18eb95..528f3f41e13 100644 --- a/.github/workflows/prod-deploy-api.yml +++ b/.github/workflows/prod-deploy-api.yml @@ -74,7 +74,7 @@ jobs: docker tag novu-api ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG docker run --network=host --name api -dit --env NODE_ENV=test ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG - docker run --network=host appropriate/curl --retry 10 --retry-delay 5 --retry-connrefused http://localhost:1337/v1/health-check | grep 'ok' + docker run --network=host appropriate/curl --retry 10 --retry-delay 5 --retry-connrefused http://127.0.0.1:1337/v1/health-check | grep 'ok' docker push ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:prod docker push ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:latest diff --git a/.github/workflows/prod-deploy-worker.yml b/.github/workflows/prod-deploy-worker.yml index 82c7ba5448c..8770f21f405 100644 --- a/.github/workflows/prod-deploy-worker.yml +++ b/.github/workflows/prod-deploy-worker.yml @@ -74,7 +74,7 @@ jobs: docker tag novu-worker ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG docker run --network=host --name worker -dit --env NODE_ENV=test ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG - docker run --network=host appropriate/curl --retry 10 --retry-delay 5 --retry-connrefused http://localhost:1342/v1/health-check | grep 'ok' + docker run --network=host appropriate/curl --retry 10 --retry-delay 5 --retry-connrefused http://127.0.0.1:1342/v1/health-check | grep 'ok' docker push ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:prod docker push ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:latest diff --git a/.github/workflows/prod-deploy-ws.yml b/.github/workflows/prod-deploy-ws.yml index f1170ec10f4..c247b18915d 100644 --- a/.github/workflows/prod-deploy-ws.yml +++ b/.github/workflows/prod-deploy-ws.yml @@ -58,7 +58,7 @@ jobs: echo $GH_PASSWORD | docker login ghcr.io -u $GH_ACTOR --password-stdin docker build --build-arg BULL_MQ_PRO_TOKEN=${BULL_MQ_PRO_NPM_TOKEN} -t ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG -f apps/ws/Dockerfile . docker run --network=host --name api -dit --env NODE_ENV=test ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG - docker run --network=host appropriate/curl --retry 10 --retry-delay 5 --retry-connrefused http://localhost:1340/v1/health-check | grep 'ok' + docker run --network=host appropriate/curl --retry 10 --retry-delay 5 --retry-connrefused http://127.0.0.1:1340/v1/health-check | grep 'ok' docker tag ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:prod docker tag ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:latest docker push ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:prod diff --git a/.github/workflows/reusable-docker.yml b/.github/workflows/reusable-docker.yml index 9a39782f772..b286a3c95f7 100644 --- a/.github/workflows/reusable-docker.yml +++ b/.github/workflows/reusable-docker.yml @@ -150,4 +150,4 @@ jobs: echo $GH_PASSWORD | docker login ghcr.io -u $GH_ACTOR --password-stdin docker run --network=host --name $LOCAL_TAG -dit --env NODE_ENV=test ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG - docker run --network=host appropriate/curl --retry 10 --retry-delay 5 --retry-connrefused http://localhost:$TEST_PORT/v1/health-check | grep 'ok' + docker run --network=host appropriate/curl --retry 10 --retry-delay 5 --retry-connrefused http://127.0.0.1:$TEST_PORT/v1/health-check | grep 'ok' diff --git a/.github/workflows/reusable-web-e2e.yml b/.github/workflows/reusable-web-e2e.yml index 44c089ce8bd..018a6bd2de3 100644 --- a/.github/workflows/reusable-web-e2e.yml +++ b/.github/workflows/reusable-web-e2e.yml @@ -76,9 +76,9 @@ jobs: - name: Start Client working-directory: apps/web env: - REACT_APP_API_URL: http://localhost:1336 - REACT_APP_WS_URL: http://localhost:1340 - REACT_APP_WEBHOOK_URL: http://localhost:1341 + REACT_APP_API_URL: http://127.0.0.1:1336 + REACT_APP_WS_URL: http://127.0.0.1:1340 + REACT_APP_WEBHOOK_URL: http://127.0.0.1:1341 REACT_APP_LAUNCH_DARKLY_CLIENT_SIDE_ID: ${{ secrets.TEST_LAUNCH_DARKLY_CLIENT_SIDE_ID }} run: pnpm start:static:build & @@ -87,7 +87,7 @@ jobs: cd apps/ws && pnpm start:test & - name: Wait on Services - run: wait-on --timeout=180000 http://localhost:1340/v1/health-check http://localhost:4200 + run: wait-on --timeout=180000 http://127.0.0.1:1340/v1/health-check http://127.0.0.1:4200/ # run cypress install only when cache was not hit - name: Cypress install diff --git a/.github/workflows/reusable-widget-e2e.yml b/.github/workflows/reusable-widget-e2e.yml index 6434b471a8b..862a8ce0ea8 100644 --- a/.github/workflows/reusable-widget-e2e.yml +++ b/.github/workflows/reusable-widget-e2e.yml @@ -89,7 +89,7 @@ jobs: cd apps/ws && pnpm start:prod & - name: Wait on Widget and WS Services - run: wait-on --timeout=180000 http://localhost:1340/v1/health-check http://localhost:3500 + run: wait-on --timeout=180000 http://127.0.0.1:1340/v1/health-check http://127.0.0.1:3500/ - name: Cypress install if: steps.setup-project.outputs.cypress_cache_hit != 'true' @@ -104,7 +104,7 @@ jobs: CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_WIDGET_KEY }} with: working-directory: apps/widget - wait-on: http://localhost:3500 + wait-on: http://127.0.0.1:3500/ browser: chrome install: false record: true diff --git a/.github/workflows/tag-images.yml b/.github/workflows/tag-images.yml index 5ff1258b229..9ea6f242c0b 100644 --- a/.github/workflows/tag-images.yml +++ b/.github/workflows/tag-images.yml @@ -26,7 +26,7 @@ jobs: run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p - uses: actions/setup-node@v3 with: - node-version: '16.15.1' + node-version: '20.8.1' - name: Login to docker env: @@ -125,4 +125,3 @@ jobs: docker pull ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:prod docker tag ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:prod ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$DOCKER_VERSION docker push ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$DOCKER_VERSION - diff --git a/.nvmrc b/.nvmrc index d9289897d30..6569dfa4f32 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -16.15.1 +20.8.1 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4d7aedf8437..ecc07a66ae8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,8 +20,8 @@ You can open a new issue with this [issue form](https://github.com/novuhq/novu/i ### Requirements -- Node.js v16.14.0 - - To install Node.js v16.14.0 through NVM (Node Version Manager), follow these steps: +- Node.js v20.8.1 (LTS) + - To install Node.js v20.8.1 (LTS) through NVM (Node Version Manager), follow these steps: 1. Open your terminal. 2. Install NVM if you haven't already. You can install NVM by following the instructions at [NVM GitHub](https://github.com/nvm-sh/nvm). @@ -30,14 +30,14 @@ You can open a new issue with this [issue form](https://github.com/novuhq/novu/i ```bash - nvm install 16.14.0 + nvm install 20.8.1 - node -v # output: v16.14.0 + node -v # output: v20.8.1 ``` - 5. You can set Node.js v16.14.0 as your default version with the following command: + 5. You can set Node.js v20.8.1 as your default version with the following command: ```bash - nvm alias default 16 + nvm alias default 20 ``` diff --git a/apps/api/Dockerfile b/apps/api/Dockerfile index 963994c0166..9ebbc6dbca1 100644 --- a/apps/api/Dockerfile +++ b/apps/api/Dockerfile @@ -1,4 +1,4 @@ -FROM nikolaik/python-nodejs:python3.10-nodejs16-alpine as dev_base +FROM nikolaik/python-nodejs:python3.10-nodejs20-alpine as dev_base ARG BULL_MQ_PRO_TOKEN ENV BULL_MQ_PRO_NPM_TOKEN=$BULL_MQ_PRO_TOKEN diff --git a/apps/api/package.json b/apps/api/package.json index 4cbdead6b58..26fb408cd52 100644 --- a/apps/api/package.json +++ b/apps/api/package.json @@ -20,7 +20,7 @@ "start:build": "TZ=UTC node dist/main.js", "lint": "eslint src", "lint:fix": "pnpm lint -- --fix", - "lint:openapi": "spectral lint http://localhost:${PORT:-3000}/openapi.yaml", + "lint:openapi": "spectral lint http://127.0.0.1:${PORT:-3000}/openapi.yaml", "test": "cross-env TS_NODE_COMPILER_OPTIONS='{\"strictNullChecks\": false}' TZ=UTC NODE_ENV=test E2E_RUNNER=true mocha --require ts-node/register --exit --file e2e/setup.ts src/**/**/*.spec.ts", "test:e2e": "cross-env TS_NODE_COMPILER_OPTIONS='{\"strictNullChecks\": false}' TZ=UTC NODE_ENV=test E2E_RUNNER=true mocha --require ts-node/register --exit --file e2e/setup.ts src/**/*.e2e.ts", "test:e2e:ee": "cross-env TS_NODE_COMPILER_OPTIONS='{\"strictNullChecks\": false}' TZ=UTC NODE_ENV=test E2E_RUNNER=true mocha --require ts-node/register --exit --file e2e/setup.ts src/**/*.e2e-ee.ts", diff --git a/apps/api/src/.env.test b/apps/api/src/.env.test index 38bd7e8d1b8..2325de0bfa7 100644 --- a/apps/api/src/.env.test +++ b/apps/api/src/.env.test @@ -1,10 +1,10 @@ GOOGLE_OAUTH_CLIENT_ID=11 GOOGLE_OAUTH_CLIENT_SECRET=11 -GOOGLE_OAUTH_REDIRECT=http://localhost:3000/v1/auth/google/callback +GOOGLE_OAUTH_REDIRECT=http://127.0.0.1:3000/v1/auth/google/callback STORE_ENCRYPTION_KEY="" BLUEPRINT_CREATOR=645b648b36dd6d25f8650d37 -CLIENT_SUCCESS_AUTH_REDIRECT=http://localhost:4200/auth/login +CLIENT_SUCCESS_AUTH_REDIRECT=http://127.0.0.1:4200/auth/login MONGO_URL=mongodb://127.0.0.1:27017/novu-test REDIS_PORT=6379 @@ -36,8 +36,8 @@ REDIS_CLUSTER_KEEP_ALIVE= REDIS_CLUSTER_FAMILY= REDIS_CLUSTER_KEY_PREFIX= -SYNC_PATH=http://localhost:3001 -API_ROOT_URL=http://localhost:3000 +SYNC_PATH=http://127.0.0.1:3001 +API_ROOT_URL=http://127.0.0.1:3000 DISABLE_USER_REGISTRATION=false PORT=1337 JWT_SECRET=ASD#asda23DFEFSFHG%fg @@ -46,14 +46,14 @@ SENDGRID_API_KEY=SG.123123 S3_ACCESS_KEY= S3_SECRET= REDIS_ARENA_PORT=4568 -FRONT_BASE_URL=http://localhost:4200 +FRONT_BASE_URL=http://127.0.0.1:4200 RELEASLY_MAIL=support@starter.co -BACK_OFFICE_URL=http://localhost:5200 +BACK_OFFICE_URL=http://127.0.0.1:5200 INTERCOM_API_KEY= GLOBAL_CONTEXT_PATH= API_CONTEXT_PATH= -S3_LOCAL_STACK=http://localhost:4566 +S3_LOCAL_STACK=http://127.0.0.1:4566 S3_BUCKET_NAME=novu-test S3_REGION=us-east-1 GCS_BUCKET_NAME=novu-test @@ -70,7 +70,7 @@ MAIL_SERVER_DOMAIN= VERCEL_CLIENT_ID= VERCEL_CLIENT_SECRET= -VERCEL_REDIRECT_URI=http://localhost:4200/auth/login +VERCEL_REDIRECT_URI=http://127.0.0.1:4200/auth/login VERCEL_BASE_URL=https://api.vercel.com FF_IS_TOPIC_NOTIFICATION_ENABLED=true diff --git a/apps/api/src/.example.env b/apps/api/src/.example.env index 66f31e1056e..835bdaf59a2 100644 --- a/apps/api/src/.example.env +++ b/apps/api/src/.example.env @@ -1,11 +1,11 @@ NODE_ENV=local PORT=3000 -API_ROOT_URL=http://localhost:3000 -FRONT_BASE_URL=http://localhost:4200 +API_ROOT_URL=http://127.0.0.1:3000 +FRONT_BASE_URL=http://127.0.0.1:4200 STORE_ENCRYPTION_KEY="" DISABLE_USER_REGISTRATION=false -MONGO_URL=mongodb://localhost:27017/novu-db +MONGO_URL=mongodb://127.0.0.1:27017/novu-db MONGO_MAX_POOL_SIZE=500 REDIS_PORT=6379 REDIS_PREFIX= @@ -37,7 +37,7 @@ REDIS_CLUSTER_KEY_PREFIX= JWT_SECRET=LOCAL_ONLY_CHANGE_ME -S3_LOCAL_STACK=http://localhost:4566 +S3_LOCAL_STACK=http://127.0.0.1:4566 S3_BUCKET_NAME=novu-local S3_REGION=us-east-1 AWS_ACCESS_KEY_ID=test @@ -51,7 +51,7 @@ GLOBAL_CONTEXT_PATH= API_CONTEXT_PATH= VERCEL_CLIENT_ID= VERCEL_CLIENT_SECRET= -VERCEL_REDIRECT_URI=http://localhost:4200/auth/login +VERCEL_REDIRECT_URI=http://127.0.0.1:4200/auth/login VERCEL_BASE_URL=https://api.vercel.com FF_IS_TOPIC_NOTIFICATION_ENABLED=true diff --git a/apps/api/src/app/events/e2e/process-subscriber.e2e.ts b/apps/api/src/app/events/e2e/process-subscriber.e2e.ts index 0e92775950c..b06e28988b0 100644 --- a/apps/api/src/app/events/e2e/process-subscriber.e2e.ts +++ b/apps/api/src/app/events/e2e/process-subscriber.e2e.ts @@ -259,7 +259,7 @@ async function updateSubscriberPreference( subscriberToken: string, templateId: string ) { - return await axios.patch(`http://localhost:${process.env.PORT}/v1/widgets/preferences/${templateId}`, data, { + return await axios.patch(`http://127.0.0.1:${process.env.PORT}/v1/widgets/preferences/${templateId}`, data, { headers: { Authorization: `Bearer ${subscriberToken}`, }, diff --git a/apps/api/src/app/subscribers/e2e/get-notifications-feed.e2e.ts b/apps/api/src/app/subscribers/e2e/get-notifications-feed.e2e.ts index 540ff7e0cec..4824c24e3eb 100644 --- a/apps/api/src/app/subscribers/e2e/get-notifications-feed.e2e.ts +++ b/apps/api/src/app/subscribers/e2e/get-notifications-feed.e2e.ts @@ -93,7 +93,7 @@ describe('Get Notifications feed - /:subscriberId/notifications/feed (GET)', fun async function getNotificationsFeed(subscriberId: string, apiKey: string, query = {}) { const response = await axios.get( - `http://localhost:${process.env.PORT}/v1/subscribers/${subscriberId}/notifications/feed`, + `http://127.0.0.1:${process.env.PORT}/v1/subscribers/${subscriberId}/notifications/feed`, { params: { ...query, diff --git a/apps/api/src/app/subscribers/e2e/get-unseen-count.e2e.ts b/apps/api/src/app/subscribers/e2e/get-unseen-count.e2e.ts index 0acd8f47940..fe2dc079bf3 100644 --- a/apps/api/src/app/subscribers/e2e/get-unseen-count.e2e.ts +++ b/apps/api/src/app/subscribers/e2e/get-unseen-count.e2e.ts @@ -38,7 +38,7 @@ describe('Get Unseen Count - /:subscriberId/notifications/unseen (GET)', functio async function getUnSeenCount(subscriberId: string, apiKey: string, query = {}) { const response = await axios.get( - `http://localhost:${process.env.PORT}/v1/subscribers/${subscriberId}/notifications/unseen`, + `http://127.0.0.1:${process.env.PORT}/v1/subscribers/${subscriberId}/notifications/unseen`, { params: { ...query, diff --git a/apps/api/src/app/widgets/e2e/get-count.e2e.ts b/apps/api/src/app/widgets/e2e/get-count.e2e.ts index b6fa214b411..07bd85d2f0c 100644 --- a/apps/api/src/app/widgets/e2e/get-count.e2e.ts +++ b/apps/api/src/app/widgets/e2e/get-count.e2e.ts @@ -262,7 +262,7 @@ describe('Count - GET /widget/notifications/count', function () { expect(messages[0].seen).to.equal(false); await axios.post( - `http://localhost:${process.env.PORT}/v1/widgets/messages/markAs`, + `http://127.0.0.1:${process.env.PORT}/v1/widgets/messages/markAs`, { messageId, mark: { seen: true } }, { headers: { @@ -293,7 +293,7 @@ describe('Count - GET /widget/notifications/count', function () { expect(messages[0].read).to.equal(false); await axios.post( - `http://localhost:${process.env.PORT}/v1/widgets/messages/markAs`, + `http://127.0.0.1:${process.env.PORT}/v1/widgets/messages/markAs`, { messageId, mark: { seen: true, read: true } }, { headers: { @@ -341,7 +341,7 @@ describe('Count - GET /widget/notifications/count', function () { }); await axios.post( - `http://localhost:${process.env.PORT}/v1/widgets/messages/markAs`, + `http://127.0.0.1:${process.env.PORT}/v1/widgets/messages/markAs`, { messageId, mark: { seen: true } }, { headers: { @@ -355,7 +355,7 @@ describe('Count - GET /widget/notifications/count', function () { }); async function getFeedCount(query = {}) { - const response = await axios.get(`http://localhost:${process.env.PORT}/v1/widgets/notifications/count`, { + const response = await axios.get(`http://127.0.0.1:${process.env.PORT}/v1/widgets/notifications/count`, { params: { ...query, }, diff --git a/apps/api/src/app/widgets/e2e/get-notification-feed.e2e.ts b/apps/api/src/app/widgets/e2e/get-notification-feed.e2e.ts index 36064ec2361..41ea07dfeba 100644 --- a/apps/api/src/app/widgets/e2e/get-notification-feed.e2e.ts +++ b/apps/api/src/app/widgets/e2e/get-notification-feed.e2e.ts @@ -209,7 +209,7 @@ describe('GET /widget/notifications/feed', function () { }); async function getSubscriberFeed(query = {}) { - const response = await axios.get(`http://localhost:${process.env.PORT}/v1/widgets/notifications/feed`, { + const response = await axios.get(`http://127.0.0.1:${process.env.PORT}/v1/widgets/notifications/feed`, { params: { page: 0, ...query, @@ -224,7 +224,7 @@ describe('GET /widget/notifications/feed', function () { async function markMessageAsSeen(messageId: string) { return await axios.post( - `http://localhost:${process.env.PORT}/v1/widgets/messages/markAs`, + `http://127.0.0.1:${process.env.PORT}/v1/widgets/messages/markAs`, { messageId, mark: { seen: true } }, { headers: { diff --git a/apps/api/src/app/widgets/e2e/get-subscriber-preference.e2e.ts b/apps/api/src/app/widgets/e2e/get-subscriber-preference.e2e.ts index 9d04e5344c9..834e0779008 100644 --- a/apps/api/src/app/widgets/e2e/get-subscriber-preference.e2e.ts +++ b/apps/api/src/app/widgets/e2e/get-subscriber-preference.e2e.ts @@ -88,7 +88,7 @@ describe('GET /widget/preferences', function () { }); export async function getSubscriberPreference(subscriberToken: string) { - return await axios.get(`http://localhost:${process.env.PORT}/v1/widgets/preferences`, { + return await axios.get(`http://127.0.0.1:${process.env.PORT}/v1/widgets/preferences`, { headers: { Authorization: `Bearer ${subscriberToken}`, }, diff --git a/apps/api/src/app/widgets/e2e/get-unread-count.e2e.ts b/apps/api/src/app/widgets/e2e/get-unread-count.e2e.ts index c0c464a0457..bc7512da204 100644 --- a/apps/api/src/app/widgets/e2e/get-unread-count.e2e.ts +++ b/apps/api/src/app/widgets/e2e/get-unread-count.e2e.ts @@ -56,7 +56,7 @@ describe('Unread Count - GET /widget/notifications/unread', function () { expect(messages[0].read).to.equal(false); await axios.post( - `http://localhost:${process.env.PORT}/v1/widgets/messages/markAs`, + `http://127.0.0.1:${process.env.PORT}/v1/widgets/messages/markAs`, { messageId, mark: { read: true } }, { headers: { @@ -85,7 +85,7 @@ describe('Unread Count - GET /widget/notifications/unread', function () { expect(messages[0].read).to.equal(false); await axios.post( - `http://localhost:${process.env.PORT}/v1/widgets/messages/markAs`, + `http://127.0.0.1:${process.env.PORT}/v1/widgets/messages/markAs`, { messageId, mark: { read: true } }, { headers: { @@ -114,7 +114,7 @@ describe('Unread Count - GET /widget/notifications/unread', function () { expect(messages[0].read).to.equal(false); await axios.post( - `http://localhost:${process.env.PORT}/v1/widgets/messages/markAs`, + `http://127.0.0.1:${process.env.PORT}/v1/widgets/messages/markAs`, { messageId, mark: { read: true } }, { headers: { @@ -128,7 +128,7 @@ describe('Unread Count - GET /widget/notifications/unread', function () { }); async function getUnreadCount(query = {}) { - const response = await axios.get(`http://localhost:${process.env.PORT}/v1/widgets/notifications/unread`, { + const response = await axios.get(`http://127.0.0.1:${process.env.PORT}/v1/widgets/notifications/unread`, { params: { ...query, }, diff --git a/apps/api/src/app/widgets/e2e/get-unseen-count.e2e.ts b/apps/api/src/app/widgets/e2e/get-unseen-count.e2e.ts index e2325e59b1e..7dffe1f9e36 100644 --- a/apps/api/src/app/widgets/e2e/get-unseen-count.e2e.ts +++ b/apps/api/src/app/widgets/e2e/get-unseen-count.e2e.ts @@ -74,7 +74,7 @@ describe('Unseen Count - GET /widget/notifications/unseen', function () { expect(messages[0].seen).to.equal(false); await axios.post( - `http://localhost:${process.env.PORT}/v1/widgets/messages/markAs`, + `http://127.0.0.1:${process.env.PORT}/v1/widgets/messages/markAs`, { messageId, mark: { seen: true } }, { headers: { @@ -103,7 +103,7 @@ describe('Unseen Count - GET /widget/notifications/unseen', function () { expect(messages[0].seen).to.equal(false); await axios.post( - `http://localhost:${process.env.PORT}/v1/widgets/messages/markAs`, + `http://127.0.0.1:${process.env.PORT}/v1/widgets/messages/markAs`, { messageId, mark: { seen: true } }, { headers: { @@ -132,7 +132,7 @@ describe('Unseen Count - GET /widget/notifications/unseen', function () { expect(messages[0].seen).to.equal(false); await axios.post( - `http://localhost:${process.env.PORT}/v1/widgets/messages/markAs`, + `http://127.0.0.1:${process.env.PORT}/v1/widgets/messages/markAs`, { messageId, mark: { seen: true } }, { headers: { @@ -177,7 +177,7 @@ describe('Unseen Count - GET /widget/notifications/unseen', function () { }); await axios.post( - `http://localhost:${process.env.PORT}/v1/widgets/messages/markAs`, + `http://127.0.0.1:${process.env.PORT}/v1/widgets/messages/markAs`, { messageId, mark: { seen: true } }, { headers: { @@ -191,7 +191,7 @@ describe('Unseen Count - GET /widget/notifications/unseen', function () { }); async function getUnseenCount(query = {}) { - const response = await axios.get(`http://localhost:${process.env.PORT}/v1/widgets/notifications/unseen`, { + const response = await axios.get(`http://127.0.0.1:${process.env.PORT}/v1/widgets/notifications/unseen`, { params: { ...query, }, diff --git a/apps/api/src/app/widgets/e2e/mark-all-as-read.e2e.ts b/apps/api/src/app/widgets/e2e/mark-all-as-read.e2e.ts index 838777e511d..935ba5a993b 100644 --- a/apps/api/src/app/widgets/e2e/mark-all-as-read.e2e.ts +++ b/apps/api/src/app/widgets/e2e/mark-all-as-read.e2e.ts @@ -51,7 +51,7 @@ describe('Mark all as read - /widgets/messages/seen (POST)', function () { expect(unseenMessagesBefore.data.count).to.equal(3); await axios.post( - `http://localhost:${process.env.PORT}/v1/widgets/messages/seen`, + `http://127.0.0.1:${process.env.PORT}/v1/widgets/messages/seen`, {}, { headers: { @@ -76,7 +76,7 @@ describe('Mark all as read - /widgets/messages/seen (POST)', function () { expect(unseenMessagesBefore.data.count).to.equal(3); await axios.post( - `http://localhost:${process.env.PORT}/v1/widgets/messages/read`, + `http://127.0.0.1:${process.env.PORT}/v1/widgets/messages/read`, {}, { headers: { @@ -91,7 +91,7 @@ describe('Mark all as read - /widgets/messages/seen (POST)', function () { }); async function getFeedCount(query = {}) { - const response = await axios.get(`http://localhost:${process.env.PORT}/v1/widgets/notifications/unseen`, { + const response = await axios.get(`http://127.0.0.1:${process.env.PORT}/v1/widgets/notifications/unseen`, { params: { ...query, }, @@ -104,7 +104,7 @@ describe('Mark all as read - /widgets/messages/seen (POST)', function () { } async function getNotificationCount(query: string) { - const response = await axios.get(`http://localhost:${process.env.PORT}/v1/widgets/notifications/count?${query}`, { + const response = await axios.get(`http://127.0.0.1:${process.env.PORT}/v1/widgets/notifications/count?${query}`, { headers: { Authorization: `Bearer ${subscriberToken}`, }, diff --git a/apps/api/src/app/widgets/e2e/mark-as-seen.e2e.ts b/apps/api/src/app/widgets/e2e/mark-as-seen.e2e.ts index bd00c8cd97e..13116d560e3 100644 --- a/apps/api/src/app/widgets/e2e/mark-as-seen.e2e.ts +++ b/apps/api/src/app/widgets/e2e/mark-as-seen.e2e.ts @@ -43,7 +43,7 @@ describe('Mark as Seen - /widgets/messages/:messageId/seen (POST)', async () => expect(messages[0].seen).to.equal(false); await axios.post( - `http://localhost:${process.env.PORT}/v1/widgets/messages/markAs`, + `http://127.0.0.1:${process.env.PORT}/v1/widgets/messages/markAs`, { messageId, mark: { seen: true } }, { headers: { diff --git a/apps/api/src/app/widgets/e2e/remove-all-messages.e2e.ts b/apps/api/src/app/widgets/e2e/remove-all-messages.e2e.ts index 7c5bc3cd33b..3c984801c5b 100644 --- a/apps/api/src/app/widgets/e2e/remove-all-messages.e2e.ts +++ b/apps/api/src/app/widgets/e2e/remove-all-messages.e2e.ts @@ -54,7 +54,7 @@ describe('Remove all messages - /widgets/messages (DELETE)', function () { }); expect(messagesBefore.length).to.equal(3); - await axios.delete(`http://localhost:${process.env.PORT}/v1/widgets/messages`, { + await axios.delete(`http://127.0.0.1:${process.env.PORT}/v1/widgets/messages`, { headers: { Authorization: `Bearer ${subscriberToken}`, }, @@ -91,7 +91,7 @@ describe('Remove all messages - /widgets/messages (DELETE)', function () { expect(messagesBefore.length).to.equal(5); - await axios.delete(`http://localhost:${process.env.PORT}/v1/widgets/messages?feedId=${_feedId}`, { + await axios.delete(`http://127.0.0.1:${process.env.PORT}/v1/widgets/messages?feedId=${_feedId}`, { headers: { Authorization: `Bearer ${subscriberToken}`, }, diff --git a/apps/api/src/app/widgets/e2e/update-subscriber-preference.e2e.ts b/apps/api/src/app/widgets/e2e/update-subscriber-preference.e2e.ts index a798cc37714..4890cdfb94f 100644 --- a/apps/api/src/app/widgets/e2e/update-subscriber-preference.e2e.ts +++ b/apps/api/src/app/widgets/e2e/update-subscriber-preference.e2e.ts @@ -115,7 +115,7 @@ export async function updateSubscriberPreference( subscriberToken: string, templateId: string ) { - return await axios.patch(`http://localhost:${process.env.PORT}/v1/widgets/preferences/${templateId}`, data, { + return await axios.patch(`http://127.0.0.1:${process.env.PORT}/v1/widgets/preferences/${templateId}`, data, { headers: { Authorization: `Bearer ${subscriberToken}`, }, diff --git a/apps/inbound-mail/.example.env b/apps/inbound-mail/.example.env index 3cda03eb73a..3a2dd632f23 100644 --- a/apps/inbound-mail/.example.env +++ b/apps/inbound-mail/.example.env @@ -1,5 +1,5 @@ POST="25" -HOST="0.0.0.0" +HOST="127.0.0.1" REDIS_DB_INDEX="2" diff --git a/apps/inbound-mail/Dockerfile b/apps/inbound-mail/Dockerfile index fbe4ec0ebf6..6c28ed00808 100644 --- a/apps/inbound-mail/Dockerfile +++ b/apps/inbound-mail/Dockerfile @@ -1,4 +1,4 @@ -FROM nikolaik/python-nodejs:python3.10-nodejs16-alpine as dev_base +FROM nikolaik/python-nodejs:python3.10-nodejs20-alpine as dev_base ARG BULL_MQ_PRO_TOKEN ENV BULL_MQ_PRO_NPM_TOKEN=$BULL_MQ_PRO_TOKEN diff --git a/apps/inbound-mail/src/.env.development b/apps/inbound-mail/src/.env.development index 5ed27ba166f..47afdea9fe5 100644 --- a/apps/inbound-mail/src/.env.development +++ b/apps/inbound-mail/src/.env.development @@ -1,7 +1,7 @@ NODE_ENV=dev POST="25" -HOST="0.0.0.0" +HOST="127.0.0.1" REDIS_PORT="6379" diff --git a/apps/inbound-mail/src/.env.production b/apps/inbound-mail/src/.env.production index eab410478bc..87217b06b4a 100644 --- a/apps/inbound-mail/src/.env.production +++ b/apps/inbound-mail/src/.env.production @@ -1,7 +1,7 @@ NODE_ENV=production POST="25" -HOST="0.0.0.0" +HOST="127.0.0.1" REDIS_HOST="localhost" REDIS_PORT=6379 diff --git a/apps/inbound-mail/src/.env.test b/apps/inbound-mail/src/.env.test index 8f58f5f941d..0f03ba716dd 100644 --- a/apps/inbound-mail/src/.env.test +++ b/apps/inbound-mail/src/.env.test @@ -1,7 +1,7 @@ NODE_ENV=test PORT="2500" -HOST="0.0.0.0" +HOST="127.0.0.1" REDIS_DB_INDEX=2 diff --git a/apps/inbound-mail/src/main.ts b/apps/inbound-mail/src/main.ts index 7609617b97c..1a011d8822f 100644 --- a/apps/inbound-mail/src/main.ts +++ b/apps/inbound-mail/src/main.ts @@ -22,7 +22,7 @@ if (process.env.SENTRY_DSN) { export default mailin.start( { port: env.PORT || 25, - host: env.HOST || '0.0.0.0', + host: env.HOST || '127.0.0.1', disableDkim: env.disableDkim, disableSpf: env.disableSpf, disableSpamScore: env.disableSpamScore, diff --git a/apps/inbound-mail/src/server/index.ts b/apps/inbound-mail/src/server/index.ts index 4f2e9f6fb5e..c72ad5995aa 100644 --- a/apps/inbound-mail/src/server/index.ts +++ b/apps/inbound-mail/src/server/index.ts @@ -33,7 +33,7 @@ class Mailin extends events.EventEmitter { super(); this.configuration = { - host: '0.0.0.0', + host: '127.0.0.1', port: 2500, tmp: '.tmp', disableWebhook: true, diff --git a/apps/web/Dockerfile b/apps/web/Dockerfile index 7f7e9863c3c..1cb2719e21f 100644 --- a/apps/web/Dockerfile +++ b/apps/web/Dockerfile @@ -1,5 +1,5 @@ # start build stage -FROM nikolaik/python-nodejs:python3.10-nodejs16-alpine as builder +FROM nikolaik/python-nodejs:python3.10-nodejs20-alpine as builder ENV NX_DAEMON=false WORKDIR /usr/src/app @@ -40,7 +40,7 @@ RUN NX_DAEMON=false pnpm build:web # end build stage # start production stage -FROM node:16-alpine +FROM node:20-alpine WORKDIR /app diff --git a/apps/web/README.md b/apps/web/README.md index 2a86d53b46f..27499c1c736 100644 --- a/apps/web/README.md +++ b/apps/web/README.md @@ -9,7 +9,7 @@ In the project directory, you can run: ### `yarn start` Runs the app in the development mode.\ -Open [http://localhost:3000](http://localhost:3000) to view it in the browser. +Open [http://127.0.0.1:3000](http://127.0.0.1:3000) to view it in the browser. The page will reload if you make edits.\ You will also see any lint errors in the console. diff --git a/apps/web/cypress.config.ts b/apps/web/cypress.config.ts index ba218888be9..534714d6bb3 100644 --- a/apps/web/cypress.config.ts +++ b/apps/web/cypress.config.ts @@ -34,13 +34,13 @@ export default defineConfig({ // eslint-disable-next-line import/extensions return require('./cypress/plugins/index.ts')(on, config); }, - baseUrl: 'http://localhost:4200', + baseUrl: 'http://127.0.0.1:4200', specPattern: 'cypress/tests/**/*.{js,jsx,ts,tsx}', }, env: { NODE_ENV: 'test', - apiUrl: 'http://localhost:1336', + apiUrl: 'http://127.0.0.1:1336', GITHUB_USER_EMAIL: '', GITHUB_USER_PASSWORD: '', BLUEPRINT_CREATOR: '645b648b36dd6d25f8650d37', diff --git a/apps/web/cypress/plugins/index.ts b/apps/web/cypress/plugins/index.ts index 168fa8d6eb5..16cbbed4ac4 100644 --- a/apps/web/cypress/plugins/index.ts +++ b/apps/web/cypress/plugins/index.ts @@ -60,13 +60,13 @@ module.exports = (on, config) => { }, async clearDatabase() { const dal = new DalService(); - await dal.connect('mongodb://localhost:27017/novu-test'); + await dal.connect('mongodb://127.0.0.1:27017/novu-test'); await dal.destroy(); return true; }, async seedDatabase() { const dal = new DalService(); - await dal.connect('mongodb://localhost:27017/novu-test'); + await dal.connect('mongodb://127.0.0.1:27017/novu-test'); const userService = new UserService(); await userService.createCypressTestUser(); @@ -75,7 +75,7 @@ module.exports = (on, config) => { }, async passwordResetToken(id: string) { const dal = new DalService(); - await dal.connect('mongodb://localhost:27017/novu-test'); + await dal.connect('mongodb://127.0.0.1:27017/novu-test'); const userService = new UserService(); const user = await userService.getUser(id); @@ -84,7 +84,7 @@ module.exports = (on, config) => { }, async addOrganization(userId: string) { const dal = new DalService(); - await dal.connect('mongodb://localhost:27017/novu-test'); + await dal.connect('mongodb://127.0.0.1:27017/novu-test'); const organizationService = new OrganizationService(); const organization = await organizationService.createOrganization(); @@ -99,7 +99,7 @@ module.exports = (on, config) => { organizationId: string; }) { const dal = new DalService(); - await dal.connect('mongodb://localhost:27017/novu-test'); + await dal.connect('mongodb://127.0.0.1:27017/novu-test'); const repository = new IntegrationRepository(); @@ -119,9 +119,9 @@ module.exports = (on, config) => { } = {} ) { const dal = new DalService(); - await dal.connect('mongodb://localhost:27017/novu-test'); + await dal.connect('mongodb://127.0.0.1:27017/novu-test'); - const session = new UserSession('http://localhost:1336'); + const session = new UserSession('http://127.0.0.1:1336'); await session.initialize({ noEnvironment: settings?.noEnvironment, showOnBoardingTour: settings?.showOnBoardingTour, @@ -160,7 +160,7 @@ module.exports = (on, config) => { }, async makeBlueprints() { const dal = new DalService(); - await dal.connect('mongodb://localhost:27017/novu-test'); + await dal.connect('mongodb://127.0.0.1:27017/novu-test'); const userService = new UserService(); const user = await userService.createUser(); diff --git a/apps/web/cypress/support/commands.ts b/apps/web/cypress/support/commands.ts index 9e94d743002..766c9f46d4f 100644 --- a/apps/web/cypress/support/commands.ts +++ b/apps/web/cypress/support/commands.ts @@ -13,8 +13,8 @@ Cypress.Commands.add('getBySelectorLike', (selector, ...args) => { }); Cypress.Commands.add('waitLoadEnv', (beforeWait: () => void): void => { - cy.intercept('GET', 'http://localhost:1336/v1/environments').as('environments'); - cy.intercept('GET', 'http://localhost:1336/v1/environments/me').as('environments-me'); + cy.intercept('GET', 'http://127.0.0.1:1336/v1/environments').as('environments'); + cy.intercept('GET', 'http://127.0.0.1:1336/v1/environments/me').as('environments-me'); beforeWait && beforeWait(); @@ -22,13 +22,13 @@ Cypress.Commands.add('waitLoadEnv', (beforeWait: () => void): void => { }); Cypress.Commands.add('waitLoadTemplatePage', (beforeWait: () => void): void => { - cy.intercept('GET', 'http://localhost:1336/v1/environments').as('environments'); - cy.intercept('GET', 'http://localhost:1336/v1/organizations').as('organizations'); - cy.intercept('GET', 'http://localhost:1336/v1/environments/me').as('environments-me'); - cy.intercept('GET', 'http://localhost:1336/v1/notification-groups').as('notification-groups'); - cy.intercept('GET', 'http://localhost:1336/v1/changes/count').as('changes-count'); - cy.intercept('GET', 'http://localhost:1336/v1/integrations/active').as('active-integrations'); - cy.intercept('GET', 'http://localhost:1336/v1/users/me').as('me'); + cy.intercept('GET', 'http://127.0.0.1:1336/v1/environments').as('environments'); + cy.intercept('GET', 'http://127.0.0.1:1336/v1/organizations').as('organizations'); + cy.intercept('GET', 'http://127.0.0.1:1336/v1/environments/me').as('environments-me'); + cy.intercept('GET', 'http://127.0.0.1:1336/v1/notification-groups').as('notification-groups'); + cy.intercept('GET', 'http://127.0.0.1:1336/v1/changes/count').as('changes-count'); + cy.intercept('GET', 'http://127.0.0.1:1336/v1/integrations/active').as('active-integrations'); + cy.intercept('GET', 'http://127.0.0.1:1336/v1/users/me').as('me'); beforeWait && beforeWait(); diff --git a/apps/web/cypress/tests/notification-editor/debugging-test-trigger.spec.ts b/apps/web/cypress/tests/notification-editor/debugging-test-trigger.spec.ts index 3d9472881dc..df50630a3eb 100644 --- a/apps/web/cypress/tests/notification-editor/debugging-test-trigger.spec.ts +++ b/apps/web/cypress/tests/notification-editor/debugging-test-trigger.spec.ts @@ -7,7 +7,7 @@ describe('Debugging - test trigger', function () { const template = this.session.templates[0]; const userId = this.session.user.id; - cy.intercept('GET', 'http://localhost:1336/v1/notification-templates/*').as('notification-templates'); + cy.intercept('GET', 'http://127.0.0.1:1336/v1/notification-templates/*').as('notification-templates'); cy.waitLoadTemplatePage(() => { cy.visit('/workflows/edit/' + template._id); diff --git a/apps/web/package.json b/apps/web/package.json index 4edec5d7d5e..e7bed8de693 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -11,7 +11,7 @@ "docker:build:depot": "depot build -f ./Dockerfile -t novu-web ./../.. --load", "envsetup:docker": "chmod +x ./env.sh && ./env.sh && mv ./env-config.js ./build/env-config.js", "envsetup": "chmod +x ./env.sh && ./env.sh && mv env-config.js ./public/env-config.js", - "start:static:build": "pnpm envsetup:docker && http-server build -p 4200 --proxy http://localhost:4200?", + "start:static:build": "pnpm envsetup:docker && http-server build -p 4200 --proxy http://127.0.0.1:4200?", "start:docker": "pnpm build && pnpm start:static:build", "start:dev": "pnpm start", "cypress:run": "cross-env NODE_ENV=test cypress run", diff --git a/apps/web/src/pages/quick-start/components/SetupTimeline.tsx b/apps/web/src/pages/quick-start/components/SetupTimeline.tsx index cfe4e5f14f4..1c90c2e6c60 100644 --- a/apps/web/src/pages/quick-start/components/SetupTimeline.tsx +++ b/apps/web/src/pages/quick-start/components/SetupTimeline.tsx @@ -87,7 +87,7 @@ export const SetupTimeline = ({ - If your browser did not automatically open, go to localhost at http://localhost:3000 + If your browser did not automatically open, go to localhost at http://127.0.0.1:3000 diff --git a/apps/webhook/Dockerfile b/apps/webhook/Dockerfile index a129dbfb6ef..0bd03a51373 100644 --- a/apps/webhook/Dockerfile +++ b/apps/webhook/Dockerfile @@ -1,4 +1,4 @@ -FROM nikolaik/python-nodejs:python3.10-nodejs16-alpine as dev_base +FROM nikolaik/python-nodejs:python3.10-nodejs20-alpine as dev_base ENV NX_DAEMON=false RUN npm i pm2 -g diff --git a/apps/webhook/src/.env.development b/apps/webhook/src/.env.development index a0ec01d78b3..4414fed41d9 100644 --- a/apps/webhook/src/.env.development +++ b/apps/webhook/src/.env.development @@ -1,6 +1,6 @@ NODE_ENV=dev PORT=3003 -MONGO_URL=mongodb://localhost:27017/novu-db +MONGO_URL=mongodb://127.0.0.1:27017/novu-db NEW_RELIC_ENABLED=true NEW_RELIC_APP_NAME="[DEV] - WEBHOOK" diff --git a/apps/webhook/src/.env.test b/apps/webhook/src/.env.test index 26226c931ec..8331ce6467d 100644 --- a/apps/webhook/src/.env.test +++ b/apps/webhook/src/.env.test @@ -1,4 +1,4 @@ -MONGO_URL=mongodb://localhost:27017/novu-test +MONGO_URL=mongodb://127.0.0.1:27017/novu-test PORT=1341 NODE_ENV=test diff --git a/apps/webhook/src/.example.env b/apps/webhook/src/.example.env index 2f2af83b8b1..524561b87af 100644 --- a/apps/webhook/src/.example.env +++ b/apps/webhook/src/.example.env @@ -1,6 +1,6 @@ NODE_ENV=local PORT=3003 -MONGO_URL=mongodb://localhost:27017/novu-db +MONGO_URL=mongodb://127.0.0.1:27017/novu-db MONGO_MAX_POOL_SIZE=500 LOGGING_LEVEL=info diff --git a/apps/webhook/src/webhooks/e2e/email-webhook.e2e.ts b/apps/webhook/src/webhooks/e2e/email-webhook.e2e.ts index 433e7858008..ebd9767aedc 100644 --- a/apps/webhook/src/webhooks/e2e/email-webhook.e2e.ts +++ b/apps/webhook/src/webhooks/e2e/email-webhook.e2e.ts @@ -7,7 +7,7 @@ import axios from 'axios'; const axiosInstance = axios.create(); const callSendgridWebhook = async (environmentId, organizationId, webhookBody) => { - const serverUrl = `http://localhost:${process.env.PORT}`; + const serverUrl = `http://127.0.0.1:${process.env.PORT}`; const { data } = await axiosInstance.post( `${serverUrl}/webhooks/organizations/${organizationId}/environments/${environmentId}/email/sendgrid`, diff --git a/apps/widget/.env b/apps/widget/.env index 3309aba99e0..978677690ac 100644 --- a/apps/widget/.env +++ b/apps/widget/.env @@ -1,6 +1,6 @@ SKIP_PREFLIGHT_CHECK=true -REACT_APP_API_URL=http://localhost:3000 -REACT_APP_WS_URL=http://localhost:3002 +REACT_APP_API_URL=http://127.0.0.1:3000 +REACT_APP_WS_URL=http://127.0.0.1:3002 GLOBAL_CONTEXT_PATH= WIDGET_CONTEXT_PATH= diff --git a/apps/widget/Dockerfile b/apps/widget/Dockerfile index 28fe6f1a0f5..5a002e1f3be 100644 --- a/apps/widget/Dockerfile +++ b/apps/widget/Dockerfile @@ -1,4 +1,4 @@ -FROM nikolaik/python-nodejs:python3.10-nodejs16-alpine +FROM nikolaik/python-nodejs:python3.10-nodejs20-alpine ENV NX_DAEMON=false WORKDIR /usr/src/app diff --git a/apps/widget/cypress.config.ts b/apps/widget/cypress.config.ts index 065a21cc23f..089cb9d1f74 100644 --- a/apps/widget/cypress.config.ts +++ b/apps/widget/cypress.config.ts @@ -6,7 +6,7 @@ export default defineConfig({ projectId: 'kedzap', env: { NODE_ENV: 'test', - API_URL: 'http://localhost:1336', + API_URL: 'http://127.0.0.1:1336', }, e2e: { /* @@ -17,7 +17,7 @@ export default defineConfig({ // eslint-disable-next-line import/extensions return require('./cypress/plugins/index.ts')(on, config); }, - baseUrl: 'http://localhost:3500', + baseUrl: 'http://127.0.0.1:3500', specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}', }, }); diff --git a/apps/widget/cypress/e2e/initialization.spec.ts b/apps/widget/cypress/e2e/initialization.spec.ts index b5eaed19152..925f5de14a7 100644 --- a/apps/widget/cypress/e2e/initialization.spec.ts +++ b/apps/widget/cypress/e2e/initialization.spec.ts @@ -33,8 +33,8 @@ describe('Initialization with enabled HMAC encryption in shell', function () { .as('session') .then((session: any) => { cy.wait(500); - Cypress.config('baseUrl', 'http://localhost:3500'); - const WidgetURL = `http://localhost:3500/${session.environment.identifier}`; + Cypress.config('baseUrl', 'http://127.0.0.1:3500'); + const WidgetURL = `http://127.0.0.1:3500/${session.environment.identifier}`; return cy.forceVisit(WidgetURL); }); cy.wait('@sessionInitialize', { diff --git a/apps/widget/cypress/plugins/index.ts b/apps/widget/cypress/plugins/index.ts index 9f2576bc22f..2c2f930e0dc 100644 --- a/apps/widget/cypress/plugins/index.ts +++ b/apps/widget/cypress/plugins/index.ts @@ -55,14 +55,14 @@ module.exports = (on, config) => { async clearDatabase() { const dal = new DalService(); - await dal.connect('mongodb://localhost:27017/novu-test'); + await dal.connect('mongodb://127.0.0.1:27017/novu-test'); await dal.destroy(); return true; }, async seedDatabase() { const dal = new DalService(); - await dal.connect('mongodb://localhost:27017/novu-test'); + await dal.connect('mongodb://127.0.0.1:27017/novu-test'); const session = new UserSession(config.env.API_URL); @@ -71,7 +71,7 @@ module.exports = (on, config) => { async getSession({ settings, templateOverride }) { const dal = new DalService(); - await dal.connect('mongodb://localhost:27017/novu-test'); + await dal.connect('mongodb://127.0.0.1:27017/novu-test'); const session = new UserSession(config.env.API_URL); await session.initialize({ diff --git a/apps/widget/cypress/support/commands.ts b/apps/widget/cypress/support/commands.ts index 798528dc82e..5b13f181fe1 100644 --- a/apps/widget/cypress/support/commands.ts +++ b/apps/widget/cypress/support/commands.ts @@ -17,7 +17,7 @@ Cypress.Commands.add('openWidget', (settings = {}) => { Cypress.Commands.add( 'initializeShellSession', ({ subscriberId, identifier, encryptedHmacHash, tabs, stores }: IInitializeShellSessionSettings) => { - cy.visit('http://localhost:4700/cypress/test-shell', { log: false }); + cy.visit('http://127.0.0.1:4700/cypress/test-shell', { log: false }); return cy .window() diff --git a/apps/widget/cypress/test-shell/index.html b/apps/widget/cypress/test-shell/index.html index 80dae4631b5..f21a0ca1126 100644 --- a/apps/widget/cypress/test-shell/index.html +++ b/apps/widget/cypress/test-shell/index.html @@ -209,7 +209,7 @@

elt.src = t; var before = o.getElementsByTagName(f)[0]; before.parentNode.insertBefore(elt, before); - })(window, document, "http://localhost:4702/embed.umd.min.js", "novu", "script"); + })(window, document, "http://127.0.0.1:4702/embed.umd.min.js", "novu", "script"); diff --git a/apps/widget/index.html b/apps/widget/index.html index 7a99c2119d6..7a617d81528 100644 --- a/apps/widget/index.html +++ b/apps/widget/index.html @@ -287,7 +287,7 @@

Dashboard

elt.src = t; var before = o.getElementsByTagName(f)[0]; before.parentNode.insertBefore(elt, before); - })(window, document, 'http://localhost:4702/embed.umd.min.js', 'novu', 'script'); + })(window, document, 'http://127.0.0.1:4702/embed.umd.min.js', 'novu', 'script'); novu.init( '', diff --git a/apps/widget/package.json b/apps/widget/package.json index b5f6579567d..e35743adad8 100644 --- a/apps/widget/package.json +++ b/apps/widget/package.json @@ -6,10 +6,10 @@ "start": "react-app-rewired start", "start:dev": "cross-env PORT=4500 pnpm start", "start:cli:local": "pnpm start:shell:test & pnpm start:shell:embed & cross-env PORT=3500 pnpm start", - "start:test": "pnpm start:shell:test & pnpm start:shell:embed & cross-env NODE_ENV=test REACT_APP_API_URL=http://localhost:1336 REACT_APP_WS_URL=http://localhost:1340 PORT=3500 pnpm start", + "start:test": "pnpm start:shell:test & pnpm start:shell:embed & cross-env NODE_ENV=test REACT_APP_API_URL=http://127.0.0.1:1336 REACT_APP_WS_URL=http://127.0.0.1:1340 PORT=3500 pnpm start", "envsetup": "chmod +x ./env.sh && ./env.sh && mv env-config.js ./public/env-config.js", "envsetup:docker": "chmod +x ./env.sh && ./env.sh && mv ./env-config.js ./build/env-config.js", - "start:static:build": "pnpm envsetup:docker && http-server build -p 4500 --proxy http://localhost:4500?", + "start:static:build": "pnpm envsetup:docker && http-server build -p 4500 --proxy http://127.0.0.1:4500?", "start:docker": "pnpm build && pnpm start:static:build", "docker:build": "docker buildx build -f ./Dockerfile -t novu-widget ./../..", "docker:build:depot": "depot build -f ./Dockerfile -t novu-widget ./../.. --load", diff --git a/apps/widget/src/config/index.ts b/apps/widget/src/config/index.ts index a276a19c7d5..e15bfd6c4cc 100644 --- a/apps/widget/src/config/index.ts +++ b/apps/widget/src/config/index.ts @@ -3,11 +3,11 @@ import { getContextPath, NovuComponentEnum } from '@novu/shared'; export const API_URL = isBrowser() && (window as any).Cypress - ? window._env_.REACT_APP_API_URL || process.env.REACT_APP_API_URL || 'http://localhost:1336' - : window._env_.REACT_APP_API_URL || process.env.REACT_APP_API_URL || 'http://localhost:3000'; + ? window._env_.REACT_APP_API_URL || process.env.REACT_APP_API_URL || 'http://127.0.0.1:1336' + : window._env_.REACT_APP_API_URL || process.env.REACT_APP_API_URL || 'http://127.0.0.1:3000'; export const WS_URL = isBrowser() && (window as any).Cypress - ? window._env_.REACT_APP_WS_URL || process.env.REACT_APP_WS_URL || 'http://localhost:1340' - : window._env_.REACT_APP_WS_URL || process.env.REACT_APP_WS_URL || 'http://localhost:3002'; + ? window._env_.REACT_APP_WS_URL || process.env.REACT_APP_WS_URL || 'http://127.0.0.1:1340' + : window._env_.REACT_APP_WS_URL || process.env.REACT_APP_WS_URL || 'http://127.0.0.1:3002'; export const CONTEXT_PATH = getContextPath(NovuComponentEnum.WIDGET); diff --git a/apps/worker/Dockerfile b/apps/worker/Dockerfile index d7f2687c034..13ae856459f 100644 --- a/apps/worker/Dockerfile +++ b/apps/worker/Dockerfile @@ -1,4 +1,4 @@ -FROM nikolaik/python-nodejs:python3.10-nodejs16-alpine as dev_base +FROM nikolaik/python-nodejs:python3.10-nodejs20-alpine as dev_base RUN apk --update --no-cache add curl ENV NX_DAEMON=false diff --git a/apps/worker/src/.env.development b/apps/worker/src/.env.development index e1166b622f2..91b0d980695 100644 --- a/apps/worker/src/.env.development +++ b/apps/worker/src/.env.development @@ -50,7 +50,7 @@ REDIS_CLUSTER_KEY_PREFIX= # MONGO_URL= # Storage -# S3_LOCAL_STACK=http://localhost:4566 +# S3_LOCAL_STACK=http://127.0.0.1:4566 # S3_BUCKET_NAME=novu-local # S3_REGION=us-east-1 # GCS_BUCKET_NAME=novu-local diff --git a/apps/worker/src/.env.production b/apps/worker/src/.env.production index 4ab605f9f39..dd96a2166b4 100644 --- a/apps/worker/src/.env.production +++ b/apps/worker/src/.env.production @@ -53,7 +53,7 @@ REDIS_CLUSTER_KEY_PREFIX= MONGO_MIN_POOL_SIZE=50 # Storage -# S3_LOCAL_STACK=http://localhost:4566 +# S3_LOCAL_STACK=http://127.0.0.1:4566 # S3_BUCKET_NAME=novu-local # S3_REGION=us-east-1 # GCS_BUCKET_NAME=novu-local diff --git a/apps/worker/src/.env.test b/apps/worker/src/.env.test index ae103fd303d..75a727062fe 100644 --- a/apps/worker/src/.env.test +++ b/apps/worker/src/.env.test @@ -53,7 +53,7 @@ REDIS_CLUSTER_KEY_PREFIX= MONGO_URL=mongodb://127.0.0.1:27017/novu-test # Storage -S3_LOCAL_STACK=http://localhost:4566 +S3_LOCAL_STACK=http://127.0.0.1:4566 S3_BUCKET_NAME=novu-test S3_REGION=us-east-1 # GCS_BUCKET_NAME=novu-test diff --git a/apps/worker/src/.example.env b/apps/worker/src/.example.env index c4b44759e9a..50b7b095580 100644 --- a/apps/worker/src/.example.env +++ b/apps/worker/src/.example.env @@ -48,11 +48,11 @@ IS_IN_MEMORY_CLUSTER_MODE_ENABLED=false # REDIS_CLUSTER_KEY_PREFIX= # MongoDB -MONGO_URL=mongodb://localhost:27017/novu-db +MONGO_URL=mongodb://127.0.0.1:27017/novu-db MONGO_MAX_POOL_SIZE=500 # Storage -S3_LOCAL_STACK=http://localhost:4566 +S3_LOCAL_STACK=http://127.0.0.1:4566 S3_BUCKET_NAME=novu-local S3_REGION=us-east-1 # GCS_BUCKET_NAME=novu-local diff --git a/apps/worker/src/app/health/e2e/health-check.e2e.ts b/apps/worker/src/app/health/e2e/health-check.e2e.ts index 9bcc4f98e80..4a79d74c183 100644 --- a/apps/worker/src/app/health/e2e/health-check.e2e.ts +++ b/apps/worker/src/app/health/e2e/health-check.e2e.ts @@ -6,7 +6,7 @@ describe('Health-check', () => { let testAgent; before(async () => { - testAgent = defaults(request(`http://localhost:${process.env.PORT}`)); + testAgent = defaults(request(`http://127.0.0.1:${process.env.PORT}`)); }); describe('/health-check (GET)', () => { diff --git a/apps/ws/Dockerfile b/apps/ws/Dockerfile index 8f71b41eeec..1be83a9c56d 100644 --- a/apps/ws/Dockerfile +++ b/apps/ws/Dockerfile @@ -1,4 +1,4 @@ -FROM node:16-alpine3.16 +FROM node:20-alpine3.16 ARG BULL_MQ_PRO_TOKEN ENV BULL_MQ_PRO_NPM_TOKEN=$BULL_MQ_PRO_TOKEN diff --git a/apps/ws/src/.env.development b/apps/ws/src/.env.development index fd24ac4b07d..bc250ca4443 100644 --- a/apps/ws/src/.env.development +++ b/apps/ws/src/.env.development @@ -1,6 +1,6 @@ NODE_ENV=dev PORT=3002 -MONGO_URL=mongodb://localhost:27017/novu-db +MONGO_URL=mongodb://127.0.0.1:27017/novu-db REDIS_PORT=6379 REDIS_HOST=localhost REDIS_PREFIX= diff --git a/apps/ws/src/.env.test b/apps/ws/src/.env.test index 93d25a0ec66..f486b36654d 100644 --- a/apps/ws/src/.env.test +++ b/apps/ws/src/.env.test @@ -1,4 +1,4 @@ -MONGO_URL=mongodb://localhost:27017/novu-test +MONGO_URL=mongodb://127.0.0.1:27017/novu-test REDIS_PORT=6379 REDIS_HOST=localhost REDIS_DB_INDEX=1 diff --git a/apps/ws/src/.example.env b/apps/ws/src/.example.env index 8a544e6e5a5..64ab3ca3d1b 100644 --- a/apps/ws/src/.example.env +++ b/apps/ws/src/.example.env @@ -1,6 +1,6 @@ NODE_ENV=local PORT=3002 -MONGO_URL=mongodb://localhost:27017/novu-db +MONGO_URL=mongodb://127.0.0.1:27017/novu-db MONGO_MAX_POOL_SIZE=500 REDIS_PORT=6379 REDIS_HOST=localhost diff --git a/docker/.env.example b/docker/.env.example index c22de1aea1f..1bf5d02a39f 100644 --- a/docker/.env.example +++ b/docker/.env.example @@ -12,7 +12,7 @@ REDIS_PASSWORD= REDIS_CACHE_SERVICE_HOST= # AWS -S3_LOCAL_STACK=http://localhost:4566 +S3_LOCAL_STACK=http://127.0.0.1:4566 S3_BUCKET_NAME=novu-local S3_REGION=us-east-1 AWS_ACCESS_KEY_ID=test @@ -25,16 +25,16 @@ REDIS_CACHE_SERVICE_PORT=6379 WS_PORT=3002 # Root URL -REACT_APP_WS_URL=http://localhost:3002 +REACT_APP_WS_URL=http://127.0.0.1:3002 # Uncomment this one when deploying Novu in the local environment -# as Web app local Dockerfile will have to load this to be used. +# as Web app local Dockerfile will have to load this to be used. # Deployment version doesn't need as we inject it with API_ROOT_URL value. -# REACT_APP_API_URL=http://localhost:3000 -API_ROOT_URL=http://localhost:3000 +# REACT_APP_API_URL=http://127.0.0.1:3000 +API_ROOT_URL=http://127.0.0.1:3000 DISABLE_USER_REGISTRATION=false FRONT_BASE_URL=http://client:4200 -WIDGET_EMBED_PATH=http://localhost:4701/embed.umd.min.js -WIDGET_URL=http://localhost:4500 +WIDGET_EMBED_PATH=http://127.0.0.1:4701/embed.umd.min.js +WIDGET_URL=http://127.0.0.1:4500 # Context Paths # Only needed for setups with reverse-proxies diff --git a/docker/Readme.md b/docker/Readme.md index 91bdc55bc5f..edffe85eeb3 100644 --- a/docker/Readme.md +++ b/docker/Readme.md @@ -29,7 +29,7 @@ cp .env.example ./local/deployment/.env docker-compose -f ./local/deployment/docker-compose.yml up ``` -Now visit [http://localhost:4200](http://localhost:4200) to start using Novu. +Now visit [http://127.0.0.1:4200](http://127.0.0.1:4200) to start using Novu. ### Securing your setup diff --git a/docker/kubernetes/helm/templates/localstack-secrets.yaml b/docker/kubernetes/helm/templates/localstack-secrets.yaml index e6058adba0a..0194a33bbe6 100644 --- a/docker/kubernetes/helm/templates/localstack-secrets.yaml +++ b/docker/kubernetes/helm/templates/localstack-secrets.yaml @@ -14,7 +14,7 @@ metadata: {{- end }} type: Opaque data: - endpoint: {{ "http://localhost:4566" | b64enc | quote }} + endpoint: {{ "http://127.0.0.1:4566" | b64enc | quote }} bucketName: {{ "novu-local" | b64enc | quote }} region: {{ "us-east-1" | b64enc | quote }} accessKey: {{ "test" | b64enc | quote }} diff --git a/docker/kubernetes/helm/values.yaml b/docker/kubernetes/helm/values.yaml index b3ebf762278..2f992032bce 100644 --- a/docker/kubernetes/helm/values.yaml +++ b/docker/kubernetes/helm/values.yaml @@ -1570,10 +1570,10 @@ web: ## @param web.apiExternalEndpoint The external endpoint of the API ## - apiExternalEndpoint: http://localhost:3000 + apiExternalEndpoint: http://127.0.0.1:3000 ## @param web.wsExternalEndpoint The external websocket endpoint of the API - wsExternalEndpoint: ws://localhost:3002 + wsExternalEndpoint: ws://127.0.0.1:3002 ## @section Persistence Parameters ## diff --git a/docker/kubernetes/kustomize/env-dev b/docker/kubernetes/kustomize/env-dev index f6153b84c66..6cb3d452b0b 100644 --- a/docker/kubernetes/kustomize/env-dev +++ b/docker/kubernetes/kustomize/env-dev @@ -13,7 +13,7 @@ REDIS_CACHE_SERVICE_HOST=novu-redis-dev REDIS_CACHE_SERVICE_PORT=6379 # AWS -S3_LOCAL_STACK=http://localhost:4566 +S3_LOCAL_STACK=http://127.0.0.1:4566 S3_BUCKET_NAME=novu-local S3_REGION=us-east-1 AWS_ACCESS_KEY_ID=test @@ -25,13 +25,13 @@ REDIS_PORT=6379 WS_PORT=3002 # Root URL -REACT_APP_API_URL=http://localhost:3000 -REACT_APP_WS_URL=http://localhost:3002 -API_ROOT_URL=http://localhost:3000 +REACT_APP_API_URL=http://127.0.0.1:3000 +REACT_APP_WS_URL=http://127.0.0.1:3002 +API_ROOT_URL=http://127.0.0.1:3000 DISABLE_USER_REGISTRATION=false FRONT_BASE_URL=http://client:4200 -WIDGET_EMBED_PATH=http://localhost:4701/embed.umd.min.js -WIDGET_URL=http://localhost:4500 +WIDGET_EMBED_PATH=http://127.0.0.1:4701/embed.umd.min.js +WIDGET_URL=http://127.0.0.1:4500 # Context Paths # Only needed for setups with reverse-proxies diff --git a/docker/local/development/docker-compose.redis-cluster.yml b/docker/local/development/docker-compose.redis-cluster.yml index 0b7c6e6d4f8..72559636ac7 100644 --- a/docker/local/development/docker-compose.redis-cluster.yml +++ b/docker/local/development/docker-compose.redis-cluster.yml @@ -13,7 +13,7 @@ services: - "${TMPDIR:-/tmp/localstack}:/tmp/localstack" - "/var/run/docker.sock:/var/run/docker.sock" healthcheck: - test: "bash -c 'AWS_ACCESS_KEY_ID=test AWS_SECRET_ACCESS_KEY=test aws --endpoint-url=http://localhost:4566 s3 ls'" + test: "bash -c 'AWS_ACCESS_KEY_ID=test AWS_SECRET_ACCESS_KEY=test aws --endpoint-url=http://127.0.0.1:4566 s3 ls'" retries: 5 interval: 10s mongo: @@ -25,7 +25,7 @@ services: volumes: - "${TMPDIR:-/tmp/mongo}:/db/data" healthcheck: - test: "bash -c 'mongo --host localhost:27017 --eval \"printjson(rs.status())\"'" + test: "bash -c 'mongo --host 127.0.0.1:27017 --eval \"printjson(rs.status())\"'" retries: 5 interval: 10s diff --git a/docker/local/development/docker-compose.yml b/docker/local/development/docker-compose.yml index 6a3b35e5b57..7b455a81961 100644 --- a/docker/local/development/docker-compose.yml +++ b/docker/local/development/docker-compose.yml @@ -13,7 +13,7 @@ services: - "${TMPDIR:-/tmp/localstack}:/tmp/localstack" - "/var/run/docker.sock:/var/run/docker.sock" healthcheck: - test: "bash -c 'AWS_ACCESS_KEY_ID=test AWS_SECRET_ACCESS_KEY=test aws --endpoint-url=http://localhost:4566 s3 ls'" + test: "bash -c 'AWS_ACCESS_KEY_ID=test AWS_SECRET_ACCESS_KEY=test aws --endpoint-url=http://127.0.0.1:4566 s3 ls'" retries: 5 interval: 10s mongo: @@ -25,7 +25,7 @@ services: volumes: - "${TMPDIR:-/tmp/mongo}:/db/data" healthcheck: - test: "bash -c 'mongo --host localhost:27017 --eval \"printjson(rs.status())\"'" + test: "bash -c 'mongo --host 127.0.0.1:27017 --eval \"printjson(rs.status())\"'" retries: 5 interval: 10s redis: diff --git a/docker/local/docker-compose.localstack.yml b/docker/local/docker-compose.localstack.yml index 45c71dfcbe7..2ccb6fa485f 100644 --- a/docker/local/docker-compose.localstack.yml +++ b/docker/local/docker-compose.localstack.yml @@ -13,6 +13,6 @@ services: - "${TMPDIR:-/tmp/localstack}:/tmp/localstack" - "/var/run/docker.sock:/var/run/docker.sock" healthcheck: - test: "bash -c 'AWS_ACCESS_KEY_ID=test AWS_SECRET_ACCESS_KEY=test aws --endpoint-url=http://localhost:4566 s3 ls'" + test: "bash -c 'AWS_ACCESS_KEY_ID=test AWS_SECRET_ACCESS_KEY=test aws --endpoint-url=http://127.0.0.1:4566 s3 ls'" retries: 15 interval: 10s diff --git a/libs/embed/Dockerfile b/libs/embed/Dockerfile index dc9c70fe1c4..fa9ef210533 100644 --- a/libs/embed/Dockerfile +++ b/libs/embed/Dockerfile @@ -1,4 +1,4 @@ -FROM nikolaik/python-nodejs:python3.10-nodejs16-alpine +FROM nikolaik/python-nodejs:python3.10-nodejs20-alpine WORKDIR /usr/src/app diff --git a/libs/embed/src/shared/resources.js b/libs/embed/src/shared/resources.js index 752fc3a301a..e8f7ada0139 100644 --- a/libs/embed/src/shared/resources.js +++ b/libs/embed/src/shared/resources.js @@ -11,14 +11,14 @@ if (process.env.ENVIRONMENT === 'production') { ResourcesConstants = { API_URL: '', IFRAME_URL: process.env.WIDGET_URL || 'https://dev.widget.novu.co', - WWW_URL: process.env.WIDGET_URL || 'http://localhost:3500', + WWW_URL: process.env.WIDGET_URL || 'http://127.0.0.1:3500', SENTRY_DSN: '', }; } else { ResourcesConstants = { API_URL: '', - IFRAME_URL: process.env.WIDGET_URL || 'http://localhost:3500', - WWW_URL: process.env.WIDGET_URL || 'http://localhost:3500', + IFRAME_URL: process.env.WIDGET_URL || 'http://127.0.0.1:3500', + WWW_URL: process.env.WIDGET_URL || 'http://127.0.0.1:3500', SENTRY_DSN: '', }; } diff --git a/libs/testing/src/notifications.service.ts b/libs/testing/src/notifications.service.ts index 18537532623..9da91a68682 100644 --- a/libs/testing/src/notifications.service.ts +++ b/libs/testing/src/notifications.service.ts @@ -9,7 +9,7 @@ export class NotificationsService { async triggerEvent(name: string, subscriberId: string, payload = {}) { await axios.post( - 'http://localhost:1336/v1/events/trigger', + 'http://127.0.0.1:1336/v1/events/trigger', { name, to: subscriberId, diff --git a/libs/testing/src/user.session.ts b/libs/testing/src/user.session.ts index a94fa540c4f..a2121969054 100644 --- a/libs/testing/src/user.session.ts +++ b/libs/testing/src/user.session.ts @@ -77,7 +77,7 @@ export class UserSession { apiKey: string; - constructor(public serverUrl = `http://localhost:${process.env.PORT}`) { + constructor(public serverUrl = `http://127.0.0.1:${process.env.PORT}`) { this.jobsService = new JobsService(); } diff --git a/package.json b/package.json index c59218575fb..957dbb03323 100644 --- a/package.json +++ b/package.json @@ -188,7 +188,7 @@ } }, "engines": { - "node": ">=13.0.0 <17.0.0", + "node": ">=20 <21", "pnpm": "^8.9.0" }, "dependencies": { diff --git a/packages/application-generic/src/.env.test b/packages/application-generic/src/.env.test index 03f5fd1f712..6a267ff4825 100644 --- a/packages/application-generic/src/.env.test +++ b/packages/application-generic/src/.env.test @@ -1,12 +1,12 @@ GOOGLE_OAUTH_CLIENT_ID=11 GOOGLE_OAUTH_CLIENT_SECRET=11 -GOOGLE_OAUTH_REDIRECT=http://localhost:3000/v1/auth/google/callback +GOOGLE_OAUTH_REDIRECT=http://127.0.0.1:3000/v1/auth/google/callback STORE_ENCRYPTION_KEY="" BLUEPRINT_CREATOR="" -CLIENT_SUCCESS_AUTH_REDIRECT=http://localhost:4200/auth/login +CLIENT_SUCCESS_AUTH_REDIRECT=http://127.0.0.1:4200/auth/login -MONGO_URL=mongodb://localhost:27017/novu-test +MONGO_URL=mongodb://127.0.0.1:27017/novu-test MONGO_MAX_POOL_SIZE=500 REDIS_PORT=6379 REDIS_HOST=localhost @@ -37,8 +37,8 @@ REDIS_CLUSTER_KEEP_ALIVE= REDIS_CLUSTER_FAMILY= REDIS_CLUSTER_KEY_PREFIX= -SYNC_PATH=http://localhost:3001 -API_ROOT_URL=http://localhost:3000 +SYNC_PATH=http://127.0.0.1:3001 +API_ROOT_URL=http://127.0.0.1:3000 DISABLE_USER_REGISTRATION=false PORT=1337 JWT_SECRET=ASD#asda23DFEFSFHG%fg @@ -47,14 +47,14 @@ SENDGRID_API_KEY=SG.123123 S3_ACCESS_KEY= S3_SECRET= REDIS_ARENA_PORT=4568 -FRONT_BASE_URL=http://localhost:4200 +FRONT_BASE_URL=http://127.0.0.1:4200 RELEASLY_MAIL=support@starter.co -BACK_OFFICE_URL=http://localhost:5200 +BACK_OFFICE_URL=http://127.0.0.1:5200 INTERCOM_API_KEY= GLOBAL_CONTEXT_PATH= API_CONTEXT_PATH= -S3_LOCAL_STACK=http://localhost:4566 +S3_LOCAL_STACK=http://127.0.0.1:4566 S3_BUCKET_NAME=novu-test S3_REGION=us-east-1 GCS_BUCKET_NAME=novu-test @@ -71,7 +71,7 @@ MAIL_SERVER_DOMAIN= VERCEL_CLIENT_ID= VERCEL_CLIENT_SECRET= -VERCEL_REDIRECT_URI=http://localhost:4200/auth/login +VERCEL_REDIRECT_URI=http://127.0.0.1:4200/auth/login VERCEL_BASE_URL=https://api.vercel.com FF_IS_TOPIC_NOTIFICATION_ENABLED=true diff --git a/packages/application-generic/src/services/auth/shared.ts b/packages/application-generic/src/services/auth/shared.ts index 2dc554d42dc..ec58c24496f 100644 --- a/packages/application-generic/src/services/auth/shared.ts +++ b/packages/application-generic/src/services/auth/shared.ts @@ -13,7 +13,7 @@ export const buildOauthRedirectUrl = (request): string => { */ if ( redirectUrl && - redirectUrl.startsWith('http://localhost:') && + redirectUrl.startsWith('http://127.0.0.1:') && !redirectUrl.includes('@') ) { url = redirectUrl; diff --git a/packages/cli/package.json b/packages/cli/package.json index 201506e9bd8..c14bca2fc0b 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -11,7 +11,7 @@ "format": "prettier --write \"src/**/*.ts\"", "precommit": "lint-staged", "start": "pnpm start:dev", - "start:dev": "cross-env NODE_ENV=dev NOVU_EMBED_PATH=http://localhost:4701/embed.umd.min.js NOVU_API_ADDRESS=http://localhost:3000 NOVU_CLIENT_LOGIN=http://localhost:4200/auth/login CLI_SEGMENT_WRITE_KEY=GdQ594CEBj4pU6RFldDOjKJwZjxZOsIj TZ=UTC nodemon init", + "start:dev": "cross-env NODE_ENV=dev NOVU_EMBED_PATH=http://127.0.0.1:4701/embed.umd.min.js NOVU_API_ADDRESS=http://127.0.0.1:3000 NOVU_CLIENT_LOGIN=http://127.0.0.1:4200/auth/login CLI_SEGMENT_WRITE_KEY=GdQ594CEBj4pU6RFldDOjKJwZjxZOsIj TZ=UTC nodemon init", "start:test": "cross-env NODE_ENV=test PORT=1336 TZ=UTC nodemon init", "start:debug": "cross-env TZ=UTC nodemon --config nodemon-debug.json", "start:prod": "cross-env TZ=UTC node dist/index.js" diff --git a/packages/headless/src/lib/headless.service.test.ts b/packages/headless/src/lib/headless.service.test.ts index b833569ded3..062e0ef1aae 100644 --- a/packages/headless/src/lib/headless.service.test.ts +++ b/packages/headless/src/lib/headless.service.test.ts @@ -162,8 +162,8 @@ Storage.prototype.removeItem = jest.fn(); describe('headless.service', () => { const options = { - backendUrl: 'http://localhost:3000', - socketUrl: 'http://localhost:3001', + backendUrl: 'http://127.0.0.1:3000', + socketUrl: 'http://127.0.0.1:3001', applicationIdentifier: 'applicationIdentifier', subscriberId: 'subscriberId', subscriberHash: 'subscriberHash', diff --git a/packages/notification-center-angular/.vscode/launch.json b/packages/notification-center-angular/.vscode/launch.json index 740e35a0c04..0693cba63e7 100644 --- a/packages/notification-center-angular/.vscode/launch.json +++ b/packages/notification-center-angular/.vscode/launch.json @@ -7,14 +7,14 @@ "type": "pwa-chrome", "request": "launch", "preLaunchTask": "npm: start", - "url": "http://localhost:4200/" + "url": "http://127.0.0.1:4200/" }, { "name": "ng test", "type": "chrome", "request": "launch", "preLaunchTask": "npm: test", - "url": "http://localhost:9876/debug.html" + "url": "http://127.0.0.1:9876/debug.html" } ] } diff --git a/providers/email-webhook/src/lib/email-webhook.provider.spec.ts b/providers/email-webhook/src/lib/email-webhook.provider.spec.ts index 1a1bd1e5a08..940aa799376 100644 --- a/providers/email-webhook/src/lib/email-webhook.provider.spec.ts +++ b/providers/email-webhook/src/lib/email-webhook.provider.spec.ts @@ -9,7 +9,7 @@ test('should trigger email-webhook-provider library correctly', async () => { jest.spyOn(axios, 'post').mockImplementation(fakePost); const provider = new EmailWebhookProvider({ - webhookUrl: 'http://localhost:8080/webhook', + webhookUrl: 'http://127.0.0.1:8080/webhook', hmacSecretKey: 'super-secret-key', retryDelay: 1, retryCount: 1, @@ -30,7 +30,7 @@ test('should trigger email-webhook-provider library correctly', async () => { expect(fakePost).toHaveBeenCalled(); expect(fakePost).toHaveBeenCalledWith( - 'http://localhost:8080/webhook', + 'http://127.0.0.1:8080/webhook', '{"to":["johndoe@example.com"],"from":"janedoe@example.com","subject":"test","html":"

test

","text":"test"}', { headers: { diff --git a/providers/push-webhook/src/lib/push-webhook.provider.spec.ts b/providers/push-webhook/src/lib/push-webhook.provider.spec.ts index 489702c72a0..a23e465a6dd 100644 --- a/providers/push-webhook/src/lib/push-webhook.provider.spec.ts +++ b/providers/push-webhook/src/lib/push-webhook.provider.spec.ts @@ -13,7 +13,7 @@ test('should trigger push-webhook library correctly', async () => { jest.spyOn(axios, 'post').mockImplementation(fakePost); const provider = new PushWebhookPushProvider({ - webhookUrl: 'http://localhost:8080/webhook', + webhookUrl: 'http://127.0.0.1:8080/webhook', hmacSecretKey: 'super-secret-key', }); @@ -33,7 +33,7 @@ test('should trigger push-webhook library correctly', async () => { expect(fakePost).toHaveBeenCalled(); expect(fakePost).toHaveBeenCalledWith( - 'http://localhost:8080/webhook', + 'http://127.0.0.1:8080/webhook', JSON.stringify({ title: 'Test', content: 'Test push', diff --git a/scripts/dev-environment-setup.sh b/scripts/dev-environment-setup.sh index bb848bdec22..63fa2d3702b 100755 --- a/scripts/dev-environment-setup.sh +++ b/scripts/dev-environment-setup.sh @@ -261,7 +261,7 @@ check_nvm () { } install_node () { - NODE_JS_VERSION="v16.15.1" + NODE_JS_VERSION="v20.8.1" SKIP="$(check_nvm)" @@ -512,4 +512,3 @@ install_os_dependencies () { install_os_dependencies clone_monorepo refresh_shell - diff --git a/scripts/jarvis.js b/scripts/jarvis.js index 9113298b61d..28725c43a8b 100644 --- a/scripts/jarvis.js +++ b/scripts/jarvis.js @@ -120,10 +120,10 @@ async function setupRunner() { console.log(` Everything is running 🎊 - Web: http://localhost:4200 - Widget: http://localhost:4500 - API: http://localhost:3000 - Worker: http://localhost:3004 + Web: http://127.0.0.1:4200 + Widget: http://127.0.0.1:4500 + API: http://127.0.0.1:3000 + Worker: http://127.0.0.1:3004 `); } else if (answers.runConfiguration === WEB_PROJECT) { try { @@ -153,10 +153,10 @@ async function setupRunner() { console.log(` Everything is running 🎊 - Web: http://localhost:4200 - API: http://localhost:3000 - WS: http://localhost:3002 - Worker: http://localhost:3004 + Web: http://127.0.0.1:4200 + API: http://127.0.0.1:3000 + WS: http://127.0.0.1:3002 + Worker: http://127.0.0.1:3004 `); } catch (e) { console.error(`Failed to spin up the project ❌`, e); @@ -178,8 +178,8 @@ async function setupRunner() { console.log(` Everything is running 🎊 - API: http://localhost:3000 - Worker: http://localhost:3004 + API: http://127.0.0.1:3000 + Worker: http://127.0.0.1:3004 `); } else if (answers.runApiConfiguration === API_INTEGRATION_TESTS) { shell.exec('nx run-many --target=build --projects=@novu/api,@novu/worker');