@prosopo/cli 3.8.20 → 3.8.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
 
2
- > @prosopo/cli@3.8.20 build:cjs
2
+ > @prosopo/cli@3.8.22 build:cjs
3
3
  > NODE_ENV=${NODE_ENV:-development}; vite build --config vite.cjs.config.ts --mode $NODE_ENV
4
4
 
5
5
  ViteCommonJSConfig: .
@@ -96,4 +96,4 @@ dist/cjs/RateLimiter.cjs 5.78 kB │ gzip: 0.92 kB
96
96
   │ ╰─────── This `import.meta` will be replaced with an empty object (`{}`) automatically. If this is desired, you can suppress this warning by adding `transform.define: { 'import.meta': {} }`. If `import.meta` needs to be kept as-is, you need to set the output format to `esm`.
97
97
  ────╯
98
98
  
99
- ✓ built in 62ms
99
+ ✓ built in 88ms
@@ -1,8 +1,8 @@
1
1
 
2
- > @prosopo/cli@3.8.20 build:tsc
2
+ > @prosopo/cli@3.8.22 build:tsc
3
3
  > tsc --build --verbose
4
4
 
5
- 9:06:40 AM - Projects in this build:
5
+ 9:57:20 AM - Projects in this build:
6
6
  * ../../dev/config/tsconfig.json
7
7
  * ../util/tsconfig.json
8
8
  * ../locale/tsconfig.json
@@ -31,59 +31,59 @@
31
31
  * ../../dev/workspace/tsconfig.json
32
32
  * tsconfig.json
33
33
 
34
- 9:06:40 AM - Project '../../dev/config/tsconfig.json' is up to date because newest input '../../dev/config/src/webpack/webpack.config.ts' is older than output '../../dev/config/tsconfig.tsbuildinfo'
34
+ 9:57:20 AM - Project '../../dev/config/tsconfig.json' is up to date because newest input '../../dev/config/src/vite/vite.frontend.config.ts' is older than output '../../dev/config/tsconfig.tsbuildinfo'
35
35
 
36
- 9:06:40 AM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/url.ts' is older than output '../util/tsconfig.tsbuildinfo'
36
+ 9:57:20 AM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/verifyRecency.ts' is older than output '../util/tsconfig.tsbuildinfo'
37
37
 
38
- 9:06:40 AM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/translationKey.ts' is older than output '../locale/tsconfig.tsbuildinfo'
38
+ 9:57:20 AM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/util.ts' is older than output '../locale/tsconfig.tsbuildinfo'
39
39
 
40
- 9:06:40 AM - Project '../util-crypto/tsconfig.json' is up to date because newest input '../util-crypto/src/types.ts' is older than output '../util-crypto/tsconfig.tsbuildinfo'
40
+ 9:57:20 AM - Project '../util-crypto/tsconfig.json' is up to date because newest input '../util-crypto/src/types.ts' is older than output '../util-crypto/tsconfig.tsbuildinfo'
41
41
 
42
- 9:06:40 AM - Project '../types/tsconfig.json' is up to date because newest input '../types/src/types.test-d.ts' is older than output '../types/tsconfig.tsbuildinfo'
42
+ 9:57:20 AM - Project '../types/tsconfig.json' is up to date because newest input '../types/src/types.test-d.ts' is older than output '../types/tsconfig.tsbuildinfo'
43
43
 
44
- 9:06:40 AM - Project '../api/tsconfig.json' is up to date because newest input '../api/src/index.ts' is older than output '../api/tsconfig.tsbuildinfo'
44
+ 9:57:20 AM - Project '../api/tsconfig.json' is up to date because newest input '../api/src/tests/apiHarness.ts' is older than output '../api/tsconfig.tsbuildinfo'
45
45
 
46
- 9:06:40 AM - Project '../logger/tsconfig.json' is up to date because newest input '../logger/src/index.ts' is older than output '../logger/tsconfig.tsbuildinfo'
46
+ 9:57:20 AM - Project '../logger/tsconfig.json' is up to date because newest input '../logger/src/tests/loggerBrowser.unit.test.ts' is older than output '../logger/tsconfig.tsbuildinfo'
47
47
 
48
- 9:06:40 AM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/error.ts' is older than output '../common/tsconfig.tsbuildinfo'
48
+ 9:57:20 AM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/index.ts' is older than output '../common/tsconfig.tsbuildinfo'
49
49
 
50
- 9:06:40 AM - Project '../dotenv/tsconfig.json' is up to date because newest input '../dotenv/src/index.ts' is older than output '../dotenv/tsconfig.tsbuildinfo'
50
+ 9:57:20 AM - Project '../dotenv/tsconfig.json' is up to date because newest input '../dotenv/src/index.ts' is older than output '../dotenv/tsconfig.tsbuildinfo'
51
51
 
52
- 9:06:40 AM - Project '../ipinfo/tsconfig.json' is up to date because newest input '../ipinfo/src/types.ts' is older than output '../ipinfo/tsconfig.tsbuildinfo'
52
+ 9:57:20 AM - Project '../ipinfo/tsconfig.json' is up to date because newest input '../ipinfo/src/IpInfoService.ts' is older than output '../ipinfo/tsconfig.tsbuildinfo'
53
53
 
54
- 9:06:40 AM - Project '../api-route/tsconfig.json' is up to date because newest input '../api-route/src/apiRoutes.ts' is older than output '../api-route/tsconfig.tsbuildinfo'
54
+ 9:57:20 AM - Project '../api-route/tsconfig.json' is up to date because newest input '../api-route/src/apiRoutes.ts' is older than output '../api-route/tsconfig.tsbuildinfo'
55
55
 
56
- 9:06:40 AM - Project '../redis-client/tsconfig.json' is up to date because newest input '../redis-client/src/redisClient.ts' is older than output '../redis-client/tsconfig.tsbuildinfo'
56
+ 9:57:20 AM - Project '../redis-client/tsconfig.json' is up to date because newest input '../redis-client/src/index.ts' is older than output '../redis-client/tsconfig.tsbuildinfo'
57
57
 
58
- 9:06:40 AM - Project '../user-access-policy/tsconfig.json' is up to date because newest input '../user-access-policy/src/transformRule.ts' is older than output '../user-access-policy/tsconfig.tsbuildinfo'
58
+ 9:57:20 AM - Project '../user-access-policy/tsconfig.json' is up to date because newest input '../user-access-policy/src/transformRule.ts' is older than output '../user-access-policy/tsconfig.tsbuildinfo'
59
59
 
60
- 9:06:40 AM - Project '../types-database/tsconfig.json' is up to date because newest input '../types-database/src/index.ts' is older than output '../types-database/tsconfig.tsbuildinfo'
60
+ 9:57:20 AM - Project '../types-database/tsconfig.json' is up to date because newest input '../types-database/src/index.ts' is older than output '../types-database/tsconfig.tsbuildinfo'
61
61
 
62
- 9:06:40 AM - Project '../database/tsconfig.json' is up to date because newest input '../database/src/tests/unit/captchaLabel.unit.test.ts' is older than output '../database/tsconfig.tsbuildinfo'
62
+ 9:57:20 AM - Project '../database/tsconfig.json' is up to date because newest input '../database/src/tests/unit/captchaLabel.unit.test.ts' is older than output '../database/tsconfig.tsbuildinfo'
63
63
 
64
- 9:06:40 AM - Project '../keyring/tsconfig.json' is up to date because newest input '../keyring/src/index.ts' is older than output '../keyring/tsconfig.tsbuildinfo'
64
+ 9:57:20 AM - Project '../keyring/tsconfig.json' is up to date because newest input '../keyring/src/index.ts' is older than output '../keyring/tsconfig.tsbuildinfo'
65
65
 
66
- 9:06:41 AM - Project '../types-env/tsconfig.json' is up to date because newest input '../types-env/src/index.ts' is older than output '../types-env/tsconfig.tsbuildinfo'
66
+ 9:57:20 AM - Project '../types-env/tsconfig.json' is up to date because newest input '../types-env/src/env.ts' is older than output '../types-env/tsconfig.tsbuildinfo'
67
67
 
68
- 9:06:41 AM - Project '../env/tsconfig.json' is up to date because newest input '../env/src/env.ts' is older than output '../env/tsconfig.tsbuildinfo'
68
+ 9:57:20 AM - Project '../env/tsconfig.json' is up to date because newest input '../env/src/env.ts' is older than output '../env/tsconfig.tsbuildinfo'
69
69
 
70
- 9:06:41 AM - Project '../api-express-router/tsconfig.json' is up to date because newest input '../api-express-router/src/tests/unit/testDoubles.ts' is older than output '../api-express-router/tsconfig.tsbuildinfo'
70
+ 9:57:20 AM - Project '../api-express-router/tsconfig.json' is up to date because newest input '../api-express-router/src/tests/unit/apiExpressDefaultEndpointAdapter.unit.test.ts' is older than output '../api-express-router/tsconfig.tsbuildinfo'
71
71
 
72
- 9:06:41 AM - Project '../captcha-severity/tsconfig.json' is up to date because newest input '../captcha-severity/src/index.test.ts' is older than output '../captcha-severity/tsconfig.tsbuildinfo'
72
+ 9:57:20 AM - Project '../captcha-severity/tsconfig.json' is up to date because newest input '../captcha-severity/src/index.test.ts' is older than output '../captcha-severity/tsconfig.tsbuildinfo'
73
73
 
74
- 9:06:41 AM - Project '../datasets/tsconfig.json' is up to date because newest input '../datasets/src/index.ts' is older than output '../datasets/tsconfig.tsbuildinfo'
74
+ 9:57:20 AM - Project '../datasets/tsconfig.json' is up to date because newest input '../datasets/src/tests/mocks/data/captchas.ts' is older than output '../datasets/tsconfig.tsbuildinfo'
75
75
 
76
- 9:06:41 AM - Project '../load-balancer/tsconfig.json' is up to date because newest input '../load-balancer/src/balancer.ts' is older than output '../load-balancer/tsconfig.tsbuildinfo'
76
+ 9:57:20 AM - Project '../load-balancer/tsconfig.json' is up to date because newest input '../load-balancer/src/balancer.ts' is older than output '../load-balancer/tsconfig.tsbuildinfo'
77
77
 
78
- 9:06:41 AM - Project '../puzzle-assets/tsconfig.json' is up to date because newest input '../puzzle-assets/src/background.ts' is older than output '../puzzle-assets/tsconfig.tsbuildinfo'
78
+ 9:57:20 AM - Project '../puzzle-assets/tsconfig.json' is up to date because newest input '../puzzle-assets/src/background.ts' is older than output '../puzzle-assets/tsconfig.tsbuildinfo'
79
79
 
80
- 9:06:41 AM - Project '../web-bot-auth/tsconfig.json' is up to date because newest input '../web-bot-auth/src/base64.ts' is older than output '../web-bot-auth/tsconfig.tsbuildinfo'
80
+ 9:57:20 AM - Project '../web-bot-auth/tsconfig.json' is up to date because newest input '../web-bot-auth/src/verify.ts' is older than output '../web-bot-auth/tsconfig.tsbuildinfo'
81
81
 
82
- 9:06:41 AM - Project '../provider/tsconfig.json' is up to date because newest input '../provider/src/utils/devicePlatform.ts' is older than output '../provider/tsconfig.tsbuildinfo'
82
+ 9:57:20 AM - Project '../provider/tsconfig.json' is up to date because newest input '../provider/src/util.ts' is older than output '../provider/tsconfig.tsbuildinfo'
83
83
 
84
- 9:06:41 AM - Project '../../dev/workspace/tsconfig.json' is up to date because newest input '../../dev/workspace/src/projectInfo.ts' is older than output '../../dev/workspace/tsconfig.tsbuildinfo'
84
+ 9:57:20 AM - Project '../../dev/workspace/tsconfig.json' is up to date because newest input '../../dev/workspace/src/projectInfo.ts' is older than output '../../dev/workspace/tsconfig.tsbuildinfo'
85
85
 
86
- 9:06:41 AM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
86
+ 9:57:20 AM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
87
87
 
88
- 9:06:41 AM - Building project '/home/runner/work/captcha/captcha/packages/cli/tsconfig.json'...
88
+ 9:57:20 AM - Building project '/home/runner/work/captcha/captcha/packages/cli/tsconfig.json'...
89
89
 
@@ -1,9 +1,9 @@
1
1
 
2
- > @prosopo/cli@3.8.20 build
2
+ > @prosopo/cli@3.8.22 build
3
3
  > npm run build:cross-env -- --mode ${NODE_ENV:-development}
4
4
 
5
5
 
6
- > @prosopo/cli@3.8.20 build:cross-env
6
+ > @prosopo/cli@3.8.22 build:cross-env
7
7
  > vite build --config vite.esm.config.ts --mode production
8
8
 
9
9
  ViteEsmConfig: .
@@ -92,4 +92,4 @@ dist/commands/siteKeyRegister.js 3.99 kB │ gzip: 1.24 kB
92
92
  dist/prosopo.config.js 4.49 kB │ gzip: 1.48 kB
93
93
  dist/RateLimiter.js 5.35 kB │ gzip: 0.92 kB
94
94
 
95
- ✓ built in 55ms
95
+ ✓ built in 66ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,48 @@
1
1
  # @prosopo/cli
2
2
 
3
+ ## 3.8.22
4
+ ### Patch Changes
5
+
6
+ - Updated dependencies [f650c66]
7
+ - Updated dependencies [59b7e87]
8
+ - Updated dependencies [b5e55a6]
9
+ - Updated dependencies [e482b25]
10
+ - Updated dependencies [8933ad5]
11
+ - Updated dependencies [294b480]
12
+ - Updated dependencies [026b126]
13
+ - Updated dependencies [0c8678e]
14
+ - Updated dependencies [b77c5f4]
15
+ - Updated dependencies [7065689]
16
+ - Updated dependencies [dab0338]
17
+ - Updated dependencies [9318584]
18
+ - Updated dependencies [0d29dde]
19
+ - Updated dependencies [084da7e]
20
+ - Updated dependencies [fa316d6]
21
+ - Updated dependencies [9ed0ac5]
22
+ - @prosopo/provider@5.13.2
23
+ - @prosopo/types@5.11.0
24
+ - @prosopo/common@3.1.60
25
+ - @prosopo/locale@3.6.1
26
+ - @prosopo/api@4.3.6
27
+ - @prosopo/util@3.3.12
28
+ - @prosopo/env@3.6.65
29
+ - @prosopo/keyring@2.9.98
30
+ - @prosopo/dotenv@3.0.58
31
+ - @prosopo/logger@2.1.1
32
+
33
+ ## 3.8.21
34
+ ### Patch Changes
35
+
36
+ - Updated dependencies [fda0eba]
37
+ - Updated dependencies [1728cd0]
38
+ - Updated dependencies [20542d8]
39
+ - Updated dependencies [eebe6ee]
40
+ - @prosopo/types@5.10.2
41
+ - @prosopo/provider@5.13.1
42
+ - @prosopo/api@4.3.5
43
+ - @prosopo/env@3.6.64
44
+ - @prosopo/keyring@2.9.97
45
+
3
46
  ## 3.8.20
4
47
  ### Patch Changes
5
48
 
package/Dockerfile CHANGED
@@ -1,30 +1,82 @@
1
- FROM node:24
1
+ # Two stages. Everything that needs a shell, a package manager or a network
2
+ # fetch happens in the builder; the runtime image is distroless and contains
3
+ # only the Node runtime, this bundle and its one dependency.
4
+ #
5
+ # The builder is `node:24-slim` rather than `node:24` for the same reason the
6
+ # runtime is distroless: `node:24` is 1.63 GB of build toolchain that a
7
+ # pre-bundled JS file and a single prebuilt-binary dependency never touch.
8
+ FROM node:24-slim AS builder
2
9
 
3
- WORKDIR /usr/src/app
10
+ WORKDIR /build
4
11
 
5
12
  # set shell to bash and error on any failure, unset variables, and pipefail
6
13
  SHELL ["/bin/bash", "-euo", "pipefail", "-c"]
7
14
 
15
+ # slim ships no curl, and the GeoLite fetches below need it. Builder-only, so
16
+ # none of this reaches the runtime image.
17
+ RUN apt-get update && \
18
+ apt-get install -y --no-install-recommends curl ca-certificates && \
19
+ rm -rf /var/lib/apt/lists/*
20
+
8
21
  COPY ./packages/cli/dist/bundle/ ./
9
22
 
10
23
  COPY ./packages/locale/dist/locales/ ./locales/
11
24
 
12
- # download the GeoLite2 databases into the same directory
13
- RUN curl -L -o GeoLite2-Country.mmdb https://git.io/GeoLite2-Country.mmdb
14
- RUN curl -L -o GeoLite2-City.mmdb https://git.io/GeoLite2-City.mmdb
15
- RUN curl -L -o GeoLite2-ASN.mmdb https://git.io/GeoLite2-ASN.mmdb
16
-
17
- # make the provider cli executable and set the binary for npx. The
18
- # generated package.json declares `sharp` as a runtime dependency so
19
- # `npm i` installs the linux-x64 native binary — vite bundles the JS
20
- # shim but not the platform-specific .node addon, and the puzzle
21
- # renderer imports sharp from @prosopo/puzzle-assets at runtime.
22
- # --os=linux --cpu=x64 --include=optional forces npm to fetch the
23
- # correct optional platform variant regardless of the build host.
24
- RUN echo '#!/usr/bin/env node' | cat - provider.cli.bundle.js > temp && mv temp provider.cli.bundle.js && \
25
- echo '{ "name": "prosopo-provider", "bin": { "provider": "./provider.cli.bundle.js" }, "type": "module", "dependencies": { "sharp": "0.35.3" } }' > /usr/src/app/package.json && \
26
- npm i --include=optional --os=linux --cpu=x64
25
+ # Download the GeoLite2 databases into the same directory. One layer rather
26
+ # than three so the intermediate states are not retained.
27
+ RUN curl -fLsS -o GeoLite2-Country.mmdb https://git.io/GeoLite2-Country.mmdb && \
28
+ curl -fLsS -o GeoLite2-City.mmdb https://git.io/GeoLite2-City.mmdb && \
29
+ curl -fLsS -o GeoLite2-ASN.mmdb https://git.io/GeoLite2-ASN.mmdb
30
+
31
+ # The generated package.json declares `sharp` as a runtime dependency so
32
+ # `npm i` installs the linux-x64 native binary — vite bundles the JS shim but
33
+ # not the platform-specific .node addon, and the puzzle renderer imports sharp
34
+ # from @prosopo/puzzle-assets at runtime. --os=linux --cpu=x64
35
+ # --include=optional forces npm to fetch the correct optional platform variant
36
+ # regardless of the build host.
37
+ #
38
+ # The shebang points at the absolute node path rather than `/usr/bin/env node`:
39
+ # there is no `env` on PATH in the runtime image to resolve a relative
40
+ # interpreter, but the kernel honours an absolute one. It is a convenience
41
+ # only — every caller in this repo invokes node explicitly, because `docker
42
+ # exec` does not apply ENTRYPOINT:
43
+ # docker exec provider1 /nodejs/bin/node /usr/src/app/provider.cli.bundle.js <command>
44
+ RUN echo '#!/nodejs/bin/node' | cat - provider.cli.bundle.js > temp && \
45
+ mv temp provider.cli.bundle.js && \
46
+ chmod +x provider.cli.bundle.js && \
47
+ echo '{ "name": "prosopo-provider", "type": "module", "dependencies": { "sharp": "0.35.3" } }' > package.json && \
48
+ npm i --include=optional --os=linux --cpu=x64 --no-fund --no-audit && \
49
+ npm cache clean --force
50
+
51
+ # `nodejs24-debian12` matches the builder's Debian release, so the glibc the
52
+ # native addons were resolved against is the same one that loads them. All
53
+ # four (@img/sharp, native-ja4, native-merkle, native-puzzle) are
54
+ # linux-x64-gnu; an Alpine/musl runtime would break every one.
55
+ #
56
+ # The `:nonroot` tag runs as uid/gid 65532 rather than root. The bind-mounted
57
+ # detector-pool directory must be owned by that uid on the host or the pool
58
+ # cannot be written or re-read — and an unreadable pool fails silently, with
59
+ # the provider falling back to proof of work. The ansible provider role
60
+ # chowns it; see captcha-private issue #4749.
61
+ #
62
+ # There is no shell, no package manager and no npx in here. That is the point,
63
+ # and it is also the operational cost: `docker exec ... bash` no longer works,
64
+ # CLI commands must name node explicitly (see above), and container
65
+ # healthchecks cannot use curl — they run `node -e "fetch(...)"` instead. Every
66
+ # call site in this repo and in the ansible playbooks has been moved over.
67
+ FROM gcr.io/distroless/nodejs24-debian12:nonroot
68
+
69
+ WORKDIR /usr/src/app
70
+
71
+ # --chown so the runtime user owns what it needs to read and write.
72
+ COPY --from=builder --chown=65532:65532 /build/ ./
27
73
 
28
74
  EXPOSE 9229 9339 80 443
29
75
 
30
- CMD ["npx" , "provider" ,"--api"]
76
+ # Redundant with the `:nonroot` tag, which already runs as this uid, but
77
+ # stated explicitly: it is the only form a Dockerfile reader — or a scanner —
78
+ # can see, and it keeps the guarantee if the tag is ever changed.
79
+ USER 65532:65532
80
+
81
+ # ENTRYPOINT is /nodejs/bin/node, so this is argv to node.
82
+ CMD ["/usr/src/app/provider.cli.bundle.js", "--api"]
Binary file