From c2dd87676fe2b6fca78dc5c29dfcf311bd0dc9a5 Mon Sep 17 00:00:00 2001 From: Thaddeus Bond Date: Sat, 13 Jul 2024 19:48:22 -0400 Subject: [PATCH 01/38] Initial work towards VM deployment --- .github/workflows/docker-deploy.yml | 65 +++++++++++++++++++++++++++++ Dockerfile | 22 ++++++++++ http/README.md | 7 ++++ http/package-lock.json | 16 +------ http/package.json | 4 +- 5 files changed, 97 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/docker-deploy.yml create mode 100644 Dockerfile create mode 100644 http/README.md diff --git a/.github/workflows/docker-deploy.yml b/.github/workflows/docker-deploy.yml new file mode 100644 index 00000000..72f0c4a6 --- /dev/null +++ b/.github/workflows/docker-deploy.yml @@ -0,0 +1,65 @@ +# +name: Publish API via Docker + +on: + push: + branches: + - ssh-deploy + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-image: + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + attestations: write + id-token: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Log in to the Container registry + uses: docker/login-action@v3.2.0 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5.5.1 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image + id: push + uses: docker/build-push-action@v6.3.0 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + - name: Generate artifact attestation + uses: actions/attest-build-provenance@v1 + with: + subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} + subject-digest: ${{ steps.push.outputs.digest }} + push-to-registry: true + + # deploy: + # needs: build-image + # runs-on: ubuntu-latest + + # steps: + # - name: Checkout code + # uses: actions/checkout@v2 + + # - name: Deploy via SSH + # run: | + # echo "Deploying via SSH" \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..0fc2da2a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM node:18-slim + +# Copy the files from the host to the container +COPY . /app + +# Setup base package +WORKDIR /app +RUN npm ci + +# Setup HTTP package +WORKDIR /app/http +RUN npm ci + +ENV CLOUDFLARE_TOKEN=placeholder +ENV CACHE_BASIC_AUTH=placeholder +ENV PORT=8088 +ENV ENVIRONMENT=dev + +EXPOSE $PORT + +# Run the application +ENTRYPOINT ["npm", "run", "start"] \ No newline at end of file diff --git a/http/README.md b/http/README.md new file mode 100644 index 00000000..d751a530 --- /dev/null +++ b/http/README.md @@ -0,0 +1,7 @@ +This folder is for running the API as a standalonen application, without using Cloudflare workers. + +## Enviroment Variables +* `PORT` - The port the server will listen on. Default is `8088`. +* `ENVIRONMENT` - The environment to run in. Either `production` or `dev`. Default is `dev`. +* `CACHE_BASIC_AUTH` - The basic auth string to use for caching. Default is `placeholder`. +* `CLOUDFLARE_TOKEN` - The Cloudflare token to use for accessing the KV store. Default is `placeholder`. \ No newline at end of file diff --git a/http/package-lock.json b/http/package-lock.json index b56c9e17..2b9abe1a 100644 --- a/http/package-lock.json +++ b/http/package-lock.json @@ -10,7 +10,7 @@ "license": "ISC", "dependencies": { "@graphql-tools/merge": "9.0.4", - "@graphql-tools/schema": "10.0.4", + "@graphql-tools/schema": "^10.0.4", "dotenv": "^16.4.5", "express": "^4.19.2", "graphql": "^16.9.0", @@ -463,20 +463,6 @@ "node": ">= 0.6" } }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", diff --git a/http/package.json b/http/package.json index d7c76528..0f178cdf 100644 --- a/http/package.json +++ b/http/package.json @@ -18,10 +18,10 @@ }, "dependencies": { "@graphql-tools/merge": "9.0.4", - "@graphql-tools/schema": "10.0.4", - "graphql": "^16.9.0", + "@graphql-tools/schema": "^10.0.4", "dotenv": "^16.4.5", "express": "^4.19.2", + "graphql": "^16.9.0", "uuid": "^10.0.0" } } From 65213d3f1b2f65593bfa00586ab1fe4152865d04 Mon Sep 17 00:00:00 2001 From: Thaddeus Bond Date: Sat, 13 Jul 2024 20:25:23 -0400 Subject: [PATCH 02/38] Update SSH docker deploy via SSH --- .github/workflows/docker-deploy.yml | 31 ++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docker-deploy.yml b/.github/workflows/docker-deploy.yml index 72f0c4a6..6d8ea888 100644 --- a/.github/workflows/docker-deploy.yml +++ b/.github/workflows/docker-deploy.yml @@ -52,14 +52,27 @@ jobs: subject-digest: ${{ steps.push.outputs.digest }} push-to-registry: true - # deploy: - # needs: build-image - # runs-on: ubuntu-latest + deploy: + needs: build-image + runs-on: ubuntu-latest + environment: development + + steps: + - name: Checkout code + uses: actions/checkout@v2 - # steps: - # - name: Checkout code - # uses: actions/checkout@v2 + - name: Setup SSH Key + run: | + mkdir -p /home/runner/.ssh + ssh-keyscan ${{ secrets.SSH_HOST }} >> /home/runner/.ssh/known_hosts + echo "${{ secrets.SSH_PRIVATE_KEY }}" > /home/runner/.ssh/api-server-key + chmod 600 /home/runner/.ssh/api-server-key + eval $(ssh-agent) + ssh-add /home/runner/.ssh/api-server-key - # - name: Deploy via SSH - # run: | - # echo "Deploying via SSH" \ No newline at end of file + - name: Deploy via SSH + run: | + echo "Deploying via SSH" + ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "sudo docker rm -f tarkov-api || true" + ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "sudo docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}:ssh-deploy" + ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "sudo docker run -d --name tarkov-api -p 80:8088 -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}:ssh-deploy" From 4930d4ac74f8b07157bb56bfa95259d280cb3fe4 Mon Sep 17 00:00:00 2001 From: Thaddeus Bond Date: Sat, 13 Jul 2024 20:28:53 -0400 Subject: [PATCH 03/38] Change ssh agent env --- .github/workflows/docker-deploy.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-deploy.yml b/.github/workflows/docker-deploy.yml index 6d8ea888..73d35c9e 100644 --- a/.github/workflows/docker-deploy.yml +++ b/.github/workflows/docker-deploy.yml @@ -62,15 +62,19 @@ jobs: uses: actions/checkout@v2 - name: Setup SSH Key + env: + SSH_AUTH_SOCK: /tmp/ssh_agent.sock run: | mkdir -p /home/runner/.ssh ssh-keyscan ${{ secrets.SSH_HOST }} >> /home/runner/.ssh/known_hosts echo "${{ secrets.SSH_PRIVATE_KEY }}" > /home/runner/.ssh/api-server-key chmod 600 /home/runner/.ssh/api-server-key - eval $(ssh-agent) + ssh-agent -a $SSH_AUTH_SOCK > /dev/null ssh-add /home/runner/.ssh/api-server-key - name: Deploy via SSH + env: + SSH_AUTH_SOCK: /tmp/ssh_agent.sock run: | echo "Deploying via SSH" ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "sudo docker rm -f tarkov-api || true" From d5de635c38c3defa684be72d3c5ebb10c844eb8b Mon Sep 17 00:00:00 2001 From: Thaddeus Bond Date: Sun, 14 Jul 2024 16:11:24 -0400 Subject: [PATCH 04/38] Update branch deploy to use ssh+docker deployments --- .github/workflows/branch-deploy.yml | 89 ++++++++++++++++++++++++----- .github/workflows/docker-deploy.yml | 82 -------------------------- 2 files changed, 74 insertions(+), 97 deletions(-) delete mode 100644 .github/workflows/docker-deploy.yml diff --git a/.github/workflows/branch-deploy.yml b/.github/workflows/branch-deploy.yml index d4b89ff7..d9f6881e 100644 --- a/.github/workflows/branch-deploy.yml +++ b/.github/workflows/branch-deploy.yml @@ -4,12 +4,23 @@ on: issue_comment: types: [ created ] -# Permissions needed for reacting and adding comments for IssueOps commands + permissions: + # Permissions needed for reacting and adding comments for IssueOps commands pull-requests: write deployments: write contents: write checks: read + # Permissions needed for building and deploying docker images + packages: write + # contents: read + attestations: write + id-token: write + +env: + # Environment variables used by docker build and push + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} jobs: deploy: @@ -33,26 +44,74 @@ jobs: with: ref: ${{ steps.branch-deploy.outputs.ref }} - - name: setup node + - name: Log in to the Container registry if: ${{ steps.branch-deploy.outputs.continue == 'true' }} - uses: actions/setup-node@v4 + uses: docker/login-action@v3.2.0 with: - node-version-file: .node-version - cache: npm + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - - name: Install dependencies + - name: Extract metadata (tags, labels) for Docker if: ${{ steps.branch-deploy.outputs.continue == 'true' }} - run: npm ci + id: docker-meta + uses: docker/metadata-action@v5.5.1 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - name: Publish - Development - if: ${{ steps.branch-deploy.outputs.environment == 'development' && - steps.branch-deploy.outputs.noop != 'true' && - steps.branch-deploy.outputs.continue == 'true' }} - uses: cloudflare/wrangler-action@a08dc762e87e8754e0d56a16a35a70b406bc869f # pin@3.6.1 + - name: Build and push Docker image to registry + if: ${{ steps.branch-deploy.outputs.continue == 'true' }} + id: docker-push + uses: docker/build-push-action@v6.3.0 with: - wranglerVersion: '2.17.0' - apiToken: ${{ secrets.CF_API_TOKEN }} - environment: "development" + context: . + push: true + tags: ${{ steps.docker-meta.outputs.tags }} + labels: ${{ steps.docker-meta.outputs.labels }} + + - name: Generate artifact attestation + if: ${{ steps.branch-deploy.outputs.continue == 'true' }} + uses: actions/attest-build-provenance@v1 + with: + subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} + subject-digest: ${{ steps.docker-push.outputs.digest }} + push-to-registry: true + + # Setup SSH agent + - if: ${{ steps.branch-deploy.outputs.continue == 'true' && + steps.branch-deploy.outputs.noop != 'true' }} + id: setup-ssh + env: + # Sets up the ssh agent to be used in future steps for connecting to the deployment environment + SSH_AUTH_SOCK: /tmp/ssh_agent.sock + # Sets the ssh host address based on the desired environment if they differ, falling back to SSH_HOST + ENV_HOST: ${{ steps.branch-deploy.outputs.environment == 'production' && secrets.SSH_HOST_PROD || secrets.SSH_HOST_DEV || secrets.SSH_HOST }} + run: | + mkdir -p /home/runner/.ssh + ssh-keyscan $ENV_HOST >> /home/runner/.ssh/known_hosts + echo "${{ secrets.SSH_PRIVATE_KEY }}" > /home/runner/.ssh/api-server-key + chmod 600 /home/runner/.ssh/api-server-key + ssh-agent -a $SSH_AUTH_SOCK > /dev/null + ssh-add /home/runner/.ssh/api-server-key + echo "ssh-host=$ENV_HOST" >> $GITHUB_OUTPUT + + - name: Deploy + if: ${{ steps.branch-deploy.outputs.continue == 'true' && + steps.branch-deploy.outputs.noop != 'true'}} + env: + # Uses the ssh agent set up in the previous step to connect to the deployment environment + SSH_AUTH_SOCK: /tmp/ssh_agent.sock + # Allows for the API to be deployed to the same system on different ports based on the environment + ENV_PORT: ${{ steps.branch-deploy.outputs.environment == 'production' && '80' || '8088' }} + # The name of the container to be run + CONTAINER_NAME: tarkov-api-${{ steps.branch-deploy.outputs.environment }} + run: | + # Stop and remove any existing container matching our container name variable + ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker rm -f ${{ env.CONTAINER_NAME }} || true" + # Pull the latest version of the image published to the registry + ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}:${{ steps.meta.outputs.tags[0] }}" + # Run the image as a container + ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker run -d --name ${{ env.CONTAINER_NAME }} - -p ${{ env.ENV_PORT }}:8088 -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.tags[0] }}" # Post comment on PR with development deploy info - uses: GrantBirki/comment@v2.0.10 diff --git a/.github/workflows/docker-deploy.yml b/.github/workflows/docker-deploy.yml deleted file mode 100644 index 73d35c9e..00000000 --- a/.github/workflows/docker-deploy.yml +++ /dev/null @@ -1,82 +0,0 @@ -# -name: Publish API via Docker - -on: - push: - branches: - - ssh-deploy - -env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} - -jobs: - build-image: - runs-on: ubuntu-latest - - permissions: - contents: read - packages: write - attestations: write - id-token: write - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Log in to the Container registry - uses: docker/login-action@v3.2.0 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v5.5.1 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - - name: Build and push Docker image - id: push - uses: docker/build-push-action@v6.3.0 - with: - context: . - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - - - name: Generate artifact attestation - uses: actions/attest-build-provenance@v1 - with: - subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} - subject-digest: ${{ steps.push.outputs.digest }} - push-to-registry: true - - deploy: - needs: build-image - runs-on: ubuntu-latest - environment: development - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Setup SSH Key - env: - SSH_AUTH_SOCK: /tmp/ssh_agent.sock - run: | - mkdir -p /home/runner/.ssh - ssh-keyscan ${{ secrets.SSH_HOST }} >> /home/runner/.ssh/known_hosts - echo "${{ secrets.SSH_PRIVATE_KEY }}" > /home/runner/.ssh/api-server-key - chmod 600 /home/runner/.ssh/api-server-key - ssh-agent -a $SSH_AUTH_SOCK > /dev/null - ssh-add /home/runner/.ssh/api-server-key - - - name: Deploy via SSH - env: - SSH_AUTH_SOCK: /tmp/ssh_agent.sock - run: | - echo "Deploying via SSH" - ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "sudo docker rm -f tarkov-api || true" - ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "sudo docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}:ssh-deploy" - ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "sudo docker run -d --name tarkov-api -p 80:8088 -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}:ssh-deploy" From 9b5d8fb94b6cc20b8044c36e88610ab7e8e89572 Mon Sep 17 00:00:00 2001 From: Thaddeus Bond Date: Sun, 14 Jul 2024 16:16:08 -0400 Subject: [PATCH 05/38] Skip reviews for development --- .github/workflows/branch-deploy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/branch-deploy.yml b/.github/workflows/branch-deploy.yml index d9f6881e..1674eda3 100644 --- a/.github/workflows/branch-deploy.yml +++ b/.github/workflows/branch-deploy.yml @@ -37,6 +37,7 @@ jobs: environment_targets: production,development environment_urls: production|https://api.tarkov.dev/graphql,development|https://dev-api.tarkov.dev/graphql sticky_locks: "true" + skip_reviews: "development" - name: checkout if: ${{ steps.branch-deploy.outputs.continue == 'true' }} From 9fb2a14798a3204313e174ef618dfb6fc7a25433 Mon Sep 17 00:00:00 2001 From: Thaddeus Bond Date: Sun, 14 Jul 2024 16:24:20 -0400 Subject: [PATCH 06/38] Update test workflow --- .github/workflows/test.yml | 14 +++++++++----- script/test | 4 ++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6ccc569e..d8e3659f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,18 +14,22 @@ jobs: test: runs-on: ubuntu-latest steps: - - name: checkout + - name: Checkout uses: actions/checkout@v4 - - name: setup node + - name: Setup Node Environment uses: actions/setup-node@v4 with: node-version-file: .node-version cache: npm - - run: npm ci + - name: Install Dependencies + run: | + npm ci + cd http && npm ci - - name: test + - name: Execute Tests env: - CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }} + CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }} + CACHE_BASIC_AUTH: ${{ secrets.CACHE_BASIC_AUTH }} run: script/test diff --git a/script/test b/script/test index 9c2ee52b..57d74a83 100755 --- a/script/test +++ b/script/test @@ -6,12 +6,12 @@ START=1 END=60 # Start the GraphQL server in the background -CLOUDFLARE_API_TOKEN=$CLOUDFLARE_API_TOKEN npm run ci & +CLOUDFLARE_API_TOKEN=$CLOUDFLARE_TOKEN CACHE_BASIC_AUTH=$CACHE_BASIC_AUTH cd http && npm run ci & for (( c=$START; c<=$END; c++ )) do echo "⏳ Checking for GraphQL server to come online - Attempt: #$c" - curl -s http://localhost:8787/graphql > /dev/null + curl -s http://localhost:8088/graphql > /dev/null if [ $? -eq 0 ]; then echo "✔️ GraphQL server is up" newman run script/ci/Tarkov.dev.postman_collection.json From cf9b4415ba0a335a9e69208d9cc29a08b1b66b4f Mon Sep 17 00:00:00 2001 From: Thaddeus Bond Date: Sun, 14 Jul 2024 16:26:54 -0400 Subject: [PATCH 07/38] Use proper node package script for test --- script/test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/test b/script/test index 57d74a83..b1c8c68d 100755 --- a/script/test +++ b/script/test @@ -6,7 +6,7 @@ START=1 END=60 # Start the GraphQL server in the background -CLOUDFLARE_API_TOKEN=$CLOUDFLARE_TOKEN CACHE_BASIC_AUTH=$CACHE_BASIC_AUTH cd http && npm run ci & +CLOUDFLARE_API_TOKEN=$CLOUDFLARE_TOKEN CACHE_BASIC_AUTH=$CACHE_BASIC_AUTH cd http && npm run start & for (( c=$START; c<=$END; c++ )) do From c62c8daf5cdb6e4e907f191858fbac3a872020cc Mon Sep 17 00:00:00 2001 From: Thaddeus Bond Date: Sun, 14 Jul 2024 16:29:14 -0400 Subject: [PATCH 08/38] Update default development port --- .github/workflows/branch-deploy.yml | 4 ++-- Dockerfile | 2 +- script/test | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/branch-deploy.yml b/.github/workflows/branch-deploy.yml index 1674eda3..9d7cf144 100644 --- a/.github/workflows/branch-deploy.yml +++ b/.github/workflows/branch-deploy.yml @@ -103,7 +103,7 @@ jobs: # Uses the ssh agent set up in the previous step to connect to the deployment environment SSH_AUTH_SOCK: /tmp/ssh_agent.sock # Allows for the API to be deployed to the same system on different ports based on the environment - ENV_PORT: ${{ steps.branch-deploy.outputs.environment == 'production' && '80' || '8088' }} + ENV_PORT: ${{ steps.branch-deploy.outputs.environment == 'production' && '80' || '8788' }} # The name of the container to be run CONTAINER_NAME: tarkov-api-${{ steps.branch-deploy.outputs.environment }} run: | @@ -112,7 +112,7 @@ jobs: # Pull the latest version of the image published to the registry ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}:${{ steps.meta.outputs.tags[0] }}" # Run the image as a container - ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker run -d --name ${{ env.CONTAINER_NAME }} - -p ${{ env.ENV_PORT }}:8088 -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.tags[0] }}" + ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker run -d --name ${{ env.CONTAINER_NAME }} - -p ${{ env.ENV_PORT }}:8788 -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.tags[0] }}" # Post comment on PR with development deploy info - uses: GrantBirki/comment@v2.0.10 diff --git a/Dockerfile b/Dockerfile index 0fc2da2a..3c08faa1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ RUN npm ci ENV CLOUDFLARE_TOKEN=placeholder ENV CACHE_BASIC_AUTH=placeholder -ENV PORT=8088 +ENV PORT=8788 ENV ENVIRONMENT=dev EXPOSE $PORT diff --git a/script/test b/script/test index b1c8c68d..d2da7eb1 100755 --- a/script/test +++ b/script/test @@ -11,7 +11,7 @@ CLOUDFLARE_API_TOKEN=$CLOUDFLARE_TOKEN CACHE_BASIC_AUTH=$CACHE_BASIC_AUTH cd htt for (( c=$START; c<=$END; c++ )) do echo "⏳ Checking for GraphQL server to come online - Attempt: #$c" - curl -s http://localhost:8088/graphql > /dev/null + curl -s http://localhost:8788/graphql > /dev/null if [ $? -eq 0 ]; then echo "✔️ GraphQL server is up" newman run script/ci/Tarkov.dev.postman_collection.json From d0e389177545f3dd44bec6c7e55182a97a8a9fa3 Mon Sep 17 00:00:00 2001 From: Thaddeus Bond Date: Sun, 14 Jul 2024 16:34:28 -0400 Subject: [PATCH 09/38] Update newman collection to use development port --- script/ci/Tarkov.dev.postman_collection.json | 62 ++++++++++---------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/script/ci/Tarkov.dev.postman_collection.json b/script/ci/Tarkov.dev.postman_collection.json index 869b976b..ff6bfdab 100644 --- a/script/ci/Tarkov.dev.postman_collection.json +++ b/script/ci/Tarkov.dev.postman_collection.json @@ -65,9 +65,9 @@ } }, "url": { - "raw": "{{tarko.dev.api}}", + "raw": "{{tarkov.dev.api}}", "host": [ - "{{tarko.dev.api}}" + "{{tarkov.dev.api}}" ] } }, @@ -110,9 +110,9 @@ } }, "url": { - "raw": "{{tarko.dev.api}}", + "raw": "{{tarkov.dev.api}}", "host": [ - "{{tarko.dev.api}}" + "{{tarkov.dev.api}}" ] } }, @@ -186,9 +186,9 @@ } }, "url": { - "raw": "{{tarko.dev.api}}", + "raw": "{{tarkov.dev.api}}", "host": [ - "{{tarko.dev.api}}" + "{{tarkov.dev.api}}" ] } }, @@ -263,9 +263,9 @@ } }, "url": { - "raw": "{{tarko.dev.api}}", + "raw": "{{tarkov.dev.api}}", "host": [ - "{{tarko.dev.api}}" + "{{tarkov.dev.api}}" ] } }, @@ -318,9 +318,9 @@ } }, "url": { - "raw": "{{tarko.dev.api}}", + "raw": "{{tarkov.dev.api}}", "host": [ - "{{tarko.dev.api}}" + "{{tarkov.dev.api}}" ] } }, @@ -362,9 +362,9 @@ } }, "url": { - "raw": "{{tarko.dev.api}}", + "raw": "{{tarkov.dev.api}}", "host": [ - "{{tarko.dev.api}}" + "{{tarkov.dev.api}}" ] } }, @@ -406,9 +406,9 @@ } }, "url": { - "raw": "{{tarko.dev.api}}", + "raw": "{{tarkov.dev.api}}", "host": [ - "{{tarko.dev.api}}" + "{{tarkov.dev.api}}" ] } }, @@ -450,9 +450,9 @@ } }, "url": { - "raw": "{{tarko.dev.api}}", + "raw": "{{tarkov.dev.api}}", "host": [ - "{{tarko.dev.api}}" + "{{tarkov.dev.api}}" ] } }, @@ -494,9 +494,9 @@ } }, "url": { - "raw": "{{tarko.dev.api}}", + "raw": "{{tarkov.dev.api}}", "host": [ - "{{tarko.dev.api}}" + "{{tarkov.dev.api}}" ] } }, @@ -538,9 +538,9 @@ } }, "url": { - "raw": "{{tarko.dev.api}}", + "raw": "{{tarkov.dev.api}}", "host": [ - "{{tarko.dev.api}}" + "{{tarkov.dev.api}}" ] } }, @@ -582,9 +582,9 @@ } }, "url": { - "raw": "{{tarko.dev.api}}", + "raw": "{{tarkov.dev.api}}", "host": [ - "{{tarko.dev.api}}" + "{{tarkov.dev.api}}" ] } }, @@ -672,9 +672,9 @@ } }, "url": { - "raw": "{{tarko.dev.api}}", + "raw": "{{tarkov.dev.api}}", "host": [ - "{{tarko.dev.api}}" + "{{tarkov.dev.api}}" ] } }, @@ -719,9 +719,9 @@ } }, "url": { - "raw": "{{tarko.dev.api}}", + "raw": "{{tarkov.dev.api}}", "host": [ - "{{tarko.dev.api}}" + "{{tarkov.dev.api}}" ] } }, @@ -774,9 +774,9 @@ } }, "url": { - "raw": "{{tarko.dev.api}}", + "raw": "{{tarkov.dev.api}}", "host": [ - "{{tarko.dev.api}}" + "{{tarkov.dev.api}}" ] } }, @@ -789,7 +789,7 @@ "script": { "type": "text/javascript", "exec": [ - "// pm.environment.set(\"tarko.dev.api\", \"http://127.0.0.1:8787/graphql\");" + "// pm.environment.set(\"tarkov.dev.api\", \"http://127.0.0.1:8788/graphql\");" ] } }, @@ -805,8 +805,8 @@ ], "variable": [ { - "key": "tarko.dev.api", - "value": "http://localhost:8787/graphql" + "key": "tarkov.dev.api", + "value": "http://localhost:8788/graphql" }, { "key": "itemFragment", From 133f8e213e72c923dc520050610b5361c1f037d9 Mon Sep 17 00:00:00 2001 From: Thaddeus Bond Date: Sun, 14 Jul 2024 16:37:06 -0400 Subject: [PATCH 10/38] Use secrets environment during test job --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d8e3659f..5a1f2c81 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,6 +12,7 @@ permissions: jobs: test: + environment: secrets runs-on: ubuntu-latest steps: - name: Checkout From c9dcb3f7a4e050d9a63ccfce41859f28427fee13 Mon Sep 17 00:00:00 2001 From: Thaddeus Bond Date: Sun, 14 Jul 2024 17:05:06 -0400 Subject: [PATCH 11/38] Remove old production deployment --- .github/workflows/branch-deploy.yml | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/.github/workflows/branch-deploy.yml b/.github/workflows/branch-deploy.yml index 9d7cf144..622fb9a8 100644 --- a/.github/workflows/branch-deploy.yml +++ b/.github/workflows/branch-deploy.yml @@ -21,6 +21,7 @@ env: # Environment variables used by docker build and push REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} + DEFAULT_PORT: 8788 jobs: deploy: @@ -79,7 +80,8 @@ jobs: push-to-registry: true # Setup SSH agent - - if: ${{ steps.branch-deploy.outputs.continue == 'true' && + - name: Setup Deployment Agent + if: ${{ steps.branch-deploy.outputs.continue == 'true' && steps.branch-deploy.outputs.noop != 'true' }} id: setup-ssh env: @@ -103,7 +105,7 @@ jobs: # Uses the ssh agent set up in the previous step to connect to the deployment environment SSH_AUTH_SOCK: /tmp/ssh_agent.sock # Allows for the API to be deployed to the same system on different ports based on the environment - ENV_PORT: ${{ steps.branch-deploy.outputs.environment == 'production' && '80' || '8788' }} + ENV_PORT: ${{ steps.branch-deploy.outputs.environment == 'production' && '80' || env.DEFAULT_PORT }} # The name of the container to be run CONTAINER_NAME: tarkov-api-${{ steps.branch-deploy.outputs.environment }} run: | @@ -112,7 +114,7 @@ jobs: # Pull the latest version of the image published to the registry ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}:${{ steps.meta.outputs.tags[0] }}" # Run the image as a container - ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker run -d --name ${{ env.CONTAINER_NAME }} - -p ${{ env.ENV_PORT }}:8788 -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.tags[0] }}" + ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker run -d --name ${{ env.CONTAINER_NAME }} - -p ${{ env.ENV_PORT }}:${{ env.DEFAULT_PORT }} -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.tags }}" # Post comment on PR with development deploy info - uses: GrantBirki/comment@v2.0.10 @@ -131,15 +133,6 @@ jobs: > Pusher: @${{ github.actor }}, Action: `${{ github.event_name }}`, Workflow: `${{ github.workflow }}`; - - name: Publish - Production - if: ${{ steps.branch-deploy.outputs.continue == 'true' && - steps.branch-deploy.outputs.noop != 'true' && - steps.branch-deploy.outputs.environment == 'production' }} - uses: cloudflare/wrangler-action@a08dc762e87e8754e0d56a16a35a70b406bc869f # pin@3.6.1 - with: - wranglerVersion: '2.17.0' - apiToken: ${{ secrets.CF_API_TOKEN }} - # Post comment on PR with production deploy info - uses: GrantBirki/comment@v2.0.10 if: ${{ steps.branch-deploy.outputs.continue == 'true' && From 5c0eb8185d6b9b90651f15e431d8957c574de4e0 Mon Sep 17 00:00:00 2001 From: Thaddeus Bond Date: Sun, 14 Jul 2024 17:19:06 -0400 Subject: [PATCH 12/38] Update tag format for images --- .github/workflows/branch-deploy.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/branch-deploy.yml b/.github/workflows/branch-deploy.yml index 622fb9a8..a25e3fd4 100644 --- a/.github/workflows/branch-deploy.yml +++ b/.github/workflows/branch-deploy.yml @@ -22,6 +22,7 @@ env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} DEFAULT_PORT: 8788 + IMAGE_TAG: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:pr-${{ github.issue.number }} jobs: deploy: @@ -68,7 +69,7 @@ jobs: with: context: . push: true - tags: ${{ steps.docker-meta.outputs.tags }} + tags: ${{ env.IMAGE_TAG }} labels: ${{ steps.docker-meta.outputs.labels }} - name: Generate artifact attestation @@ -112,9 +113,9 @@ jobs: # Stop and remove any existing container matching our container name variable ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker rm -f ${{ env.CONTAINER_NAME }} || true" # Pull the latest version of the image published to the registry - ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}:${{ steps.meta.outputs.tags[0] }}" + ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker pull ${{ env.IMAGE_TAG }}" # Run the image as a container - ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker run -d --name ${{ env.CONTAINER_NAME }} - -p ${{ env.ENV_PORT }}:${{ env.DEFAULT_PORT }} -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.tags }}" + ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker run -d --name ${{ env.CONTAINER_NAME }} - -p ${{ env.ENV_PORT }}:${{ env.DEFAULT_PORT }} -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.IMAGE_TAG }}" # Post comment on PR with development deploy info - uses: GrantBirki/comment@v2.0.10 From 068b3f35ad1e45f8e40f144835d038e7ad9fca5c Mon Sep 17 00:00:00 2001 From: Thaddeus Bond Date: Sun, 14 Jul 2024 17:25:00 -0400 Subject: [PATCH 13/38] Define image tag in deploy job --- .github/workflows/branch-deploy.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/branch-deploy.yml b/.github/workflows/branch-deploy.yml index a25e3fd4..1fec4736 100644 --- a/.github/workflows/branch-deploy.yml +++ b/.github/workflows/branch-deploy.yml @@ -22,7 +22,6 @@ env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} DEFAULT_PORT: 8788 - IMAGE_TAG: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:pr-${{ github.issue.number }} jobs: deploy: @@ -30,6 +29,9 @@ jobs: if: ${{ github.event.issue.pull_request }} # only run on pull request comments runs-on: ubuntu-latest + env: + IMAGE_TAG: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:pr-${{ github.issue.number }} + steps: - uses: github/branch-deploy@v9.3.0 id: branch-deploy From a25eef9cfe3543509d330abe3bd50d4ca33c8520 Mon Sep 17 00:00:00 2001 From: Thaddeus Bond Date: Sun, 14 Jul 2024 17:30:38 -0400 Subject: [PATCH 14/38] Set tag variables explicitly --- .github/workflows/branch-deploy.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/branch-deploy.yml b/.github/workflows/branch-deploy.yml index 1fec4736..6ef12a92 100644 --- a/.github/workflows/branch-deploy.yml +++ b/.github/workflows/branch-deploy.yml @@ -22,6 +22,7 @@ env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} DEFAULT_PORT: 8788 + IMAGE_TAG: ghcr.io/${{ github.repository }}:pr-${{ github.issue.number }} jobs: deploy: @@ -29,9 +30,6 @@ jobs: if: ${{ github.event.issue.pull_request }} # only run on pull request comments runs-on: ubuntu-latest - env: - IMAGE_TAG: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:pr-${{ github.issue.number }} - steps: - uses: github/branch-deploy@v9.3.0 id: branch-deploy From c2996e48b0a96d8f0d16dcd38f91fe58a33b6d5b Mon Sep 17 00:00:00 2001 From: Thaddeus Bond Date: Sun, 14 Jul 2024 17:34:36 -0400 Subject: [PATCH 15/38] Use proper namespace for GH PR number --- .github/workflows/branch-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/branch-deploy.yml b/.github/workflows/branch-deploy.yml index 6ef12a92..61361350 100644 --- a/.github/workflows/branch-deploy.yml +++ b/.github/workflows/branch-deploy.yml @@ -22,7 +22,7 @@ env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} DEFAULT_PORT: 8788 - IMAGE_TAG: ghcr.io/${{ github.repository }}:pr-${{ github.issue.number }} + IMAGE_TAG: ghcr.io/${{ github.repository }}:pr-${{ github.event.issue.number }} jobs: deploy: From 455909de56e8804213b7b2dff4bcb8aa484d73b9 Mon Sep 17 00:00:00 2001 From: Thaddeus Bond Date: Sun, 14 Jul 2024 17:43:49 -0400 Subject: [PATCH 16/38] Remove typo from docker run --- .github/workflows/branch-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/branch-deploy.yml b/.github/workflows/branch-deploy.yml index 61361350..951cd4d8 100644 --- a/.github/workflows/branch-deploy.yml +++ b/.github/workflows/branch-deploy.yml @@ -115,7 +115,7 @@ jobs: # Pull the latest version of the image published to the registry ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker pull ${{ env.IMAGE_TAG }}" # Run the image as a container - ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker run -d --name ${{ env.CONTAINER_NAME }} - -p ${{ env.ENV_PORT }}:${{ env.DEFAULT_PORT }} -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.IMAGE_TAG }}" + ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker run -d --name ${{ env.CONTAINER_NAME }} -p ${{ env.ENV_PORT }}:${{ env.DEFAULT_PORT }} -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.IMAGE_TAG }}" # Post comment on PR with development deploy info - uses: GrantBirki/comment@v2.0.10 From 3d4189dcfc00e9e986f8ddf35c368c2d99f47e6e Mon Sep 17 00:00:00 2001 From: Thaddeus Bond Date: Sun, 14 Jul 2024 16:46:56 -0400 Subject: [PATCH 17/38] Update HTTP README --- http/README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/http/README.md b/http/README.md index d751a530..b87b0af5 100644 --- a/http/README.md +++ b/http/README.md @@ -1,5 +1,10 @@ This folder is for running the API as a standalonen application, without using Cloudflare workers. +## Setup +1. Install [Node.js](https://nodejs.org/en/download/) +2. Run `npm install` from the parent directory to install the base dependencies +3. Run `npm install` from this directory to install the dependencies for the HTTP server + ## Enviroment Variables * `PORT` - The port the server will listen on. Default is `8088`. * `ENVIRONMENT` - The environment to run in. Either `production` or `dev`. Default is `dev`. From e880678a200cedeeb3aef8a7dbe00a503b00772d Mon Sep 17 00:00:00 2001 From: Thaddeus Bond Date: Sun, 14 Jul 2024 18:10:32 -0400 Subject: [PATCH 18/38] Update main deploy workflow --- .github/workflows/branch-deploy.yml | 2 + .github/workflows/deploy.yml | 94 ++++++++++++++++++++++++----- docs/maintainer-notes.md | 10 +++ 3 files changed, 92 insertions(+), 14 deletions(-) diff --git a/.github/workflows/branch-deploy.yml b/.github/workflows/branch-deploy.yml index 951cd4d8..8dc64452 100644 --- a/.github/workflows/branch-deploy.yml +++ b/.github/workflows/branch-deploy.yml @@ -62,6 +62,8 @@ jobs: with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + # In theory, we could build the container as soon as a commit is pushed, rather than waiting until just before deployment. + # This would make deployments faster, but it does mean we would have images in our repository that may not have been reviewed. - name: Build and push Docker image to registry if: ${{ steps.branch-deploy.outputs.continue == 'true' }} id: docker-push diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f8f20fbc..d0688bc2 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -7,8 +7,54 @@ on: permissions: contents: read + # Permissions needed for building and deploying docker images + packages: write + # contents: read + attestations: write + id-token: write + +env: + # Environment variables used by docker build and push + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + DEFAULT_PORT: 8788 + IMAGE_LATEST_TAG: ghcr.io/${{ github.repository }}:latest + IMAGE_MAIN_TAG: ghcr.io/${{ github.repository }}:main jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Log in to the Container registry + uses: docker/login-action@v3.2.0 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: docker-meta + uses: docker/metadata-action@v5.5.1 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image to registry + id: docker-push + uses: docker/build-push-action@v6.3.0 + with: + context: . + push: true + tags: ${{ env.IMAGE_LATEST_TAG }},${{ env.IMAGE_MAIN_TAG }} + labels: ${{ steps.docker-meta.outputs.labels }} + + - name: Generate artifact attestation + uses: actions/attest-build-provenance@v1 + with: + subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} + subject-digest: ${{ steps.docker-push.outputs.digest }} + push-to-registry: true + deployment-check: runs-on: ubuntu-latest outputs: # set outputs for use in downstream jobs @@ -25,7 +71,9 @@ jobs: deploy: if: ${{ needs.deployment-check.outputs.continue == 'true' }} - needs: deployment-check + needs: + - deployment-check + - build environment: production runs-on: ubuntu-latest @@ -33,17 +81,35 @@ jobs: - name: checkout uses: actions/checkout@v4 - - name: setup node - uses: actions/setup-node@v4 - with: - node-version-file: .node-version - cache: npm - - - name: install dependencies - run: npm ci + # Setup SSH agent + - name: Setup Deployment Agent + id: setup-ssh + env: + # Sets up the ssh agent to be used in future steps for connecting to the deployment environment + SSH_AUTH_SOCK: /tmp/ssh_agent.sock + # Sets the ssh host address based on the desired environment if they differ, falling back to SSH_HOST + ENV_HOST: ${{ secrets.SSH_HOST_PROD || secrets.SSH_HOST }} + run: | + mkdir -p /home/runner/.ssh + ssh-keyscan $ENV_HOST >> /home/runner/.ssh/known_hosts + echo "${{ secrets.SSH_PRIVATE_KEY }}" > /home/runner/.ssh/api-server-key + chmod 600 /home/runner/.ssh/api-server-key + ssh-agent -a $SSH_AUTH_SOCK > /dev/null + ssh-add /home/runner/.ssh/api-server-key + echo "ssh-host=$ENV_HOST" >> $GITHUB_OUTPUT - - name: Publish - Production - uses: cloudflare/wrangler-action@a08dc762e87e8754e0d56a16a35a70b406bc869f # pin@3.6.1 - with: - wranglerVersion: '2.17.0' - apiToken: ${{ secrets.CF_API_TOKEN }} + - name: Deploy + env: + # Uses the ssh agent set up in the previous step to connect to the deployment environment + SSH_AUTH_SOCK: /tmp/ssh_agent.sock + # Allows for the API to be deployed to the same system on different ports based on the environment + ENV_PORT: '80' + # The name of the container to be run + CONTAINER_NAME: tarkov-api-production + run: | + # Stop and remove any existing container matching our container name variable + ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker rm -f ${{ env.CONTAINER_NAME }} || true" + # Pull the latest version of the image published to the registry + ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker pull ${{ env.IMAGE_MAIN_TAG }}" + # Run the image as a container + ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker run -d --name ${{ env.CONTAINER_NAME }} -p ${{ env.ENV_PORT }}:${{ env.DEFAULT_PORT }} -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.IMAGE_MAIN_TAG }}" diff --git a/docs/maintainer-notes.md b/docs/maintainer-notes.md index 7acec8b2..2212d500 100644 --- a/docs/maintainer-notes.md +++ b/docs/maintainer-notes.md @@ -14,6 +14,16 @@ This is a simple run down of how review / deploy a pull request. > It should be noted that the approval step can come before the deployment steps if that suits the situation better. +## Required Secrets + +To deploy the API, you will need the following secrets. To deploy via GitHub Actions, you will need to add these secrets to the `secrets` and `production` environments in the repository settings. + +* `CLOUDFLARE_TOKEN` - The Cloudflare API token used for accessing the KV store until such a time as we have an independent database for the new express hosted API. +* `CACHE_BASIC_AUTH` - The basic auth string to use with the cache server. +* `SSH_HOST` - The host (ip or DNS record) of the server to deploy the Docker container. +* `SSH_USER` - The user to use when connecting to the deployment server. +* `SSH_PRIVATE_KEY` - The private key to use when connecting to the deployment server. + ## CI Failures A known issue (I am not sure of the cause) for CI failures is when dependabot opens a pull request. For some very strange reason, the necessary secrets are not injected into the Actions workflow when the pull request comes from dependabot. This causes the wrangler environment in CI to fail because it lacks the proper credentials to authenticate with Cloudflare. From 745855064cc5da6385106851c5b598b5d205ac22 Mon Sep 17 00:00:00 2001 From: Thaddeus Bond Date: Sun, 14 Jul 2024 18:13:21 -0400 Subject: [PATCH 19/38] Add checkout to main build job --- .github/workflows/deploy.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d0688bc2..eda883d1 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -26,6 +26,9 @@ jobs: runs-on: ubuntu-latest steps: + - name: checkout + uses: actions/checkout@v4 + - name: Log in to the Container registry uses: docker/login-action@v3.2.0 with: From 1ad247db4290b090bd7662afac16f445d16785cf Mon Sep 17 00:00:00 2001 From: Thaddeus Bond Date: Sun, 14 Jul 2024 18:20:29 -0400 Subject: [PATCH 20/38] Test production deployment --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index b9e8641c..c91f30d9 100644 --- a/README.md +++ b/README.md @@ -95,3 +95,5 @@ There's also an http webserver in the /http folder. It can be run with `npm run - CACHE_BASIC_AUTH (used for caching) - ENVIRONMENT (either `production` or `dev`; determines which KVs are read) - PORT (defaults to 8088) + +No-op test \ No newline at end of file From fe921fa64c9a40c4fe0022714246f1a70e7c11e5 Mon Sep 17 00:00:00 2001 From: Thaddeus Bond Date: Tue, 16 Jul 2024 21:25:59 -0400 Subject: [PATCH 21/38] Add Sentry instrumentation --- .github/workflows/branch-deploy.yml | 2 +- .github/workflows/deploy.yml | 2 +- .node-version | 2 +- Dockerfile | 3 + http/README.md | 5 +- http/index.mjs | 5 +- http/instrument.mjs | 16 + http/package-lock.json | 1105 ++++++++++++++++++++++++++- http/package.json | 3 + 9 files changed, 1136 insertions(+), 7 deletions(-) create mode 100644 http/instrument.mjs diff --git a/.github/workflows/branch-deploy.yml b/.github/workflows/branch-deploy.yml index 8dc64452..5eb6137d 100644 --- a/.github/workflows/branch-deploy.yml +++ b/.github/workflows/branch-deploy.yml @@ -117,7 +117,7 @@ jobs: # Pull the latest version of the image published to the registry ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker pull ${{ env.IMAGE_TAG }}" # Run the image as a container - ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker run -d --name ${{ env.CONTAINER_NAME }} -p ${{ env.ENV_PORT }}:${{ env.DEFAULT_PORT }} -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.IMAGE_TAG }}" + ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker run -d --name ${{ env.CONTAINER_NAME }} -p ${{ env.ENV_PORT }}:${{ env.DEFAULT_PORT }} -e SENTRY_DSN='${{ secrets.SENTRY_DSN || '' }}' -e SENTRY_TRACE_RATE=${{ secrets.SENTRY_TRACE_RATE || 0 }} -e SENTRY_PROFILE_RATE=${{ secrets.SENTRY_PROFILE_RATE || 0 }} -e DEPLOY_REF='${{ steps.branch-deploy.ouputs.ref }}' -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.IMAGE_TAG }}" # Post comment on PR with development deploy info - uses: GrantBirki/comment@v2.0.10 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index eda883d1..fdac6e68 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -115,4 +115,4 @@ jobs: # Pull the latest version of the image published to the registry ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker pull ${{ env.IMAGE_MAIN_TAG }}" # Run the image as a container - ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker run -d --name ${{ env.CONTAINER_NAME }} -p ${{ env.ENV_PORT }}:${{ env.DEFAULT_PORT }} -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.IMAGE_MAIN_TAG }}" + ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker run -d --name ${{ env.CONTAINER_NAME }} -p ${{ env.ENV_PORT }}:${{ env.DEFAULT_PORT }} -e SENTRY_DSN='${{ secrets.SENTRY_DSN || '' }}' -e SENTRY_TRACE_RATE=${{ secrets.SENTRY_TRACE_RATE || 0 }} -e SENTRY_PROFILE_RATE=${{ secrets.SENTRY_PROFILE_RATE || 0 }} -e DEPLOY_REF='${{ github.ref }}' -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.IMAGE_MAIN_TAG }}" diff --git a/.node-version b/.node-version index 6d80269a..a9d08739 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -18.16.0 +18.19.0 diff --git a/Dockerfile b/Dockerfile index 3c08faa1..b331f858 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,6 +15,9 @@ ENV CLOUDFLARE_TOKEN=placeholder ENV CACHE_BASIC_AUTH=placeholder ENV PORT=8788 ENV ENVIRONMENT=dev +ENV SENTRY_DSN= +ENV SENTRY_TRACE_RATE=0 +ENV SENTRY_PROFILE_RATE=0 EXPOSE $PORT diff --git a/http/README.md b/http/README.md index b87b0af5..a28dd718 100644 --- a/http/README.md +++ b/http/README.md @@ -9,4 +9,7 @@ This folder is for running the API as a standalonen application, without using C * `PORT` - The port the server will listen on. Default is `8088`. * `ENVIRONMENT` - The environment to run in. Either `production` or `dev`. Default is `dev`. * `CACHE_BASIC_AUTH` - The basic auth string to use for caching. Default is `placeholder`. -* `CLOUDFLARE_TOKEN` - The Cloudflare token to use for accessing the KV store. Default is `placeholder`. \ No newline at end of file +* `CLOUDFLARE_TOKEN` - The Cloudflare token to use for accessing the KV store. Default is `placeholder`. +* `SENTRY_DSN` - The Sentry DSN to use for error reporting. Defaults to empty. +* `SENTRY_TRACE_RATE` - The Sentry trace sample rate to use for error reporting. Default is `0`. +* `SENTRY_PROFILE_RATE` - The Sentry profile sample rate to use for error reporting. Default is `0`. \ No newline at end of file diff --git a/http/index.mjs b/http/index.mjs index 249773a3..8712904f 100644 --- a/http/index.mjs +++ b/http/index.mjs @@ -1,3 +1,4 @@ +import "./instrument.mjs"; import express from 'express'; import 'dotenv/config'; @@ -24,9 +25,9 @@ const convertIncomingMessageToRequest = (req) => { }; const app = express(); -app.use(express.json({limit: '100mb'}), express.text()); +app.use(express.json({ limit: '100mb' }), express.text()); app.all('*', async (req, res, next) => { - const response = await worker.fetch(convertIncomingMessageToRequest(req), getEnv(), {waitUntil: () => {}}); + const response = await worker.fetch(convertIncomingMessageToRequest(req), getEnv(), { waitUntil: () => { } }); // Convert Response object to JSON const responseBody = await response.text(); diff --git a/http/instrument.mjs b/http/instrument.mjs new file mode 100644 index 00000000..580bf25b --- /dev/null +++ b/http/instrument.mjs @@ -0,0 +1,16 @@ +// Import with `import * as Sentry from "@sentry/node"` if you are using ESM +import * as Sentry from "@sentry/node"; +import { nodeProfilingIntegration } from "@sentry/profiling-node"; + +Sentry.init({ + release: `tarkov-api@${process.env.DEPLOY_REF || 'local'}`, + dsn: process.env.SENTRY_DSN || '', + integrations: [ + nodeProfilingIntegration(), + ], + // Performance Monitoring + tracesSampleRate: process.env.SENTRY_TRACE_RATE || 0, + + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: process.env.SENTRY_PROFILE_RATE || 0, +}); \ No newline at end of file diff --git a/http/package-lock.json b/http/package-lock.json index 2b9abe1a..a5c4dcaa 100644 --- a/http/package-lock.json +++ b/http/package-lock.json @@ -11,6 +11,9 @@ "dependencies": { "@graphql-tools/merge": "9.0.4", "@graphql-tools/schema": "^10.0.4", + "@sentry/cli": "^2.32.2", + "@sentry/node": "^8.18.0", + "@sentry/profiling-node": "^8.18.0", "dotenv": "^16.4.5", "express": "^4.19.2", "graphql": "^16.9.0", @@ -80,6 +83,691 @@ "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" } }, + "node_modules/@opentelemetry/api": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz", + "integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@opentelemetry/api-logs": { + "version": "0.52.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.52.1.tgz", + "integrity": "sha512-qnSqB2DQ9TPP96dl8cDubDvrUyWc0/sK81xHTK8eSUspzDM3bsewX903qclQFvVhgStjRWdC5bLb3kQqMkfV5A==", + "dependencies": { + "@opentelemetry/api": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/context-async-hooks": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/context-async-hooks/-/context-async-hooks-1.25.1.tgz", + "integrity": "sha512-UW/ge9zjvAEmRWVapOP0qyCvPulWU6cQxGxDbWEFfGOj1VBBZAuOqTo3X6yWmDTD3Xe15ysCZChHncr2xFMIfQ==", + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/core": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.25.1.tgz", + "integrity": "sha512-GeT/l6rBYWVQ4XArluLVB6WWQ8flHbdb6r2FCHC3smtdOAbrJBIv35tpV/yp9bmYUJf+xmZpu9DRTIeJVhFbEQ==", + "dependencies": { + "@opentelemetry/semantic-conventions": "1.25.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/instrumentation": { + "version": "0.52.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.52.1.tgz", + "integrity": "sha512-uXJbYU/5/MBHjMp1FqrILLRuiJCs3Ofk0MeRDk8g1S1gD47U8X3JnSwcMO1rtRo1x1a7zKaQHaoYu49p/4eSKw==", + "dependencies": { + "@opentelemetry/api-logs": "0.52.1", + "@types/shimmer": "^1.0.2", + "import-in-the-middle": "^1.8.1", + "require-in-the-middle": "^7.1.1", + "semver": "^7.5.2", + "shimmer": "^1.2.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-connect": { + "version": "0.38.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-connect/-/instrumentation-connect-0.38.0.tgz", + "integrity": "sha512-2/nRnx3pjYEmdPIaBwtgtSviTKHWnDZN3R+TkRUnhIVrvBKVcq+I5B2rtd6mr6Fe9cHlZ9Ojcuh7pkNh/xdWWg==", + "dependencies": { + "@opentelemetry/core": "^1.8.0", + "@opentelemetry/instrumentation": "^0.52.0", + "@opentelemetry/semantic-conventions": "^1.22.0", + "@types/connect": "3.4.36" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-express": { + "version": "0.41.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-express/-/instrumentation-express-0.41.0.tgz", + "integrity": "sha512-/B7fbMdaf3SYe5f1P973tkqd6s7XZirjpfkoJ63E7nltU30qmlgm9tY5XwZOzAFI0rHS9tbrFI2HFPAvQUFe/A==", + "dependencies": { + "@opentelemetry/core": "^1.8.0", + "@opentelemetry/instrumentation": "^0.52.0", + "@opentelemetry/semantic-conventions": "^1.22.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-fastify": { + "version": "0.38.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-fastify/-/instrumentation-fastify-0.38.0.tgz", + "integrity": "sha512-HBVLpTSYpkQZ87/Df3N0gAw7VzYZV3n28THIBrJWfuqw3Or7UqdhnjeuMIPQ04BKk3aZc0cWn2naSQObbh5vXw==", + "dependencies": { + "@opentelemetry/core": "^1.8.0", + "@opentelemetry/instrumentation": "^0.52.0", + "@opentelemetry/semantic-conventions": "^1.22.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-graphql": { + "version": "0.42.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-graphql/-/instrumentation-graphql-0.42.0.tgz", + "integrity": "sha512-N8SOwoKL9KQSX7z3gOaw5UaTeVQcfDO1c21csVHnmnmGUoqsXbArK2B8VuwPWcv6/BC/i3io+xTo7QGRZ/z28Q==", + "dependencies": { + "@opentelemetry/instrumentation": "^0.52.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-hapi": { + "version": "0.40.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-hapi/-/instrumentation-hapi-0.40.0.tgz", + "integrity": "sha512-8U/w7Ifumtd2bSN1OLaSwAAFhb9FyqWUki3lMMB0ds+1+HdSxYBe9aspEJEgvxAqOkrQnVniAPTEGf1pGM7SOw==", + "dependencies": { + "@opentelemetry/core": "^1.8.0", + "@opentelemetry/instrumentation": "^0.52.0", + "@opentelemetry/semantic-conventions": "^1.22.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-http": { + "version": "0.52.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-http/-/instrumentation-http-0.52.1.tgz", + "integrity": "sha512-dG/aevWhaP+7OLv4BQQSEKMJv8GyeOp3Wxl31NHqE8xo9/fYMfEljiZphUHIfyg4gnZ9swMyWjfOQs5GUQe54Q==", + "dependencies": { + "@opentelemetry/core": "1.25.1", + "@opentelemetry/instrumentation": "0.52.1", + "@opentelemetry/semantic-conventions": "1.25.1", + "semver": "^7.5.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-ioredis": { + "version": "0.42.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-ioredis/-/instrumentation-ioredis-0.42.0.tgz", + "integrity": "sha512-P11H168EKvBB9TUSasNDOGJCSkpT44XgoM6d3gRIWAa9ghLpYhl0uRkS8//MqPzcJVHr3h3RmfXIpiYLjyIZTw==", + "dependencies": { + "@opentelemetry/instrumentation": "^0.52.0", + "@opentelemetry/redis-common": "^0.36.2", + "@opentelemetry/semantic-conventions": "^1.23.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-koa": { + "version": "0.42.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-koa/-/instrumentation-koa-0.42.0.tgz", + "integrity": "sha512-H1BEmnMhho8o8HuNRq5zEI4+SIHDIglNB7BPKohZyWG4fWNuR7yM4GTlR01Syq21vODAS7z5omblScJD/eZdKw==", + "dependencies": { + "@opentelemetry/core": "^1.8.0", + "@opentelemetry/instrumentation": "^0.52.0", + "@opentelemetry/semantic-conventions": "^1.22.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-mongodb": { + "version": "0.46.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mongodb/-/instrumentation-mongodb-0.46.0.tgz", + "integrity": "sha512-VF/MicZ5UOBiXrqBslzwxhN7TVqzu1/LN/QDpkskqM0Zm0aZ4CVRbUygL8d7lrjLn15x5kGIe8VsSphMfPJzlA==", + "dependencies": { + "@opentelemetry/instrumentation": "^0.52.0", + "@opentelemetry/sdk-metrics": "^1.9.1", + "@opentelemetry/semantic-conventions": "^1.22.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-mongoose": { + "version": "0.40.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mongoose/-/instrumentation-mongoose-0.40.0.tgz", + "integrity": "sha512-niRi5ZUnkgzRhIGMOozTyoZIvJKNJyhijQI4nF4iFSb+FUx2v5fngfR+8XLmdQAO7xmsD8E5vEGdDVYVtKbZew==", + "dependencies": { + "@opentelemetry/core": "^1.8.0", + "@opentelemetry/instrumentation": "^0.52.0", + "@opentelemetry/semantic-conventions": "^1.22.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-mysql": { + "version": "0.40.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mysql/-/instrumentation-mysql-0.40.0.tgz", + "integrity": "sha512-d7ja8yizsOCNMYIJt5PH/fKZXjb/mS48zLROO4BzZTtDfhNCl2UM/9VIomP2qkGIFVouSJrGr/T00EzY7bPtKA==", + "dependencies": { + "@opentelemetry/instrumentation": "^0.52.0", + "@opentelemetry/semantic-conventions": "^1.22.0", + "@types/mysql": "2.15.22" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-mysql2": { + "version": "0.40.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mysql2/-/instrumentation-mysql2-0.40.0.tgz", + "integrity": "sha512-0xfS1xcqUmY7WE1uWjlmI67Xg3QsSUlNT+AcXHeA4BDUPwZtWqF4ezIwLgpVZfHOnkAEheqGfNSWd1PIu3Wnfg==", + "dependencies": { + "@opentelemetry/instrumentation": "^0.52.0", + "@opentelemetry/semantic-conventions": "^1.22.0", + "@opentelemetry/sql-common": "^0.40.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-nestjs-core": { + "version": "0.39.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-nestjs-core/-/instrumentation-nestjs-core-0.39.0.tgz", + "integrity": "sha512-mewVhEXdikyvIZoMIUry8eb8l3HUjuQjSjVbmLVTt4NQi35tkpnHQrG9bTRBrl3403LoWZ2njMPJyg4l6HfKvA==", + "dependencies": { + "@opentelemetry/instrumentation": "^0.52.0", + "@opentelemetry/semantic-conventions": "^1.23.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-pg": { + "version": "0.43.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-pg/-/instrumentation-pg-0.43.0.tgz", + "integrity": "sha512-og23KLyoxdnAeFs1UWqzSonuCkePUzCX30keSYigIzJe/6WSYA8rnEI5lobcxPEzg+GcU06J7jzokuEHbjVJNw==", + "dependencies": { + "@opentelemetry/instrumentation": "^0.52.0", + "@opentelemetry/semantic-conventions": "^1.22.0", + "@opentelemetry/sql-common": "^0.40.1", + "@types/pg": "8.6.1", + "@types/pg-pool": "2.0.4" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-redis-4": { + "version": "0.41.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-redis-4/-/instrumentation-redis-4-0.41.0.tgz", + "integrity": "sha512-H7IfGTqW2reLXqput4yzAe8YpDC0fmVNal95GHMLOrS89W+qWUKIqxolSh63hJyfmwPSFwXASzj7wpSk8Az+Dg==", + "dependencies": { + "@opentelemetry/instrumentation": "^0.52.0", + "@opentelemetry/redis-common": "^0.36.2", + "@opentelemetry/semantic-conventions": "^1.22.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/redis-common": { + "version": "0.36.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/redis-common/-/redis-common-0.36.2.tgz", + "integrity": "sha512-faYX1N0gpLhej/6nyp6bgRjzAKXn5GOEMYY7YhciSfCoITAktLUtQ36d24QEWNA1/WA1y6qQunCe0OhHRkVl9g==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/resources": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.25.1.tgz", + "integrity": "sha512-pkZT+iFYIZsVn6+GzM0kSX+u3MSLCY9md+lIJOoKl/P+gJFfxJte/60Usdp8Ce4rOs8GduUpSPNe1ddGyDT1sQ==", + "dependencies": { + "@opentelemetry/core": "1.25.1", + "@opentelemetry/semantic-conventions": "1.25.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/sdk-metrics": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.25.1.tgz", + "integrity": "sha512-9Mb7q5ioFL4E4dDrc4wC/A3NTHDat44v4I3p2pLPSxRvqUbDIQyMVr9uK+EU69+HWhlET1VaSrRzwdckWqY15Q==", + "dependencies": { + "@opentelemetry/core": "1.25.1", + "@opentelemetry/resources": "1.25.1", + "lodash.merge": "^4.6.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.3.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/sdk-trace-base": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.25.1.tgz", + "integrity": "sha512-C8k4hnEbc5FamuZQ92nTOp8X/diCY56XUTnMiv9UTuJitCzaNNHAVsdm5+HLCdI8SLQsLWIrG38tddMxLVoftw==", + "dependencies": { + "@opentelemetry/core": "1.25.1", + "@opentelemetry/resources": "1.25.1", + "@opentelemetry/semantic-conventions": "1.25.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/semantic-conventions": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.25.1.tgz", + "integrity": "sha512-ZDjMJJQRlyk8A1KZFCc+bCbsyrn1wTwdNt56F7twdfUfnHUZUq77/WfONCj8p72NZOyP7pNTdUWSTYC3GTbuuQ==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/sql-common": { + "version": "0.40.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sql-common/-/sql-common-0.40.1.tgz", + "integrity": "sha512-nSDlnHSqzC3pXn/wZEZVLuAuJ1MYMXPBwtv2qAbCa3847SaHItdE7SzUq/Jtb0KZmh1zfAbNi3AAMjztTT4Ugg==", + "dependencies": { + "@opentelemetry/core": "^1.1.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.1.0" + } + }, + "node_modules/@prisma/instrumentation": { + "version": "5.16.1", + "resolved": "https://registry.npmjs.org/@prisma/instrumentation/-/instrumentation-5.16.1.tgz", + "integrity": "sha512-4m5gRFWnQb8s/yTyGbMZkL7A5uJgqOWcWJxapwcAD0T0kh5sGPEVSQl/zTQvE9aduXhFAxOtC3gO+R8Hb5xO1Q==", + "dependencies": { + "@opentelemetry/api": "^1.8", + "@opentelemetry/instrumentation": "^0.49 || ^0.50 || ^0.51 || ^0.52.0", + "@opentelemetry/sdk-trace-base": "^1.22" + } + }, + "node_modules/@sentry/cli": { + "version": "2.32.2", + "resolved": "https://registry.npmjs.org/@sentry/cli/-/cli-2.32.2.tgz", + "integrity": "sha512-m/6Z3FWu+rTd8jepVlJPKQhvbT8vCjt0N7BSWZiEUVW/8mhwAYJiwO0b+Ch/u4IqbBg1dp3805q5TFPl4AdrNw==", + "hasInstallScript": true, + "dependencies": { + "https-proxy-agent": "^5.0.0", + "node-fetch": "^2.6.7", + "progress": "^2.0.3", + "proxy-from-env": "^1.1.0", + "which": "^2.0.2" + }, + "bin": { + "sentry-cli": "bin/sentry-cli" + }, + "engines": { + "node": ">= 10" + }, + "optionalDependencies": { + "@sentry/cli-darwin": "2.32.2", + "@sentry/cli-linux-arm": "2.32.2", + "@sentry/cli-linux-arm64": "2.32.2", + "@sentry/cli-linux-i686": "2.32.2", + "@sentry/cli-linux-x64": "2.32.2", + "@sentry/cli-win32-i686": "2.32.2", + "@sentry/cli-win32-x64": "2.32.2" + } + }, + "node_modules/@sentry/cli-darwin": { + "version": "2.32.2", + "resolved": "https://registry.npmjs.org/@sentry/cli-darwin/-/cli-darwin-2.32.2.tgz", + "integrity": "sha512-GDtePIavx3FKSRowdPdtIssahn46MfFFYNN+s7a9MjlhFwJtvC9A1bSDw7ksEtDaQolepUwmLPHaVe19y0T/zw==", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@sentry/cli-linux-arm": { + "version": "2.32.2", + "resolved": "https://registry.npmjs.org/@sentry/cli-linux-arm/-/cli-linux-arm-2.32.2.tgz", + "integrity": "sha512-u9s08wr8bDDqsAl6pk9iGGlOHtU+T8btU6voNKy71QzeIBpV9c8VVk/OnmP9aswp/ea4NY416yjnzcTvCrFKAw==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux", + "freebsd" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@sentry/cli-linux-arm64": { + "version": "2.32.2", + "resolved": "https://registry.npmjs.org/@sentry/cli-linux-arm64/-/cli-linux-arm64-2.32.2.tgz", + "integrity": "sha512-VECLVC1rLyvXk6rTVUfmfs4vhANjMgm4BVKGlA3rydmf2PJw2/NfipH3KeyijdE2vEoyLri+/6HH883pP0iniQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux", + "freebsd" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@sentry/cli-linux-i686": { + "version": "2.32.2", + "resolved": "https://registry.npmjs.org/@sentry/cli-linux-i686/-/cli-linux-i686-2.32.2.tgz", + "integrity": "sha512-XhofQz32OqLrQK1DEOsryhT7d29Df6VkccvxueGoIt2gpXEXtgRczsUwZjZqquDdkNCt+HPj9eUGcj8pY8JkmQ==", + "cpu": [ + "x86", + "ia32" + ], + "optional": true, + "os": [ + "linux", + "freebsd" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@sentry/cli-linux-x64": { + "version": "2.32.2", + "resolved": "https://registry.npmjs.org/@sentry/cli-linux-x64/-/cli-linux-x64-2.32.2.tgz", + "integrity": "sha512-anyng4Qqt7zX4ZY4IzDH1RJWAVZNBe6sUHcuciNy7giCU3B4/XnxAHlwYmBSN5txpaumsWdstPgRKEUJG6AOSA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux", + "freebsd" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@sentry/cli-win32-i686": { + "version": "2.32.2", + "resolved": "https://registry.npmjs.org/@sentry/cli-win32-i686/-/cli-win32-i686-2.32.2.tgz", + "integrity": "sha512-/auqx7QXG7F556fNK7vaB26pX7Far1CQMfI65iV4u/VWg6gV2WfvJWXB4iowhjqkYv56sZ+zOymLkEVF0R8wtg==", + "cpu": [ + "x86", + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@sentry/cli-win32-x64": { + "version": "2.32.2", + "resolved": "https://registry.npmjs.org/@sentry/cli-win32-x64/-/cli-win32-x64-2.32.2.tgz", + "integrity": "sha512-w7hW2sEWVYQquqdILBSFhcVW+HdoyLqVPPkLPAXRSLTwBnuni9nQEIdXr0h/7db+K3cm7PvWndp5ixVyswLHZA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@sentry/core": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-8.18.0.tgz", + "integrity": "sha512-8moEMC3gp4W6mH9w5amb/zrYk6bNW8WGgcLRMCs5rguxny8YP5i8ISOJ0T0LP9x/RxSK/6xix5D2bzI/5ECzlw==", + "dependencies": { + "@sentry/types": "8.18.0", + "@sentry/utils": "8.18.0" + }, + "engines": { + "node": ">=14.18" + } + }, + "node_modules/@sentry/node": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@sentry/node/-/node-8.18.0.tgz", + "integrity": "sha512-a+W477bmt28I1DT51xJKmp4Y7hBAdEGqQ2K7gfOn3mRBHoihuhKl2Xe8BMwFH7+v4mAEZEwAZBUOLAC7h+Tjig==", + "dependencies": { + "@opentelemetry/api": "^1.9.0", + "@opentelemetry/context-async-hooks": "^1.25.1", + "@opentelemetry/core": "^1.25.1", + "@opentelemetry/instrumentation": "^0.52.1", + "@opentelemetry/instrumentation-connect": "0.38.0", + "@opentelemetry/instrumentation-express": "0.41.0", + "@opentelemetry/instrumentation-fastify": "0.38.0", + "@opentelemetry/instrumentation-graphql": "0.42.0", + "@opentelemetry/instrumentation-hapi": "0.40.0", + "@opentelemetry/instrumentation-http": "0.52.1", + "@opentelemetry/instrumentation-ioredis": "0.42.0", + "@opentelemetry/instrumentation-koa": "0.42.0", + "@opentelemetry/instrumentation-mongodb": "0.46.0", + "@opentelemetry/instrumentation-mongoose": "0.40.0", + "@opentelemetry/instrumentation-mysql": "0.40.0", + "@opentelemetry/instrumentation-mysql2": "0.40.0", + "@opentelemetry/instrumentation-nestjs-core": "0.39.0", + "@opentelemetry/instrumentation-pg": "0.43.0", + "@opentelemetry/instrumentation-redis-4": "0.41.0", + "@opentelemetry/resources": "^1.25.1", + "@opentelemetry/sdk-trace-base": "^1.25.1", + "@opentelemetry/semantic-conventions": "^1.25.1", + "@prisma/instrumentation": "5.16.1", + "@sentry/core": "8.18.0", + "@sentry/opentelemetry": "8.18.0", + "@sentry/types": "8.18.0", + "@sentry/utils": "8.18.0" + }, + "engines": { + "node": ">=14.18" + }, + "optionalDependencies": { + "opentelemetry-instrumentation-fetch-node": "1.2.3" + } + }, + "node_modules/@sentry/opentelemetry": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@sentry/opentelemetry/-/opentelemetry-8.18.0.tgz", + "integrity": "sha512-P2OoXXJcU2RiRZmpBqOkK+NLGkwQrYizlOHl1zckHI1nYmQgOD1tcJj4c1xOYzH+eGPLp/IViXHO6vaBr8BGGg==", + "dependencies": { + "@sentry/core": "8.18.0", + "@sentry/types": "8.18.0", + "@sentry/utils": "8.18.0" + }, + "engines": { + "node": ">=14.18" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.9.0", + "@opentelemetry/core": "^1.25.1", + "@opentelemetry/instrumentation": "^0.52.1", + "@opentelemetry/sdk-trace-base": "^1.25.1", + "@opentelemetry/semantic-conventions": "^1.25.1" + } + }, + "node_modules/@sentry/profiling-node": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@sentry/profiling-node/-/profiling-node-8.18.0.tgz", + "integrity": "sha512-bgX8aPRQe8o+KDS4CgWCayCRs3BC6t6oqto1vU1h7/Nzg2XuI8xPFlaalZ/ihFvpWO+qBJZvlMu4Z9zDBWeFfQ==", + "hasInstallScript": true, + "dependencies": { + "@sentry/core": "8.18.0", + "@sentry/node": "8.18.0", + "@sentry/types": "8.18.0", + "@sentry/utils": "8.18.0", + "detect-libc": "^2.0.2", + "node-abi": "^3.61.0" + }, + "bin": { + "sentry-prune-profiler-binaries": "scripts/prune-profiler-binaries.js" + }, + "engines": { + "node": ">=14.18" + } + }, + "node_modules/@sentry/types": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-8.18.0.tgz", + "integrity": "sha512-5J+uOqptnmAnW3Rk31AHIqW36Wzvlo3UOM+p2wjSYGrC/PgcE47Klzr+w4UcOhN6AZqefalGd3vaUXz9NaFdRg==", + "engines": { + "node": ">=14.18" + } + }, + "node_modules/@sentry/utils": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-8.18.0.tgz", + "integrity": "sha512-7wq7cgaeSIGJncl9/2VMu81ZN5ep4lp4H1/+O8+xUxOmnPb/05ZZcbn9/VxVQvIoqZSZdwCLPeBz6PEVukvokA==", + "dependencies": { + "@sentry/types": "8.18.0" + }, + "engines": { + "node": ">=14.18" + } + }, + "node_modules/@types/connect": { + "version": "3.4.36", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.36.tgz", + "integrity": "sha512-P63Zd/JUGq+PdrM1lv0Wv5SBYeA2+CORvbrXbngriYY0jzLUWfQMQQxOhjONEz/wlHOAxOdY7CY65rgQdTjq2w==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/mysql": { + "version": "2.15.22", + "resolved": "https://registry.npmjs.org/@types/mysql/-/mysql-2.15.22.tgz", + "integrity": "sha512-wK1pzsJVVAjYCSZWQoWHziQZbNggXFDUEIGf54g4ZM/ERuP86uGdWeKZWMYlqTPMZfHJJvLPyogXGvCOg87yLQ==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/node": { + "version": "20.14.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.11.tgz", + "integrity": "sha512-kprQpL8MMeszbz6ojB5/tU8PLN4kesnN8Gjzw349rDlNgsSzg90lAVj3llK99Dh7JON+t9AuscPPFW6mPbTnSA==", + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/pg": { + "version": "8.6.1", + "resolved": "https://registry.npmjs.org/@types/pg/-/pg-8.6.1.tgz", + "integrity": "sha512-1Kc4oAGzAl7uqUStZCDvaLFqZrW9qWSjXOmBfdgyBP5La7Us6Mg4GBvRlSoaZMhQF/zSj1C8CtKMBkoiT8eL8w==", + "dependencies": { + "@types/node": "*", + "pg-protocol": "*", + "pg-types": "^2.2.0" + } + }, + "node_modules/@types/pg-pool": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/pg-pool/-/pg-pool-2.0.4.tgz", + "integrity": "sha512-qZAvkv1K3QbmHHFYSNRYPkRjOWRLBYrL4B9c+wG0GSVGBw0NtJwPcgx/DSddeDJvRGMHCEQ4VMEVfuJ/0gZ3XQ==", + "dependencies": { + "@types/pg": "*" + } + }, + "node_modules/@types/shimmer": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@types/shimmer/-/shimmer-1.2.0.tgz", + "integrity": "sha512-UE7oxhQLLd9gub6JKIAhDq06T0F6FnztwMNRvYgjeQSBeMc1ZG/tA47EwfduvkuQS8apbkM/lpLpWsaCeYsXVg==" + }, "node_modules/accepts": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", @@ -92,6 +780,66 @@ "node": ">= 0.6" } }, + "node_modules/acorn": { + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", + "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-import-assertions": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz", + "integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==", + "optional": true, + "peerDependencies": { + "acorn": "^8" + } + }, + "node_modules/acorn-import-attributes": { + "version": "1.9.5", + "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", + "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", + "peerDependencies": { + "acorn": "^8" + } + }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/agent-base/node_modules/debug": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", + "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/agent-base/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, "node_modules/anymatch": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", @@ -223,6 +971,11 @@ "fsevents": "~2.3.2" } }, + "node_modules/cjs-module-lexer": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.3.1.tgz", + "integrity": "sha512-a3KdPAANPbNE4ZUv9h6LckSl9zLsYOP4MBmhIPkRaeyybt+r4UghLvq+xw/YwUcC1gqylCkL4rdVs3Lwupjm4Q==" + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -313,6 +1066,14 @@ "npm": "1.2.8000 || >= 1.4.16" } }, + "node_modules/detect-libc": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", + "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", + "engines": { + "node": ">=8" + } + }, "node_modules/dotenv": { "version": "16.4.5", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", @@ -588,6 +1349,39 @@ "node": ">= 0.8" } }, + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/https-proxy-agent/node_modules/debug": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", + "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/https-proxy-agent/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, "node_modules/iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -605,6 +1399,17 @@ "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", "dev": true }, + "node_modules/import-in-the-middle": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.9.1.tgz", + "integrity": "sha512-E+3tEOutU1MV0mxhuCwfSPNNWRkbTJ3/YyL5be+blNIbHwZc53uYHQfuIhAU77xWR0BoF2eT7cqDJ6VlU5APPg==", + "dependencies": { + "acorn": "^8.8.2", + "acorn-import-attributes": "^1.9.5", + "cjs-module-lexer": "^1.2.2", + "module-details-from-path": "^1.0.3" + } + }, "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", @@ -630,6 +1435,20 @@ "node": ">=8" } }, + "node_modules/is-core-module": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.14.0.tgz", + "integrity": "sha512-a5dFJih5ZLYlRtDc0dZWP7RiKr6xIKzmn/oAYCDvdLThadVgyJwlaoQPmRtMSpz+rk0OGAgIu+TcM9HUF0fk1A==", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -660,6 +1479,16 @@ "node": ">=0.12.0" } }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" + }, "node_modules/media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -723,6 +1552,11 @@ "node": "*" } }, + "node_modules/module-details-from-path": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/module-details-from-path/-/module-details-from-path-1.0.3.tgz", + "integrity": "sha512-ySViT69/76t8VhE1xXHK6Ch4NcDd26gx0MzKXLO+F7NOtnqH68d9zF94nT8ZWSxXh8ELOERsnJO/sWt1xZYw5A==" + }, "node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -736,6 +1570,36 @@ "node": ">= 0.6" } }, + "node_modules/node-abi": { + "version": "3.65.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.65.0.tgz", + "integrity": "sha512-ThjYBfoDNr08AWx6hGaRbfPwxKV9kVzAzOzlLKbk2CuqXE2xnCh+cbAGnwM3t8Lq4v9rUB7VfondlkBckcJrVA==", + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, "node_modules/nodemon": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.3.tgz", @@ -815,6 +1679,53 @@ "node": ">= 0.8" } }, + "node_modules/opentelemetry-instrumentation-fetch-node": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/opentelemetry-instrumentation-fetch-node/-/opentelemetry-instrumentation-fetch-node-1.2.3.tgz", + "integrity": "sha512-Qb11T7KvoCevMaSeuamcLsAD+pZnavkhDnlVL0kRozfhl42dKG5Q3anUklAFKJZjY3twLR+BnRa6DlwwkIE/+A==", + "optional": true, + "dependencies": { + "@opentelemetry/instrumentation": "^0.46.0", + "@opentelemetry/semantic-conventions": "^1.17.0" + }, + "engines": { + "node": ">18.0.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.6.0" + } + }, + "node_modules/opentelemetry-instrumentation-fetch-node/node_modules/@opentelemetry/instrumentation": { + "version": "0.46.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.46.0.tgz", + "integrity": "sha512-a9TijXZZbk0vI5TGLZl+0kxyFfrXHhX6Svtz7Pp2/VBlCSKrazuULEyoJQrOknJyFWNMEmbbJgOciHCCpQcisw==", + "optional": true, + "dependencies": { + "@types/shimmer": "^1.0.2", + "import-in-the-middle": "1.7.1", + "require-in-the-middle": "^7.1.1", + "semver": "^7.5.2", + "shimmer": "^1.2.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/opentelemetry-instrumentation-fetch-node/node_modules/import-in-the-middle": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.7.1.tgz", + "integrity": "sha512-1LrZPDtW+atAxH42S6288qyDFNQ2YCty+2mxEPRtfazH6Z5QwkaBSTS2ods7hnVJioF6rkRfNoA6A/MstpFXLg==", + "optional": true, + "dependencies": { + "acorn": "^8.8.2", + "acorn-import-assertions": "^1.9.0", + "cjs-module-lexer": "^1.2.2", + "module-details-from-path": "^1.0.3" + } + }, "node_modules/parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -823,11 +1734,44 @@ "node": ">= 0.8" } }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" + }, "node_modules/path-to-regexp": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" }, + "node_modules/pg-int8": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz", + "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/pg-protocol": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.6.1.tgz", + "integrity": "sha512-jPIlvgoD63hrEuihvIg+tJhoGjUsLPn6poJY9N5CnlPd91c2T18T/9zBtLxZSb1EhYxBRoZJtzScCaWlYLtktg==" + }, + "node_modules/pg-types": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz", + "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==", + "dependencies": { + "pg-int8": "1.0.1", + "postgres-array": "~2.0.0", + "postgres-bytea": "~1.0.0", + "postgres-date": "~1.0.4", + "postgres-interval": "^1.1.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", @@ -840,6 +1784,49 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/postgres-array": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", + "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==", + "engines": { + "node": ">=4" + } + }, + "node_modules/postgres-bytea": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz", + "integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/postgres-date": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz", + "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/postgres-interval": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz", + "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", + "dependencies": { + "xtend": "^4.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -852,6 +1839,11 @@ "node": ">= 0.10" } }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "node_modules/pstree.remy": { "version": "1.1.8", "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", @@ -906,6 +1898,56 @@ "node": ">=8.10.0" } }, + "node_modules/require-in-the-middle": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/require-in-the-middle/-/require-in-the-middle-7.3.0.tgz", + "integrity": "sha512-nQFEv9gRw6SJAwWD2LrL0NmQvAcO7FBwJbwmr2ttPAacfy0xuiOjE5zt+zM4xDyuyvUaxBi/9gb2SoCyNEVJcw==", + "dependencies": { + "debug": "^4.1.1", + "module-details-from-path": "^1.0.3", + "resolve": "^1.22.1" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/require-in-the-middle/node_modules/debug": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", + "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/require-in-the-middle/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -934,7 +1976,6 @@ "version": "7.6.2", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", - "dev": true, "bin": { "semver": "bin/semver.js" }, @@ -1005,6 +2046,11 @@ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" }, + "node_modules/shimmer": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/shimmer/-/shimmer-1.2.1.tgz", + "integrity": "sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw==" + }, "node_modules/side-channel": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", @@ -1054,6 +2100,17 @@ "node": ">=4" } }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -1083,6 +2140,11 @@ "nodetouch": "bin/nodetouch.js" } }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, "node_modules/tslib": { "version": "2.6.3", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", @@ -1106,6 +2168,11 @@ "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", "dev": true }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" + }, "node_modules/unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", @@ -1149,6 +2216,42 @@ "engines": { "node": ">= 0.8" } + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "engines": { + "node": ">=0.4" + } } } } diff --git a/http/package.json b/http/package.json index 0f178cdf..570cc4c8 100644 --- a/http/package.json +++ b/http/package.json @@ -19,6 +19,9 @@ "dependencies": { "@graphql-tools/merge": "9.0.4", "@graphql-tools/schema": "^10.0.4", + "@sentry/cli": "^2.32.2", + "@sentry/node": "^8.18.0", + "@sentry/profiling-node": "^8.18.0", "dotenv": "^16.4.5", "express": "^4.19.2", "graphql": "^16.9.0", From c455fbdbfbf477b554019f8ebd75dedf2c68c75a Mon Sep 17 00:00:00 2001 From: Thaddeus Bond Date: Tue, 16 Jul 2024 21:32:03 -0400 Subject: [PATCH 22/38] Use variables for Sentry sample rates during deployment --- .github/workflows/branch-deploy.yml | 2 +- .github/workflows/deploy.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/branch-deploy.yml b/.github/workflows/branch-deploy.yml index 5eb6137d..a9f38fda 100644 --- a/.github/workflows/branch-deploy.yml +++ b/.github/workflows/branch-deploy.yml @@ -117,7 +117,7 @@ jobs: # Pull the latest version of the image published to the registry ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker pull ${{ env.IMAGE_TAG }}" # Run the image as a container - ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker run -d --name ${{ env.CONTAINER_NAME }} -p ${{ env.ENV_PORT }}:${{ env.DEFAULT_PORT }} -e SENTRY_DSN='${{ secrets.SENTRY_DSN || '' }}' -e SENTRY_TRACE_RATE=${{ secrets.SENTRY_TRACE_RATE || 0 }} -e SENTRY_PROFILE_RATE=${{ secrets.SENTRY_PROFILE_RATE || 0 }} -e DEPLOY_REF='${{ steps.branch-deploy.ouputs.ref }}' -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.IMAGE_TAG }}" + ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker run -d --name ${{ env.CONTAINER_NAME }} -p ${{ env.ENV_PORT }}:${{ env.DEFAULT_PORT }} -e SENTRY_DSN='${{ secrets.SENTRY_DSN || '' }}' -e SENTRY_TRACE_RATE=${{ vars.SENTRY_TRACE_RATE || 0 }} -e SENTRY_PROFILE_RATE=${{ vars.SENTRY_PROFILE_RATE || 0 }} -e DEPLOY_REF='${{ steps.branch-deploy.ouputs.ref }}' -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.IMAGE_TAG }}" # Post comment on PR with development deploy info - uses: GrantBirki/comment@v2.0.10 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index fdac6e68..c0fa1db9 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -115,4 +115,4 @@ jobs: # Pull the latest version of the image published to the registry ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker pull ${{ env.IMAGE_MAIN_TAG }}" # Run the image as a container - ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker run -d --name ${{ env.CONTAINER_NAME }} -p ${{ env.ENV_PORT }}:${{ env.DEFAULT_PORT }} -e SENTRY_DSN='${{ secrets.SENTRY_DSN || '' }}' -e SENTRY_TRACE_RATE=${{ secrets.SENTRY_TRACE_RATE || 0 }} -e SENTRY_PROFILE_RATE=${{ secrets.SENTRY_PROFILE_RATE || 0 }} -e DEPLOY_REF='${{ github.ref }}' -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.IMAGE_MAIN_TAG }}" + ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker run -d --name ${{ env.CONTAINER_NAME }} -p ${{ env.ENV_PORT }}:${{ env.DEFAULT_PORT }} -e SENTRY_DSN='${{ secrets.SENTRY_DSN || '' }}' -e SENTRY_TRACE_RATE=${{ vars.SENTRY_TRACE_RATE || 0 }} -e SENTRY_PROFILE_RATE=${{ vars.SENTRY_PROFILE_RATE || 0 }} -e DEPLOY_REF='${{ github.ref }}' -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.IMAGE_MAIN_TAG }}" From 7fb669274c70a8e8a8d49753708fca974333a095 Mon Sep 17 00:00:00 2001 From: Thaddeus Bond Date: Tue, 16 Jul 2024 22:33:51 -0400 Subject: [PATCH 23/38] Add environment to Sentry init --- .github/workflows/branch-deploy.yml | 2 +- .github/workflows/deploy.yml | 2 +- http/README.md | 3 ++- http/instrument.mjs | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/branch-deploy.yml b/.github/workflows/branch-deploy.yml index a9f38fda..7cf9a29a 100644 --- a/.github/workflows/branch-deploy.yml +++ b/.github/workflows/branch-deploy.yml @@ -117,7 +117,7 @@ jobs: # Pull the latest version of the image published to the registry ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker pull ${{ env.IMAGE_TAG }}" # Run the image as a container - ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker run -d --name ${{ env.CONTAINER_NAME }} -p ${{ env.ENV_PORT }}:${{ env.DEFAULT_PORT }} -e SENTRY_DSN='${{ secrets.SENTRY_DSN || '' }}' -e SENTRY_TRACE_RATE=${{ vars.SENTRY_TRACE_RATE || 0 }} -e SENTRY_PROFILE_RATE=${{ vars.SENTRY_PROFILE_RATE || 0 }} -e DEPLOY_REF='${{ steps.branch-deploy.ouputs.ref }}' -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.IMAGE_TAG }}" + ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker run -d --name ${{ env.CONTAINER_NAME }} -p ${{ env.ENV_PORT }}:${{ env.DEFAULT_PORT }} -e SENTRY_ENV='${{ steps.branch-deploy.outputs.environment }}' -e SENTRY_DSN='${{ secrets.SENTRY_DSN || '' }}' -e SENTRY_TRACE_RATE=${{ vars.SENTRY_TRACE_RATE || 0 }} -e SENTRY_PROFILE_RATE=${{ vars.SENTRY_PROFILE_RATE || 0 }} -e DEPLOY_REF='${{ steps.branch-deploy.ouputs.ref }}' -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.IMAGE_TAG }}" # Post comment on PR with development deploy info - uses: GrantBirki/comment@v2.0.10 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c0fa1db9..a7ab11b2 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -115,4 +115,4 @@ jobs: # Pull the latest version of the image published to the registry ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker pull ${{ env.IMAGE_MAIN_TAG }}" # Run the image as a container - ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker run -d --name ${{ env.CONTAINER_NAME }} -p ${{ env.ENV_PORT }}:${{ env.DEFAULT_PORT }} -e SENTRY_DSN='${{ secrets.SENTRY_DSN || '' }}' -e SENTRY_TRACE_RATE=${{ vars.SENTRY_TRACE_RATE || 0 }} -e SENTRY_PROFILE_RATE=${{ vars.SENTRY_PROFILE_RATE || 0 }} -e DEPLOY_REF='${{ github.ref }}' -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.IMAGE_MAIN_TAG }}" + ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker run -d --name ${{ env.CONTAINER_NAME }} -p ${{ env.ENV_PORT }}:${{ env.DEFAULT_PORT }} -e SENTRY_ENV='production' -e SENTRY_DSN='${{ secrets.SENTRY_DSN || '' }}' -e SENTRY_TRACE_RATE=${{ vars.SENTRY_TRACE_RATE || 0 }} -e SENTRY_PROFILE_RATE=${{ vars.SENTRY_PROFILE_RATE || 0 }} -e DEPLOY_REF='${{ github.ref }}' -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.IMAGE_MAIN_TAG }}" diff --git a/http/README.md b/http/README.md index a28dd718..97327811 100644 --- a/http/README.md +++ b/http/README.md @@ -12,4 +12,5 @@ This folder is for running the API as a standalonen application, without using C * `CLOUDFLARE_TOKEN` - The Cloudflare token to use for accessing the KV store. Default is `placeholder`. * `SENTRY_DSN` - The Sentry DSN to use for error reporting. Defaults to empty. * `SENTRY_TRACE_RATE` - The Sentry trace sample rate to use for error reporting. Default is `0`. -* `SENTRY_PROFILE_RATE` - The Sentry profile sample rate to use for error reporting. Default is `0`. \ No newline at end of file +* `SENTRY_PROFILE_RATE` - The Sentry profile sample rate to use for error reporting. Default is `0`. +* `SENTRY_ENV` - The Sentry environment to use for error reporting. Default is `unknown`. \ No newline at end of file diff --git a/http/instrument.mjs b/http/instrument.mjs index 580bf25b..b32444a0 100644 --- a/http/instrument.mjs +++ b/http/instrument.mjs @@ -4,6 +4,7 @@ import { nodeProfilingIntegration } from "@sentry/profiling-node"; Sentry.init({ release: `tarkov-api@${process.env.DEPLOY_REF || 'local'}`, + environment: process.env.SENTRY_ENV || 'unknown', dsn: process.env.SENTRY_DSN || '', integrations: [ nodeProfilingIntegration(), From 9be813b796f72a00406a44e82b320f6c30fb61d4 Mon Sep 17 00:00:00 2001 From: Thaddeus Bond Date: Tue, 16 Jul 2024 22:38:00 -0400 Subject: [PATCH 24/38] Use sha for Sentry release version --- .github/workflows/branch-deploy.yml | 2 +- .github/workflows/deploy.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/branch-deploy.yml b/.github/workflows/branch-deploy.yml index 7cf9a29a..10191aaa 100644 --- a/.github/workflows/branch-deploy.yml +++ b/.github/workflows/branch-deploy.yml @@ -117,7 +117,7 @@ jobs: # Pull the latest version of the image published to the registry ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker pull ${{ env.IMAGE_TAG }}" # Run the image as a container - ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker run -d --name ${{ env.CONTAINER_NAME }} -p ${{ env.ENV_PORT }}:${{ env.DEFAULT_PORT }} -e SENTRY_ENV='${{ steps.branch-deploy.outputs.environment }}' -e SENTRY_DSN='${{ secrets.SENTRY_DSN || '' }}' -e SENTRY_TRACE_RATE=${{ vars.SENTRY_TRACE_RATE || 0 }} -e SENTRY_PROFILE_RATE=${{ vars.SENTRY_PROFILE_RATE || 0 }} -e DEPLOY_REF='${{ steps.branch-deploy.ouputs.ref }}' -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.IMAGE_TAG }}" + ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker run -d --name ${{ env.CONTAINER_NAME }} -p ${{ env.ENV_PORT }}:${{ env.DEFAULT_PORT }} -e SENTRY_ENV='${{ steps.branch-deploy.outputs.environment }}' -e SENTRY_DSN='${{ secrets.SENTRY_DSN || '' }}' -e SENTRY_TRACE_RATE=${{ vars.SENTRY_TRACE_RATE || 0 }} -e SENTRY_PROFILE_RATE=${{ vars.SENTRY_PROFILE_RATE || 0 }} -e DEPLOY_REF='${{ github.event.pull_request.head.sha || github.sha }}' -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.IMAGE_TAG }}" # Post comment on PR with development deploy info - uses: GrantBirki/comment@v2.0.10 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index a7ab11b2..30a131e5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -115,4 +115,4 @@ jobs: # Pull the latest version of the image published to the registry ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker pull ${{ env.IMAGE_MAIN_TAG }}" # Run the image as a container - ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker run -d --name ${{ env.CONTAINER_NAME }} -p ${{ env.ENV_PORT }}:${{ env.DEFAULT_PORT }} -e SENTRY_ENV='production' -e SENTRY_DSN='${{ secrets.SENTRY_DSN || '' }}' -e SENTRY_TRACE_RATE=${{ vars.SENTRY_TRACE_RATE || 0 }} -e SENTRY_PROFILE_RATE=${{ vars.SENTRY_PROFILE_RATE || 0 }} -e DEPLOY_REF='${{ github.ref }}' -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.IMAGE_MAIN_TAG }}" + ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker run -d --name ${{ env.CONTAINER_NAME }} -p ${{ env.ENV_PORT }}:${{ env.DEFAULT_PORT }} -e SENTRY_ENV='production' -e SENTRY_DSN='${{ secrets.SENTRY_DSN || '' }}' -e SENTRY_TRACE_RATE=${{ vars.SENTRY_TRACE_RATE || 0 }} -e SENTRY_PROFILE_RATE=${{ vars.SENTRY_PROFILE_RATE || 0 }} -e DEPLOY_REF='${{ github.sha }}' -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.IMAGE_MAIN_TAG }}" From ae4650154026353cb02c29787ccea308a6372092 Mon Sep 17 00:00:00 2001 From: Thaddeus Bond Date: Tue, 16 Jul 2024 23:13:03 -0400 Subject: [PATCH 25/38] Update to Node 20 --- .node-version | 2 +- Dockerfile | 2 +- http/package-lock.json | 2 +- http/package.json | 2 +- package.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.node-version b/.node-version index a9d08739..b8e593f5 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -18.19.0 +20.15.1 diff --git a/Dockerfile b/Dockerfile index b331f858..6e14c920 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:18-slim +FROM node:20-slim # Copy the files from the host to the container COPY . /app diff --git a/http/package-lock.json b/http/package-lock.json index a5c4dcaa..7b87cb20 100644 --- a/http/package-lock.json +++ b/http/package-lock.json @@ -23,7 +23,7 @@ "nodemon": "^3.1.3" }, "engines": { - "node": ">=18.16.0" + "node": ">=20.15.1" } }, "node_modules/@graphql-tools/merge": { diff --git a/http/package.json b/http/package.json index 570cc4c8..667f50fa 100644 --- a/http/package.json +++ b/http/package.json @@ -4,7 +4,7 @@ "description": "Tarkov Data API", "main": "index.mjs", "engines": { - "node": ">=18.16.0" + "node": ">=20.15.1" }, "scripts": { "test": "echo \"Error: no test specified\"", diff --git a/package.json b/package.json index c9f4b9ee..50e40b3a 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "Tarkov Data API", "main": "index.mjs", "engines": { - "node": ">=18.16.0" + "node": ">=20.15.1" }, "scripts": { "test": "echo \"Error: no test specified\"", From 347630a4a66305246914b9a2f6359686ae1daecf Mon Sep 17 00:00:00 2001 From: Thaddeus Bond Date: Tue, 16 Jul 2024 23:21:11 -0400 Subject: [PATCH 26/38] Add explicit evironment flag --- .github/workflows/branch-deploy.yml | 2 +- .github/workflows/deploy.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/branch-deploy.yml b/.github/workflows/branch-deploy.yml index 10191aaa..01dd4d2c 100644 --- a/.github/workflows/branch-deploy.yml +++ b/.github/workflows/branch-deploy.yml @@ -117,7 +117,7 @@ jobs: # Pull the latest version of the image published to the registry ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker pull ${{ env.IMAGE_TAG }}" # Run the image as a container - ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker run -d --name ${{ env.CONTAINER_NAME }} -p ${{ env.ENV_PORT }}:${{ env.DEFAULT_PORT }} -e SENTRY_ENV='${{ steps.branch-deploy.outputs.environment }}' -e SENTRY_DSN='${{ secrets.SENTRY_DSN || '' }}' -e SENTRY_TRACE_RATE=${{ vars.SENTRY_TRACE_RATE || 0 }} -e SENTRY_PROFILE_RATE=${{ vars.SENTRY_PROFILE_RATE || 0 }} -e DEPLOY_REF='${{ github.event.pull_request.head.sha || github.sha }}' -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.IMAGE_TAG }}" + ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker run -d --name ${{ env.CONTAINER_NAME }} -p ${{ env.ENV_PORT }}:${{ env.DEFAULT_PORT }} -e ENVIRONMENT='${{ steps.branch-deploy.outputs.environment }}' -e SENTRY_ENV='${{ steps.branch-deploy.outputs.environment }}' -e SENTRY_DSN='${{ secrets.SENTRY_DSN || '' }}' -e SENTRY_TRACE_RATE=${{ vars.SENTRY_TRACE_RATE || 0 }} -e SENTRY_PROFILE_RATE=${{ vars.SENTRY_PROFILE_RATE || 0 }} -e DEPLOY_REF='${{ github.event.pull_request.head.sha || github.sha }}' -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.IMAGE_TAG }}" # Post comment on PR with development deploy info - uses: GrantBirki/comment@v2.0.10 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 30a131e5..00173211 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -115,4 +115,4 @@ jobs: # Pull the latest version of the image published to the registry ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker pull ${{ env.IMAGE_MAIN_TAG }}" # Run the image as a container - ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker run -d --name ${{ env.CONTAINER_NAME }} -p ${{ env.ENV_PORT }}:${{ env.DEFAULT_PORT }} -e SENTRY_ENV='production' -e SENTRY_DSN='${{ secrets.SENTRY_DSN || '' }}' -e SENTRY_TRACE_RATE=${{ vars.SENTRY_TRACE_RATE || 0 }} -e SENTRY_PROFILE_RATE=${{ vars.SENTRY_PROFILE_RATE || 0 }} -e DEPLOY_REF='${{ github.sha }}' -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.IMAGE_MAIN_TAG }}" + ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker run -d --name ${{ env.CONTAINER_NAME }} -p ${{ env.ENV_PORT }}:${{ env.DEFAULT_PORT }} -e ENVIRONMENT='production' -e SENTRY_ENV='production' -e SENTRY_DSN='${{ secrets.SENTRY_DSN || '' }}' -e SENTRY_TRACE_RATE=${{ vars.SENTRY_TRACE_RATE || 0 }} -e SENTRY_PROFILE_RATE=${{ vars.SENTRY_PROFILE_RATE || 0 }} -e DEPLOY_REF='${{ github.sha }}' -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.IMAGE_MAIN_TAG }}" From ead258db8e0566ca167253197218bcd2b68a0a82 Mon Sep 17 00:00:00 2001 From: Thaddeus Bond Date: Tue, 16 Jul 2024 23:31:53 -0400 Subject: [PATCH 27/38] Add restart flag to docker run --- .github/workflows/branch-deploy.yml | 2 +- .github/workflows/deploy.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/branch-deploy.yml b/.github/workflows/branch-deploy.yml index 01dd4d2c..b0c7533d 100644 --- a/.github/workflows/branch-deploy.yml +++ b/.github/workflows/branch-deploy.yml @@ -117,7 +117,7 @@ jobs: # Pull the latest version of the image published to the registry ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker pull ${{ env.IMAGE_TAG }}" # Run the image as a container - ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker run -d --name ${{ env.CONTAINER_NAME }} -p ${{ env.ENV_PORT }}:${{ env.DEFAULT_PORT }} -e ENVIRONMENT='${{ steps.branch-deploy.outputs.environment }}' -e SENTRY_ENV='${{ steps.branch-deploy.outputs.environment }}' -e SENTRY_DSN='${{ secrets.SENTRY_DSN || '' }}' -e SENTRY_TRACE_RATE=${{ vars.SENTRY_TRACE_RATE || 0 }} -e SENTRY_PROFILE_RATE=${{ vars.SENTRY_PROFILE_RATE || 0 }} -e DEPLOY_REF='${{ github.event.pull_request.head.sha || github.sha }}' -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.IMAGE_TAG }}" + ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker run -d --name ${{ env.CONTAINER_NAME }} --restart unless-stopped -p ${{ env.ENV_PORT }}:${{ env.DEFAULT_PORT }} -e ENVIRONMENT='${{ steps.branch-deploy.outputs.environment }}' -e SENTRY_ENV='${{ steps.branch-deploy.outputs.environment }}' -e SENTRY_DSN='${{ secrets.SENTRY_DSN || '' }}' -e SENTRY_TRACE_RATE=${{ vars.SENTRY_TRACE_RATE || 0 }} -e SENTRY_PROFILE_RATE=${{ vars.SENTRY_PROFILE_RATE || 0 }} -e DEPLOY_REF='${{ github.event.pull_request.head.sha || github.sha }}' -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.IMAGE_TAG }}" # Post comment on PR with development deploy info - uses: GrantBirki/comment@v2.0.10 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 00173211..71279258 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -115,4 +115,4 @@ jobs: # Pull the latest version of the image published to the registry ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker pull ${{ env.IMAGE_MAIN_TAG }}" # Run the image as a container - ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker run -d --name ${{ env.CONTAINER_NAME }} -p ${{ env.ENV_PORT }}:${{ env.DEFAULT_PORT }} -e ENVIRONMENT='production' -e SENTRY_ENV='production' -e SENTRY_DSN='${{ secrets.SENTRY_DSN || '' }}' -e SENTRY_TRACE_RATE=${{ vars.SENTRY_TRACE_RATE || 0 }} -e SENTRY_PROFILE_RATE=${{ vars.SENTRY_PROFILE_RATE || 0 }} -e DEPLOY_REF='${{ github.sha }}' -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.IMAGE_MAIN_TAG }}" + ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker run -d --name ${{ env.CONTAINER_NAME }} --restart unless-stopped -p ${{ env.ENV_PORT }}:${{ env.DEFAULT_PORT }} -e ENVIRONMENT='production' -e SENTRY_ENV='production' -e SENTRY_DSN='${{ secrets.SENTRY_DSN || '' }}' -e SENTRY_TRACE_RATE=${{ vars.SENTRY_TRACE_RATE || 0 }} -e SENTRY_PROFILE_RATE=${{ vars.SENTRY_PROFILE_RATE || 0 }} -e DEPLOY_REF='${{ github.sha }}' -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.IMAGE_MAIN_TAG }}" From 1924252b76c3a00842754befd9c7820b894fea86 Mon Sep 17 00:00:00 2001 From: Thaddeus Bond Date: Wed, 17 Jul 2024 00:31:29 -0400 Subject: [PATCH 28/38] Add extra integration data to Sentry --- http/instrument.mjs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/http/instrument.mjs b/http/instrument.mjs index b32444a0..e78ec28a 100644 --- a/http/instrument.mjs +++ b/http/instrument.mjs @@ -8,6 +8,14 @@ Sentry.init({ dsn: process.env.SENTRY_DSN || '', integrations: [ nodeProfilingIntegration(), + Sentry.requestDataIntegration({ + include: { + ip: true + } + }), + Sentry.graphqlIntegration({ + ignoreResolveSpans: false + }) ], // Performance Monitoring tracesSampleRate: process.env.SENTRY_TRACE_RATE || 0, From 8cc1cd8158d33bdd67ed05c18babaa6ec7fbf18a Mon Sep 17 00:00:00 2001 From: Thaddeus Bond Date: Wed, 17 Jul 2024 00:54:07 -0400 Subject: [PATCH 29/38] Manually set user --- http/index.mjs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/http/index.mjs b/http/index.mjs index 8712904f..ed72ed55 100644 --- a/http/index.mjs +++ b/http/index.mjs @@ -1,3 +1,4 @@ +import * as Sentry from "@sentry/node"; import "./instrument.mjs"; import express from 'express'; import 'dotenv/config'; @@ -27,6 +28,7 @@ const convertIncomingMessageToRequest = (req) => { const app = express(); app.use(express.json({ limit: '100mb' }), express.text()); app.all('*', async (req, res, next) => { + Sentry.setUser({ ip_address: req.ip }); const response = await worker.fetch(convertIncomingMessageToRequest(req), getEnv(), { waitUntil: () => { } }); // Convert Response object to JSON From 43ec6b4c89cc0a7071b4fc49be4ee65b04637668 Mon Sep 17 00:00:00 2001 From: Thaddeus Bond Date: Wed, 17 Jul 2024 20:39:03 -0400 Subject: [PATCH 30/38] Use normal user for docker control --- .github/workflows/branch-deploy.yml | 6 +++--- .github/workflows/deploy.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/branch-deploy.yml b/.github/workflows/branch-deploy.yml index b0c7533d..97f9aaab 100644 --- a/.github/workflows/branch-deploy.yml +++ b/.github/workflows/branch-deploy.yml @@ -113,11 +113,11 @@ jobs: CONTAINER_NAME: tarkov-api-${{ steps.branch-deploy.outputs.environment }} run: | # Stop and remove any existing container matching our container name variable - ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker rm -f ${{ env.CONTAINER_NAME }} || true" + ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "docker rm -f ${{ env.CONTAINER_NAME }} || true" # Pull the latest version of the image published to the registry - ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker pull ${{ env.IMAGE_TAG }}" + ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "docker pull ${{ env.IMAGE_TAG }}" # Run the image as a container - ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker run -d --name ${{ env.CONTAINER_NAME }} --restart unless-stopped -p ${{ env.ENV_PORT }}:${{ env.DEFAULT_PORT }} -e ENVIRONMENT='${{ steps.branch-deploy.outputs.environment }}' -e SENTRY_ENV='${{ steps.branch-deploy.outputs.environment }}' -e SENTRY_DSN='${{ secrets.SENTRY_DSN || '' }}' -e SENTRY_TRACE_RATE=${{ vars.SENTRY_TRACE_RATE || 0 }} -e SENTRY_PROFILE_RATE=${{ vars.SENTRY_PROFILE_RATE || 0 }} -e DEPLOY_REF='${{ github.event.pull_request.head.sha || github.sha }}' -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.IMAGE_TAG }}" + ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "docker run -d --name ${{ env.CONTAINER_NAME }} --restart unless-stopped -p ${{ env.ENV_PORT }}:${{ env.DEFAULT_PORT }} -e ENVIRONMENT='${{ steps.branch-deploy.outputs.environment }}' -e SENTRY_ENV='${{ steps.branch-deploy.outputs.environment }}' -e SENTRY_DSN='${{ secrets.SENTRY_DSN || '' }}' -e SENTRY_TRACE_RATE=${{ vars.SENTRY_TRACE_RATE || 0 }} -e SENTRY_PROFILE_RATE=${{ vars.SENTRY_PROFILE_RATE || 0 }} -e DEPLOY_REF='${{ github.event.pull_request.head.sha || github.sha }}' -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.IMAGE_TAG }}" # Post comment on PR with development deploy info - uses: GrantBirki/comment@v2.0.10 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 71279258..1af7dc35 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -111,8 +111,8 @@ jobs: CONTAINER_NAME: tarkov-api-production run: | # Stop and remove any existing container matching our container name variable - ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker rm -f ${{ env.CONTAINER_NAME }} || true" + ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "docker rm -f ${{ env.CONTAINER_NAME }} || true" # Pull the latest version of the image published to the registry - ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker pull ${{ env.IMAGE_MAIN_TAG }}" + ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "docker pull ${{ env.IMAGE_MAIN_TAG }}" # Run the image as a container - ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "sudo docker run -d --name ${{ env.CONTAINER_NAME }} --restart unless-stopped -p ${{ env.ENV_PORT }}:${{ env.DEFAULT_PORT }} -e ENVIRONMENT='production' -e SENTRY_ENV='production' -e SENTRY_DSN='${{ secrets.SENTRY_DSN || '' }}' -e SENTRY_TRACE_RATE=${{ vars.SENTRY_TRACE_RATE || 0 }} -e SENTRY_PROFILE_RATE=${{ vars.SENTRY_PROFILE_RATE || 0 }} -e DEPLOY_REF='${{ github.sha }}' -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.IMAGE_MAIN_TAG }}" + ssh ${{ secrets.SSH_USER }}@${{ steps.setup-ssh.outputs.ssh-host }} "docker run -d --name ${{ env.CONTAINER_NAME }} --restart unless-stopped -p ${{ env.ENV_PORT }}:${{ env.DEFAULT_PORT }} -e ENVIRONMENT='production' -e SENTRY_ENV='production' -e SENTRY_DSN='${{ secrets.SENTRY_DSN || '' }}' -e SENTRY_TRACE_RATE=${{ vars.SENTRY_TRACE_RATE || 0 }} -e SENTRY_PROFILE_RATE=${{ vars.SENTRY_PROFILE_RATE || 0 }} -e DEPLOY_REF='${{ github.sha }}' -e CLOUDFLARE_TOKEN='${{ secrets.CLOUDFLARE_TOKEN }}' -e CACHE_BASIC_AUTH='${{ secrets.CACHE_BASIC_AUTH }}' ${{ env.IMAGE_MAIN_TAG }}" From 73301555e7f19433dd63bb4d5b908977c4683de3 Mon Sep 17 00:00:00 2001 From: Thaddeus Bond Date: Wed, 17 Jul 2024 21:31:37 -0400 Subject: [PATCH 31/38] Ignore resolve spans --- http/instrument.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/instrument.mjs b/http/instrument.mjs index e78ec28a..8c9b4599 100644 --- a/http/instrument.mjs +++ b/http/instrument.mjs @@ -14,7 +14,7 @@ Sentry.init({ } }), Sentry.graphqlIntegration({ - ignoreResolveSpans: false + ignoreResolveSpans: true }) ], // Performance Monitoring From 1f5b56c6e82dee63a0ec910c81835490b55c9124 Mon Sep 17 00:00:00 2001 From: Thaddeus Bond Date: Fri, 19 Jul 2024 06:18:34 -0400 Subject: [PATCH 32/38] Use cluster for serving --- http/index.mjs | 50 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 17 deletions(-) diff --git a/http/index.mjs b/http/index.mjs index ed72ed55..7aae5372 100644 --- a/http/index.mjs +++ b/http/index.mjs @@ -1,3 +1,5 @@ +import cluster from 'node:cluster'; +import os from 'node:os'; import * as Sentry from "@sentry/node"; import "./instrument.mjs"; import express from 'express'; @@ -25,25 +27,39 @@ const convertIncomingMessageToRequest = (req) => { return request }; -const app = express(); -app.use(express.json({ limit: '100mb' }), express.text()); -app.all('*', async (req, res, next) => { - Sentry.setUser({ ip_address: req.ip }); - const response = await worker.fetch(convertIncomingMessageToRequest(req), getEnv(), { waitUntil: () => { } }); +if (cluster.isPrimary) { + // Create workers (process forks) equal to the available CPUs. + console.log(`Primary ${process.pid} is running`); + cluster.on('exit', (worker, code, signal) => { + console.log(`Worker ${worker.process.pid} crashed. Starting a new worker...`); + cluster.fork(); + }); + for (let i = 0; i < os.cpus().length; i++) { + cluster.fork(); + } +} else { + // We are a worker (fork) - start a server + const app = express(); + app.use(express.json({ limit: '100mb' }), express.text()); + app.all('*', async (req, res, next) => { + Sentry.setUser({ ip_address: req.ip }); + const response = await worker.fetch(convertIncomingMessageToRequest(req), getEnv(), { waitUntil: () => { } }); + + // Convert Response object to JSON + const responseBody = await response.text(); - // Convert Response object to JSON - const responseBody = await response.text(); + // Reflect headers from Response object + response.headers.forEach((value, key) => { + res.setHeader(key, value); + }); + + // Send the status and JSON body + res.status(response.status).send(responseBody); + }); - // Reflect headers from Response object - //Object.entries(response.headers.raw()).forEach(([key, value]) => { - response.headers.forEach((value, key) => { - res.setHeader(key, value); + app.listen(port, () => { + console.log(`HTTP GraphQL server (PID: ${process.pid}) running at http://127.0.0.1:${port}`); }); +} - // Send the status and JSON body - res.status(response.status).send(responseBody); -}); -app.listen(port, () => { - console.log(`HTTP GraphQL server running at http://127.0.0.1:${port}`); -}); From 39cdf8900682e5fba6f33067eceb603a01e5866d Mon Sep 17 00:00:00 2001 From: Thaddeus Bond Date: Sat, 10 Aug 2024 10:42:13 -0400 Subject: [PATCH 33/38] Add cluster worker message instrumentation --- http/index.mjs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/http/index.mjs b/http/index.mjs index 20434917..d3badc8b 100644 --- a/http/index.mjs +++ b/http/index.mjs @@ -9,6 +9,7 @@ import 'dotenv/config'; import getYoga from '../graphql-yoga.mjs'; import getEnv from './env-binding.mjs'; +import * as Sentry from "@sentry/node"; const port = process.env.PORT ?? 8788; const workerCount = parseInt(process.env.WORKERS ?? String(os.cpus().length - 1)); @@ -73,6 +74,9 @@ if (cluster.isPrimary && workerCount > 0) { for (const id in cluster.workers) { cluster.workers[id].on('message', async (message) => { + // Add worker message span + const rcvWorkerMsgSpan = Sentry.startInactiveSpan({ name: "Receive worker message" }); + //console.log(`message from worker ${id}:`, message); if (message.action === 'getKv') { const response = { @@ -93,6 +97,9 @@ if (cluster.isPrimary && workerCount > 0) { } cluster.workers[id].send(response); } + + // End the span + rcvWorkerMsgSpan.end(); }); } From a12afbaa1977116726d5d827482d5f73e9aa5dc7 Mon Sep 17 00:00:00 2001 From: Thaddeus Bond Date: Sat, 10 Aug 2024 16:51:30 -0400 Subject: [PATCH 34/38] Fix Sentry and add trace propagation --- http/index.mjs | 2 -- utils/cache-machine.mjs | 8 +++++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/http/index.mjs b/http/index.mjs index d3badc8b..40d877d0 100644 --- a/http/index.mjs +++ b/http/index.mjs @@ -2,14 +2,12 @@ import cluster from 'node:cluster'; import os from 'node:os'; import * as Sentry from "@sentry/node"; import "./instrument.mjs"; -import express from 'express'; import { createServer } from 'node:http'; import 'dotenv/config'; import getYoga from '../graphql-yoga.mjs'; import getEnv from './env-binding.mjs'; -import * as Sentry from "@sentry/node"; const port = process.env.PORT ?? 8788; const workerCount = parseInt(process.env.WORKERS ?? String(os.cpus().length - 1)); diff --git a/utils/cache-machine.mjs b/utils/cache-machine.mjs index 222f8cdb..a8bb71fc 100644 --- a/utils/cache-machine.mjs +++ b/utils/cache-machine.mjs @@ -63,7 +63,9 @@ async function updateCache(env, query, variables, body, ttl = '', specialCache = method: 'POST', headers: { 'content-type': 'application/json;charset=UTF-8', - 'Authorization': `Basic ${env.CACHE_BASIC_AUTH}` + 'Authorization': `Basic ${env.CACHE_BASIC_AUTH}`, + 'sentry-trace': Sentry.getCurrentHub().getScope().getSpan().toTraceparent(), + 'baggage': Sentry.getCurrentHub().getScope().getSpan().toBaggageHeader() }, timeout: 10000, }; @@ -109,11 +111,11 @@ async function checkCache(env, query, variables, specialCache = '') { return false; } - const response = await fetchWithTimeout(`${cacheUrl}/api/cache?key=${cacheKey}`, { + const response = await fetchWithTimeout(`${cacheUrl}/api/cache?key=${cacheKey}`, { headers: { 'content-type': 'application/json;charset=UTF-8', 'Authorization': `Basic ${env.CACHE_BASIC_AUTH}` - }, + }, }); cacheFailCount = 0; if (response.status === 200) { From 260a1d15170cdcc8bbdf3a1e27b17803d4c94403 Mon Sep 17 00:00:00 2001 From: Thaddeus Bond Date: Sat, 10 Aug 2024 17:04:14 -0400 Subject: [PATCH 35/38] Import Sentry to cache machine module --- package-lock.json | 760 +++++++++++++++++++++++++++++++++++++++- package.json | 2 + utils/cache-machine.mjs | 2 + 3 files changed, 749 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index c7a001b1..47a10b95 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,8 @@ "dependencies": { "@graphql-tools/merge": "9.0.4", "@graphql-tools/schema": "10.0.4", + "@sentry/node": "^8.25.0", + "@sentry/profiling-node": "^8.25.0", "graphql-yoga": "^5.6.3", "uuid": "^10.0.0" }, @@ -697,6 +699,387 @@ "resolved": "https://registry.npmjs.org/@kamilkisiela/fast-url-parser/-/fast-url-parser-1.1.4.tgz", "integrity": "sha512-gbkePEBupNydxCelHCESvFSFM8XPh1Zs/OAVRW/rKpEqPAl5PbOM90Si8mv9bvnR53uPD2s/FiRxdvSejpRJew==" }, + "node_modules/@opentelemetry/api": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz", + "integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@opentelemetry/api-logs": { + "version": "0.52.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.52.1.tgz", + "integrity": "sha512-qnSqB2DQ9TPP96dl8cDubDvrUyWc0/sK81xHTK8eSUspzDM3bsewX903qclQFvVhgStjRWdC5bLb3kQqMkfV5A==", + "dependencies": { + "@opentelemetry/api": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/context-async-hooks": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/context-async-hooks/-/context-async-hooks-1.25.1.tgz", + "integrity": "sha512-UW/ge9zjvAEmRWVapOP0qyCvPulWU6cQxGxDbWEFfGOj1VBBZAuOqTo3X6yWmDTD3Xe15ysCZChHncr2xFMIfQ==", + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/core": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.25.1.tgz", + "integrity": "sha512-GeT/l6rBYWVQ4XArluLVB6WWQ8flHbdb6r2FCHC3smtdOAbrJBIv35tpV/yp9bmYUJf+xmZpu9DRTIeJVhFbEQ==", + "dependencies": { + "@opentelemetry/semantic-conventions": "1.25.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/instrumentation": { + "version": "0.52.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.52.1.tgz", + "integrity": "sha512-uXJbYU/5/MBHjMp1FqrILLRuiJCs3Ofk0MeRDk8g1S1gD47U8X3JnSwcMO1rtRo1x1a7zKaQHaoYu49p/4eSKw==", + "dependencies": { + "@opentelemetry/api-logs": "0.52.1", + "@types/shimmer": "^1.0.2", + "import-in-the-middle": "^1.8.1", + "require-in-the-middle": "^7.1.1", + "semver": "^7.5.2", + "shimmer": "^1.2.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-connect": { + "version": "0.38.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-connect/-/instrumentation-connect-0.38.0.tgz", + "integrity": "sha512-2/nRnx3pjYEmdPIaBwtgtSviTKHWnDZN3R+TkRUnhIVrvBKVcq+I5B2rtd6mr6Fe9cHlZ9Ojcuh7pkNh/xdWWg==", + "dependencies": { + "@opentelemetry/core": "^1.8.0", + "@opentelemetry/instrumentation": "^0.52.0", + "@opentelemetry/semantic-conventions": "^1.22.0", + "@types/connect": "3.4.36" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-express": { + "version": "0.41.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-express/-/instrumentation-express-0.41.1.tgz", + "integrity": "sha512-uRx0V3LPGzjn2bxAnV8eUsDT82vT7NTwI0ezEuPMBOTOsnPpGhWdhcdNdhH80sM4TrWrOfXm9HGEdfWE3TRIww==", + "dependencies": { + "@opentelemetry/core": "^1.8.0", + "@opentelemetry/instrumentation": "^0.52.0", + "@opentelemetry/semantic-conventions": "^1.22.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-fastify": { + "version": "0.38.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-fastify/-/instrumentation-fastify-0.38.0.tgz", + "integrity": "sha512-HBVLpTSYpkQZ87/Df3N0gAw7VzYZV3n28THIBrJWfuqw3Or7UqdhnjeuMIPQ04BKk3aZc0cWn2naSQObbh5vXw==", + "dependencies": { + "@opentelemetry/core": "^1.8.0", + "@opentelemetry/instrumentation": "^0.52.0", + "@opentelemetry/semantic-conventions": "^1.22.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-graphql": { + "version": "0.42.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-graphql/-/instrumentation-graphql-0.42.0.tgz", + "integrity": "sha512-N8SOwoKL9KQSX7z3gOaw5UaTeVQcfDO1c21csVHnmnmGUoqsXbArK2B8VuwPWcv6/BC/i3io+xTo7QGRZ/z28Q==", + "dependencies": { + "@opentelemetry/instrumentation": "^0.52.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-hapi": { + "version": "0.40.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-hapi/-/instrumentation-hapi-0.40.0.tgz", + "integrity": "sha512-8U/w7Ifumtd2bSN1OLaSwAAFhb9FyqWUki3lMMB0ds+1+HdSxYBe9aspEJEgvxAqOkrQnVniAPTEGf1pGM7SOw==", + "dependencies": { + "@opentelemetry/core": "^1.8.0", + "@opentelemetry/instrumentation": "^0.52.0", + "@opentelemetry/semantic-conventions": "^1.22.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-http": { + "version": "0.52.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-http/-/instrumentation-http-0.52.1.tgz", + "integrity": "sha512-dG/aevWhaP+7OLv4BQQSEKMJv8GyeOp3Wxl31NHqE8xo9/fYMfEljiZphUHIfyg4gnZ9swMyWjfOQs5GUQe54Q==", + "dependencies": { + "@opentelemetry/core": "1.25.1", + "@opentelemetry/instrumentation": "0.52.1", + "@opentelemetry/semantic-conventions": "1.25.1", + "semver": "^7.5.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-ioredis": { + "version": "0.42.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-ioredis/-/instrumentation-ioredis-0.42.0.tgz", + "integrity": "sha512-P11H168EKvBB9TUSasNDOGJCSkpT44XgoM6d3gRIWAa9ghLpYhl0uRkS8//MqPzcJVHr3h3RmfXIpiYLjyIZTw==", + "dependencies": { + "@opentelemetry/instrumentation": "^0.52.0", + "@opentelemetry/redis-common": "^0.36.2", + "@opentelemetry/semantic-conventions": "^1.23.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-koa": { + "version": "0.42.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-koa/-/instrumentation-koa-0.42.0.tgz", + "integrity": "sha512-H1BEmnMhho8o8HuNRq5zEI4+SIHDIglNB7BPKohZyWG4fWNuR7yM4GTlR01Syq21vODAS7z5omblScJD/eZdKw==", + "dependencies": { + "@opentelemetry/core": "^1.8.0", + "@opentelemetry/instrumentation": "^0.52.0", + "@opentelemetry/semantic-conventions": "^1.22.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-mongodb": { + "version": "0.46.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mongodb/-/instrumentation-mongodb-0.46.0.tgz", + "integrity": "sha512-VF/MicZ5UOBiXrqBslzwxhN7TVqzu1/LN/QDpkskqM0Zm0aZ4CVRbUygL8d7lrjLn15x5kGIe8VsSphMfPJzlA==", + "dependencies": { + "@opentelemetry/instrumentation": "^0.52.0", + "@opentelemetry/sdk-metrics": "^1.9.1", + "@opentelemetry/semantic-conventions": "^1.22.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-mongoose": { + "version": "0.40.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mongoose/-/instrumentation-mongoose-0.40.0.tgz", + "integrity": "sha512-niRi5ZUnkgzRhIGMOozTyoZIvJKNJyhijQI4nF4iFSb+FUx2v5fngfR+8XLmdQAO7xmsD8E5vEGdDVYVtKbZew==", + "dependencies": { + "@opentelemetry/core": "^1.8.0", + "@opentelemetry/instrumentation": "^0.52.0", + "@opentelemetry/semantic-conventions": "^1.22.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-mysql": { + "version": "0.40.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mysql/-/instrumentation-mysql-0.40.0.tgz", + "integrity": "sha512-d7ja8yizsOCNMYIJt5PH/fKZXjb/mS48zLROO4BzZTtDfhNCl2UM/9VIomP2qkGIFVouSJrGr/T00EzY7bPtKA==", + "dependencies": { + "@opentelemetry/instrumentation": "^0.52.0", + "@opentelemetry/semantic-conventions": "^1.22.0", + "@types/mysql": "2.15.22" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-mysql2": { + "version": "0.40.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mysql2/-/instrumentation-mysql2-0.40.0.tgz", + "integrity": "sha512-0xfS1xcqUmY7WE1uWjlmI67Xg3QsSUlNT+AcXHeA4BDUPwZtWqF4ezIwLgpVZfHOnkAEheqGfNSWd1PIu3Wnfg==", + "dependencies": { + "@opentelemetry/instrumentation": "^0.52.0", + "@opentelemetry/semantic-conventions": "^1.22.0", + "@opentelemetry/sql-common": "^0.40.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-nestjs-core": { + "version": "0.39.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-nestjs-core/-/instrumentation-nestjs-core-0.39.0.tgz", + "integrity": "sha512-mewVhEXdikyvIZoMIUry8eb8l3HUjuQjSjVbmLVTt4NQi35tkpnHQrG9bTRBrl3403LoWZ2njMPJyg4l6HfKvA==", + "dependencies": { + "@opentelemetry/instrumentation": "^0.52.0", + "@opentelemetry/semantic-conventions": "^1.23.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-pg": { + "version": "0.43.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-pg/-/instrumentation-pg-0.43.0.tgz", + "integrity": "sha512-og23KLyoxdnAeFs1UWqzSonuCkePUzCX30keSYigIzJe/6WSYA8rnEI5lobcxPEzg+GcU06J7jzokuEHbjVJNw==", + "dependencies": { + "@opentelemetry/instrumentation": "^0.52.0", + "@opentelemetry/semantic-conventions": "^1.22.0", + "@opentelemetry/sql-common": "^0.40.1", + "@types/pg": "8.6.1", + "@types/pg-pool": "2.0.4" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-redis-4": { + "version": "0.41.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-redis-4/-/instrumentation-redis-4-0.41.0.tgz", + "integrity": "sha512-H7IfGTqW2reLXqput4yzAe8YpDC0fmVNal95GHMLOrS89W+qWUKIqxolSh63hJyfmwPSFwXASzj7wpSk8Az+Dg==", + "dependencies": { + "@opentelemetry/instrumentation": "^0.52.0", + "@opentelemetry/redis-common": "^0.36.2", + "@opentelemetry/semantic-conventions": "^1.22.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/redis-common": { + "version": "0.36.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/redis-common/-/redis-common-0.36.2.tgz", + "integrity": "sha512-faYX1N0gpLhej/6nyp6bgRjzAKXn5GOEMYY7YhciSfCoITAktLUtQ36d24QEWNA1/WA1y6qQunCe0OhHRkVl9g==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/resources": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.25.1.tgz", + "integrity": "sha512-pkZT+iFYIZsVn6+GzM0kSX+u3MSLCY9md+lIJOoKl/P+gJFfxJte/60Usdp8Ce4rOs8GduUpSPNe1ddGyDT1sQ==", + "dependencies": { + "@opentelemetry/core": "1.25.1", + "@opentelemetry/semantic-conventions": "1.25.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/sdk-metrics": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.25.1.tgz", + "integrity": "sha512-9Mb7q5ioFL4E4dDrc4wC/A3NTHDat44v4I3p2pLPSxRvqUbDIQyMVr9uK+EU69+HWhlET1VaSrRzwdckWqY15Q==", + "dependencies": { + "@opentelemetry/core": "1.25.1", + "@opentelemetry/resources": "1.25.1", + "lodash.merge": "^4.6.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.3.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/sdk-trace-base": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.25.1.tgz", + "integrity": "sha512-C8k4hnEbc5FamuZQ92nTOp8X/diCY56XUTnMiv9UTuJitCzaNNHAVsdm5+HLCdI8SLQsLWIrG38tddMxLVoftw==", + "dependencies": { + "@opentelemetry/core": "1.25.1", + "@opentelemetry/resources": "1.25.1", + "@opentelemetry/semantic-conventions": "1.25.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/semantic-conventions": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.25.1.tgz", + "integrity": "sha512-ZDjMJJQRlyk8A1KZFCc+bCbsyrn1wTwdNt56F7twdfUfnHUZUq77/WfONCj8p72NZOyP7pNTdUWSTYC3GTbuuQ==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/sql-common": { + "version": "0.40.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sql-common/-/sql-common-0.40.1.tgz", + "integrity": "sha512-nSDlnHSqzC3pXn/wZEZVLuAuJ1MYMXPBwtv2qAbCa3847SaHItdE7SzUq/Jtb0KZmh1zfAbNi3AAMjztTT4Ugg==", + "dependencies": { + "@opentelemetry/core": "^1.1.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.1.0" + } + }, "node_modules/@postman/form-data": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/@postman/form-data/-/form-data-3.1.1.tgz", @@ -738,16 +1121,153 @@ "node": "*" } }, + "node_modules/@prisma/instrumentation": { + "version": "5.17.0", + "resolved": "https://registry.npmjs.org/@prisma/instrumentation/-/instrumentation-5.17.0.tgz", + "integrity": "sha512-c1Sle4ji8aasMcYfBBHFM56We4ljfenVtRmS8aY06BllS7SoU6SmJBwG7vil+GHiR0Yrh+t9iBwt4AY0Jr4KNQ==", + "dependencies": { + "@opentelemetry/api": "^1.8", + "@opentelemetry/instrumentation": "^0.49 || ^0.50 || ^0.51 || ^0.52.0", + "@opentelemetry/sdk-trace-base": "^1.22" + } + }, "node_modules/@repeaterjs/repeater": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/@repeaterjs/repeater/-/repeater-3.0.6.tgz", "integrity": "sha512-Javneu5lsuhwNCryN+pXH93VPQ8g0dBX7wItHFgYiwQmzE1sVdg5tWHiOgHywzL2W21XQopa7IwIEnNbmeUJYA==" }, + "node_modules/@sentry/core": { + "version": "8.25.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-8.25.0.tgz", + "integrity": "sha512-7KtglbrW1eX4DOHkf6i4rRIExEf2CgtQ99qZ8gn5FUaAmNMg0rK7bb1yZMx0RZtp5G1TSz/S0jQQgxHWebaEig==", + "dependencies": { + "@sentry/types": "8.25.0", + "@sentry/utils": "8.25.0" + }, + "engines": { + "node": ">=14.18" + } + }, + "node_modules/@sentry/node": { + "version": "8.25.0", + "resolved": "https://registry.npmjs.org/@sentry/node/-/node-8.25.0.tgz", + "integrity": "sha512-KFeJpYU/7CKi/v8D72ztniA+QqH0yBv2wzEP0PUe3DWZ/Fwl0OQSVWNNuDfJBQUvk3NrytCH5A6klZjU0/rwlw==", + "dependencies": { + "@opentelemetry/api": "^1.9.0", + "@opentelemetry/context-async-hooks": "^1.25.1", + "@opentelemetry/core": "^1.25.1", + "@opentelemetry/instrumentation": "^0.52.1", + "@opentelemetry/instrumentation-connect": "0.38.0", + "@opentelemetry/instrumentation-express": "0.41.1", + "@opentelemetry/instrumentation-fastify": "0.38.0", + "@opentelemetry/instrumentation-graphql": "0.42.0", + "@opentelemetry/instrumentation-hapi": "0.40.0", + "@opentelemetry/instrumentation-http": "0.52.1", + "@opentelemetry/instrumentation-ioredis": "0.42.0", + "@opentelemetry/instrumentation-koa": "0.42.0", + "@opentelemetry/instrumentation-mongodb": "0.46.0", + "@opentelemetry/instrumentation-mongoose": "0.40.0", + "@opentelemetry/instrumentation-mysql": "0.40.0", + "@opentelemetry/instrumentation-mysql2": "0.40.0", + "@opentelemetry/instrumentation-nestjs-core": "0.39.0", + "@opentelemetry/instrumentation-pg": "0.43.0", + "@opentelemetry/instrumentation-redis-4": "0.41.0", + "@opentelemetry/resources": "^1.25.1", + "@opentelemetry/sdk-trace-base": "^1.25.1", + "@opentelemetry/semantic-conventions": "^1.25.1", + "@prisma/instrumentation": "5.17.0", + "@sentry/core": "8.25.0", + "@sentry/opentelemetry": "8.25.0", + "@sentry/types": "8.25.0", + "@sentry/utils": "8.25.0", + "import-in-the-middle": "^1.11.0" + }, + "engines": { + "node": ">=14.18" + }, + "optionalDependencies": { + "opentelemetry-instrumentation-fetch-node": "1.2.3" + } + }, + "node_modules/@sentry/opentelemetry": { + "version": "8.25.0", + "resolved": "https://registry.npmjs.org/@sentry/opentelemetry/-/opentelemetry-8.25.0.tgz", + "integrity": "sha512-6g4TXwQMHtvmlu2i1OKqvFD2W2RTrGBxDtJ1tBQmqCfHKyiqQ37gy6AozuwrQ3po1KKbawaQGIFNEzb4wnSrfA==", + "dependencies": { + "@sentry/core": "8.25.0", + "@sentry/types": "8.25.0", + "@sentry/utils": "8.25.0" + }, + "engines": { + "node": ">=14.18" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.9.0", + "@opentelemetry/core": "^1.25.1", + "@opentelemetry/instrumentation": "^0.52.1", + "@opentelemetry/sdk-trace-base": "^1.25.1", + "@opentelemetry/semantic-conventions": "^1.25.1" + } + }, + "node_modules/@sentry/profiling-node": { + "version": "8.25.0", + "resolved": "https://registry.npmjs.org/@sentry/profiling-node/-/profiling-node-8.25.0.tgz", + "integrity": "sha512-bFe5FYjk0ShxIp1ZVSSdBpDKWR17vTuDL06Fh9QbIy7Ni6Wudipxu3a5RlLrgQ1mf3w+tIZf1m8cNuplnXNC4g==", + "hasInstallScript": true, + "dependencies": { + "@sentry/core": "8.25.0", + "@sentry/node": "8.25.0", + "@sentry/types": "8.25.0", + "@sentry/utils": "8.25.0", + "detect-libc": "^2.0.2", + "node-abi": "^3.61.0" + }, + "bin": { + "sentry-prune-profiler-binaries": "scripts/prune-profiler-binaries.js" + }, + "engines": { + "node": ">=14.18" + } + }, + "node_modules/@sentry/types": { + "version": "8.25.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-8.25.0.tgz", + "integrity": "sha512-ojim0gDcRhGJPguYrtms4FsprX4xZz3LGNk9Z0hwTbSVEdlhQIInsQ7CYcdM3sjUs+qT7kfpxTRZGUeZNRRJcA==", + "engines": { + "node": ">=14.18" + } + }, + "node_modules/@sentry/utils": { + "version": "8.25.0", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-8.25.0.tgz", + "integrity": "sha512-mVlkV7S62ZZ2jM38/kOwWx2xoW8fUv2cjw2IwFKoAIPyLBh3mo1WJtvfdtN/rXGjQWZJBKW53EWaWnD00rkjyA==", + "dependencies": { + "@sentry/types": "8.25.0" + }, + "engines": { + "node": ">=14.18" + } + }, + "node_modules/@types/connect": { + "version": "3.4.36", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.36.tgz", + "integrity": "sha512-P63Zd/JUGq+PdrM1lv0Wv5SBYeA2+CORvbrXbngriYY0jzLUWfQMQQxOhjONEz/wlHOAxOdY7CY65rgQdTjq2w==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/mysql": { + "version": "2.15.22", + "resolved": "https://registry.npmjs.org/@types/mysql/-/mysql-2.15.22.tgz", + "integrity": "sha512-wK1pzsJVVAjYCSZWQoWHziQZbNggXFDUEIGf54g4ZM/ERuP86uGdWeKZWMYlqTPMZfHJJvLPyogXGvCOg87yLQ==", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/node": { "version": "22.1.0", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.1.0.tgz", "integrity": "sha512-AOmuRF0R2/5j1knA3c6G3HOk523Ga+l+ZXltX8SF1+5oqcXijjfTd8fY3XRZqSihEu9XhtQnKYLmkFaoxgsJHw==", - "dev": true, "dependencies": { "undici-types": "~6.13.0" } @@ -761,6 +1281,29 @@ "@types/node": "*" } }, + "node_modules/@types/pg": { + "version": "8.6.1", + "resolved": "https://registry.npmjs.org/@types/pg/-/pg-8.6.1.tgz", + "integrity": "sha512-1Kc4oAGzAl7uqUStZCDvaLFqZrW9qWSjXOmBfdgyBP5La7Us6Mg4GBvRlSoaZMhQF/zSj1C8CtKMBkoiT8eL8w==", + "dependencies": { + "@types/node": "*", + "pg-protocol": "*", + "pg-types": "^2.2.0" + } + }, + "node_modules/@types/pg-pool": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/pg-pool/-/pg-pool-2.0.4.tgz", + "integrity": "sha512-qZAvkv1K3QbmHHFYSNRYPkRjOWRLBYrL4B9c+wG0GSVGBw0NtJwPcgx/DSddeDJvRGMHCEQ4VMEVfuJ/0gZ3XQ==", + "dependencies": { + "@types/pg": "*" + } + }, + "node_modules/@types/shimmer": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@types/shimmer/-/shimmer-1.2.0.tgz", + "integrity": "sha512-UE7oxhQLLd9gub6JKIAhDq06T0F6FnztwMNRvYgjeQSBeMc1ZG/tA47EwfduvkuQS8apbkM/lpLpWsaCeYsXVg==" + }, "node_modules/@whatwg-node/events": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/@whatwg-node/events/-/events-0.1.2.tgz", @@ -814,7 +1357,6 @@ "version": "8.12.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", - "dev": true, "bin": { "acorn": "bin/acorn" }, @@ -822,6 +1364,23 @@ "node": ">=0.4.0" } }, + "node_modules/acorn-import-assertions": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz", + "integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==", + "optional": true, + "peerDependencies": { + "acorn": "^8" + } + }, + "node_modules/acorn-import-attributes": { + "version": "1.9.5", + "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", + "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", + "peerDependencies": { + "acorn": "^8" + } + }, "node_modules/acorn-walk": { "version": "8.3.3", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.3.tgz", @@ -1066,6 +1625,11 @@ "fsevents": "~2.3.2" } }, + "node_modules/cjs-module-lexer": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.3.1.tgz", + "integrity": "sha512-a3KdPAANPbNE4ZUv9h6LckSl9zLsYOP4MBmhIPkRaeyybt+r4UghLvq+xw/YwUcC1gqylCkL4rdVs3Lwupjm4Q==" + }, "node_modules/cli-progress": { "version": "3.12.0", "resolved": "https://registry.npmjs.org/cli-progress/-/cli-progress-3.12.0.tgz", @@ -1196,7 +1760,6 @@ "version": "4.3.6", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", - "dev": true, "dependencies": { "ms": "2.1.2" }, @@ -1234,6 +1797,14 @@ "minimalistic-assert": "^1.0.0" } }, + "node_modules/detect-libc": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", + "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", + "engines": { + "node": ">=8" + } + }, "node_modules/dset": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/dset/-/dset-3.1.3.tgz", @@ -1428,7 +1999,6 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -1551,7 +2121,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "dev": true, "dependencies": { "function-bind": "^1.1.2" }, @@ -1625,6 +2194,17 @@ "node": ">=0.10.0" } }, + "node_modules/import-in-the-middle": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.11.0.tgz", + "integrity": "sha512-5DimNQGoe0pLUHbR9qK84iWaWjjbsxiqXnw6Qz64+azRgleqv9k2kTt5fw7QsOpmaGYtuxxursnPPsnTKEx10Q==", + "dependencies": { + "acorn": "^8.8.2", + "acorn-import-attributes": "^1.9.5", + "cjs-module-lexer": "^1.2.2", + "module-details-from-path": "^1.0.3" + } + }, "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", @@ -1647,7 +2227,6 @@ "version": "2.15.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.0.tgz", "integrity": "sha512-Dd+Lb2/zvk9SKy1TGCt1wFJFo/MWBPMX5x7KcvLajWTGuomczdQX61PvY5yK6SVACwpoexWo81IfFyoKY2QnTA==", - "dev": true, "dependencies": { "hasown": "^2.0.2" }, @@ -1784,6 +2363,11 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" + }, "node_modules/lru-cache": { "version": "10.4.3", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", @@ -1896,11 +2480,15 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/module-details-from-path": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/module-details-from-path/-/module-details-from-path-1.0.3.tgz", + "integrity": "sha512-ySViT69/76t8VhE1xXHK6Ch4NcDd26gx0MzKXLO+F7NOtnqH68d9zF94nT8ZWSxXh8ELOERsnJO/sWt1xZYw5A==" + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/mustache": { "version": "4.2.0", @@ -1970,6 +2558,17 @@ "node": ">=16" } }, + "node_modules/node-abi": { + "version": "3.65.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.65.0.tgz", + "integrity": "sha512-ThjYBfoDNr08AWx6hGaRbfPwxKV9kVzAzOzlLKbk2CuqXE2xnCh+cbAGnwM3t8Lq4v9rUB7VfondlkBckcJrVA==", + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/node-fetch-native": { "version": "1.6.4", "resolved": "https://registry.npmjs.org/node-fetch-native/-/node-fetch-native-1.6.4.tgz", @@ -2018,6 +2617,53 @@ "node": ">= 0.10.0" } }, + "node_modules/opentelemetry-instrumentation-fetch-node": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/opentelemetry-instrumentation-fetch-node/-/opentelemetry-instrumentation-fetch-node-1.2.3.tgz", + "integrity": "sha512-Qb11T7KvoCevMaSeuamcLsAD+pZnavkhDnlVL0kRozfhl42dKG5Q3anUklAFKJZjY3twLR+BnRa6DlwwkIE/+A==", + "optional": true, + "dependencies": { + "@opentelemetry/instrumentation": "^0.46.0", + "@opentelemetry/semantic-conventions": "^1.17.0" + }, + "engines": { + "node": ">18.0.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.6.0" + } + }, + "node_modules/opentelemetry-instrumentation-fetch-node/node_modules/@opentelemetry/instrumentation": { + "version": "0.46.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.46.0.tgz", + "integrity": "sha512-a9TijXZZbk0vI5TGLZl+0kxyFfrXHhX6Svtz7Pp2/VBlCSKrazuULEyoJQrOknJyFWNMEmbbJgOciHCCpQcisw==", + "optional": true, + "dependencies": { + "@types/shimmer": "^1.0.2", + "import-in-the-middle": "1.7.1", + "require-in-the-middle": "^7.1.1", + "semver": "^7.5.2", + "shimmer": "^1.2.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/opentelemetry-instrumentation-fetch-node/node_modules/import-in-the-middle": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.7.1.tgz", + "integrity": "sha512-1LrZPDtW+atAxH42S6288qyDFNQ2YCty+2mxEPRtfazH6Z5QwkaBSTS2ods7hnVJioF6rkRfNoA6A/MstpFXLg==", + "optional": true, + "dependencies": { + "acorn": "^8.8.2", + "acorn-import-assertions": "^1.9.0", + "cjs-module-lexer": "^1.2.2", + "module-details-from-path": "^1.0.3" + } + }, "node_modules/parse-ms": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-2.1.0.tgz", @@ -2030,8 +2676,7 @@ "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, "node_modules/path-to-regexp": { "version": "6.2.2", @@ -2051,6 +2696,34 @@ "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", "dev": true }, + "node_modules/pg-int8": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz", + "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/pg-protocol": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.6.1.tgz", + "integrity": "sha512-jPIlvgoD63hrEuihvIg+tJhoGjUsLPn6poJY9N5CnlPd91c2T18T/9zBtLxZSb1EhYxBRoZJtzScCaWlYLtktg==" + }, + "node_modules/pg-types": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz", + "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==", + "dependencies": { + "pg-int8": "1.0.1", + "postgres-array": "~2.0.0", + "postgres-bytea": "~1.0.0", + "postgres-date": "~1.0.4", + "postgres-interval": "^1.1.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", @@ -2063,6 +2736,41 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/postgres-array": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", + "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==", + "engines": { + "node": ">=4" + } + }, + "node_modules/postgres-bytea": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz", + "integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/postgres-date": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz", + "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/postgres-interval": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz", + "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", + "dependencies": { + "xtend": "^4.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/postman-collection": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/postman-collection/-/postman-collection-4.4.0.tgz", @@ -2368,6 +3076,19 @@ "node": ">=8.10.0" } }, + "node_modules/require-in-the-middle": { + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/require-in-the-middle/-/require-in-the-middle-7.4.0.tgz", + "integrity": "sha512-X34iHADNbNDfr6OTStIAHWSAvvKQRYgLO6duASaVf7J2VA3lvmNYboAHOuLC2huav1IwgZJtyEcJCKVzFxOSMQ==", + "dependencies": { + "debug": "^4.3.5", + "module-details-from-path": "^1.0.3", + "resolve": "^1.22.8" + }, + "engines": { + "node": ">=8.6.0" + } + }, "node_modules/requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", @@ -2378,7 +3099,6 @@ "version": "1.22.8", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", - "dev": true, "dependencies": { "is-core-module": "^2.13.0", "path-parse": "^1.0.7", @@ -2473,7 +3193,6 @@ "version": "7.6.2", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", - "dev": true, "bin": { "semver": "bin/semver.js" }, @@ -2502,6 +3221,11 @@ "uuid": "bin/uuid" } }, + "node_modules/shimmer": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/shimmer/-/shimmer-1.2.1.tgz", + "integrity": "sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw==" + }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -2631,7 +3355,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -2708,8 +3431,7 @@ "node_modules/undici-types": { "version": "6.13.0", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.13.0.tgz", - "integrity": "sha512-xtFJHudx8S2DSoujjMd1WeWvn7KKWFRESZTMeL1RptAYERu29D6jphMjjY+vn96jvN3kVPDNxU/E13VTaXj6jg==", - "dev": true + "integrity": "sha512-xtFJHudx8S2DSoujjMd1WeWvn7KKWFRESZTMeL1RptAYERu29D6jphMjjY+vn96jvN3kVPDNxU/E13VTaXj6jg==" }, "node_modules/unenv": { "name": "unenv-nightly", @@ -2914,6 +3636,14 @@ "node": ">=8.0" } }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "engines": { + "node": ">=0.4" + } + }, "node_modules/xxhash-wasm": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/xxhash-wasm/-/xxhash-wasm-1.0.2.tgz", diff --git a/package.json b/package.json index 1ae698c0..7de2adab 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,8 @@ "dependencies": { "@graphql-tools/merge": "9.0.4", "@graphql-tools/schema": "10.0.4", + "@sentry/node": "^8.25.0", + "@sentry/profiling-node": "^8.25.0", "graphql-yoga": "^5.6.3", "uuid": "^10.0.0" } diff --git a/utils/cache-machine.mjs b/utils/cache-machine.mjs index a8bb71fc..c6a4afa7 100644 --- a/utils/cache-machine.mjs +++ b/utils/cache-machine.mjs @@ -1,3 +1,5 @@ +import * as Sentry from '@sentry/node'; + // cache url const cacheUrl = 'https://cache.tarkov.dev' From 5a6e07be113f034cfcb874451db665c45e352295 Mon Sep 17 00:00:00 2001 From: Thaddeus Bond Date: Sat, 10 Aug 2024 17:15:59 -0400 Subject: [PATCH 36/38] Use new API for trace propagation headers --- utils/cache-machine.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/cache-machine.mjs b/utils/cache-machine.mjs index c6a4afa7..b64fa343 100644 --- a/utils/cache-machine.mjs +++ b/utils/cache-machine.mjs @@ -66,8 +66,8 @@ async function updateCache(env, query, variables, body, ttl = '', specialCache = headers: { 'content-type': 'application/json;charset=UTF-8', 'Authorization': `Basic ${env.CACHE_BASIC_AUTH}`, - 'sentry-trace': Sentry.getCurrentHub().getScope().getSpan().toTraceparent(), - 'baggage': Sentry.getCurrentHub().getScope().getSpan().toBaggageHeader() + 'sentry-trace': Sentry.spanToTraceHeader(Sentry.getActiveSpan()), + 'baggage': Sentry.spanToBaggageHeader(Sentry.getActiveSpan()), }, timeout: 10000, }; From 4277ca2692386bb3b9c641f2f2096d7ae8f5d2f5 Mon Sep 17 00:00:00 2001 From: Thaddeus Bond Date: Sat, 10 Aug 2024 17:33:55 -0400 Subject: [PATCH 37/38] Remove broken trace propagation --- utils/cache-machine.mjs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/utils/cache-machine.mjs b/utils/cache-machine.mjs index b64fa343..91773e8b 100644 --- a/utils/cache-machine.mjs +++ b/utils/cache-machine.mjs @@ -66,8 +66,10 @@ async function updateCache(env, query, variables, body, ttl = '', specialCache = headers: { 'content-type': 'application/json;charset=UTF-8', 'Authorization': `Basic ${env.CACHE_BASIC_AUTH}`, - 'sentry-trace': Sentry.spanToTraceHeader(Sentry.getActiveSpan()), - 'baggage': Sentry.spanToBaggageHeader(Sentry.getActiveSpan()), + // Spans don't appear to be propagating properly through the graphql server from the http server :( + // This might be because they are two distinct node packages + //'sentry-trace': Sentry.spanToTraceHeader(Sentry.getActiveSpan()), + //'baggage': Sentry.spanToBaggageHeader(Sentry.getActiveSpan()), }, timeout: 10000, }; From 0fe73a880af46b0b04b79e5adde60ed1c9411b85 Mon Sep 17 00:00:00 2001 From: Thaddeus Bond Date: Sun, 11 Aug 2024 09:32:55 -0400 Subject: [PATCH 38/38] Revert "Don't use waitUntil" --- http/index.mjs | 6 +++--- plugins/plugin-nightbot.mjs | 5 ++--- plugins/plugin-use-cache-machine.mjs | 5 +---- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/http/index.mjs b/http/index.mjs index 16dc40e9..40d877d0 100644 --- a/http/index.mjs +++ b/http/index.mjs @@ -51,8 +51,8 @@ if (cluster.isPrimary && workerCount > 0) { delete kvLoading[kvName]; console.error('Error getting KV from cloudflare', error); if (error.message !== 'Invalid CLOUDFLARE_TOKEN') { - let refreshTime = msOneMinute; - if (typeof kvStore[kvName] === 'undefined') { + refreshTime = msOneMinute; + if (!kvStore[kvName]) { refreshTime = 1000; } kvRefreshTimeout[kvName] = setTimeout(() => { @@ -83,7 +83,7 @@ if (cluster.isPrimary && workerCount > 0) { id: message.id, }; try { - if (typeof kvStore[message.kvName] !== 'undefined') { + if (kvStore[message.kvName]) { response.data = JSON.stringify(kvStore[message.kvName]); } else if (kvLoading[message.kvName]) { response.data = JSON.stringify(await kvLoading[message.kvName]); diff --git a/plugins/plugin-nightbot.mjs b/plugins/plugin-nightbot.mjs index be468001..9fc7b333 100644 --- a/plugins/plugin-nightbot.mjs +++ b/plugins/plugin-nightbot.mjs @@ -13,7 +13,6 @@ const usePaths = [ ]; export async function getNightbotResponse(request, url, env, serverContext) { - console.log('serverContext', Object.keys(serverContext)); if (request.method.toUpperCase() !== 'GET') { return new Response(null, { status: 405, @@ -76,9 +75,9 @@ export async function getNightbotResponse(request, url, env, serverContext) { // using waitUntil doens't hold up returning a response but keeps the worker alive as long as needed if (request.ctx?.waitUntil) { request.ctx.waitUntil(putCachePromise); - } /*else if (serverContext.waitUntil) { + } else if (serverContext.waitUntil) { serverContext.waitUntil(putCachePromise); - }*/ + } } return new Response(responseBody) } diff --git a/plugins/plugin-use-cache-machine.mjs b/plugins/plugin-use-cache-machine.mjs index 4cac5cb6..3f842113 100644 --- a/plugins/plugin-use-cache-machine.mjs +++ b/plugins/plugin-use-cache-machine.mjs @@ -77,10 +77,7 @@ export default function useCacheMachine(env) { // using waitUntil doesn't hold up returning a response but keeps the worker alive as long as needed const cacheBody = JSON.stringify(result); if (cacheBody.length > 0) { - const cachePut = cacheMachine.put(env, request.params.query, request.params.variables, cacheBody, String(ttl), sCache); - if (typeof process === 'undefined') { - request.ctx.waitUntil(cachePut); - } + request.ctx.waitUntil(cacheMachine.put(env, request.params.query, request.params.variables, cacheBody, String(ttl), sCache)); } else { console.warn('Skipping cache for zero-length response'); console.log(`Request method: ${request.method}`);