From 96e534c7ed640f03fc3d4688628980152348e708 Mon Sep 17 00:00:00 2001 From: prosoponator <156670514+prosoponator@users.noreply.github.com> Date: Wed, 16 Oct 2024 14:25:25 +0100 Subject: [PATCH] Release 2.1.5 (#1457) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - **Bot detection encryption (#1431)** - **Change health checks to run less frequently and on existing API endpo… (#1442)** - **Open observe / vector (#1434)** - **Captcha package lock** - **bump pkg lock** - **pkg lock bump** - **Pkg Lock bump** - **Working updated build** - **Fixing polkadot versions to stop 14.0.1 extensions bleeding** - **Forcing global override for @polkadot/api** - **Reverting pkg lock** - **tsnocheck plugin dedupe** - **drop prosoponator as workflow (#1449)** - **check branch is up to date before doing a release (#1447)** - **workflow to bring staging up to date with main post push to main (#1446)** - **checkout submodules in gha (#1448)** - **replace rimraf with del-cli (#1445)** - **remove nvmrc in favor of node engine (#1444)** - **Add button for restarting the captcha process (#1423)** - **Captcha challenge failed alert** - **Correct path for vector as from root of captcha** - **fix caddy logs (#1452)** - **remove provider config toml path (#1453)** - **fix gh release typo (#1454)** - **Allow continue if can't resolve release** - **remove label enable watchtower args (#1456)** - **Changing default captcha type to frictionless for explicit render** - **Changing default captcha type to frictionless** - **Tidy of dirty bundle** - **fix logging (#1455)** - **Log errors returned from provider and return false for verified (#1441)** - **fix bump version** - **git pull in bump version** - **move check** - **fetch before check** - **use fetch depth** - **adjust src branch check** - **Bump version to 2.1.5** --------- Co-authored-by: Hugh <90424587+HughParry@users.noreply.github.com> Co-authored-by: Chris Co-authored-by: George Oastler Co-authored-by: Hugh Co-authored-by: George Oastler --- .github/workflows/bump_version.yml | 14 +- .github/workflows/cache.yml | 4 +- .github/workflows/cypress.yml | 4 +- .github/workflows/lint.yml | 4 +- .github/workflows/ls_cache.yml | 2 + .github/workflows/provider_image.yml | 4 +- .github/workflows/release.yml | 7 +- .github/workflows/tests.yml | 4 +- ...rosoponator_bot.yml => update_staging.yml} | 45 +- .nvmrc | 1 - biome.json | 6 +- demos/client-bundle-example/package.json | 6 +- demos/client-bundle-example/src/index.html | 2 +- demos/client-example-server/package.json | 18 +- demos/client-example/package.json | 24 +- demos/client-example/src/App.tsx | 1 + .../cypress/e2e/correct.captcha.signup.cy.ts | 2 +- demos/cypress-shared/package.json | 14 +- demos/provider-mock/package.json | 10 +- dev/config/package.json | 10 +- dev/config/src/vite/TsNoCheckPlugin.ts | 27 + dev/config/src/vite/index.ts | 1 + dev/config/src/webpack/webpack.config.ts | 2 +- dev/flux/package.json | 12 +- dev/gh-actions/package.json | 4 +- dev/lint/package.json | 7 +- dev/lint/src/nvmrc.ts | 57 - dev/prosoponator-bot/package.json | 4 +- dev/scripts/env.development | 2 +- dev/scripts/env.production | 2 +- dev/scripts/env.staging | 2 +- dev/scripts/env.test | 2 +- dev/scripts/package.json | 28 +- dev/scripts/src/setup/dapp.ts | 2 +- dev/ts-brand/package.json | 6 +- dev/vite-plugin-watch-workspace/package.json | 6 +- docker/docker-compose.provider.yml | 55 +- docker/images/provider/package.json | 2 +- docker/images/vector/Dockerfile | 47 + docker/images/vector/vector.toml | 189 + docker/provider.Caddyfile | 4 - package-lock.json | 1098 ++-- package.json | 15 +- packages/account/package.json | 14 +- .../account/src/extension/ExtensionWeb2.ts | 4 +- packages/account/tsconfig.cjs.json | 2 +- packages/account/tsconfig.json | 2 +- packages/api/package.json | 8 +- packages/api/src/api/ProviderApi.ts | 24 +- packages/cli/package.json | 24 +- packages/cli/src/RateLimiter.ts | 8 + packages/cli/src/commands/siteKeyRegister.ts | 2 +- packages/common/package.json | 8 +- packages/contract/package.json | 14 +- packages/database/package.json | 12 +- packages/database/src/databases/provider.ts | 42 + packages/datasets-fs/package.json | 12 +- packages/datasets/package.json | 12 +- packages/detector/package.json | 4 +- packages/detector/src/index.d.ts | 72 +- packages/detector/src/index.js | 5822 +---------------- packages/dotenv/package.json | 8 +- packages/env/package.json | 18 +- packages/file-server/package.json | 8 +- packages/fingerprint/package.json | 48 + packages/fingerprint/src/index.ts | 21 + packages/fingerprint/tsconfig.cjs.json | 14 + packages/fingerprint/tsconfig.json | 9 + packages/fingerprint/vite.cjs.config.ts | 19 + packages/load-balancer/package.json | 10 +- packages/locale-browser/package.json | 8 +- packages/locale/package.json | 6 +- packages/locale/src/locales/de.json | 1 + packages/locale/src/locales/en.json | 1 + packages/locale/src/locales/es.json | 1 + packages/locale/src/locales/fr.json | 1 + packages/locale/src/locales/it.json | 1 + packages/locale/src/locales/pt-BR.json | 1 + packages/locale/src/locales/pt.json | 1 + packages/procaptcha-bundle/package.json | 20 +- .../src/util/defaultCallbacks.ts | 3 +- .../src/util/renderLogic.tsx | 12 +- packages/procaptcha-bundle/webpack.config.cjs | 18 +- packages/procaptcha-common/package.json | 14 +- packages/procaptcha-common/src/events.ts | 7 +- packages/procaptcha-frictionless/package.json | 18 +- .../src/ProcaptchaFrictionless.tsx | 76 +- packages/procaptcha-pow/package.json | 24 +- .../src/components/ProcaptchaPoW.tsx | 6 +- .../src/components/ProcaptchaWidget.tsx | 24 +- .../procaptcha-pow/src/services/Manager.ts | 17 +- packages/procaptcha-react/package.json | 20 +- .../src/components/CaptchaComponent.tsx | 70 +- .../src/components/ProcaptchaWidget.tsx | 1 + packages/procaptcha/package.json | 22 +- packages/procaptcha/src/modules/Manager.ts | 14 +- packages/provider/package.json | 26 +- packages/provider/src/api/admin.ts | 7 +- packages/provider/src/api/captcha.ts | 94 +- packages/provider/src/api/errorHandler.ts | 20 +- .../provider/src/tasks/client/clientTasks.ts | 9 +- .../src/tasks/detection/decodePayload.js | 15 + .../src/tasks/detection/getBotScore.ts | 31 + .../provider/src/tasks/powCaptcha/powTasks.ts | 5 +- .../powCaptcha.integration.test.ts | 2 + .../src/tests/integration/registerSitekey.ts | 6 + packages/provider/tsconfig.json | 3 +- packages/server/package.json | 14 +- packages/server/src/server.ts | 71 +- packages/tx/package.json | 10 +- packages/types-database/package.json | 10 +- packages/types-database/src/types/client.ts | 4 +- packages/types-database/src/types/provider.ts | 14 + packages/types-env/package.json | 12 +- packages/types/package.json | 10 +- packages/types/src/api/api.ts | 7 +- packages/types/src/api/params.ts | 3 + packages/types/src/client/user.ts | 6 +- .../src/procaptcha-frictionless/props.ts | 13 +- packages/types/src/procaptcha/manager.ts | 1 + packages/types/src/procaptcha/props.ts | 7 + packages/types/src/provider/api.ts | 25 + packages/util/package.json | 6 +- packages/web-components/package.json | 6 +- packages/web-components/src/Reload.tsx | 87 + packages/web-components/src/index.ts | 1 + 126 files changed, 1983 insertions(+), 6926 deletions(-) rename .github/workflows/{prosoponator_bot.yml => update_staging.yml} (71%) delete mode 100644 .nvmrc create mode 100644 dev/config/src/vite/TsNoCheckPlugin.ts delete mode 100644 dev/lint/src/nvmrc.ts create mode 100644 docker/images/vector/Dockerfile create mode 100644 docker/images/vector/vector.toml create mode 100644 packages/fingerprint/package.json create mode 100644 packages/fingerprint/src/index.ts create mode 100644 packages/fingerprint/tsconfig.cjs.json create mode 100644 packages/fingerprint/tsconfig.json create mode 100644 packages/fingerprint/vite.cjs.config.ts create mode 100644 packages/provider/src/tasks/detection/decodePayload.js create mode 100644 packages/provider/src/tasks/detection/getBotScore.ts create mode 100644 packages/web-components/src/Reload.tsx diff --git a/.github/workflows/bump_version.yml b/.github/workflows/bump_version.yml index 83e96a4456..b9a51384ad 100644 --- a/.github/workflows/bump_version.yml +++ b/.github/workflows/bump_version.yml @@ -82,10 +82,13 @@ jobs: echo "******************************" - uses: actions/checkout@v4 + with: + submodules: "recursive" + fetch-depth: 0 # Fetch all history for all branches - uses: actions/setup-node@v4 with: - node-version-file: '.nvmrc' + node-version-file: 'package.json' - run: npm i -g "npm@$(jq -r .engines.npm < package.json)" - run: mkdir -p ~/.npm @@ -114,8 +117,15 @@ jobs: git config user.name "prosoponator[bot]" git config user.email "dev@prosopo.io" + # check the source branch (e.g. staging) is up-to-date with the dest branch (e.g. main) + if [ "$(git rev-list --count origin/${{ github.event.inputs.src }}..origin/${{ github.event.inputs.dest }})" -ne 0 ]; then + echo "Source branch ${{ github.event.inputs.src }} is not up-to-date with destination branch ${{ github.event.inputs.dest }}. PR destination branch into the source branch and try again." + exit 1 + else + echo "Source branch ${{ github.event.inputs.src }} is up-to-date with destination branch ${{ github.event.inputs.dest }}" + fi + # checkout the src branch - git fetch --all git checkout ${{ github.event.inputs.src }} INTERIM="${{ github.event.inputs.interim}}" diff --git a/.github/workflows/cache.yml b/.github/workflows/cache.yml index c4dc54ed78..3ce56524c4 100644 --- a/.github/workflows/cache.yml +++ b/.github/workflows/cache.yml @@ -64,6 +64,8 @@ jobs: echo "******************************" - uses: actions/checkout@v4 + with: + submodules: "recursive" # make cache dirs, these must exist before doing cache stuff - run: mkdir -p ~/.npm @@ -74,7 +76,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version-file: '.nvmrc' + node-version-file: 'package.json' - run: npm i -g "npm@$(jq -r .engines.npm < package.json)" - run: npm ci diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index be0970efc8..112e1a786b 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -71,6 +71,8 @@ jobs: echo "******************************" - uses: actions/checkout@v4 + with: + submodules: "recursive" - run: mkdir -p ~/.npm - run: mkdir -p ~/.cache/Cypress @@ -92,7 +94,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version-file: '.nvmrc' + node-version-file: 'package.json' - run: npm i -g "npm@$(jq -r .engines.npm < package.json)" - run: npm ci diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 44d549ec5d..efeb419aba 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -70,6 +70,8 @@ jobs: echo "******************************" - uses: actions/checkout@v4 + with: + submodules: "recursive" - run: mkdir -p ~/.npm - run: mkdir -p ~/.cache/Cypress @@ -91,7 +93,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version-file: '.nvmrc' + node-version-file: 'package.json' - run: npm i -g "npm@$(jq -r .engines.npm < package.json)" - run: npm ci diff --git a/.github/workflows/ls_cache.yml b/.github/workflows/ls_cache.yml index acb1d284a8..d150a6aa22 100644 --- a/.github/workflows/ls_cache.yml +++ b/.github/workflows/ls_cache.yml @@ -62,6 +62,8 @@ jobs: echo "******************************" - uses: actions/checkout@v4 + with: + submodules: "recursive" - run: mkdir -p ~/.npm - run: mkdir -p ~/.cache/Cypress diff --git a/.github/workflows/provider_image.yml b/.github/workflows/provider_image.yml index 604415349f..c13ef0fe80 100644 --- a/.github/workflows/provider_image.yml +++ b/.github/workflows/provider_image.yml @@ -70,6 +70,8 @@ jobs: echo "******************************" - uses: actions/checkout@v4 + with: + submodules: "recursive" - run: mkdir -p ~/.npm - run: mkdir -p ~/.cache/Cypress @@ -91,7 +93,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version-file: '.nvmrc' + node-version-file: 'package.json' - run: npm i -g "npm@$(jq -r .engines.npm < package.json)" - run: npm ci diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 72b4620216..ee79d242ef 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -78,6 +78,8 @@ jobs: npm-${{ runner.os }}-${{ runner.arch }}- - uses: actions/checkout@v4 + with: + submodules: "recursive" - name: Detect env id: env @@ -124,7 +126,7 @@ jobs: echo "docker_latest_tag=staging"; echo "docker_version_tag=staging"; echo "gh_release_tag=staging-release" - echo "gh_prelease=true" + echo "gh_prerelease=true" } >> $GITHUB_OUTPUT else echo "cannot deploy from branch ${{ github.ref }}" @@ -133,7 +135,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version-file: '.nvmrc' + node-version-file: 'package.json' - run: npm i -g "npm@$(jq -r .engines.npm < package.json)" - run: npm ci @@ -156,6 +158,7 @@ jobs: - name: Mark Github release as prerelease if: ${{ steps.env.outputs.gh_prerelease }} + continue-on-error: true # don't fail the workflow if the release can't be resolved run: | gh release edit "${{ steps.env.outputs.gh_release_tag }}" --prerelease diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fd7691f4f6..0c9612a5ac 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -71,6 +71,8 @@ jobs: echo "******************************" - uses: actions/checkout@v4 + with: + submodules: "recursive" - run: mkdir -p ~/.npm - run: mkdir -p ~/.cache/Cypress @@ -92,7 +94,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version-file: '.nvmrc' + node-version-file: 'package.json' - run: npm i -g "npm@$(jq -r .engines.npm < package.json)" - run: npm ci diff --git a/.github/workflows/prosoponator_bot.yml b/.github/workflows/update_staging.yml similarity index 71% rename from .github/workflows/prosoponator_bot.yml rename to .github/workflows/update_staging.yml index 9809214019..4591b7b7b4 100644 --- a/.github/workflows/prosoponator_bot.yml +++ b/.github/workflows/update_staging.yml @@ -1,8 +1,15 @@ -# Run prosoponator bot on any comments +# update staging on push to main -name: prosoponator_bot +name: update_staging -on: issue_comment +on: + push: + branches: [main] + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true env: GITHUB_TOKEN: ${{ secrets.PROSOPONATOR_PAT }} @@ -10,14 +17,8 @@ env: CARGO_TERM_COLOR: always NODE_OPTIONS: "--max-old-space-size=4096" -defaults: - run: - shell: bash - jobs: - comment: - # This job only runs for pull request comments - if: ${{ github.event.issue.pull_request && github.event.pull_request.draft == false }} + deploy: runs-on: ubuntu-latest steps: - name: Print contexts @@ -59,16 +60,26 @@ jobs: echo "******************************" - uses: actions/checkout@v4 + with: + submodules: "recursive" - uses: actions/setup-node@v4 with: - node-version-file: '.nvmrc' + node-version-file: 'package.json' + - run: npm i -g "npm@$(jq -r .engines.npm < package.json)" - - name: Run - env: - GITHUB_TOKEN: ${{ secrets.PROSOPONATOR_PAT }} + - name: PR main into staging run: | - npm ci - cd dev/prosoponator-bot - npx tsx src/bot.ts + set -euo pipefail # stop on errors, print commands, fail on pipe fails + + # set the author in git + git config user.name "prosoponator[bot]" + git config user.email "dev@prosopo.io" + + # checkout the src branch + git fetch --all + git checkout main + + # create a PR for the release + gh pr create --base staging --title "Bring staging up to date with main" --fill diff --git a/.nvmrc b/.nvmrc deleted file mode 100644 index 209e3ef4b6..0000000000 --- a/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -20 diff --git a/biome.json b/biome.json index 3e4782e87b..ef847ffe4d 100644 --- a/biome.json +++ b/biome.json @@ -19,7 +19,11 @@ "**/*.jsonc", "**/*.css" ], - "ignore": ["./packages/detector/src/index.js", "*.bundle.js"] + "ignore": [ + "./packages/detector/src/index.js", + "*.bundle.js", + "./packages/provider/src/tasks/detection/decodePayload.js" + ] }, "linter": { "rules": { diff --git a/demos/client-bundle-example/package.json b/demos/client-bundle-example/package.json index e152ea809d..f3caf24bc3 100644 --- a/demos/client-bundle-example/package.json +++ b/demos/client-bundle-example/package.json @@ -13,14 +13,14 @@ "start": "vite serve ./src --port 9232 --config vite.config.ts", "clean": "echo 'nothing to clean'" }, - "version": "2.1.4", + "version": "2.1.5", "devDependencies": { - "@prosopo/dotenv": "2.1.4", + "@prosopo/dotenv": "2.1.5", "@types/node": "22.5.5", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", "npm-run-all": "4.1.5", - "rimraf": "6.0.1", + "del-cli": "6.0.0", "tslib": "2.7.0", "tsx": "4.19.1", "typescript": "5.6.2", diff --git a/demos/client-bundle-example/src/index.html b/demos/client-bundle-example/src/index.html index b51781f642..d1f0c0f325 100644 --- a/demos/client-bundle-example/src/index.html +++ b/demos/client-bundle-example/src/index.html @@ -140,7 +140,7 @@

Example Login Form

> - +