Compare commits

..

43 Commits

Author SHA1 Message Date
Aravinth Manivannan
cadc15a7a1 fix: copy OpenAPI build from build container to final container
fixes: https://github.com/mCaptcha/mCaptcha/issues/59
2023-01-17 03:54:54 +05:30
Aravinth Manivannan
c1f6ce3ae2 Merge pull request #52 from Gusted/close-register-page
Hide register page when registrations are closed
2022-11-07 13:39:34 +05:30
Gusted
864549cb4c Fix copyright 2022-11-06 19:42:22 +01:00
Gusted
5713d4b1ae Hide register page when registrations are closed
- Improve UX for "private" instances.
2022-10-24 22:47:07 +02:00
Aravinth Manivannan
ac502b7c08 Merge pull request #51 from Gusted/fix-compiling
Fix compiling
2022-10-24 21:22:34 +05:30
Gusted
8dc690ca01 Remove redunant format 2022-10-24 16:22:10 +02:00
Gusted
a4f9c92b32 Update cargo 2022-10-22 21:53:18 +02:00
Gusted
8826f6df8f Fix compiling
- I made some mistakes while checking my two previous PRs(Seems like I
don't understand Rust that great after all).
- Do the url encoding only on the password part, not only the whole URL.
- Fix `temporary value dropped while borrowed` compile error.
2022-10-22 21:28:58 +02:00
Aravinth Manivannan
af35fdb48e Merge pull request #46 from Gusted/relax-port-env
Allow `PORT` environment to be not set
2022-10-18 15:51:22 +05:30
Gusted
9fd8ffd666 Add more logging for configuration/env 2022-10-17 19:49:42 +02:00
Aravinth Manivannan
521abd82d6 Merge pull request #47 from Gusted/encode-url-postgres
Encode connection URL to database
2022-10-17 15:42:02 +05:30
Gusted
021f2fe5b4 Encode connection URL to database
- If you have a database password that contains characters like `#` or `*`, sqlx
will error about a InvalidPort, this is due to not encoding the url.
[See issue on sqlx](https://github.com/launchbadge/sqlx/issues/1624).
- Removed useless statements.
2022-10-16 23:37:24 +02:00
Gusted
b3e0ff6769 Allow PORT environment to be not set
- It's quite weird to require the `PORT` environment to be set, when it
already can be set via the config file.
2022-10-16 23:07:10 +02:00
Aravinth Manivannan
97abca2520 Merge pull request #45 from DarianAnjuhal/master
feat: open mail link with target=_blank
2022-10-12 15:28:13 +05:30
Daniel Antlinger
96a6c98c10 feat: open mail link with target=_blank 2022-10-12 11:50:55 +02:00
realaravinth
9d285573d7 fix: typo in widget 2022-09-26 16:40:40 +05:30
Aravinth Manivannan
d506d291c3 Merge pull request #43 from DarianAnjuhal/master
feat: open links from widget in new pages target=_blank
2022-09-07 23:31:56 +05:30
Daniel Antlinger
223e8fb8c2 feat: open links from widget in new pages target=_blank 2022-09-07 14:05:25 +02:00
realaravinth
2abf57d16b fix: set correct upload dir 2022-08-15 18:01:41 +05:30
realaravinth
b3ee57d042 fix: configure gpg key 2022-08-15 17:37:48 +05:30
realaravinth
8c65edd257 fix: upload path 2022-08-15 17:25:22 +05:30
realaravinth
9f521fe199 feat: publish mcaptcha bin to dl.mcaptcha.org 2022-08-15 17:03:46 +05:30
realaravinth
8ac1e2b81e feat: package and sign dist assets 2022-08-15 17:03:46 +05:30
Aravinth Manivannan
5db58d477b Merge pull request #24 from mCaptcha/dependabot/npm_and_yarn/nanoid-3.3.4
Bump nanoid from 3.1.29 to 3.3.4
2022-08-14 01:32:55 +05:30
Aravinth Manivannan
db03cd3b1f Merge pull request #34 from mCaptcha/dependabot/npm_and_yarn/terser-5.14.2
chore(deps): bump terser from 5.9.0 to 5.14.2
2022-08-14 01:32:25 +05:30
realaravinth
e5e89bd8a0 chore: bump libmcaptcha, switch to master 2022-08-13 01:58:40 +05:30
Aravinth Manivannan
2dd6f063c5 Merge pull request #40 from Gusted/automate-releases
Automate releases via Github Actions
2022-08-12 18:39:48 +05:30
Gusted
bb81e7fb9b Automate releases via Github Actions
- Use Github Actions to compile static linked binaries for the three
major OS and upload them to Github Releases.
2022-08-12 14:55:57 +02:00
realaravinth
b3d00c89a6 feat: increase demo test waint time 2022-08-09 17:08:26 +05:30
realaravinth
8c9587ad65 feat: set custom runers and queue length 2022-08-09 16:30:04 +05:30
realaravinth
21825582e5 feat: fallabck to localhost when running tests 2022-08-09 16:29:24 +05:30
realaravinth
f8e6bdf229 feat: bump libmcaptcha 2022-08-09 16:29:05 +05:30
realaravinth
8c576d2b07 feat: queue length and IP runner config 2022-08-09 16:28:30 +05:30
realaravinth
c377cf431e feat & fix: ip queues 2022-08-09 02:52:17 +05:30
realaravinth
ce1b3b0856 feat: bump libmcaptcha and pow_sha256 2022-08-09 02:51:40 +05:30
Aravinth Manivannan
cd6cecfe4a Merge pull request #39 from evilsocket/master
fix: fixes broken docker-compose.yml (#38)
2022-08-05 17:40:05 +05:30
Simone Margaritelli
a66d75c3c3 fix: fixes broken docker-compose.yml (#38) 2022-08-05 14:00:40 +02:00
Aravinth Manivannan
3d9056e968 Merge pull request #36 from kianmeng/fix-typos
Fix typos
2022-08-05 14:26:11 +05:30
Kian-Meng Ang
bb42841a66 Fix typos 2022-08-04 23:06:54 +08:00
Aravinth Manivannan
961bb6c5f4 Merge pull request #35 from Gusted/use-full-screen
Let widget use full-screen
2022-07-27 21:35:52 +05:30
Gusted
f56bc6d9e4 Let widget use full-screen
- Instead of using static values for dimensions. Use responsive CSS and
take up the whole screen. Let the user deal with setting the correct
dimensions accordingly.
2022-07-26 22:58:17 +02:00
dependabot[bot]
8a667ad71f chore(deps): bump terser from 5.9.0 to 5.14.2
Bumps [terser](https://github.com/terser/terser) from 5.9.0 to 5.14.2.
- [Release notes](https://github.com/terser/terser/releases)
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/commits)

---
updated-dependencies:
- dependency-name: terser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-20 06:01:46 +00:00
dependabot[bot]
72cff2a470 Bump nanoid from 3.1.29 to 3.3.4
Bumps [nanoid](https://github.com/ai/nanoid) from 3.1.29 to 3.3.4.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.1.29...3.3.4)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-07 10:54:21 +00:00
35 changed files with 524 additions and 219 deletions

View File

@@ -81,6 +81,12 @@ jobs:
target target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: configure GPG key
if: (github.ref == 'refs/heads/master' || github.event_name == 'push') && github.repository == 'mCaptcha/mCaptcha'
run: echo -n "$RELEASE_BOT_GPG_SIGNING_KEY" | gpg --batch --import --pinentry-mode loopback
env:
RELEASE_BOT_GPG_SIGNING_KEY: ${{ secrets.RELEASE_BOT_GPG_SIGNING_KEY }}
- name: load env - name: load env
run: | run: |
source .env_sample \ source .env_sample \
@@ -133,6 +139,13 @@ jobs:
if: (github.ref == 'refs/heads/master' || github.event_name == 'push') && github.repository == 'mCaptcha/mCaptcha' if: (github.ref == 'refs/heads/master' || github.event_name == 'push') && github.repository == 'mCaptcha/mCaptcha'
run: make docker-publish run: make docker-publish
- name: publish bins
if: (github.ref == 'refs/heads/master' || github.event_name == 'push') && github.repository == 'mCaptcha/mCaptcha'
run: ./scripts/publish.sh publish master latest $DUMBSERVE_PASSWORD
env:
DUMBSERVE_PASSWORD: ${{ secrets.DUMBSERVE_PASSWORD }}
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
- name: generate documentation - name: generate documentation
if: matrix.version == 'stable' && (github.repository == 'mCaptcha/mCaptcha') if: matrix.version == 'stable' && (github.repository == 'mCaptcha/mCaptcha')
run: make doc run: make doc

32
.github/workflows/tagged-release.yml vendored Normal file
View File

@@ -0,0 +1,32 @@
name: Create binary for release
# Only on tags that start with a "v"
on:
push:
tags:
- "v*"
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-pc-windows-gnu
archive: zip
- target: x86_64-unknown-linux-musl
archive: tar.gz tar.xz
- target: x86_64-apple-darwin
archive: zip
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Compile and release
uses: rust-build/rust-build.action@v1.3.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
RUSTTARGET: ${{ matrix.target }}
ARCHIVE_TYPES: ${{ matrix.archive }}

245
Cargo.lock generated
View File

@@ -57,9 +57,9 @@ dependencies = [
[[package]] [[package]]
name = "actix-cors" name = "actix-cors"
version = "0.6.1" version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "414360eed71ba2d5435b185ba43ecbe281dfab5df3898286d6b7be8074372c92" checksum = "02a0adcaabb68f1dfe8880cb3c5f049261c68f5d69ce06b6f3a930f31710838e"
dependencies = [ dependencies = [
"actix-utils", "actix-utils",
"actix-web", "actix-web",
@@ -94,7 +94,7 @@ dependencies = [
"http", "http",
"httparse", "httparse",
"httpdate", "httpdate",
"itoa 1.0.2", "itoa 1.0.3",
"language-tags", "language-tags",
"local-channel", "local-channel",
"mime", "mime",
@@ -117,9 +117,9 @@ dependencies = [
"actix-utils", "actix-utils",
"actix-web", "actix-web",
"futures-util", "futures-util",
"serde 1.0.140", "serde 1.0.143",
"serde_json", "serde_json",
"time 0.3.11", "time 0.3.13",
] ]
[[package]] [[package]]
@@ -143,7 +143,7 @@ dependencies = [
"http", "http",
"log", "log",
"regex", "regex",
"serde 1.0.140", "serde 1.0.143",
] ]
[[package]] [[package]]
@@ -237,19 +237,19 @@ dependencies = [
"encoding_rs", "encoding_rs",
"futures-core", "futures-core",
"futures-util", "futures-util",
"itoa 1.0.2", "itoa 1.0.3",
"language-tags", "language-tags",
"log", "log",
"mime", "mime",
"once_cell", "once_cell",
"pin-project-lite", "pin-project-lite",
"regex", "regex",
"serde 1.0.140", "serde 1.0.143",
"serde_json", "serde_json",
"serde_urlencoded", "serde_urlencoded",
"smallvec", "smallvec",
"socket2", "socket2",
"time 0.3.11", "time 0.3.13",
"url", "url",
] ]
@@ -469,13 +469,13 @@ dependencies = [
"futures-util", "futures-util",
"h2", "h2",
"http", "http",
"itoa 1.0.2", "itoa 1.0.3",
"log", "log",
"mime", "mime",
"percent-encoding", "percent-encoding",
"pin-project-lite", "pin-project-lite",
"rand", "rand",
"serde 1.0.140", "serde 1.0.143",
"serde_json", "serde_json",
"serde_urlencoded", "serde_urlencoded",
"tokio", "tokio",
@@ -505,7 +505,7 @@ version = "1.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad"
dependencies = [ dependencies = [
"serde 1.0.140", "serde 1.0.143",
] ]
[[package]] [[package]]
@@ -578,9 +578,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
[[package]] [[package]]
name = "bytes" name = "bytes"
version = "1.2.0" version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0b3de4a0c5e67e16066a0715723abd91edc2f9001d09c46e1dca929351e130e" checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db"
[[package]] [[package]]
name = "bytestring" name = "bytestring"
@@ -600,7 +600,7 @@ dependencies = [
"derive_builder 0.11.1", "derive_builder 0.11.1",
"mime", "mime",
"mime_guess", "mime_guess",
"serde 1.0.140", "serde 1.0.143",
"serde_json", "serde_json",
"sha2 0.10.2", "sha2 0.10.2",
"walkdir", "walkdir",
@@ -632,9 +632,9 @@ dependencies = [
[[package]] [[package]]
name = "combine" name = "combine"
version = "4.6.4" version = "4.6.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a604e93b79d1808327a6fca85a6f2d69de66461e7620f5a4cbf5fb4d1d7c948" checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4"
dependencies = [ dependencies = [
"bytes", "bytes",
"futures-core", "futures-core",
@@ -653,7 +653,7 @@ dependencies = [
"lazy_static", "lazy_static",
"nom 5.1.2", "nom 5.1.2",
"rust-ini", "rust-ini",
"serde 1.0.140", "serde 1.0.143",
"serde-hjson", "serde-hjson",
"serde_json", "serde_json",
"toml", "toml",
@@ -698,7 +698,7 @@ dependencies = [
"rand", "rand",
"sha2 0.10.2", "sha2 0.10.2",
"subtle", "subtle",
"time 0.3.11", "time 0.3.13",
"version_check", "version_check",
] ]
@@ -759,9 +759,9 @@ dependencies = [
[[package]] [[package]]
name = "crossbeam-channel" name = "crossbeam-channel"
version = "0.5.5" version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4c02a4d71819009c192cf4872265391563fd6a84c81ff2c0f2a7026ca4c1d85c" checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"crossbeam-utils", "crossbeam-utils",
@@ -769,9 +769,9 @@ dependencies = [
[[package]] [[package]]
name = "crossbeam-queue" name = "crossbeam-queue"
version = "0.3.5" version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1f25d8400f4a7a5778f0e4e52384a48cbd9b5c495d110786187fc750075277a2" checksum = "1cd42583b04998a5363558e5f9291ee5a5ff6b49944332103f251e7479a82aa7"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"crossbeam-utils", "crossbeam-utils",
@@ -779,9 +779,9 @@ dependencies = [
[[package]] [[package]]
name = "crossbeam-utils" name = "crossbeam-utils"
version = "0.8.10" version = "0.8.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7d82ee10ce34d7bc12c2122495e7593a9c41347ecdd64185af4ecf72cb1a7f83" checksum = "51887d4adc7b564537b15adcfb307936f8075dfcd5f00dde9a9f1d29383682bc"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"once_cell", "once_cell",
@@ -863,7 +863,7 @@ version = "0.1.0"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"libmcaptcha", "libmcaptcha",
"serde 1.0.140", "serde 1.0.143",
"serde_json", "serde_json",
"thiserror", "thiserror",
"url", "url",
@@ -1043,7 +1043,7 @@ version = "1.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f107b87b6afc2a64fd13cac55fe06d6c8859f12d4b14cbcdd2c67d0976781be" checksum = "3f107b87b6afc2a64fd13cac55fe06d6c8859f12d4b14cbcdd2c67d0976781be"
dependencies = [ dependencies = [
"serde 1.0.140", "serde 1.0.143",
] ]
[[package]] [[package]]
@@ -1058,9 +1058,9 @@ dependencies = [
[[package]] [[package]]
name = "email_address" name = "email_address"
version = "0.2.1" version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8684b7c9cb4857dfa1e5b9629ef584ba618c9b93bae60f58cb23f4f271d0468e" checksum = "b1b32a7a2580c4473f10f66b512c34bdd7d33c5e3473227ca833abdb5afe4809"
[[package]] [[package]]
name = "encoding_rs" name = "encoding_rs"
@@ -1086,15 +1086,15 @@ dependencies = [
[[package]] [[package]]
name = "event-listener" name = "event-listener"
version = "2.5.2" version = "2.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77f3309417938f28bf8228fcff79a4a37103981e3e186d2ccd19c74b38f4eb71" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0"
[[package]] [[package]]
name = "fastrand" name = "fastrand"
version = "1.7.0" version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499"
dependencies = [ dependencies = [
"instant", "instant",
] ]
@@ -1270,9 +1270,9 @@ dependencies = [
[[package]] [[package]]
name = "generic-array" name = "generic-array"
version = "0.14.5" version = "0.14.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9"
dependencies = [ dependencies = [
"typenum", "typenum",
"version_check", "version_check",
@@ -1426,7 +1426,7 @@ checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399"
dependencies = [ dependencies = [
"bytes", "bytes",
"fnv", "fnv",
"itoa 1.0.2", "itoa 1.0.3",
] ]
[[package]] [[package]]
@@ -1509,9 +1509,9 @@ checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4"
[[package]] [[package]]
name = "itoa" name = "itoa"
version = "1.0.2" version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754"
[[package]] [[package]]
name = "itoap" name = "itoap"
@@ -1530,9 +1530,9 @@ dependencies = [
[[package]] [[package]]
name = "js-sys" name = "js-sys"
version = "0.3.58" version = "0.3.59"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3fac17f7123a73ca62df411b1bf727ccc805daa070338fda671c86dac1bdc27" checksum = "258451ab10b34f8af53416d1fdab72c22e805f0c92a1136d59470ec0b11138b2"
dependencies = [ dependencies = [
"wasm-bindgen", "wasm-bindgen",
] ]
@@ -1593,30 +1593,32 @@ dependencies = [
[[package]] [[package]]
name = "libc" name = "libc"
version = "0.2.126" version = "0.2.129"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" checksum = "64de3cc433455c14174d42e554d4027ee631c4d046d43e3ecc6efc4636cdc7a7"
[[package]] [[package]]
name = "libm" name = "libm"
version = "0.2.2" version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33a33a362ce288760ec6a508b94caaec573ae7d3bbbd91b87aa0bad4456839db" checksum = "292a948cd991e376cf75541fe5b97a1081d713c618b4f1b9500f8844e49eb565"
[[package]] [[package]]
name = "libmcaptcha" name = "libmcaptcha"
version = "0.1.4" version = "0.2.2"
source = "git+https://github.com/mCaptcha/libmcaptcha?branch=master#374dcc936ad5d030517be73a4d939cbe245fd9ac" source = "git+https://github.com/mCaptcha/libmcaptcha?branch=master#4efe8cdfee94766dd85647ad6f1ecc1b486b40a7"
dependencies = [ dependencies = [
"actix", "actix",
"crossbeam-channel",
"derive_builder 0.10.2", "derive_builder 0.10.2",
"derive_more", "derive_more",
"log", "log",
"pow_sha256", "num_cpus",
"pow_sha256 0.3.1 (git+https://github.com/mcaptcha/pow_sha256)",
"pretty_env_logger", "pretty_env_logger",
"rand", "rand",
"redis", "redis",
"serde 1.0.140", "serde 1.0.143",
"serde_json", "serde_json",
"tokio", "tokio",
] ]
@@ -1732,13 +1734,14 @@ dependencies = [
"log", "log",
"mime", "mime",
"mime_guess", "mime_guess",
"num_cpus",
"openssl", "openssl",
"pow_sha256", "pow_sha256 0.3.1 (git+https://github.com/mcaptcha/pow_sha256?tag=0.3.1)",
"pretty_env_logger", "pretty_env_logger",
"rand", "rand",
"rust-embed", "rust-embed",
"sailfish", "sailfish",
"serde 1.0.140", "serde 1.0.143",
"serde_json", "serde_json",
"sqlx", "sqlx",
"tokio", "tokio",
@@ -1884,7 +1887,7 @@ dependencies = [
"autocfg", "autocfg",
"num-integer", "num-integer",
"num-traits 0.2.15", "num-traits 0.2.15",
"serde 1.0.140", "serde 1.0.143",
] ]
[[package]] [[package]]
@@ -1911,7 +1914,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ae39348c8bc5fbd7f40c727a9925f03517afd2ab27d46702108b6a7e5414c19" checksum = "7ae39348c8bc5fbd7f40c727a9925f03517afd2ab27d46702108b6a7e5414c19"
dependencies = [ dependencies = [
"num-traits 0.2.15", "num-traits 0.2.15",
"serde 1.0.140", "serde 1.0.143",
] ]
[[package]] [[package]]
@@ -1944,7 +1947,7 @@ dependencies = [
"autocfg", "autocfg",
"num-integer", "num-integer",
"num-traits 0.2.15", "num-traits 0.2.15",
"serde 1.0.140", "serde 1.0.143",
] ]
[[package]] [[package]]
@@ -2102,9 +2105,9 @@ dependencies = [
[[package]] [[package]]
name = "paste" name = "paste"
version = "1.0.7" version = "1.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c520e05135d6e763148b6426a837e239041653ba7becd2e538c076c738025fc" checksum = "9423e2b32f7a043629287a536f21951e8c6a82482d0acb1eeebfc90bc2225b22"
[[package]] [[package]]
name = "pem-rfc7468" name = "pem-rfc7468"
@@ -2213,13 +2216,25 @@ dependencies = [
[[package]] [[package]]
name = "pow_sha256" name = "pow_sha256"
version = "0.2.1" version = "0.3.1"
source = "git+https://github.com/mcaptcha/pow_sha256#36c48597b24eb8ea3cdb47f9676f44e1f5c22627" source = "git+https://github.com/mcaptcha/pow_sha256?tag=0.3.1#3b4e28706a8946987ba02f98e1f816d9fa156dad"
dependencies = [ dependencies = [
"bincode", "bincode",
"derive_builder 0.11.1", "derive_builder 0.11.1",
"num", "num",
"serde 1.0.140", "serde 1.0.143",
"sha2 0.10.2",
]
[[package]]
name = "pow_sha256"
version = "0.3.1"
source = "git+https://github.com/mcaptcha/pow_sha256#3b4e28706a8946987ba02f98e1f816d9fa156dad"
dependencies = [
"bincode",
"derive_builder 0.11.1",
"num",
"serde 1.0.143",
"sha2 0.10.2", "sha2 0.10.2",
] ]
@@ -2359,9 +2374,9 @@ dependencies = [
[[package]] [[package]]
name = "redox_syscall" name = "redox_syscall"
version = "0.2.13" version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a"
dependencies = [ dependencies = [
"bitflags", "bitflags",
] ]
@@ -2505,7 +2520,7 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366"
dependencies = [ dependencies = [
"semver 1.0.12", "semver 1.0.13",
] ]
[[package]] [[package]]
@@ -2523,9 +2538,9 @@ dependencies = [
[[package]] [[package]]
name = "ryu" name = "ryu"
version = "1.0.10" version = "1.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09"
[[package]] [[package]]
name = "sailfish" name = "sailfish"
@@ -2550,7 +2565,7 @@ dependencies = [
"memchr", "memchr",
"proc-macro2", "proc-macro2",
"quote", "quote",
"serde 1.0.140", "serde 1.0.143",
"syn", "syn",
"toml", "toml",
] ]
@@ -2634,9 +2649,9 @@ dependencies = [
[[package]] [[package]]
name = "semver" name = "semver"
version = "1.0.12" version = "1.0.13"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a2333e6df6d6598f2b1974829f853c2b4c5f4a6e503c10af918081aa6f8564e1" checksum = "93f6841e709003d68bb2deee8c343572bf446003ec20a583e76f7b15cebf3711"
[[package]] [[package]]
name = "semver-parser" name = "semver-parser"
@@ -2652,9 +2667,9 @@ checksum = "9dad3f759919b92c3068c696c15c3d17238234498bbdcc80f2c469606f948ac8"
[[package]] [[package]]
name = "serde" name = "serde"
version = "1.0.140" version = "1.0.143"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc855a42c7967b7c369eb5860f7164ef1f6f81c20c7cc1141f2a604e18723b03" checksum = "53e8e5d5b70924f74ff5c6d64d9a5acd91422117c60f48c4e07855238a254553"
dependencies = [ dependencies = [
"serde_derive", "serde_derive",
] ]
@@ -2673,9 +2688,9 @@ dependencies = [
[[package]] [[package]]
name = "serde_derive" name = "serde_derive"
version = "1.0.140" version = "1.0.143"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6f2122636b9fe3b81f1cb25099fcf2d3f542cdb1d45940d56c713158884a05da" checksum = "d3d8e8de557aee63c26b85b947f5e59b690d0454c753f3adeb5cd7835ab88391"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@@ -2684,13 +2699,13 @@ dependencies = [
[[package]] [[package]]
name = "serde_json" name = "serde_json"
version = "1.0.82" version = "1.0.83"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "82c2c1fdcd807d1098552c5b9a36e425e42e9fbd7c6a37a8425f390f781f7fa7" checksum = "38dd04e3c8279e75b31ef29dbdceebfe5ad89f4d0937213c53f7d49d01b3d5a7"
dependencies = [ dependencies = [
"itoa 1.0.2", "itoa 1.0.3",
"ryu", "ryu",
"serde 1.0.140", "serde 1.0.143",
] ]
[[package]] [[package]]
@@ -2700,9 +2715,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd"
dependencies = [ dependencies = [
"form_urlencoded", "form_urlencoded",
"itoa 1.0.2", "itoa 1.0.3",
"ryu", "ryu",
"serde 1.0.140", "serde 1.0.143",
] ]
[[package]] [[package]]
@@ -2871,7 +2886,7 @@ dependencies = [
"hkdf", "hkdf",
"hmac", "hmac",
"indexmap", "indexmap",
"itoa 1.0.2", "itoa 1.0.3",
"libc", "libc",
"log", "log",
"md-5", "md-5",
@@ -2883,7 +2898,7 @@ dependencies = [
"rand", "rand",
"rsa", "rsa",
"rustls", "rustls",
"serde 1.0.140", "serde 1.0.143",
"serde_json", "serde_json",
"sha-1", "sha-1",
"sha2 0.10.2", "sha2 0.10.2",
@@ -2913,7 +2928,7 @@ dependencies = [
"once_cell", "once_cell",
"proc-macro2", "proc-macro2",
"quote", "quote",
"serde 1.0.140", "serde 1.0.143",
"serde_json", "serde_json",
"sha2 0.10.2", "sha2 0.10.2",
"sqlx-core", "sqlx-core",
@@ -2971,7 +2986,7 @@ checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"serde 1.0.140", "serde 1.0.143",
"serde_derive", "serde_derive",
"syn", "syn",
] ]
@@ -2985,7 +3000,7 @@ dependencies = [
"base-x", "base-x",
"proc-macro2", "proc-macro2",
"quote", "quote",
"serde 1.0.140", "serde 1.0.143",
"serde_derive", "serde_derive",
"serde_json", "serde_json",
"sha1 0.6.1", "sha1 0.6.1",
@@ -3009,7 +3024,7 @@ dependencies = [
"parking_lot 0.12.1", "parking_lot 0.12.1",
"phf_shared", "phf_shared",
"precomputed-hash", "precomputed-hash",
"serde 1.0.140", "serde 1.0.143",
] ]
[[package]] [[package]]
@@ -3093,18 +3108,18 @@ dependencies = [
[[package]] [[package]]
name = "thiserror" name = "thiserror"
version = "1.0.31" version = "1.0.32"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" checksum = "f5f6586b7f764adc0231f4c79be7b920e766bb2f3e51b3661cdb263828f19994"
dependencies = [ dependencies = [
"thiserror-impl", "thiserror-impl",
] ]
[[package]] [[package]]
name = "thiserror-impl" name = "thiserror-impl"
version = "1.0.31" version = "1.0.32"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" checksum = "12bafc5b54507e0149cdf1b145a5d80ab80a90bcd9275df43d4fff68460f6c21"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@@ -3128,11 +3143,11 @@ dependencies = [
[[package]] [[package]]
name = "time" name = "time"
version = "0.3.11" version = "0.3.13"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72c91f41dcb2f096c05f0873d667dceec1087ce5bcf984ec8ffb19acddbb3217" checksum = "db76ff9fa4b1458b3c7f077f3ff9887394058460d21e634355b273aaf11eea45"
dependencies = [ dependencies = [
"itoa 1.0.2", "itoa 1.0.3",
"libc", "libc",
"num_threads", "num_threads",
"time-macros 0.2.4", "time-macros 0.2.4",
@@ -3184,9 +3199,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
[[package]] [[package]]
name = "tokio" name = "tokio"
version = "1.20.0" version = "1.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57aec3cfa4c296db7255446efb4928a6be304b431a806216105542a67b6ca82e" checksum = "7a8325f63a7d4774dd041e363b2409ed1c5cbbd0f867795e661df066b2b0a581"
dependencies = [ dependencies = [
"autocfg", "autocfg",
"bytes", "bytes",
@@ -3268,14 +3283,14 @@ version = "0.5.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7"
dependencies = [ dependencies = [
"serde 1.0.140", "serde 1.0.143",
] ]
[[package]] [[package]]
name = "tracing" name = "tracing"
version = "0.1.35" version = "0.1.36"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a400e31aa60b9d44a52a8ee0343b5b18566b03a8321e0d321f695cf56e940160" checksum = "2fce9567bd60a67d08a16488756721ba392f24f29006402881e43b19aac64307"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"log", "log",
@@ -3285,9 +3300,9 @@ dependencies = [
[[package]] [[package]]
name = "tracing-core" name = "tracing-core"
version = "0.1.28" version = "0.1.29"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b7358be39f2f274f322d2aaed611acc57f382e8eb1e5b48cb9ae30933495ce7" checksum = "5aeea4303076558a00714b823f9ad67d58a3bbda1df83d8827d21193156e22f7"
dependencies = [ dependencies = [
"once_cell", "once_cell",
] ]
@@ -3366,14 +3381,14 @@ dependencies = [
"idna", "idna",
"matches", "matches",
"percent-encoding", "percent-encoding",
"serde 1.0.140", "serde 1.0.143",
] ]
[[package]] [[package]]
name = "urlencoding" name = "urlencoding"
version = "2.1.0" version = "2.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68b90931029ab9b034b300b797048cf23723400aa757e8a2bfb9d748102f9821" checksum = "e8db7427f936968176eaa7cdf81b7f98b980b18495ec28f1b5791ac3bfe3eea9"
[[package]] [[package]]
name = "utf-8" name = "utf-8"
@@ -3390,7 +3405,7 @@ dependencies = [
"idna", "idna",
"lazy_static", "lazy_static",
"regex", "regex",
"serde 1.0.140", "serde 1.0.143",
"serde_derive", "serde_derive",
"serde_json", "serde_json",
"url", "url",
@@ -3454,9 +3469,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
[[package]] [[package]]
name = "wasm-bindgen" name = "wasm-bindgen"
version = "0.2.81" version = "0.2.82"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7c53b543413a17a202f4be280a7e5c62a1c69345f5de525ee64f8cfdbc954994" checksum = "fc7652e3f6c4706c8d9cd54832c4a4ccb9b5336e2c3bd154d5cccfbf1c1f5f7d"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"wasm-bindgen-macro", "wasm-bindgen-macro",
@@ -3464,13 +3479,13 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-backend" name = "wasm-bindgen-backend"
version = "0.2.81" version = "0.2.82"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5491a68ab4500fa6b4d726bd67408630c3dbe9c4fe7bda16d5c82a1fd8c7340a" checksum = "662cd44805586bd52971b9586b1df85cdbbd9112e4ef4d8f41559c334dc6ac3f"
dependencies = [ dependencies = [
"bumpalo", "bumpalo",
"lazy_static",
"log", "log",
"once_cell",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn",
@@ -3479,9 +3494,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-macro" name = "wasm-bindgen-macro"
version = "0.2.81" version = "0.2.82"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c441e177922bc58f1e12c022624b6216378e5febc2f0533e41ba443d505b80aa" checksum = "b260f13d3012071dfb1512849c033b1925038373aea48ced3012c09df952c602"
dependencies = [ dependencies = [
"quote", "quote",
"wasm-bindgen-macro-support", "wasm-bindgen-macro-support",
@@ -3489,9 +3504,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-macro-support" name = "wasm-bindgen-macro-support"
version = "0.2.81" version = "0.2.82"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7d94ac45fcf608c1f45ef53e748d35660f168490c10b23704c7779ab8f5c3048" checksum = "5be8e654bdd9b79216c2929ab90721aa82faf65c48cdf08bdc4e7f51357b80da"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@@ -3502,15 +3517,15 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-shared" name = "wasm-bindgen-shared"
version = "0.2.81" version = "0.2.82"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a89911bd99e5f3659ec4acf9c4d93b0a90fe4a2a11f15328472058edc5261be" checksum = "6598dd0bd3c7d51095ff6531a5b23e02acdc81804e30d8f07afb77b7215a140a"
[[package]] [[package]]
name = "web-sys" name = "web-sys"
version = "0.3.58" version = "0.3.59"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2fed94beee57daf8dd7d51f2b15dc2bcde92d7a72304cdf662a4371008b71b90" checksum = "ed055ab27f941423197eb86b2035720b1a3ce40504df082cac2ecc6ed73335a1"
dependencies = [ dependencies = [
"js-sys", "js-sys",
"wasm-bindgen", "wasm-bindgen",
@@ -3630,9 +3645,9 @@ dependencies = [
[[package]] [[package]]
name = "zeroize" name = "zeroize"
version = "1.5.6" version = "1.5.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "20b578acffd8516a6c3f2a1bdefc1ec37e547bb4e0fb8b6b01a4cafc886b4442" checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f"
[[package]] [[package]]
name = "zstd" name = "zstd"

View File

@@ -59,6 +59,7 @@ log = "0.4"
lazy_static = "1.4" lazy_static = "1.4"
#libmcaptcha = { version = "0.2.2", git = "https://github.com/mCaptcha/libmcaptcha", features = ["full"], tag ="0.2.2" }
libmcaptcha = { branch = "master", git = "https://github.com/mCaptcha/libmcaptcha", features = ["full"] } libmcaptcha = { branch = "master", git = "https://github.com/mCaptcha/libmcaptcha", features = ["full"] }
#libmcaptcha = { path = "../libmcaptcha", features = ["full"]} #libmcaptcha = { path = "../libmcaptcha", features = ["full"]}
@@ -68,6 +69,8 @@ sailfish = "0.4.0"
mime = "0.3.16" mime = "0.3.16"
num_cpus = "1.13.1"
lettre = { version = "0.10.0-rc.3", features = [ lettre = { version = "0.10.0-rc.3", features = [
"builder", "builder",
"tokio1", "tokio1",
@@ -101,7 +104,7 @@ serde_json = "1"
sqlx = { version = "0.5.13", features = [ "runtime-actix-rustls", "postgres", "time", "offline", "mysql" ] } sqlx = { version = "0.5.13", features = [ "runtime-actix-rustls", "postgres", "time", "offline", "mysql" ] }
[dev-dependencies] [dev-dependencies]
pow_sha256 = { version = "0.2.1", git = "https://github.com/mcaptcha/pow_sha256" } pow_sha256 = { version = "0.3.1", git = "https://github.com/mcaptcha/pow_sha256", tag="0.3.1" }
awc = "3.0.0" awc = "3.0.0"

View File

@@ -38,6 +38,7 @@ COPY --from=cacher /src/target target
#COPY --from=cacher /src/db/db-migrations/target /src/db/db-migrations/target #COPY --from=cacher /src/db/db-migrations/target /src/db/db-migrations/target
#COPY --from=cacher /src/utils/cache-bust/target /src/utils/cache-bust/target #COPY --from=cacher /src/utils/cache-bust/target /src/utils/cache-bust/target
COPY --from=frontend /src/static/cache/bundle/ /src/static/cache/bundle/ COPY --from=frontend /src/static/cache/bundle/ /src/static/cache/bundle/
COPY --from=frontend /src/docs/openapi/dist/ /src/docs/openapi/dist/
RUN cargo --version RUN cargo --version
RUN make cache-bust RUN make cache-bust
RUN cargo build --release RUN cargo build --release

View File

@@ -11,7 +11,7 @@ cookie_secret = "Zae0OOxf^bOJ#zN^&k7VozgW&QAx%n02TQFXpRMG4cCU0xMzgu3dna@tQ9dvc&T
# The port at which you want authentication to listen to # The port at which you want authentication to listen to
# takes a number, choose from 1000-10000 if you dont know what you are doing # takes a number, choose from 1000-10000 if you dont know what you are doing
port = 7000 port = 7000
#IP address. Enter 0.0.0.0 to listen on all availale addresses #IP address. Enter 0.0.0.0 to listen on all available addresses
ip= "0.0.0.0" ip= "0.0.0.0"
# enter your hostname, eg: example.com # enter your hostname, eg: example.com
domain = "localhost" domain = "localhost"
@@ -28,6 +28,8 @@ salt = "asdl;kjfhjawehfpa;osdkjasdvjaksndfpoanjdfainsdfaijdsfajlkjdsaf;ajsdfwero
# garbage collection period to manage mCaptcha system # garbage collection period to manage mCaptcha system
# leave untouched if you don't know what you are doing # leave untouched if you don't know what you are doing
gc = 30 gc = 30
runners = 4
queue_length = 2000
enable_stats = true enable_stats = true
[captcha.default_difficulty_strategy] [captcha.default_difficulty_strategy]

View File

@@ -13,7 +13,8 @@ async-trait = "0.1.51"
thiserror = "1.0.30" thiserror = "1.0.30"
serde = { version = "1", features = ["derive"]} serde = { version = "1", features = ["derive"]}
url = { version = "2.2.2", features = ["serde"] } url = { version = "2.2.2", features = ["serde"] }
libmcaptcha = { branch = "master", git = "https://github.com/mCaptcha/libmcaptcha", features = ["minimal"], default-features = false } #libmcaptcha = { version = "0.2.2", git = "https://github.com/mCaptcha/libmcaptcha", features = ["minimal"], default-features = false, tag = "0.2.2"}
libmcaptcha = { branch = "master", git = "https://github.com/mCaptcha/libmcaptcha", features = ["full"] }
[features] [features]
default = [] default = []

View File

@@ -26,7 +26,7 @@
//! //!
//! ## Organisation //! ## Organisation
//! //!
//! Database functionallity is divided accross various modules: //! Database functionality is divided across various modules:
//! //!
//! - [errors](crate::auth): error data structures used in this crate //! - [errors](crate::auth): error data structures used in this crate
//! - [ops](crate::ops): meta operations like connection pool creation, migrations and getting //! - [ops](crate::ops): meta operations like connection pool creation, migrations and getting
@@ -242,13 +242,13 @@ pub trait MCDatabase: std::marker::Send + std::marker::Sync + CloneSPDatabase {
/// record PoWConfig confirms /// record PoWConfig confirms
async fn record_confirm(&self, key: &str) -> DBResult<()>; async fn record_confirm(&self, key: &str) -> DBResult<()>;
/// featch PoWConfig fetches /// fetch PoWConfig fetches
async fn fetch_config_fetched(&self, user: &str, key: &str) -> DBResult<Vec<i64>>; async fn fetch_config_fetched(&self, user: &str, key: &str) -> DBResult<Vec<i64>>;
/// featch PoWConfig solves /// fetch PoWConfig solves
async fn fetch_solve(&self, user: &str, key: &str) -> DBResult<Vec<i64>>; async fn fetch_solve(&self, user: &str, key: &str) -> DBResult<Vec<i64>>;
/// featch PoWConfig confirms /// fetch PoWConfig confirms
async fn fetch_confirm(&self, user: &str, key: &str) -> DBResult<Vec<i64>>; async fn fetch_confirm(&self, user: &str, key: &str) -> DBResult<Vec<i64>>;
} }
@@ -287,7 +287,7 @@ pub struct AddNotification<'a> {
pub from: &'a str, pub from: &'a str,
/// heading of the notification /// heading of the notification
pub heading: &'a str, pub heading: &'a str,
/// mesage of the notification /// message of the notification
pub message: &'a str, pub message: &'a str,
} }
@@ -298,12 +298,12 @@ pub struct TrafficPattern {
pub avg_traffic: u32, pub avg_traffic: u32,
/// the peak traffic that the user's website can handle /// the peak traffic that the user's website can handle
pub peak_sustainable_traffic: u32, pub peak_sustainable_traffic: u32,
/// trafic that bought the user's website down; optional /// traffic that bought the user's website down; optional
pub broke_my_site_traffic: Option<u32>, pub broke_my_site_traffic: Option<u32>,
} }
#[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
/// data requried to create new captcha /// data required to create new captcha
pub struct CreateCaptcha<'a> { pub struct CreateCaptcha<'a> {
/// cool down duration /// cool down duration
pub duration: i32, pub duration: i32,

View File

@@ -30,7 +30,7 @@ pub trait GetConnection {
async fn get_conn(&self) -> DBResult<Self::Conn>; async fn get_conn(&self) -> DBResult<Self::Conn>;
} }
/// Create databse connection /// Create database connection
#[async_trait] #[async_trait]
pub trait Connect { pub trait Connect {
/// database specific pool-type /// database specific pool-type

View File

@@ -33,7 +33,7 @@ pub async fn database_works<'a, T: MCDatabase>(
db.delete_user(p.username).await.unwrap(); db.delete_user(p.username).await.unwrap();
assert!( assert!(
!db.username_exists(p.username).await.unwrap(), !db.username_exists(p.username).await.unwrap(),
"user is deleted so username shouldn't exsit" "user is deleted so username shouldn't exist"
); );
} }
@@ -89,11 +89,11 @@ pub async fn database_works<'a, T: MCDatabase>(
// testing email exists // testing email exists
assert!( assert!(
db.email_exists(p.email.as_ref().unwrap()).await.unwrap(), db.email_exists(p.email.as_ref().unwrap()).await.unwrap(),
"user is registered so email should exsit" "user is registered so email should exist"
); );
assert!( assert!(
db.username_exists(p.username).await.unwrap(), db.username_exists(p.username).await.unwrap(),
"user is registered so username should exsit" "user is registered so username should exist"
); );
// update password test. setting password = username // update password test. setting password = username
@@ -124,7 +124,7 @@ pub async fn database_works<'a, T: MCDatabase>(
db.delete_user(p.email.as_ref().unwrap()).await.unwrap(); db.delete_user(p.email.as_ref().unwrap()).await.unwrap();
assert!( assert!(
!db.username_exists(p.email.as_ref().unwrap()).await.unwrap(), !db.username_exists(p.email.as_ref().unwrap()).await.unwrap(),
"user is deleted so username shouldn't exsit" "user is deleted so username shouldn't exist"
); );
// register with email = None // register with email = None
@@ -133,11 +133,11 @@ pub async fn database_works<'a, T: MCDatabase>(
db.register(&p2).await.unwrap(); db.register(&p2).await.unwrap();
assert!( assert!(
db.username_exists(p2.username).await.unwrap(), db.username_exists(p2.username).await.unwrap(),
"user is registered so username should exsit" "user is registered so username should exist"
); );
assert!( assert!(
!db.email_exists(p.email.as_ref().unwrap()).await.unwrap(), !db.email_exists(p.email.as_ref().unwrap()).await.unwrap(),
"user registration with email is deleted; so email shouldn't exsit" "user registration with email is deleted; so email shouldn't exist"
); );
// testing get_email = None // testing get_email = None
@@ -155,7 +155,7 @@ pub async fn database_works<'a, T: MCDatabase>(
); );
assert!( assert!(
db.email_exists(p.email.as_ref().unwrap()).await.unwrap(), db.email_exists(p.email.as_ref().unwrap()).await.unwrap(),
"user was with empty email but email is set; so email should exsit" "user was with empty email but email is set; so email should exist"
); );
/* /*

View File

@@ -35,7 +35,7 @@ pub struct Database {
/// Use an existing database pool /// Use an existing database pool
pub struct Conn(pub MySqlPool); pub struct Conn(pub MySqlPool);
/// Connect to databse /// Connect to database
pub enum ConnectionOptions { pub enum ConnectionOptions {
/// fresh connection /// fresh connection
Fresh(Fresh), Fresh(Fresh),
@@ -73,9 +73,6 @@ impl Connect for ConnectionOptions {
if fresh.disable_logging { if fresh.disable_logging {
connect_options.disable_statement_logging(); connect_options.disable_statement_logging();
} }
sqlx::mysql::MySqlConnectOptions::from_str(&fresh.url)
.unwrap()
.disable_statement_logging();
fresh fresh
.pool_options .pool_options
.connect_with(connect_options) .connect_with(connect_options)
@@ -824,7 +821,7 @@ impl MCDatabase for Database {
Ok(()) Ok(())
} }
/// featch PoWConfig fetches /// fetch PoWConfig fetches
async fn fetch_config_fetched(&self, user: &str, key: &str) -> DBResult<Vec<i64>> { async fn fetch_config_fetched(&self, user: &str, key: &str) -> DBResult<Vec<i64>> {
let records = sqlx::query_as!( let records = sqlx::query_as!(
Date, Date,
@@ -850,7 +847,7 @@ impl MCDatabase for Database {
Ok(Date::dates_to_unix(records)) Ok(Date::dates_to_unix(records))
} }
/// featch PoWConfig solves /// fetch PoWConfig solves
async fn fetch_solve(&self, user: &str, key: &str) -> DBResult<Vec<i64>> { async fn fetch_solve(&self, user: &str, key: &str) -> DBResult<Vec<i64>> {
let records = sqlx::query_as!( let records = sqlx::query_as!(
Date, Date,
@@ -874,7 +871,7 @@ impl MCDatabase for Database {
Ok(Date::dates_to_unix(records)) Ok(Date::dates_to_unix(records))
} }
/// featch PoWConfig confirms /// fetch PoWConfig confirms
async fn fetch_confirm(&self, user: &str, key: &str) -> DBResult<Vec<i64>> { async fn fetch_confirm(&self, user: &str, key: &str) -> DBResult<Vec<i64>> {
let records = sqlx::query_as!( let records = sqlx::query_as!(
Date, Date,

View File

@@ -35,7 +35,7 @@ pub struct Database {
/// Use an existing database pool /// Use an existing database pool
pub struct Conn(pub PgPool); pub struct Conn(pub PgPool);
/// Connect to databse /// Connect to database
pub enum ConnectionOptions { pub enum ConnectionOptions {
/// fresh connection /// fresh connection
Fresh(Fresh), Fresh(Fresh),
@@ -73,9 +73,6 @@ impl Connect for ConnectionOptions {
if fresh.disable_logging { if fresh.disable_logging {
connect_options.disable_statement_logging(); connect_options.disable_statement_logging();
} }
sqlx::postgres::PgConnectOptions::from_str(&fresh.url)
.unwrap()
.disable_statement_logging();
fresh fresh
.pool_options .pool_options
.connect_with(connect_options) .connect_with(connect_options)
@@ -830,7 +827,7 @@ impl MCDatabase for Database {
Ok(()) Ok(())
} }
/// featch PoWConfig fetches /// fetch PoWConfig fetches
async fn fetch_config_fetched(&self, user: &str, key: &str) -> DBResult<Vec<i64>> { async fn fetch_config_fetched(&self, user: &str, key: &str) -> DBResult<Vec<i64>> {
let records = sqlx::query_as!( let records = sqlx::query_as!(
Date, Date,
@@ -856,7 +853,7 @@ impl MCDatabase for Database {
Ok(Date::dates_to_unix(records)) Ok(Date::dates_to_unix(records))
} }
/// featch PoWConfig solves /// fetch PoWConfig solves
async fn fetch_solve(&self, user: &str, key: &str) -> DBResult<Vec<i64>> { async fn fetch_solve(&self, user: &str, key: &str) -> DBResult<Vec<i64>> {
let records = sqlx::query_as!( let records = sqlx::query_as!(
Date, Date,
@@ -880,7 +877,7 @@ impl MCDatabase for Database {
Ok(Date::dates_to_unix(records)) Ok(Date::dates_to_unix(records))
} }
/// featch PoWConfig confirms /// fetch PoWConfig confirms
async fn fetch_confirm(&self, user: &str, key: &str) -> DBResult<Vec<i64>> { async fn fetch_confirm(&self, user: &str, key: &str) -> DBResult<Vec<i64>> {
let records = sqlx::query_as!( let records = sqlx::query_as!(
Date, Date,

View File

@@ -7,12 +7,12 @@ services:
- 7000:7000 - 7000:7000
environment: environment:
DATABASE_URL: postgres://postgres:password@mcaptcha_postgres:5432/postgres # set password at placeholder DATABASE_URL: postgres://postgres:password@mcaptcha_postgres:5432/postgres # set password at placeholder
MCAPTCHA_REDIS_URL: redis://mcaptcha-redis/ MCAPTCHA_REDIS_URL: redis://mcaptcha_redis/
RUST_LOG: debug RUST_LOG: debug
PORT: 7000 PORT: 7000
depends_on: depends_on:
- mcaptcha-postgres - mcaptcha_postgres
- mcaptcha-redis - mcaptcha_redis
mcaptcha_postgres: mcaptcha_postgres:
image: postgres:13.2 image: postgres:13.2
@@ -22,7 +22,7 @@ services:
POSTGRES_PASSWORD: password # change password POSTGRES_PASSWORD: password # change password
PGDATA: /var/lib/postgresql/data/mcaptcha/ PGDATA: /var/lib/postgresql/data/mcaptcha/
mcaptcha-redis: mcaptcha_redis:
image: mcaptcha/cache:latest image: mcaptcha/cache:latest
volumes: volumes:

View File

@@ -107,7 +107,7 @@ I use mariadb also in Docker
2. Create create database user: 2. Create create database user:
```bash ```bash
docker create docker create \
-p 3306:3306 \ -p 3306:3306 \
--name some-mariadb \ --name some-mariadb \
--env MARIADB_USER=maria \ --env MARIADB_USER=maria \

121
scripts/publish.sh Executable file
View File

@@ -0,0 +1,121 @@
#!/bin/bash
# Copyright (C) 2022 Aravinth Manivannan <realaravinth@batsense.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# publish.sh: grab bin from docker container, pack, sign and upload
# $2: binary version
# $3: Docker img tag
# $4: dumbserve password
set -xEeuo pipefail
DUMBSERVE_USERNAME=mcaptcha
DUMBSERVE_PASSWORD=$4
DUMBSERVE_HOST="https://$DUMBSERVE_USERNAME:$DUMBSERVE_PASSWORD@dl.mcaptcha.org"
NAME=mcaptcha
KEY=0CBABF3084E84E867A76709750BE39D10ECE01FB
TMP_DIR=$(mktemp -d)
FILENAME="$NAME-$2-linux-amd64"
TARBALL=$FILENAME.tar.gz
TARGET_DIR="$TMP_DIR/$FILENAME/"
mkdir -p $TARGET_DIR
DOCKER_IMG="mcaptcha/$NAME:$3"
get_bin(){
echo "[*] Grabbing binary"
container_id=$(docker create $DOCKER_IMG)
docker cp $container_id:/usr/local/bin/$NAME $TARGET_DIR/
docker rm -v $container_id
}
copy() {
echo "[*] Copying dist assets"
cp README.md $TARGET_DIR
cp LICENSE.md $TARGET_DIR
cp CHANGELOG.md $TARGET_DIR
cp docker-compose.yml $TARGET_DIR
mkdir $TARGET_DIR/docs
cp docs/DEPLOYMENT.md $TARGET_DIR/docs
cp docs/CONFIGURATION.md $TARGET_DIR/docs
get_bin
}
pack() {
echo "[*] Creating dist tarball"
pushd $TMP_DIR
tar -cvzf $TARBALL $FILENAME
popd
}
checksum() {
echo "[*] Generating dist tarball checksum"
pushd $TMP_DIR
sha256sum $TARBALL > $TARBALL.sha256
popd
}
sign() {
echo "[*] Signing dist tarball checksum"
pushd $TMP_DIR
export GPG_TTY=$(tty)
gpg --verbose \
--pinentry-mode loopback \
--batch --yes \
--passphrase $GPG_PASSWORD \
--local-user $KEY \
--output $TARBALL.asc \
--sign --detach \
--armor $TARBALL
popd
}
delete_dir() {
curl --location --request DELETE "$DUMBSERVE_HOST/api/v1/files/delete" \
--header 'Content-Type: application/json' \
--data-raw "{
\"path\": \"$1\"
}"
}
upload_dist() {
upload_dir="mCaptcha/$1"
delete_dir $upload_dir
pushd $TMP_DIR
for file in $TARBALL $TARBALL.asc $TARBALL.sha256
do
curl -v \
-F upload=@$file \
"$DUMBSERVE_HOST/api/v1/files/upload?path=$upload_dir"
done
popd
}
publish() {
copy
pack
checksum
sign
upload_dist $2
}
$1 $@

View File

@@ -51,7 +51,7 @@ pub async fn uname_email_exists_works(data: ArcData) {
let cookies = get_cookie!(signin_resp); let cookies = get_cookie!(signin_resp);
let app = get_app!(data).await; let app = get_app!(data).await;
// chech if get user secret works // check if get user secret works
let resp = test::call_service( let resp = test::call_service(
&app, &app,
test::TestRequest::get() test::TestRequest::get()
@@ -62,7 +62,7 @@ pub async fn uname_email_exists_works(data: ArcData) {
.await; .await;
assert_eq!(resp.status(), StatusCode::OK); assert_eq!(resp.status(), StatusCode::OK);
// chech if get user secret works // check if get user secret works
let resp = test::call_service( let resp = test::call_service(
&app, &app,
test::TestRequest::post() test::TestRequest::post()
@@ -178,7 +178,7 @@ pub async fn email_udpate_password_validation_del_userworks(data: ArcData) {
) )
.await; .await;
// wrong password while deleteing account // wrong password while deleting account
let mut payload = Password { let mut payload = Password {
password: NAME.into(), password: NAME.into(),
}; };

View File

@@ -86,7 +86,7 @@ pub mod runners {
pub password: String, pub password: String,
} }
/// returns Ok(()) when everything checks out and the user is authenticated. Erros otherwise /// returns Ok(()) when everything checks out and the user is authenticated. Errors otherwise
pub async fn login_runner(payload: Login, data: &AppData) -> ServiceResult<String> { pub async fn login_runner(payload: Login, data: &AppData) -> ServiceResult<String> {
use argon2_creds::Config; use argon2_creds::Config;

View File

@@ -56,7 +56,7 @@ pub struct TrafficPatternRequest {
pub avg_traffic: u32, pub avg_traffic: u32,
/// the peak traffic that the user's website can handle /// the peak traffic that the user's website can handle
pub peak_sustainable_traffic: u32, pub peak_sustainable_traffic: u32,
/// trafic that bought the user's website down; optional /// traffic that bought the user's website down; optional
pub broke_my_site_traffic: Option<u32>, pub broke_my_site_traffic: Option<u32>,
/// Captcha description /// Captcha description
pub description: String, pub description: String,

View File

@@ -191,7 +191,7 @@ mod tests {
let updated_token: MCaptchaDetails = let updated_token: MCaptchaDetails =
test::read_body_json(update_token_resp).await; test::read_body_json(update_token_resp).await;
// get levels with udpated key // get levels with updated key
let get_token_resp = test::call_service( let get_token_resp = test::call_service(
&app, &app,
post_request!(&updated_token, ROUTES.captcha.get) post_request!(&updated_token, ROUTES.captcha.get)
@@ -199,7 +199,7 @@ mod tests {
.to_request(), .to_request(),
) )
.await; .await;
// if updated key doesn't exist in databse, a non 200 result will bereturned // if updated key doesn't exist in database, a non 200 result will bereturned
assert_eq!(get_token_resp.status(), StatusCode::OK); assert_eq!(get_token_resp.status(), StatusCode::OK);
// get stats // get stats
@@ -211,7 +211,7 @@ mod tests {
.to_request(), .to_request(),
) )
.await; .await;
// if updated key doesn't exist in databse, a non 200 result will bereturned // if updated key doesn't exist in database, a non 200 result will bereturned
assert_eq!(get_statis_resp.status(), StatusCode::OK); assert_eq!(get_statis_resp.status(), StatusCode::OK);
} }
} }

View File

@@ -46,7 +46,7 @@ pub mod routes {
} }
} }
/// emmits build details of the bninary /// emits build details of the bninary
#[my_codegen::get(path = "crate::V1_API_ROUTES.meta.build_details")] #[my_codegen::get(path = "crate::V1_API_ROUTES.meta.build_details")]
async fn build_details() -> impl Responder { async fn build_details() -> impl Responder {
let build = BuildDetails { let build = BuildDetails {

View File

@@ -42,7 +42,7 @@ pub async fn add_notification(
id: Identity, id: Identity,
) -> ServiceResult<impl Responder> { ) -> ServiceResult<impl Responder> {
let sender = id.identity().unwrap(); let sender = id.identity().unwrap();
// TODO handle error where payload.to doesnt exist // TODO handle error where payload.to doesn't exist
let p = AddNotification { let p = AddNotification {
from: &sender, from: &sender,
@@ -98,7 +98,7 @@ pub mod tests {
let msg = AddNotificationRequest { let msg = AddNotificationRequest {
to: NAME2.into(), to: NAME2.into(),
heading: "Test notification".into(), heading: "Test notification".into(),
message: "Testeing notifications with a dummy message".into(), message: "Testing notifications with a dummy message".into(),
}; };
let send_notification_resp = test::call_service( let send_notification_resp = test::call_service(

View File

@@ -68,7 +68,7 @@ pub async fn get_notification(
id: Identity, id: Identity,
) -> ServiceResult<impl Responder> { ) -> ServiceResult<impl Responder> {
let receiver = id.identity().unwrap(); let receiver = id.identity().unwrap();
// TODO handle error where payload.to doesnt exist // TODO handle error where payload.to doesn't exist
let notifications = data.db.get_all_unread_notifications(&receiver).await?; let notifications = data.db.get_all_unread_notifications(&receiver).await?;
let notifications = NotificationResp::from_notifications(notifications); let notifications = NotificationResp::from_notifications(notifications);

View File

@@ -38,7 +38,7 @@ pub async fn mark_read(
id: Identity, id: Identity,
) -> ServiceResult<impl Responder> { ) -> ServiceResult<impl Responder> {
let receiver = id.identity().unwrap(); let receiver = id.identity().unwrap();
// TODO handle error where payload.to doesnt exist // TODO handle error where payload.to doesn't exist
// TODO get payload from path /api/v1/notifications/{id}/read" // TODO get payload from path /api/v1/notifications/{id}/read"
data.db data.db

View File

@@ -16,6 +16,7 @@
*/ */
//! PoW Verification module //! PoW Verification module
use actix_web::HttpRequest;
use actix_web::{web, HttpResponse, Responder}; use actix_web::{web, HttpResponse, Responder};
use libmcaptcha::pow::Work; use libmcaptcha::pow::Work;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
@@ -37,11 +38,21 @@ pub struct ValidationToken {
/// if verification is successful /// if verification is successful
#[my_codegen::post(path = "V1_API_ROUTES.pow.verify_pow()")] #[my_codegen::post(path = "V1_API_ROUTES.pow.verify_pow()")]
pub async fn verify_pow( pub async fn verify_pow(
req: HttpRequest,
payload: web::Json<Work>, payload: web::Json<Work>,
data: AppData, data: AppData,
) -> ServiceResult<impl Responder> { ) -> ServiceResult<impl Responder> {
#[cfg(not(test))]
let ip = req.connection_info().peer_addr().unwrap().to_string();
// From actix-web docs:
// Will only return None when called in unit tests unless TestRequest::peer_addr is used.
//
// ref: https://docs.rs/actix-web/latest/actix_web/struct.HttpRequest.html#method.peer_addr
#[cfg(test)]
let ip = "127.0.1.1".into();
let key = payload.key.clone(); let key = payload.key.clone();
let res = data.captcha.verify_pow(payload.into_inner()).await?; let res = data.captcha.verify_pow(payload.into_inner(), ip).await?;
data.stats.record_solve(&data, &key).await?; data.stats.record_solve(&data, &key).await?;
let payload = ValidationToken { token: res }; let payload = ValidationToken { token: res };
Ok(HttpResponse::Ok().json(payload)) Ok(HttpResponse::Ok().json(payload))
@@ -135,7 +146,7 @@ pub mod tests {
// .await; // .await;
// assert_eq!(pow_config_resp.status(), StatusCode::OK); // assert_eq!(pow_config_resp.status(), StatusCode::OK);
// I'm not checking for errors because changing work.result triggered // I'm not checking for errors because changing work.result triggered
// InssuficientDifficulty, which is possible becuase libmcaptcha calculates // InssuficientDifficulty, which is possible because libmcaptcha calculates
// difficulty with the submitted result. Besides, this endpoint is merely // difficulty with the submitted result. Besides, this endpoint is merely
// propagating errors from libmcaptcha and libmcaptcha has tests covering the // propagating errors from libmcaptcha and libmcaptcha has tests covering the
// pow aspects ¯\_(ツ)_/¯ // pow aspects ¯\_(ツ)_/¯

View File

@@ -47,7 +47,7 @@ impl From<VerifyCaptchaResultPayload> for VerifyCaptchaResult {
// API keys are mcaptcha actor names // API keys are mcaptcha actor names
/// route hander that validates a PoW solution token /// route handler that validates a PoW solution token
#[my_codegen::post(path = "V1_API_ROUTES.pow.validate_captcha_token()")] #[my_codegen::post(path = "V1_API_ROUTES.pow.validate_captcha_token()")]
pub async fn validate_captcha_token( pub async fn validate_captcha_token(
payload: web::Json<VerifyCaptchaResultPayload>, payload: web::Json<VerifyCaptchaResultPayload>,

View File

@@ -69,7 +69,7 @@ macro_rules! enum_system_wrapper {
/// Represents mCaptcha cache and master system. /// Represents mCaptcha cache and master system.
/// When Redis is configured, [SystemGroup::Redis] is used and /// When Redis is configured, [SystemGroup::Redis] is used and
/// in its absense, [SystemGroup::Embedded] is used /// in its absence, [SystemGroup::Embedded] is used
pub enum SystemGroup { pub enum SystemGroup {
Embedded(System<HashCache, EmbeddedMaster>), Embedded(System<HashCache, EmbeddedMaster>),
Redis(System<RedisCache, RedisMaster>), Redis(System<RedisCache, RedisMaster>),
@@ -83,7 +83,12 @@ impl SystemGroup {
enum_system_wrapper!(get_pow, String, CaptchaResult<Option<PoWConfig>>); enum_system_wrapper!(get_pow, String, CaptchaResult<Option<PoWConfig>>);
// utility function to verify [Work] // utility function to verify [Work]
enum_system_wrapper!(verify_pow, Work, CaptchaResult<String>); pub async fn verify_pow(&self, msg: Work, ip: String) -> CaptchaResult<String> {
match self {
Self::Embedded(val) => val.verify_pow(msg, ip).await,
Self::Redis(val) => val.verify_pow(msg, ip).await,
}
}
// utility function to validate verification tokens // utility function to validate verification tokens
enum_system_wrapper!( enum_system_wrapper!(
@@ -111,7 +116,18 @@ impl SystemGroup {
.build() .build()
.unwrap(); .unwrap();
SystemBuilder::default().pow(pow).cache(c).master(m).build() let runners = if let Some(runners) = s.captcha.runners {
runners
} else {
num_cpus::get_physical()
};
SystemBuilder::default()
.pow(pow)
.cache(c)
.master(m)
.runners(runners)
.queue_length(s.captcha.queue_length)
.build()
} }
// read settings, if Redis is configured then produce a Redis mCaptcha cache // read settings, if Redis is configured then produce a Redis mCaptcha cache

View File

@@ -111,7 +111,7 @@ mod tests {
use super::*; use super::*;
use crate::tests::*; use crate::tests::*;
const DURATION: u64 = 5; const DURATION: u64 = 25;
#[actix_rt::test] #[actix_rt::test]
async fn demo_account_works_pg() { async fn demo_account_works_pg() {

View File

@@ -71,7 +71,7 @@ const PAGE: &str = "Notifications";
)] )]
pub async fn notifications(data: AppData, id: Identity) -> PageResult<impl Responder> { pub async fn notifications(data: AppData, id: Identity) -> PageResult<impl Responder> {
let receiver = id.identity().unwrap(); let receiver = id.identity().unwrap();
// TODO handle error where payload.to doesnt exist // TODO handle error where payload.to doesn't exist
// let mut notifications = runner::get_notification(&data, &receiver).await?; // let mut notifications = runner::get_notification(&data, &receiver).await?;
let mut notifications = data.db.get_all_unread_notifications(&receiver).await?; let mut notifications = data.db.get_all_unread_notifications(&receiver).await?;

View File

@@ -14,8 +14,8 @@
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
use std::env;
use std::path::Path; use std::path::Path;
use std::{env, fs};
use config::{Config, ConfigError, Environment, File}; use config::{Config, ConfigError, Environment, File};
use derive_more::Display; use derive_more::Display;
@@ -37,6 +37,8 @@ pub struct Server {
pub struct Captcha { pub struct Captcha {
pub salt: String, pub salt: String,
pub gc: u64, pub gc: u64,
pub runners: Option<usize>,
pub queue_length: usize,
pub enable_stats: bool, pub enable_stats: bool,
pub default_difficulty_strategy: DefaultDifficultyStrategy, pub default_difficulty_strategy: DefaultDifficultyStrategy,
} }
@@ -78,7 +80,7 @@ impl Server {
//impl DatabaseBuilder { //impl DatabaseBuilder {
// #[cfg(not(tarpaulin_include))] // #[cfg(not(tarpaulin_include))]
// fn extract_database_url(url: &Url) -> Self { // fn extract_database_url(url: &Url) -> Self {
// debug!("Databse name: {}", url.path()); // debug!("Database name: {}", url.path());
// let mut path = url.path().split('/'); // let mut path = url.path().split('/');
// path.next(); // path.next();
// let name = path.next().expect("no database name").to_string(); // let name = path.next().expect("no database name").to_string();
@@ -150,25 +152,34 @@ impl Settings {
.expect("unable to set capatcha.enable_stats default config"); .expect("unable to set capatcha.enable_stats default config");
if let Ok(path) = env::var("MCAPTCHA_CONFIG") { if let Ok(path) = env::var("MCAPTCHA_CONFIG") {
s.merge(File::with_name(&path))?; let absolute_path = Path::new(&path).canonicalize().unwrap();
log::info!(
"Loading config file from {}",
absolute_path.to_str().unwrap()
);
s.merge(File::with_name(absolute_path.to_str().unwrap()))?;
} else if Path::new(CURRENT_DIR).exists() { } else if Path::new(CURRENT_DIR).exists() {
let absolute_path = fs::canonicalize(CURRENT_DIR).unwrap();
log::info!(
"Loading config file from {}",
absolute_path.to_str().unwrap()
);
// merging default config from file // merging default config from file
s.merge(File::with_name(CURRENT_DIR))?; s.merge(File::with_name(absolute_path.to_str().unwrap()))?;
} else if Path::new(ETC).exists() { } else if Path::new(ETC).exists() {
log::info!("{}", format!("Loading config file from {}", ETC));
s.merge(File::with_name(ETC))?; s.merge(File::with_name(ETC))?;
} else { } else {
log::warn!("configuration file not found"); log::warn!("Configuration file not found");
} }
s.merge(Environment::with_prefix("MCAPTCHA").separator("_"))?; s.merge(Environment::with_prefix("MCAPTCHA").separator("_"))?;
check_url(&s); check_url(&s);
match env::var("PORT") { if let Ok(val) = env::var("PORT") {
Ok(val) => { s.set("server.port", val).unwrap();
s.set("server.port", val).unwrap(); log::info!("Overriding [server].port with environment variable");
}
Err(e) => warn!("couldn't interpret PORT: {}", e),
} }
match env::var("DATABASE_URL") { match env::var("DATABASE_URL") {
@@ -178,6 +189,7 @@ impl Settings {
let database_type = DBType::from_url(&url).unwrap(); let database_type = DBType::from_url(&url).unwrap();
s.set("database.database_type", database_type.to_string()) s.set("database.database_type", database_type.to_string())
.unwrap(); .unwrap();
log::info!("Overriding [database].url and [database].database_type with environment variable");
} }
Err(e) => { Err(e) => {
set_database_url(&mut s); set_database_url(&mut s);
@@ -213,8 +225,11 @@ fn set_database_url(s: &mut Config) {
r"postgres://{}:{}@{}:{}/{}", r"postgres://{}:{}@{}:{}/{}",
s.get::<String>("database.username") s.get::<String>("database.username")
.expect("Couldn't access database username"), .expect("Couldn't access database username"),
s.get::<String>("database.password") urlencoding::encode(
.expect("Couldn't access database password"), s.get::<String>("database.password")
.expect("Couldn't access database password")
.as_str()
),
s.get::<String>("database.hostname") s.get::<String>("database.hostname")
.expect("Couldn't access database hostname"), .expect("Couldn't access database hostname"),
s.get::<String>("database.port") s.get::<String>("database.port")
@@ -223,7 +238,7 @@ fn set_database_url(s: &mut Config) {
.expect("Couldn't access database name") .expect("Couldn't access database name")
), ),
) )
.expect("Couldn't set databse url"); .expect("Couldn't set database url");
} }
//#[cfg(test)] //#[cfg(test)]

View File

@@ -49,6 +49,7 @@ pub mod pg {
pub async fn get_data() -> ArcData { pub async fn get_data() -> ArcData {
let url = env::var("POSTGRES_DATABASE_URL").unwrap(); let url = env::var("POSTGRES_DATABASE_URL").unwrap();
let mut settings = get_settings(); let mut settings = get_settings();
settings.captcha.runners = Some(1);
settings.database.url = url.clone(); settings.database.url = url.clone();
settings.database.database_type = DBType::Postgres; settings.database.database_type = DBType::Postgres;
let data = Data::new(&settings).await; let data = Data::new(&settings).await;
@@ -67,6 +68,7 @@ pub mod maria {
pub async fn get_data() -> ArcData { pub async fn get_data() -> ArcData {
let url = env::var("MARIA_DATABASE_URL").unwrap(); let url = env::var("MARIA_DATABASE_URL").unwrap();
let mut settings = get_settings(); let mut settings = get_settings();
settings.captcha.runners = Some(1);
settings.database.url = url.clone(); settings.database.url = url.clone();
settings.database.database_type = DBType::Maria; settings.database.database_type = DBType::Maria;
let data = Data::new(&settings).await; let data = Data::new(&settings).await;

View File

@@ -8,6 +8,16 @@
class="auth__logo" alt="mcaptcha logo" /> class="auth__logo" alt="mcaptcha logo" />
<. if !crate::SETTINGS.allow_registration { .>
<table class="reg-closed__table">
<thead class="reg-closed__table-heading">
<tr><th colspan="4" class="reg-closed__table-title-text">Registration closed</th></tr>
</thead>
<tbody class="reg-closed__body">
<tr><td class="reg-closed__body-text">This mCaptcha instance is closed for registrations.</td></tr>
</tbody>
</table>
<. } else {.>
<form <form
method="POST" method="POST"
action="<.= crate::V1_API_ROUTES.auth.register .>" action="<.= crate::V1_API_ROUTES.auth.register .>"
@@ -73,5 +83,6 @@
<a href="<.= crate::PAGES.auth.login .>" class="auth__secondary-action__link">Log in</a> <a href="<.= crate::PAGES.auth.login .>" class="auth__secondary-action__link">Log in</a>
</p> </p>
<. include!("../demo-user-banner.html"); .> <. include!("../demo-user-banner.html"); .>
<. } .>
</div> </div>
<. include!("../../components/footers.html"); .> <. include!("../../components/footers.html"); .>

View File

@@ -0,0 +1,32 @@
/*
* Copyright (C) 2022 Gusted <postmaster@gusted.xyz>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
@import '../../components/table/main';
.reg-closed__table {
@include table;
margin: auto;
}
.reg-closed__table-title-text {
@include table__title-text;
}
.reg-closed__body-text {
display: block;
margin: 0.5em 0;
}

View File

@@ -19,11 +19,12 @@
<span id="widget__verification-text--before">I'm not a robot</span> <span id="widget__verification-text--before">I'm not a robot</span>
<span id="widget__verification-text--during">Processing...</span> <span id="widget__verification-text--during">Processing...</span>
<span id="widget__verification-text--after">Verified!</span> <span id="widget__verification-text--after">Verified!</span>
<span id="widget__verification-text--error">Something wen't wrong</span> <span id="widget__verification-text--error">Something went wrong</span>
</label> </label>
<div class="widget__mcaptcha-details"> <div class="widget__mcaptcha-details">
<a href="<.= crate::PKG_HOMEPAGE .>" <a href="<.= crate::PKG_HOMEPAGE .>"
class="widget__mcaptcha-logo-container" class="widget__mcaptcha-logo-container"
target="_blank"
> >
<img <img
class="widget__mcaptcha-logo" class="widget__mcaptcha-logo"
@@ -33,12 +34,14 @@
<p class="widget__mcaptcha-brand-name">mCaptcha</p> <p class="widget__mcaptcha-brand-name">mCaptcha</p>
</a> </a>
<div class="widget__mcaptcha-info-container"> <div class="widget__mcaptcha-info-container">
<a class="widget__mcaptcha-info-link" <a class="widget__mcaptcha-info-link"
href="<.= crate::PKG_HOMEPAGE .><.= crate::PAGES.privacy .>"> target="_blank"
href="<.= crate::PKG_HOMEPAGE .><.= crate::PAGES.privacy .>">
Privacy Privacy
</a> </a>
<a class="widget__mcaptcha-info-link" <a class="widget__mcaptcha-info-link"
href="<.= crate::PKG_HOMEPAGE .><.= crate::PAGES.security .>"> target="_blank"
href="<.= crate::PKG_HOMEPAGE .><.= crate::PAGES.security .>">
Terms Terms
</a> </a>
</div> </div>

View File

@@ -18,10 +18,10 @@
@import '../reset'; @import '../reset';
.widget__contaienr { .widget__contaienr {
max-width: 300px; align-items: center;
max-height: 74px;
display: flex;
box-sizing: border-box; box-sizing: border-box;
display: flex;
height: 100%;
} }
.widget__noscript-container { .widget__noscript-container {
@@ -49,13 +49,10 @@
} }
.widget__verification-container { .widget__verification-container {
display: none;
/*display: flex; */
align-items: center; align-items: center;
display: none;
line-height: 30px; line-height: 30px;
flex: 2; font-size: 1rem;
margin: auto;
font-size: 0.99rem;
} }
.widget__verification-checkbox { .widget__verification-checkbox {
@@ -95,15 +92,10 @@
} }
.widget__mcaptcha-details { .widget__mcaptcha-details {
flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
box-sizing: border-box; margin-left: auto;
} margin-right: 10px;
.widget__mcaptcha-logo-container {
flex: 2;
padding-top: 3px;
} }
.widget__mcaptcha-brand-name { .widget__mcaptcha-brand-name {

View File

@@ -533,6 +533,46 @@
"@types/yargs" "^16.0.0" "@types/yargs" "^16.0.0"
chalk "^4.0.0" chalk "^4.0.0"
"@jridgewell/gen-mapping@^0.3.0":
version "0.3.2"
resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz#c1aedc61e853f2bb9f5dfe6d4442d3b565b253b9"
integrity sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==
dependencies:
"@jridgewell/set-array" "^1.0.1"
"@jridgewell/sourcemap-codec" "^1.4.10"
"@jridgewell/trace-mapping" "^0.3.9"
"@jridgewell/resolve-uri@^3.0.3":
version "3.1.0"
resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78"
integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==
"@jridgewell/set-array@^1.0.1":
version "1.1.2"
resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72"
integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==
"@jridgewell/source-map@^0.3.2":
version "0.3.2"
resolved "https://registry.yarnpkg.com/@jridgewell/source-map/-/source-map-0.3.2.tgz#f45351aaed4527a298512ec72f81040c998580fb"
integrity sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==
dependencies:
"@jridgewell/gen-mapping" "^0.3.0"
"@jridgewell/trace-mapping" "^0.3.9"
"@jridgewell/sourcemap-codec@^1.4.10":
version "1.4.14"
resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24"
integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==
"@jridgewell/trace-mapping@^0.3.9":
version "0.3.14"
resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.14.tgz#b231a081d8f66796e475ad588a1ef473112701ed"
integrity sha512-bJWEfQ9lPTvm3SneWwRFVLzrh6nhjwqw7TUFFBEMzwvg7t7PCDenf2lDwqo4NQXzdpgBXyFgDWnQA+2vkruksQ==
dependencies:
"@jridgewell/resolve-uri" "^3.0.3"
"@jridgewell/sourcemap-codec" "^1.4.10"
"@mcaptcha/core-glue@^0.1.0-alpha-3": "@mcaptcha/core-glue@^0.1.0-alpha-3":
version "0.1.0-alpha-3" version "0.1.0-alpha-3"
resolved "https://registry.yarnpkg.com/@mcaptcha/core-glue/-/core-glue-0.1.0-alpha-3.tgz#16c11cb3751b6421999353dc10c032afd08ffa8b" resolved "https://registry.yarnpkg.com/@mcaptcha/core-glue/-/core-glue-0.1.0-alpha-3.tgz#16c11cb3751b6421999353dc10c032afd08ffa8b"
@@ -1079,9 +1119,9 @@ acorn@^7.1.1:
integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==
acorn@^8.2.4, acorn@^8.4.1, acorn@^8.5.0: acorn@^8.2.4, acorn@^8.4.1, acorn@^8.5.0:
version "8.5.0" version "8.7.1"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.5.0.tgz#4512ccb99b3698c752591e9bb4472e38ad43cee2" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.1.tgz#0197122c843d1bf6d0a5e83220a788f278f63c30"
integrity sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q== integrity sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==
agent-base@6: agent-base@6:
version "6.0.2" version "6.0.2"
@@ -3830,9 +3870,9 @@ nanocolors@^0.1.12:
integrity sha512-2nMHqg1x5PU+unxX7PGY7AuYxl2qDx7PSrTRjizr8sxdd3l/3hBuWWaki62qmtYm2U5i4Z5E7GbjlyDFhs9/EQ== integrity sha512-2nMHqg1x5PU+unxX7PGY7AuYxl2qDx7PSrTRjizr8sxdd3l/3hBuWWaki62qmtYm2U5i4Z5E7GbjlyDFhs9/EQ==
nanoid@^3.1.28: nanoid@^3.1.28:
version "3.1.29" version "3.3.4"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.29.tgz#214fb2d7a33e1a5bef4757b779dfaeb6a4e5aeb4" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab"
integrity sha512-dW2pUSGZ8ZnCFIlBIA31SV8huOGCHb6OwzVCc7A69rb/a+SgPBwfmLvK5TKQ3INPbRkcI8a/Owo0XbiTNH19wg== integrity sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==
natural-compare@^1.4.0: natural-compare@^1.4.0:
version "1.4.0" version "1.4.0"
@@ -4809,9 +4849,9 @@ source-map-js@^0.6.2:
integrity sha512-/3GptzWzu0+0MBQFrDKzw/DvvMTUORvgY6k6jd/VS6iCR4RDTKWH6v6WPwQoUO8667uQEf9Oe38DxAYWY5F/Ug== integrity sha512-/3GptzWzu0+0MBQFrDKzw/DvvMTUORvgY6k6jd/VS6iCR4RDTKWH6v6WPwQoUO8667uQEf9Oe38DxAYWY5F/Ug==
source-map-support@^0.5.6, source-map-support@~0.5.20: source-map-support@^0.5.6, source-map-support@~0.5.20:
version "0.5.20" version "0.5.21"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.20.tgz#12166089f8f5e5e8c56926b377633392dd2cb6c9" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f"
integrity sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw== integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==
dependencies: dependencies:
buffer-from "^1.0.0" buffer-from "^1.0.0"
source-map "^0.6.0" source-map "^0.6.0"
@@ -4826,7 +4866,7 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1:
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
source-map@^0.7.3, source-map@~0.7.2: source-map@^0.7.3:
version "0.7.3" version "0.7.3"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383"
integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==
@@ -5017,12 +5057,13 @@ terser-webpack-plugin@^5.1.3:
terser "^5.7.2" terser "^5.7.2"
terser@^5.7.2: terser@^5.7.2:
version "5.9.0" version "5.14.2"
resolved "https://registry.yarnpkg.com/terser/-/terser-5.9.0.tgz#47d6e629a522963240f2b55fcaa3c99083d2c351" resolved "https://registry.yarnpkg.com/terser/-/terser-5.14.2.tgz#9ac9f22b06994d736174f4091aa368db896f1c10"
integrity sha512-h5hxa23sCdpzcye/7b8YqbE5OwKca/ni0RQz1uRX3tGh8haaGHqcuSqbGRybuAKNdntZ0mDgFNXPJ48xQ2RXKQ== integrity sha512-oL0rGeM/WFQCUd0y2QrWxYnq7tfSuKBiqTjRPWrRgB46WD/kiwHwF8T23z78H6Q6kGCuuHcPB+KULHRdxvVGQA==
dependencies: dependencies:
"@jridgewell/source-map" "^0.3.2"
acorn "^8.5.0"
commander "^2.20.0" commander "^2.20.0"
source-map "~0.7.2"
source-map-support "~0.5.20" source-map-support "~0.5.20"
test-exclude@^6.0.0: test-exclude@^6.0.0: