mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-11 10:05:41 +00:00
Compare commits
45 Commits
dependabot
...
update-dep
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
49a8757ead | ||
|
|
1107d3fc05 | ||
|
|
072a997ff0 | ||
|
|
d30b53f4ee | ||
|
|
b3021c500e | ||
|
|
79006f1e64 | ||
|
|
a45840d259 | ||
|
|
960283324d | ||
|
|
74364c4e17 | ||
|
|
3d02f55241 | ||
|
|
eab146b121 | ||
|
|
d4534c1c43 | ||
|
|
d5617c7ec7 | ||
|
|
f933a30e7e | ||
|
|
87785b38be | ||
|
|
52c2c6e598 | ||
|
|
b6a6705449 | ||
|
|
c56b04fa5a | ||
|
|
ccb9278d67 | ||
|
|
eb69e9aedc | ||
|
|
1310c22bed | ||
|
|
b300d2caac | ||
|
|
5d03682c45 | ||
|
|
61729c5fae | ||
|
|
8ec5122f87 | ||
|
|
6bd66e6d00 | ||
|
|
8e3fb9d8ec | ||
|
|
c67b7ac686 | ||
|
|
cb7245d577 | ||
|
|
4739c697b7 | ||
|
|
561a847bd7 | ||
|
|
9e77eec657 | ||
|
|
30dc51e8e1 | ||
|
|
4e2758f415 | ||
|
|
0e75a22beb | ||
|
|
0d2c02348b | ||
|
|
98efe3ae56 | ||
|
|
060291d174 | ||
|
|
65c3b9ad67 | ||
|
|
d3e08ff49e | ||
|
|
431463a397 | ||
|
|
342d03b58b | ||
|
|
765be413c4 | ||
|
|
e0203c660d | ||
|
|
ce73d29792 |
@@ -12,3 +12,4 @@ src/cache_buster_data.json
|
|||||||
browser/target
|
browser/target
|
||||||
browser/cobertura.xml
|
browser/cobertura.xml
|
||||||
browser/docs
|
browser/docs
|
||||||
|
**/target
|
||||||
|
|||||||
56
.github/workflows/clippy-fmt.yml
vendored
56
.github/workflows/clippy-fmt.yml
vendored
@@ -12,64 +12,28 @@ jobs:
|
|||||||
fmt:
|
fmt:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
- name: ⚡ Cache
|
# Ensure rustfmt is installed and setup problem matcher
|
||||||
uses: actions/cache@v2
|
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
with:
|
with:
|
||||||
path: |
|
|
||||||
~/.cargo/registry
|
|
||||||
~/.cargo/git
|
|
||||||
node_modules
|
|
||||||
./docs/openapi/node_modules
|
|
||||||
target
|
|
||||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
||||||
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Install Rust
|
|
||||||
uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
toolchain: stable
|
|
||||||
components: rustfmt
|
components: rustfmt
|
||||||
- name: Check with rustfmt
|
- name: Rustfmt Check
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rust-lang/rustfmt@v1
|
||||||
with:
|
|
||||||
command: fmt
|
|
||||||
args: --all -- --check
|
|
||||||
|
|
||||||
clippy:
|
clippy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
- name: ⚡ Cache
|
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
with:
|
||||||
path: |
|
|
||||||
~/.cargo/registry
|
|
||||||
~/.cargo/git
|
|
||||||
node_modules
|
|
||||||
./docs/openapi/node_modules
|
|
||||||
target
|
|
||||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
||||||
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Install Rust
|
|
||||||
uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
toolchain: stable
|
|
||||||
components: clippy
|
components: clippy
|
||||||
override: true
|
|
||||||
|
|
||||||
- uses: actions/setup-node@v2
|
- uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: "18.0.0"
|
node-version: "20.0.0"
|
||||||
|
|
||||||
- name: Build frontend
|
- name: Build frontend
|
||||||
run: make frontend
|
run: make frontend
|
||||||
|
|
||||||
- name: Check with Clippy
|
- name: clippy Check
|
||||||
uses: actions-rs/clippy-check@v1
|
run: cargo clippy --workspace --tests --all-features
|
||||||
with:
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
args: --workspace --tests --all-features
|
|
||||||
|
|||||||
254
.github/workflows/coverage.yml
vendored
254
.github/workflows/coverage.yml
vendored
@@ -1,135 +1,119 @@
|
|||||||
name: Coverage
|
#name: Coverage
|
||||||
|
#
|
||||||
on:
|
#on:
|
||||||
pull_request:
|
# pull_request:
|
||||||
types: [opened, synchronize, reopened]
|
# types: [opened, synchronize, reopened]
|
||||||
push:
|
# push:
|
||||||
branches:
|
# branches:
|
||||||
- master
|
# - master
|
||||||
- db-abstract
|
# - db-abstract
|
||||||
|
#
|
||||||
jobs:
|
#jobs:
|
||||||
build_and_test:
|
# build_and_test:
|
||||||
strategy:
|
# strategy:
|
||||||
fail-fast: false
|
# fail-fast: false
|
||||||
matrix:
|
# matrix:
|
||||||
version:
|
# version:
|
||||||
- stable
|
# - stable
|
||||||
#- 1.51.0
|
# #- 1.51.0
|
||||||
|
#
|
||||||
name: ${{ matrix.version }} - x86_64-unknown-linux-gnu
|
# name: ${{ matrix.version }} - x86_64-unknown-linux-gnu
|
||||||
runs-on: ubuntu-latest
|
# runs-on: ubuntu-latest
|
||||||
|
#
|
||||||
services:
|
# services:
|
||||||
postgres:
|
# postgres:
|
||||||
image: postgres
|
# image: postgres
|
||||||
env:
|
# env:
|
||||||
POSTGRES_PASSWORD: password
|
# POSTGRES_PASSWORD: password
|
||||||
POSTGRES_USER: postgres
|
# POSTGRES_USER: postgres
|
||||||
POSTGRES_DB: postgres
|
# POSTGRES_DB: postgres
|
||||||
options: >-
|
# options: >-
|
||||||
--health-cmd pg_isready
|
# --health-cmd pg_isready
|
||||||
--health-interval 10s
|
# --health-interval 10s
|
||||||
--health-timeout 5s
|
# --health-timeout 5s
|
||||||
--health-retries 5
|
# --health-retries 5
|
||||||
ports:
|
# ports:
|
||||||
- 5432:5432
|
# - 5432:5432
|
||||||
|
#
|
||||||
mcaptcha-redis:
|
# mcaptcha-redis:
|
||||||
image: mcaptcha/cache
|
# image: mcaptcha/cache
|
||||||
ports:
|
# ports:
|
||||||
- 6379:6379
|
# - 6379:6379
|
||||||
|
#
|
||||||
mcaptcha-smtp:
|
# mcaptcha-smtp:
|
||||||
image: maildev/maildev
|
# image: maildev/maildev
|
||||||
env:
|
# env:
|
||||||
MAILDEV_WEB_PORT: "1080"
|
# MAILDEV_WEB_PORT: "1080"
|
||||||
MAILDEV_INCOMING_USER: "admin"
|
# MAILDEV_INCOMING_USER: "admin"
|
||||||
MAILDEV_INCOMING_PASS: "password"
|
# MAILDEV_INCOMING_PASS: "password"
|
||||||
ports:
|
# ports:
|
||||||
- 1080:1080
|
# - 1080:1080
|
||||||
- 10025:1025
|
# - 10025:1025
|
||||||
|
#
|
||||||
|
#
|
||||||
maria:
|
# maria:
|
||||||
image: mariadb:10
|
# image: mariadb:10
|
||||||
env:
|
# env:
|
||||||
MARIADB_USER: "maria"
|
# MARIADB_USER: "maria"
|
||||||
MARIADB_PASSWORD: "password"
|
# MARIADB_PASSWORD: "password"
|
||||||
MARIADB_ROOT_PASSWORD: "password"
|
# MARIADB_ROOT_PASSWORD: "password"
|
||||||
MARIADB_DATABASE: "maria"
|
# MARIADB_DATABASE: "maria"
|
||||||
options: >-
|
# options: >-
|
||||||
--health-cmd="mysqladmin ping"
|
# --health-cmd="mysqladmin ping"
|
||||||
--health-interval=10s
|
# --health-interval=10s
|
||||||
--health-timeout=5s
|
# --health-timeout=5s
|
||||||
--health-retries=10
|
# --health-retries=10
|
||||||
ports:
|
# ports:
|
||||||
- 3306:3306
|
# - 3306:3306
|
||||||
|
#
|
||||||
|
#
|
||||||
steps:
|
# steps:
|
||||||
- uses: actions/checkout@v2
|
# - uses: actions/checkout@v4
|
||||||
- name: ⚡ Cache
|
#
|
||||||
uses: actions/cache@v2
|
# - name: load env
|
||||||
with:
|
# run: |
|
||||||
path: |
|
# source .env_sample \
|
||||||
~/.cargo/registry
|
# && echo "POSTGRES_DATABASE_URL=$POSTGRES_DATABASE_URL" >> $GITHUB_ENV \
|
||||||
~/.cargo/git
|
# && echo "MARIA_DATABASE_URL=$MARIA_DATABASE_URL" >> $GITHUB_ENV
|
||||||
node_modules
|
#
|
||||||
./docs/openapi/node_modules
|
#
|
||||||
target
|
# - uses: actions/setup-node@v2
|
||||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
# with:
|
||||||
|
# node-version: "18.0.0"
|
||||||
|
#
|
||||||
- name: load env
|
# - uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
run: |
|
#
|
||||||
source .env_sample \
|
# - name: Build frontend
|
||||||
&& echo "POSTGRES_DATABASE_URL=$POSTGRES_DATABASE_URL" >> $GITHUB_ENV \
|
# run: make frontend
|
||||||
&& echo "MARIA_DATABASE_URL=$MARIA_DATABASE_URL" >> $GITHUB_ENV
|
#
|
||||||
|
# - name: Run the frontend tests
|
||||||
|
# run: make test.frontend
|
||||||
- uses: actions/setup-node@v2
|
#
|
||||||
with:
|
# - name: Run migrations
|
||||||
node-version: "18.0.0"
|
# run: make migrate
|
||||||
|
# env:
|
||||||
- name: Install ${{ matrix.version }}
|
# POSTGRES_DATABASE_URL: "${{ env.POSTGRES_DATABASE_URL }}"
|
||||||
uses: actions-rs/toolchain@v1
|
# MARIA_DATABASE_URL: "${{ env.MARIA_DATABASE_URL }}"
|
||||||
with:
|
#
|
||||||
toolchain: ${{ matrix.version }}-x86_64-unknown-linux-gnu
|
# - name: build frontend
|
||||||
profile: minimal
|
# run: make frontend
|
||||||
override: true
|
#
|
||||||
|
# - name: Generate coverage file
|
||||||
- name: Build frontend
|
# if: github.event_name == 'pull_request'
|
||||||
run: make frontend
|
# #if: (github.ref == 'refs/heads/master' || github.event_name == 'pull_request')
|
||||||
|
# uses: actions-rs/tarpaulin@v0.1
|
||||||
- name: Run the frontend tests
|
# with:
|
||||||
run: make test.frontend
|
# args: "-t 1200"
|
||||||
|
# env:
|
||||||
- name: Run migrations
|
# POSTGRES_DATABASE_URL: "${{ env.POSTGRES_DATABASE_URL }}"
|
||||||
run: make migrate
|
# MARIA_DATABASE_URL: "${{ env.MARIA_DATABASE_URL }}"
|
||||||
env:
|
# # GIT_HASH is dummy value. I guess build.rs is skipped in tarpaulin
|
||||||
POSTGRES_DATABASE_URL: "${{ env.POSTGRES_DATABASE_URL }}"
|
# # execution so this value is required for preventing meta tests from
|
||||||
MARIA_DATABASE_URL: "${{ env.MARIA_DATABASE_URL }}"
|
# # panicking
|
||||||
|
# GIT_HASH: 8e77345f1597e40c2e266cb4e6dee74888918a61
|
||||||
- name: build frontend
|
# CACHE_BUSTER_FILE_MAP: '{"map":{"./static/bundle/main.js":"./prod/bundle/main.1417115E59909BE0A01040A45A398ADB09D928DF89CCF038FA44B14850442096.js"},"base_dir":"./prod"}'
|
||||||
run: make frontend
|
# COMPILED_DATE: "2021-07-21"
|
||||||
|
#
|
||||||
- name: Generate coverage file
|
# - name: Upload to Codecov
|
||||||
if: github.event_name == 'pull_request'
|
# if: github.event_name == 'pull_request'
|
||||||
#if: (github.ref == 'refs/heads/master' || github.event_name == 'pull_request')
|
# uses: codecov/codecov-action@v2
|
||||||
uses: actions-rs/tarpaulin@v0.1
|
|
||||||
with:
|
|
||||||
args: "-t 1200"
|
|
||||||
env:
|
|
||||||
POSTGRES_DATABASE_URL: "${{ env.POSTGRES_DATABASE_URL }}"
|
|
||||||
MARIA_DATABASE_URL: "${{ env.MARIA_DATABASE_URL }}"
|
|
||||||
# GIT_HASH is dummy value. I guess build.rs is skipped in tarpaulin
|
|
||||||
# execution so this value is required for preventing meta tests from
|
|
||||||
# panicking
|
|
||||||
GIT_HASH: 8e77345f1597e40c2e266cb4e6dee74888918a61
|
|
||||||
CACHE_BUSTER_FILE_MAP: '{"map":{"./static/bundle/main.js":"./prod/bundle/main.1417115E59909BE0A01040A45A398ADB09D928DF89CCF038FA44B14850442096.js"},"base_dir":"./prod"}'
|
|
||||||
COMPILED_DATE: "2021-07-21"
|
|
||||||
|
|
||||||
- name: Upload to Codecov
|
|
||||||
if: github.event_name == 'pull_request'
|
|
||||||
uses: codecov/codecov-action@v2
|
|
||||||
|
|||||||
42
.github/workflows/linux.yml
vendored
42
.github/workflows/linux.yml
vendored
@@ -9,7 +9,7 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
- "*"
|
- "*"
|
||||||
- '!gh-pages'
|
- "!gh-pages"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_and_test:
|
build_and_test:
|
||||||
@@ -17,9 +17,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
version:
|
version:
|
||||||
#- 1.51.0
|
|
||||||
- stable
|
- stable
|
||||||
# - nightly
|
|
||||||
|
|
||||||
name: ${{ matrix.version }} - x86_64-unknown-linux-gnu
|
name: ${{ matrix.version }} - x86_64-unknown-linux-gnu
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -55,7 +53,7 @@ jobs:
|
|||||||
|
|
||||||
maria:
|
maria:
|
||||||
image: mariadb:10
|
image: mariadb:10
|
||||||
env:
|
env:
|
||||||
MARIADB_USER: "maria"
|
MARIADB_USER: "maria"
|
||||||
MARIADB_PASSWORD: "password"
|
MARIADB_PASSWORD: "password"
|
||||||
MARIADB_ROOT_PASSWORD: "password"
|
MARIADB_ROOT_PASSWORD: "password"
|
||||||
@@ -69,17 +67,8 @@ jobs:
|
|||||||
- 3306:3306
|
- 3306:3306
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
- name: ⚡ Cache
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/.cargo/registry
|
|
||||||
~/.cargo/git
|
|
||||||
node_modules
|
|
||||||
./docs/openapi/node_modules
|
|
||||||
target
|
|
||||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
||||||
|
|
||||||
- name: configure GPG key
|
- name: configure GPG key
|
||||||
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'
|
||||||
@@ -95,14 +84,9 @@ jobs:
|
|||||||
|
|
||||||
- uses: actions/setup-node@v2
|
- uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: "18.0.0"
|
node-version: "20.0.0"
|
||||||
|
|
||||||
- name: Install ${{ matrix.version }}
|
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
toolchain: ${{ matrix.version }}-x86_64-unknown-linux-gnu
|
|
||||||
profile: minimal
|
|
||||||
override: true
|
|
||||||
|
|
||||||
- name: install nightwatch dep
|
- name: install nightwatch dep
|
||||||
run: sudo apt-get install xvfb
|
run: sudo apt-get install xvfb
|
||||||
@@ -135,7 +119,7 @@ jobs:
|
|||||||
run: make test.integration
|
run: make test.integration
|
||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
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'
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@v1
|
||||||
with:
|
with:
|
||||||
username: mcaptcha
|
username: mcaptcha
|
||||||
@@ -145,12 +129,12 @@ 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
|
# - name: publish bins
|
||||||
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: ./scripts/publish.sh publish master latest $DUMBSERVE_PASSWORD
|
# run: ./scripts/publish.sh publish master latest $DUMBSERVE_PASSWORD
|
||||||
env:
|
# env:
|
||||||
DUMBSERVE_PASSWORD: ${{ secrets.DUMBSERVE_PASSWORD }}
|
# DUMBSERVE_PASSWORD: ${{ secrets.DUMBSERVE_PASSWORD }}
|
||||||
GPG_PASSWORD: ${{ secrets.GPG_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')
|
||||||
|
|||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -16,3 +16,5 @@ assets
|
|||||||
yarn-error.log
|
yarn-error.log
|
||||||
src/cache_buster_data.json.license
|
src/cache_buster_data.json.license
|
||||||
**/**/target
|
**/**/target
|
||||||
|
src/libcachebust_data.json
|
||||||
|
utils/cache-bust/src/libcachebust_data.json
|
||||||
|
|||||||
@@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
- 2023-10-18: Environment variable names have changed, please see
|
||||||
|
[CONFIGURATION.md](docs/CONFIGURATION.md) for the names of environment
|
||||||
|
variables.
|
||||||
- ([`7d0e4c6`](https://github.com/mCaptcha/mCaptcha/commit/7d0e4c6be4b0769921cda7681858ebe16ec9a07b)) Add `secret` parameter to token verification request payload(`/api/v1/pow/siteverify`) to mitigate a security issue that @gusted found:
|
- ([`7d0e4c6`](https://github.com/mCaptcha/mCaptcha/commit/7d0e4c6be4b0769921cda7681858ebe16ec9a07b)) Add `secret` parameter to token verification request payload(`/api/v1/pow/siteverify`) to mitigate a security issue that @gusted found:
|
||||||
> ...A malicious user could grab the sitekey
|
> ...A malicious user could grab the sitekey
|
||||||
> and use that sitekey with mcaptcha to use it for their own server.
|
> and use that sitekey with mcaptcha to use it for their own server.
|
||||||
|
|||||||
1505
Cargo.lock
generated
1505
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
17
Cargo.toml
17
Cargo.toml
@@ -33,15 +33,15 @@ actix-service = "2.0.0"
|
|||||||
async-trait = "0.1.51"
|
async-trait = "0.1.51"
|
||||||
mime_guess = "2.0.3"
|
mime_guess = "2.0.3"
|
||||||
rust-embed = "6.4.0"
|
rust-embed = "6.4.0"
|
||||||
cache-buster = { git = "https://github.com/realaravinth/cache-buster" }
|
libcachebust = "0.3.0"
|
||||||
|
|
||||||
futures = "0.3.15"
|
futures = "0.3.15"
|
||||||
tokio = { version = "1.14", features = ["sync"]}
|
tokio = { version = "1.14", features = ["sync"]}
|
||||||
|
|
||||||
sqlx = { version = "0.5.13", features = [ "runtime-actix-rustls", "postgres", "time", "offline", "mysql"] }
|
sqlx = { version = "0.7", features = [ "runtime-tokio-rustls", "postgres", "time", "mysql"] }
|
||||||
argon2-creds = { branch = "master", git = "https://github.com/realaravinth/argon2-creds"}
|
argon2-creds = { branch = "master", git = "https://github.com/realaravinth/argon2-creds"}
|
||||||
#argon2-creds = { version="*", path = "../../argon2-creds/" }
|
#argon2-creds = { version="*", path = "../../argon2-creds/" }
|
||||||
config = "0.11"
|
config = "0.13"
|
||||||
validator = { version = "0.15", features = ["derive"]}
|
validator = { version = "0.15", features = ["derive"]}
|
||||||
|
|
||||||
derive_builder = "0.11"
|
derive_builder = "0.11"
|
||||||
@@ -59,13 +59,11 @@ log = "0.4"
|
|||||||
lazy_static = "1.4"
|
lazy_static = "1.4"
|
||||||
|
|
||||||
|
|
||||||
libmcaptcha = { version = "0.2.3", git = "https://github.com/mCaptcha/libmcaptcha", features = ["full"], tag ="0.2.3" }
|
libmcaptcha = "0.2.4"
|
||||||
#libmcaptcha = { branch = "master", git = "https://github.com/mCaptcha/libmcaptcha", features = ["full"] }
|
|
||||||
#libmcaptcha = { path = "../libmcaptcha", features = ["full"]}
|
|
||||||
|
|
||||||
rand = "0.8"
|
rand = "0.8"
|
||||||
|
|
||||||
sailfish = "0.4.0"
|
sailfish = "0.7.0"
|
||||||
|
|
||||||
mime = "0.3.16"
|
mime = "0.3.16"
|
||||||
|
|
||||||
@@ -80,6 +78,7 @@ lettre = { version = "0.10.0-rc.3", features = [
|
|||||||
|
|
||||||
openssl = { version = "0.10.48", features = ["vendored"] }
|
openssl = { version = "0.10.48", features = ["vendored"] }
|
||||||
uuid = { version = "1.4.0", features = ["v4", "serde"] }
|
uuid = { version = "1.4.0", features = ["v4", "serde"] }
|
||||||
|
reqwest = { version = "0.11.18", features = ["json", "gzip"] }
|
||||||
|
|
||||||
|
|
||||||
[dependencies.db-core]
|
[dependencies.db-core]
|
||||||
@@ -102,10 +101,10 @@ features = ["actix_identity_backend"]
|
|||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
serde_json = "1"
|
serde_json = "1"
|
||||||
sqlx = { version = "0.5.13", features = [ "runtime-actix-rustls", "postgres", "time", "offline", "mysql" ] }
|
sqlx = { version = "0.7", features = [ "runtime-tokio-rustls", "postgres", "time", "mysql" ] }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
pow_sha256 = { version = "0.3.1", git = "https://github.com/mcaptcha/pow_sha256", tag="0.3.1" }
|
mcaptcha_pow_sha256 = "0.4"
|
||||||
awc = "3.0.0"
|
awc = "3.0.0"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
22
Dockerfile
22
Dockerfile
@@ -1,8 +1,7 @@
|
|||||||
# SPDX-FileCopyrightText: 2023 Aravinth Manivannan <realaravinth@batsense.net>
|
# SPDX-FileCopyrightText: 2023 Aravinth Manivannan <realaravinth@batsense.net>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
FROM node:20 as frontend
|
||||||
FROM node:18.0.0 as frontend
|
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
apt-get update; \
|
apt-get update; \
|
||||||
DEBIAN_FRONTEND=noninteractive \
|
DEBIAN_FRONTEND=noninteractive \
|
||||||
@@ -21,33 +20,16 @@ COPY Makefile /src/
|
|||||||
COPY scripts /src/scripts
|
COPY scripts /src/scripts
|
||||||
RUN make frontend
|
RUN make frontend
|
||||||
|
|
||||||
FROM rust:latest as planner
|
|
||||||
RUN cargo install cargo-chef
|
|
||||||
WORKDIR /src
|
|
||||||
COPY . /src/
|
|
||||||
RUN cargo chef prepare --recipe-path recipe.json
|
|
||||||
|
|
||||||
FROM rust:latest as cacher
|
|
||||||
WORKDIR /src/
|
|
||||||
RUN cargo install cargo-chef
|
|
||||||
COPY --from=planner /src/recipe.json recipe.json
|
|
||||||
RUN cargo chef cook --release --recipe-path recipe.json
|
|
||||||
|
|
||||||
FROM rust:latest as rust
|
FROM rust:latest as rust
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
COPY . .
|
COPY . .
|
||||||
COPY --from=cacher /src/target target
|
|
||||||
#COPY --from=cacher /src/db/db-core/target /src/db/db-core/target
|
|
||||||
#COPY --from=cacher /src/db/db-sqlx-postgres/target /src/db/db-sqlx-postgres/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=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/
|
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
|
||||||
|
|
||||||
FROM debian:bullseye as mCaptcha
|
FROM debian:bookworm as mCaptcha
|
||||||
LABEL org.opencontainers.image.source https://github.com/mCaptcha/mCaptcha
|
LABEL org.opencontainers.image.source https://github.com/mCaptcha/mCaptcha
|
||||||
RUN useradd -ms /bin/bash -u 1001 mcaptcha
|
RUN useradd -ms /bin/bash -u 1001 mcaptcha
|
||||||
WORKDIR /home/mcaptcha
|
WORKDIR /home/mcaptcha
|
||||||
|
|||||||
9
Makefile
9
Makefile
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
BUNDLE = static/cache/bundle
|
BUNDLE = static/cache/bundle
|
||||||
OPENAPI = docs/openapi
|
OPENAPI = docs/openapi
|
||||||
CLEAN_UP = $(BUNDLE) src/cache_buster_data.json assets
|
CLEAN_UP = $(BUNDLE) src/libcachebust_data.json assets
|
||||||
|
|
||||||
define deploy_dependencies ## deploy dependencies
|
define deploy_dependencies ## deploy dependencies
|
||||||
@-docker create --name ${db} \
|
@-docker create --name ${db} \
|
||||||
@@ -34,8 +34,7 @@ endef
|
|||||||
|
|
||||||
define run_dev_migrations ## run database migrations
|
define run_dev_migrations ## run database migrations
|
||||||
cd db/db-sqlx-maria/ && \
|
cd db/db-sqlx-maria/ && \
|
||||||
DATABASE_URL=${MARIA_DATABASE_URL} sqlx migrate run
|
DATABASE_URL=${MARIA_DATABASE_URL} sqlx migrate run cd db/db-sqlx-postgres/ && \
|
||||||
cd db/db-sqlx-postgres/ && \
|
|
||||||
DATABASE_URL=${POSTGRES_DATABASE_URL} sqlx migrate run
|
DATABASE_URL=${POSTGRES_DATABASE_URL} sqlx migrate run
|
||||||
endef
|
endef
|
||||||
|
|
||||||
@@ -67,11 +66,9 @@ define test_db_sqlx_maria
|
|||||||
endef
|
endef
|
||||||
|
|
||||||
define test_core
|
define test_core
|
||||||
cargo test --no-fail-fast
|
cargo test --no-fail-fast --jobs=4
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
default: frontend ## Build app in debug mode
|
default: frontend ## Build app in debug mode
|
||||||
$(call cache_bust)
|
$(call cache_bust)
|
||||||
cargo build
|
cargo build
|
||||||
|
|||||||
3
build.rs
3
build.rs
@@ -16,6 +16,7 @@ fn main() {
|
|||||||
let git_hash = String::from_utf8(output.stdout).unwrap();
|
let git_hash = String::from_utf8(output.stdout).unwrap();
|
||||||
println!("cargo:rustc-env=GIT_HASH={}", git_hash);
|
println!("cargo:rustc-env=GIT_HASH={}", git_hash);
|
||||||
|
|
||||||
let now = OffsetDateTime::now_utc().format("%y-%m-%d");
|
let now = OffsetDateTime::now_utc();
|
||||||
|
let now = format!("{}{}{}", now.year(), now.month(), now.date());
|
||||||
println!("cargo:rustc-env=COMPILED_DATE={}", &now);
|
println!("cargo:rustc-env=COMPILED_DATE={}", &now);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,17 +42,11 @@ duration = 30 # cooldown period in seconds
|
|||||||
# This section deals with the database location and how to access it
|
# This section deals with the database location and how to access it
|
||||||
# Please note that at the moment, we have support for only postgresqa.
|
# Please note that at the moment, we have support for only postgresqa.
|
||||||
# Example, if you are Batman, your config would be:
|
# Example, if you are Batman, your config would be:
|
||||||
# hostname = "batcave.org"
|
# url = "postgres://batman:password@batcave.org:5432/batcave"
|
||||||
# port = "5432"
|
# database_type = "postgres"
|
||||||
# username = "batman"
|
# pool = 4
|
||||||
# password = "somereallycomplicatedBatmanpassword"
|
url = "postgres://example.org" # hack for tests to run successfully
|
||||||
hostname = "localhost"
|
|
||||||
port = "5432"
|
|
||||||
username = "postgres"
|
|
||||||
password = "password"
|
|
||||||
name = "postgres"
|
|
||||||
pool = 4
|
pool = 4
|
||||||
database_type="postgres" # "postgres", "maria"
|
|
||||||
|
|
||||||
[redis]
|
[redis]
|
||||||
# This section deals with the database location and how to access it
|
# This section deals with the database location and how to access it
|
||||||
@@ -72,3 +66,8 @@ url = "127.0.0.1"
|
|||||||
port = 10025
|
port = 10025
|
||||||
username = "admin"
|
username = "admin"
|
||||||
password = "password"
|
password = "password"
|
||||||
|
|
||||||
|
#[survey]
|
||||||
|
#nodes = ["http://localhost:7001"]
|
||||||
|
#rate_limit = 10 # upload every hour
|
||||||
|
#instance_root_url = "http://localhost:7000"
|
||||||
|
|||||||
@@ -13,8 +13,7 @@ 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 = { version = "0.2.3", git = "https://github.com/mCaptcha/libmcaptcha", features = ["minimal"], default-features = false, tag = "0.2.3"}
|
libmcaptcha = "0.2.4"
|
||||||
#libmcaptcha = { branch = "master", git = "https://github.com/mCaptcha/libmcaptcha", features = ["full"] }
|
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
|
|||||||
@@ -289,6 +289,9 @@ pub trait MCDatabase: std::marker::Send + std::marker::Sync + CloneSPDatabase {
|
|||||||
Err(e) => Err(e),
|
Err(e) => Err(e),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Get all psuedo IDs
|
||||||
|
async fn analytics_get_all_psuedo_ids(&self, page: usize) -> DBResult<Vec<String>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Default, Deserialize, Serialize, PartialEq)]
|
#[derive(Debug, Clone, Default, Deserialize, Serialize, PartialEq)]
|
||||||
|
|||||||
@@ -258,6 +258,12 @@ pub async fn database_works<'a, T: MCDatabase>(
|
|||||||
.analytics_get_psuedo_id_from_capmaign_id(c.key)
|
.analytics_get_psuedo_id_from_capmaign_id(c.key)
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
assert_eq!(
|
||||||
|
vec![psuedo_id.clone()],
|
||||||
|
db.analytics_get_all_psuedo_ids(0).await.unwrap()
|
||||||
|
);
|
||||||
|
assert!(db.analytics_get_all_psuedo_ids(1).await.unwrap().is_empty());
|
||||||
|
|
||||||
db.analytics_create_psuedo_id_if_not_exists(c.key)
|
db.analytics_create_psuedo_id_if_not_exists(c.key)
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
@@ -267,6 +273,7 @@ pub async fn database_works<'a, T: MCDatabase>(
|
|||||||
.await
|
.await
|
||||||
.unwrap()
|
.unwrap()
|
||||||
);
|
);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
c.key,
|
c.key,
|
||||||
db.analytics_get_capmaign_id_from_psuedo_id(&psuedo_id)
|
db.analytics_get_capmaign_id_from_psuedo_id(&psuedo_id)
|
||||||
|
|||||||
@@ -10,4 +10,4 @@ authors = ["realaravinth <realaravinth@batsense.net>"]
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
actix-rt = "2"
|
actix-rt = "2"
|
||||||
sqlx = { version = "0.5.13", features = [ "runtime-actix-rustls", "postgres", "time", "offline", "mysql" ] }
|
sqlx = { version = "0.7", features = [ "runtime-tokio-rustls", "postgres", "time", "mysql" ] }
|
||||||
|
|||||||
25
db/db-sqlx-maria/.sqlx/query-1367dceb151a766a901b5dd771d0b75d0bc61d2fef17a94a90c8ffa0065e2c44.json
generated
Normal file
25
db/db-sqlx-maria/.sqlx/query-1367dceb151a766a901b5dd771d0b75d0bc61d2fef17a94a90c8ffa0065e2c44.json
generated
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "SELECT time FROM mcaptcha_pow_confirmed_stats \n WHERE \n config_id = (\n SELECT config_id FROM mcaptcha_config \n WHERE \n captcha_key = ?\n AND\n user_id = (\n SELECT \n ID FROM mcaptcha_users WHERE name = ?))\n ORDER BY time DESC",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "time",
|
||||||
|
"type_info": {
|
||||||
|
"type": "Timestamp",
|
||||||
|
"flags": "NOT_NULL | UNSIGNED | BINARY | TIMESTAMP",
|
||||||
|
"char_set": 63,
|
||||||
|
"max_size": 19
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 2
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "1367dceb151a766a901b5dd771d0b75d0bc61d2fef17a94a90c8ffa0065e2c44"
|
||||||
|
}
|
||||||
25
db/db-sqlx-maria/.sqlx/query-14dc89b2988b221fd24e4f319b1d48f5e6c65c760c30d11c9c29087f09cee23a.json
generated
Normal file
25
db/db-sqlx-maria/.sqlx/query-14dc89b2988b221fd24e4f319b1d48f5e6c65c760c30d11c9c29087f09cee23a.json
generated
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "SELECT\n captcha_key\n FROM\n mcaptcha_config\n WHERE\n config_id = (\n SELECT\n config_id\n FROM\n mcaptcha_psuedo_campaign_id\n WHERE\n psuedo_id = ?\n );",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "captcha_key",
|
||||||
|
"type_info": {
|
||||||
|
"type": "VarString",
|
||||||
|
"flags": "NOT_NULL | UNIQUE_KEY | NO_DEFAULT_VALUE",
|
||||||
|
"char_set": 224,
|
||||||
|
"max_size": 400
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 1
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "14dc89b2988b221fd24e4f319b1d48f5e6c65c760c30d11c9c29087f09cee23a"
|
||||||
|
}
|
||||||
12
db/db-sqlx-maria/.sqlx/query-22e697114c3ed5b0156cdceab11a398f1ef3a804f482e1cd948bc615ef95fc92.json
generated
Normal file
12
db/db-sqlx-maria/.sqlx/query-22e697114c3ed5b0156cdceab11a398f1ef3a804f482e1cd948bc615ef95fc92.json
generated
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "INSERT INTO mcaptcha_sitekey_user_provided_avg_traffic (\n config_id,\n avg_traffic,\n peak_sustainable_traffic,\n broke_my_site_traffic\n ) VALUES ( \n (SELECT config_id FROM mcaptcha_config where captcha_key= (?)\n AND user_id = (SELECT ID FROM mcaptcha_users WHERE name = ?)\n ), ?, ?, ?)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 5
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "22e697114c3ed5b0156cdceab11a398f1ef3a804f482e1cd948bc615ef95fc92"
|
||||||
|
}
|
||||||
12
db/db-sqlx-maria/.sqlx/query-34b29417f9ff3f4d5987df0ce81023b1985eb84e560602b36182f55de6cd9d83.json
generated
Normal file
12
db/db-sqlx-maria/.sqlx/query-34b29417f9ff3f4d5987df0ce81023b1985eb84e560602b36182f55de6cd9d83.json
generated
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "INSERT INTO mcaptcha_pow_confirmed_stats \n (config_id, time) VALUES ((SELECT config_id FROM mcaptcha_config where captcha_key= ?), ?)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 2
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "34b29417f9ff3f4d5987df0ce81023b1985eb84e560602b36182f55de6cd9d83"
|
||||||
|
}
|
||||||
58
db/db-sqlx-maria/.sqlx/query-3812693a9ae4402d900bcbf680981e6194073bd1937af11a77daa3776fb4c873.json
generated
Normal file
58
db/db-sqlx-maria/.sqlx/query-3812693a9ae4402d900bcbf680981e6194073bd1937af11a77daa3776fb4c873.json
generated
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "SELECT captcha_key, name, config_id, duration FROM mcaptcha_config WHERE\n user_id = (SELECT ID FROM mcaptcha_users WHERE name = ?) ",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "captcha_key",
|
||||||
|
"type_info": {
|
||||||
|
"type": "VarString",
|
||||||
|
"flags": "NOT_NULL | UNIQUE_KEY | NO_DEFAULT_VALUE",
|
||||||
|
"char_set": 224,
|
||||||
|
"max_size": 400
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "name",
|
||||||
|
"type_info": {
|
||||||
|
"type": "VarString",
|
||||||
|
"flags": "NOT_NULL | NO_DEFAULT_VALUE",
|
||||||
|
"char_set": 224,
|
||||||
|
"max_size": 400
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "config_id",
|
||||||
|
"type_info": {
|
||||||
|
"type": "Long",
|
||||||
|
"flags": "NOT_NULL | PRIMARY_KEY | AUTO_INCREMENT",
|
||||||
|
"char_set": 63,
|
||||||
|
"max_size": 11
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 3,
|
||||||
|
"name": "duration",
|
||||||
|
"type_info": {
|
||||||
|
"type": "Long",
|
||||||
|
"flags": "NOT_NULL",
|
||||||
|
"char_set": 63,
|
||||||
|
"max_size": 11
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 1
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "3812693a9ae4402d900bcbf680981e6194073bd1937af11a77daa3776fb4c873"
|
||||||
|
}
|
||||||
12
db/db-sqlx-maria/.sqlx/query-3a8381eb0f0542a492d9dd51368e769e2b313e0576a1873e5c7630011e463daf.json
generated
Normal file
12
db/db-sqlx-maria/.sqlx/query-3a8381eb0f0542a492d9dd51368e769e2b313e0576a1873e5c7630011e463daf.json
generated
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "UPDATE mcaptcha_config SET name = ?, duration = ?\n WHERE user_id = (SELECT ID FROM mcaptcha_users WHERE name = ?)\n AND captcha_key = ?",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 4
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "3a8381eb0f0542a492d9dd51368e769e2b313e0576a1873e5c7630011e463daf"
|
||||||
|
}
|
||||||
25
db/db-sqlx-maria/.sqlx/query-413ea53cea8b8f114fc009bad527b054a68a94477dfcc50d860d45bbd864d4f1.json
generated
Normal file
25
db/db-sqlx-maria/.sqlx/query-413ea53cea8b8f114fc009bad527b054a68a94477dfcc50d860d45bbd864d4f1.json
generated
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "SELECT email FROM mcaptcha_users WHERE name = ?",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "email",
|
||||||
|
"type_info": {
|
||||||
|
"type": "VarString",
|
||||||
|
"flags": "UNIQUE_KEY",
|
||||||
|
"char_set": 224,
|
||||||
|
"max_size": 400
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 1
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
true
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "413ea53cea8b8f114fc009bad527b054a68a94477dfcc50d860d45bbd864d4f1"
|
||||||
|
}
|
||||||
69
db/db-sqlx-maria/.sqlx/query-42d967d6e080efd3cff8d4df13ea4d2ff38f3093da5c97000349dfc23c4d4eb3.json
generated
Normal file
69
db/db-sqlx-maria/.sqlx/query-42d967d6e080efd3cff8d4df13ea4d2ff38f3093da5c97000349dfc23c4d4eb3.json
generated
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "-- SPDX-FileCopyrightText: 2023 Aravinth Manivannan <realaravinth@batsense.net>\n--\n-- SPDX-License-Identifier: AGPL-3.0-or-later\n\n-- gets all unread notifications a user has\nSELECT \n mcaptcha_notifications.id,\n mcaptcha_notifications.heading,\n mcaptcha_notifications.message,\n mcaptcha_notifications.received,\n mcaptcha_users.name\nFROM\n mcaptcha_notifications \nINNER JOIN \n mcaptcha_users \nON \n mcaptcha_notifications.tx = mcaptcha_users.id\nWHERE \n mcaptcha_notifications.rx = (\n SELECT \n id \n FROM \n mcaptcha_users\n WHERE\n name = ?\n )\nAND \n mcaptcha_notifications.read_notification IS NULL;\n",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "id",
|
||||||
|
"type_info": {
|
||||||
|
"type": "Long",
|
||||||
|
"flags": "NOT_NULL | PRIMARY_KEY | AUTO_INCREMENT",
|
||||||
|
"char_set": 63,
|
||||||
|
"max_size": 11
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "heading",
|
||||||
|
"type_info": {
|
||||||
|
"type": "VarString",
|
||||||
|
"flags": "NOT_NULL | NO_DEFAULT_VALUE",
|
||||||
|
"char_set": 224,
|
||||||
|
"max_size": 400
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "message",
|
||||||
|
"type_info": {
|
||||||
|
"type": "VarString",
|
||||||
|
"flags": "NOT_NULL | NO_DEFAULT_VALUE",
|
||||||
|
"char_set": 224,
|
||||||
|
"max_size": 1000
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 3,
|
||||||
|
"name": "received",
|
||||||
|
"type_info": {
|
||||||
|
"type": "Timestamp",
|
||||||
|
"flags": "NOT_NULL | UNSIGNED | BINARY | TIMESTAMP",
|
||||||
|
"char_set": 63,
|
||||||
|
"max_size": 19
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 4,
|
||||||
|
"name": "name",
|
||||||
|
"type_info": {
|
||||||
|
"type": "VarString",
|
||||||
|
"flags": "NOT_NULL | UNIQUE_KEY | NO_DEFAULT_VALUE",
|
||||||
|
"char_set": 224,
|
||||||
|
"max_size": 400
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 1
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "42d967d6e080efd3cff8d4df13ea4d2ff38f3093da5c97000349dfc23c4d4eb3"
|
||||||
|
}
|
||||||
12
db/db-sqlx-maria/.sqlx/query-598a8202942771eff460faa6f09bd3fb1fc910d5fab7edb07c49dadbbaeb1cb8.json
generated
Normal file
12
db/db-sqlx-maria/.sqlx/query-598a8202942771eff460faa6f09bd3fb1fc910d5fab7edb07c49dadbbaeb1cb8.json
generated
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "INSERT INTO mcaptcha_pow_fetched_stats \n (config_id, time) VALUES ((SELECT config_id FROM mcaptcha_config where captcha_key= ?), ?)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 2
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "598a8202942771eff460faa6f09bd3fb1fc910d5fab7edb07c49dadbbaeb1cb8"
|
||||||
|
}
|
||||||
25
db/db-sqlx-maria/.sqlx/query-5ad1ef722a961183228d851813b9f50284520bf8cc8118c765b72c108daaf6fb.json
generated
Normal file
25
db/db-sqlx-maria/.sqlx/query-5ad1ef722a961183228d851813b9f50284520bf8cc8118c765b72c108daaf6fb.json
generated
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "SELECT psuedo_id FROM\n mcaptcha_psuedo_campaign_id\n WHERE\n config_id = (SELECT config_id FROM mcaptcha_config WHERE captcha_key = (?));\n ",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "psuedo_id",
|
||||||
|
"type_info": {
|
||||||
|
"type": "VarString",
|
||||||
|
"flags": "NOT_NULL | UNIQUE_KEY | NO_DEFAULT_VALUE",
|
||||||
|
"char_set": 224,
|
||||||
|
"max_size": 400
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 1
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "5ad1ef722a961183228d851813b9f50284520bf8cc8118c765b72c108daaf6fb"
|
||||||
|
}
|
||||||
12
db/db-sqlx-maria/.sqlx/query-5d5a106981345e9f62bc2239c00cdc683d3aaaa820d63da300dc51e3f6f363d3.json
generated
Normal file
12
db/db-sqlx-maria/.sqlx/query-5d5a106981345e9f62bc2239c00cdc683d3aaaa820d63da300dc51e3f6f363d3.json
generated
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "INSERT INTO mcaptcha_users \n (name , password, secret) VALUES (?, ?, ?)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 3
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "5d5a106981345e9f62bc2239c00cdc683d3aaaa820d63da300dc51e3f6f363d3"
|
||||||
|
}
|
||||||
12
db/db-sqlx-maria/.sqlx/query-6094468b7fa20043b0da90e366b7f1fa29a8c748e163b6712725440b25ae9361.json
generated
Normal file
12
db/db-sqlx-maria/.sqlx/query-6094468b7fa20043b0da90e366b7f1fa29a8c748e163b6712725440b25ae9361.json
generated
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "\n DELETE FROM\n mcaptcha_pow_analytics\n WHERE\n config_id = (\n SELECT config_id FROM mcaptcha_config WHERE captcha_key = ?\n ) ",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 1
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "6094468b7fa20043b0da90e366b7f1fa29a8c748e163b6712725440b25ae9361"
|
||||||
|
}
|
||||||
25
db/db-sqlx-maria/.sqlx/query-66ec7df10484f8e0206f3c97afc9136021589556c38dbbed341d6574487f79f2.json
generated
Normal file
25
db/db-sqlx-maria/.sqlx/query-66ec7df10484f8e0206f3c97afc9136021589556c38dbbed341d6574487f79f2.json
generated
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "SELECT config_id FROM mcaptcha_config\n WHERE\n captcha_key = ? \n AND user_id = (SELECT ID FROM mcaptcha_users WHERE name = ?)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "config_id",
|
||||||
|
"type_info": {
|
||||||
|
"type": "Long",
|
||||||
|
"flags": "NOT_NULL | PRIMARY_KEY | AUTO_INCREMENT",
|
||||||
|
"char_set": 63,
|
||||||
|
"max_size": 11
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 2
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "66ec7df10484f8e0206f3c97afc9136021589556c38dbbed341d6574487f79f2"
|
||||||
|
}
|
||||||
12
db/db-sqlx-maria/.sqlx/query-676a9f1761c3b63cf16d7d4dd6261507cc7707feb32d458f4b946ed9caa53721.json
generated
Normal file
12
db/db-sqlx-maria/.sqlx/query-676a9f1761c3b63cf16d7d4dd6261507cc7707feb32d458f4b946ed9caa53721.json
generated
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "UPDATE mcaptcha_users set name = ?\n WHERE name = ?",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 2
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "676a9f1761c3b63cf16d7d4dd6261507cc7707feb32d458f4b946ed9caa53721"
|
||||||
|
}
|
||||||
12
db/db-sqlx-maria/.sqlx/query-6d1b6e5e58ca2ba285cab7b050bbdc43de1f3e46cf7d420bc95c124a1c7c9d1f.json
generated
Normal file
12
db/db-sqlx-maria/.sqlx/query-6d1b6e5e58ca2ba285cab7b050bbdc43de1f3e46cf7d420bc95c124a1c7c9d1f.json
generated
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "DELETE FROM mcaptcha_users WHERE name = (?)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 1
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "6d1b6e5e58ca2ba285cab7b050bbdc43de1f3e46cf7d420bc95c124a1c7c9d1f"
|
||||||
|
}
|
||||||
36
db/db-sqlx-maria/.sqlx/query-6d43e6ceb54a0ff8a803bd96dd9134b15da01d48776ac0cf3d66a2997dadce5e.json
generated
Normal file
36
db/db-sqlx-maria/.sqlx/query-6d43e6ceb54a0ff8a803bd96dd9134b15da01d48776ac0cf3d66a2997dadce5e.json
generated
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "SELECT difficulty_factor, visitor_threshold FROM mcaptcha_levels WHERE\n config_id = (\n SELECT config_id FROM mcaptcha_config where captcha_key= (?)\n ) ORDER BY difficulty_factor ASC;",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "difficulty_factor",
|
||||||
|
"type_info": {
|
||||||
|
"type": "Long",
|
||||||
|
"flags": "NOT_NULL | NO_DEFAULT_VALUE",
|
||||||
|
"char_set": 63,
|
||||||
|
"max_size": 11
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "visitor_threshold",
|
||||||
|
"type_info": {
|
||||||
|
"type": "Long",
|
||||||
|
"flags": "NOT_NULL | NO_DEFAULT_VALUE",
|
||||||
|
"char_set": 63,
|
||||||
|
"max_size": 11
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 1
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "6d43e6ceb54a0ff8a803bd96dd9134b15da01d48776ac0cf3d66a2997dadce5e"
|
||||||
|
}
|
||||||
12
db/db-sqlx-maria/.sqlx/query-74d68a86f852d3d85957e94ed04e8acd8e6144744f7b13e383ebcb2bcf3360ae.json
generated
Normal file
12
db/db-sqlx-maria/.sqlx/query-74d68a86f852d3d85957e94ed04e8acd8e6144744f7b13e383ebcb2bcf3360ae.json
generated
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "INSERT INTO mcaptcha_levels (\n difficulty_factor, \n visitor_threshold,\n config_id) VALUES (\n ?, ?, (\n SELECT config_id FROM mcaptcha_config WHERE\n captcha_key = (?) AND user_id = (\n SELECT ID FROM mcaptcha_users WHERE name = ?\n )));",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 4
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "74d68a86f852d3d85957e94ed04e8acd8e6144744f7b13e383ebcb2bcf3360ae"
|
||||||
|
}
|
||||||
12
db/db-sqlx-maria/.sqlx/query-7838ade4a48068e25c6f117ee8e38f088b867b1ab08a7dd0269b76891266ace6.json
generated
Normal file
12
db/db-sqlx-maria/.sqlx/query-7838ade4a48068e25c6f117ee8e38f088b867b1ab08a7dd0269b76891266ace6.json
generated
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "UPDATE mcaptcha_users set secret = ?\n WHERE name = ?",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 2
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "7838ade4a48068e25c6f117ee8e38f088b867b1ab08a7dd0269b76891266ace6"
|
||||||
|
}
|
||||||
12
db/db-sqlx-maria/.sqlx/query-7894dda54cd65559fe3b81bab7df8cc848e21ed5c7f5e88951bf1c98c78ed820.json
generated
Normal file
12
db/db-sqlx-maria/.sqlx/query-7894dda54cd65559fe3b81bab7df8cc848e21ed5c7f5e88951bf1c98c78ed820.json
generated
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "DELETE FROM mcaptcha_levels \n WHERE config_id = (\n SELECT config_id FROM mcaptcha_config where captcha_key= (?) \n AND user_id = (\n SELECT ID from mcaptcha_users WHERE name = ?\n )\n )",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 2
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "7894dda54cd65559fe3b81bab7df8cc848e21ed5c7f5e88951bf1c98c78ed820"
|
||||||
|
}
|
||||||
12
db/db-sqlx-maria/.sqlx/query-89386c46668a2653a54687e65958af5cf7a8da268339a1f5a379ede47b3c6d2a.json
generated
Normal file
12
db/db-sqlx-maria/.sqlx/query-89386c46668a2653a54687e65958af5cf7a8da268339a1f5a379ede47b3c6d2a.json
generated
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "INSERT INTO mcaptcha_notifications (\n heading, message, tx, rx, received)\n VALUES (\n ?, ?,\n (SELECT ID FROM mcaptcha_users WHERE name = ?),\n (SELECT ID FROM mcaptcha_users WHERE name = ?),\n ?\n );",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 5
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "89386c46668a2653a54687e65958af5cf7a8da268339a1f5a379ede47b3c6d2a"
|
||||||
|
}
|
||||||
25
db/db-sqlx-maria/.sqlx/query-8acbf84d4801e86221d8f6324ae50488a0986182d66b20ad414bce4e2ac18eca.json
generated
Normal file
25
db/db-sqlx-maria/.sqlx/query-8acbf84d4801e86221d8f6324ae50488a0986182d66b20ad414bce4e2ac18eca.json
generated
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "SELECT duration FROM mcaptcha_config \n where captcha_key= ?",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "duration",
|
||||||
|
"type_info": {
|
||||||
|
"type": "Long",
|
||||||
|
"flags": "NOT_NULL",
|
||||||
|
"char_set": 63,
|
||||||
|
"max_size": 11
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 1
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "8acbf84d4801e86221d8f6324ae50488a0986182d66b20ad414bce4e2ac18eca"
|
||||||
|
}
|
||||||
12
db/db-sqlx-maria/.sqlx/query-8e6026abf7c0e8ab90ee8eb7ada9f66962ab6999d3127944b058d6f96346e72f.json
generated
Normal file
12
db/db-sqlx-maria/.sqlx/query-8e6026abf7c0e8ab90ee8eb7ada9f66962ab6999d3127944b058d6f96346e72f.json
generated
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "UPDATE mcaptcha_config SET captcha_key = ? \n WHERE captcha_key = ? AND user_id = (SELECT ID FROM mcaptcha_users WHERE name = ?)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 3
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "8e6026abf7c0e8ab90ee8eb7ada9f66962ab6999d3127944b058d6f96346e72f"
|
||||||
|
}
|
||||||
12
db/db-sqlx-maria/.sqlx/query-8ec8bbde0c02a99f74d12e6778f123a973283e6d56b6861b30f559768617848a.json
generated
Normal file
12
db/db-sqlx-maria/.sqlx/query-8ec8bbde0c02a99f74d12e6778f123a973283e6d56b6861b30f559768617848a.json
generated
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "insert into mcaptcha_users \n (name , password, email, secret) values (?, ?, ?, ?)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 4
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "8ec8bbde0c02a99f74d12e6778f123a973283e6d56b6861b30f559768617848a"
|
||||||
|
}
|
||||||
58
db/db-sqlx-maria/.sqlx/query-9c435148ed5655e79dd1e73e3566ce23b7c6d38edcedbb988c95813c5da893ed.json
generated
Normal file
58
db/db-sqlx-maria/.sqlx/query-9c435148ed5655e79dd1e73e3566ce23b7c6d38edcedbb988c95813c5da893ed.json
generated
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "SELECT `config_id`, `duration`, `name`, `captcha_key` from mcaptcha_config WHERE\n `captcha_key` = ? AND\n user_id = (SELECT ID FROM mcaptcha_users WHERE name = ?) ",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "config_id",
|
||||||
|
"type_info": {
|
||||||
|
"type": "Long",
|
||||||
|
"flags": "NOT_NULL | PRIMARY_KEY | AUTO_INCREMENT",
|
||||||
|
"char_set": 63,
|
||||||
|
"max_size": 11
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "duration",
|
||||||
|
"type_info": {
|
||||||
|
"type": "Long",
|
||||||
|
"flags": "NOT_NULL",
|
||||||
|
"char_set": 63,
|
||||||
|
"max_size": 11
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "name",
|
||||||
|
"type_info": {
|
||||||
|
"type": "VarString",
|
||||||
|
"flags": "NOT_NULL | NO_DEFAULT_VALUE",
|
||||||
|
"char_set": 224,
|
||||||
|
"max_size": 400
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 3,
|
||||||
|
"name": "captcha_key",
|
||||||
|
"type_info": {
|
||||||
|
"type": "VarString",
|
||||||
|
"flags": "NOT_NULL | UNIQUE_KEY | NO_DEFAULT_VALUE",
|
||||||
|
"char_set": 224,
|
||||||
|
"max_size": 400
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 2
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "9c435148ed5655e79dd1e73e3566ce23b7c6d38edcedbb988c95813c5da893ed"
|
||||||
|
}
|
||||||
12
db/db-sqlx-maria/.sqlx/query-9cb416de904872d66af90baa0024f382ce6f8344464c607fe6e6c2572816dfc2.json
generated
Normal file
12
db/db-sqlx-maria/.sqlx/query-9cb416de904872d66af90baa0024f382ce6f8344464c607fe6e6c2572816dfc2.json
generated
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "UPDATE mcaptcha_users set email = ?\n WHERE name = ?",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 2
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "9cb416de904872d66af90baa0024f382ce6f8344464c607fe6e6c2572816dfc2"
|
||||||
|
}
|
||||||
12
db/db-sqlx-maria/.sqlx/query-9e45969a0f79eab8caba41b0d91e5e3b85a1a68a49136f89fc90793c38f00041.json
generated
Normal file
12
db/db-sqlx-maria/.sqlx/query-9e45969a0f79eab8caba41b0d91e5e3b85a1a68a49136f89fc90793c38f00041.json
generated
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "\n INSERT INTO\n mcaptcha_psuedo_campaign_id (config_id, psuedo_id)\n VALUES (\n (SELECT config_id FROM mcaptcha_config WHERE captcha_key = (?)),\n ?\n );",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 2
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "9e45969a0f79eab8caba41b0d91e5e3b85a1a68a49136f89fc90793c38f00041"
|
||||||
|
}
|
||||||
58
db/db-sqlx-maria/.sqlx/query-9f10afb0f242f11c58389803c5e85e244cc59102b8929a21e3fcaa852d57a52c.json
generated
Normal file
58
db/db-sqlx-maria/.sqlx/query-9f10afb0f242f11c58389803c5e85e244cc59102b8929a21e3fcaa852d57a52c.json
generated
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "SELECT\n id, time, difficulty_factor, worker_type\n FROM\n mcaptcha_pow_analytics\n WHERE\n config_id = (\n SELECT config_id FROM mcaptcha_config WHERE captcha_key = ?\n ) \n ORDER BY ID\n LIMIT ? OFFSET ?",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "id",
|
||||||
|
"type_info": {
|
||||||
|
"type": "Long",
|
||||||
|
"flags": "NOT_NULL | PRIMARY_KEY | AUTO_INCREMENT",
|
||||||
|
"char_set": 63,
|
||||||
|
"max_size": 11
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "time",
|
||||||
|
"type_info": {
|
||||||
|
"type": "Long",
|
||||||
|
"flags": "NOT_NULL | NO_DEFAULT_VALUE",
|
||||||
|
"char_set": 63,
|
||||||
|
"max_size": 11
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "difficulty_factor",
|
||||||
|
"type_info": {
|
||||||
|
"type": "Long",
|
||||||
|
"flags": "NOT_NULL | NO_DEFAULT_VALUE",
|
||||||
|
"char_set": 63,
|
||||||
|
"max_size": 11
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 3,
|
||||||
|
"name": "worker_type",
|
||||||
|
"type_info": {
|
||||||
|
"type": "VarString",
|
||||||
|
"flags": "NOT_NULL | NO_DEFAULT_VALUE",
|
||||||
|
"char_set": 224,
|
||||||
|
"max_size": 400
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 3
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "9f10afb0f242f11c58389803c5e85e244cc59102b8929a21e3fcaa852d57a52c"
|
||||||
|
}
|
||||||
25
db/db-sqlx-maria/.sqlx/query-a89c066db044cddfdebee6a0fd0d80a5a26dcb7ecc00a9899f5634b72ea0a952.json
generated
Normal file
25
db/db-sqlx-maria/.sqlx/query-a89c066db044cddfdebee6a0fd0d80a5a26dcb7ecc00a9899f5634b72ea0a952.json
generated
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "SELECT config_id from mcaptcha_config WHERE captcha_key = ?",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "config_id",
|
||||||
|
"type_info": {
|
||||||
|
"type": "Long",
|
||||||
|
"flags": "NOT_NULL | PRIMARY_KEY | AUTO_INCREMENT",
|
||||||
|
"char_set": 63,
|
||||||
|
"max_size": 11
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 1
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "a89c066db044cddfdebee6a0fd0d80a5a26dcb7ecc00a9899f5634b72ea0a952"
|
||||||
|
}
|
||||||
25
db/db-sqlx-maria/.sqlx/query-b9258c2494d95701d19703cf5cd05a222057a0ccad943192138b1a4a94bf823b.json
generated
Normal file
25
db/db-sqlx-maria/.sqlx/query-b9258c2494d95701d19703cf5cd05a222057a0ccad943192138b1a4a94bf823b.json
generated
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "SELECT secret FROM mcaptcha_users WHERE ID = (\n SELECT user_id FROM mcaptcha_config WHERE captcha_key = ?\n )",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "secret",
|
||||||
|
"type_info": {
|
||||||
|
"type": "VarString",
|
||||||
|
"flags": "NOT_NULL | UNIQUE_KEY | NO_DEFAULT_VALUE",
|
||||||
|
"char_set": 224,
|
||||||
|
"max_size": 200
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 1
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "b9258c2494d95701d19703cf5cd05a222057a0ccad943192138b1a4a94bf823b"
|
||||||
|
}
|
||||||
12
db/db-sqlx-maria/.sqlx/query-b95e5a60a202cb646d5e76df8c7395e4bf881a6dd14e28e6f2e8b93e0536b331.json
generated
Normal file
12
db/db-sqlx-maria/.sqlx/query-b95e5a60a202cb646d5e76df8c7395e4bf881a6dd14e28e6f2e8b93e0536b331.json
generated
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "DELETE FROM mcaptcha_config where captcha_key= (?)\n AND\n user_id = (SELECT ID FROM mcaptcha_users WHERE name = ?)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 2
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "b95e5a60a202cb646d5e76df8c7395e4bf881a6dd14e28e6f2e8b93e0536b331"
|
||||||
|
}
|
||||||
25
db/db-sqlx-maria/.sqlx/query-caa1638ee510ef62b86817e5d2baeaca8dfa432c23d7630c0e70737211a4680b.json
generated
Normal file
25
db/db-sqlx-maria/.sqlx/query-caa1638ee510ef62b86817e5d2baeaca8dfa432c23d7630c0e70737211a4680b.json
generated
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "SELECT name from mcaptcha_users WHERE email = ?",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "name",
|
||||||
|
"type_info": {
|
||||||
|
"type": "VarString",
|
||||||
|
"flags": "NOT_NULL | UNIQUE_KEY | NO_DEFAULT_VALUE",
|
||||||
|
"char_set": 224,
|
||||||
|
"max_size": 400
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 1
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "caa1638ee510ef62b86817e5d2baeaca8dfa432c23d7630c0e70737211a4680b"
|
||||||
|
}
|
||||||
12
db/db-sqlx-maria/.sqlx/query-cad5b403470f26c565e74a1dca19b7dee066141dec0f708070067e34d5bf72cc.json
generated
Normal file
12
db/db-sqlx-maria/.sqlx/query-cad5b403470f26c565e74a1dca19b7dee066141dec0f708070067e34d5bf72cc.json
generated
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "UPDATE mcaptcha_users set password = ?\n WHERE name = ?",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 2
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "cad5b403470f26c565e74a1dca19b7dee066141dec0f708070067e34d5bf72cc"
|
||||||
|
}
|
||||||
12
db/db-sqlx-maria/.sqlx/query-d05b84966f4e70c53789221f961bf3637f404f3ba45e880115e97ed1ba5a2809.json
generated
Normal file
12
db/db-sqlx-maria/.sqlx/query-d05b84966f4e70c53789221f961bf3637f404f3ba45e880115e97ed1ba5a2809.json
generated
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "INSERT INTO mcaptcha_config\n (`captcha_key`, `user_id`, `duration`, `name`)\n VALUES (?, (SELECT ID FROM mcaptcha_users WHERE name = ?), ?, ?)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 4
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "d05b84966f4e70c53789221f961bf3637f404f3ba45e880115e97ed1ba5a2809"
|
||||||
|
}
|
||||||
25
db/db-sqlx-maria/.sqlx/query-d4b92e8099cd29cfdb99aadeeada739bb6858667fc65f528ec484e98a9da21bc.json
generated
Normal file
25
db/db-sqlx-maria/.sqlx/query-d4b92e8099cd29cfdb99aadeeada739bb6858667fc65f528ec484e98a9da21bc.json
generated
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "SELECT time FROM mcaptcha_pow_solved_stats \n WHERE config_id = (\n SELECT config_id FROM mcaptcha_config \n WHERE \n captcha_key = ?\n AND\n user_id = (\n SELECT \n ID FROM mcaptcha_users WHERE name = ?)) \n ORDER BY time DESC",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "time",
|
||||||
|
"type_info": {
|
||||||
|
"type": "Timestamp",
|
||||||
|
"flags": "NOT_NULL | UNSIGNED | BINARY | TIMESTAMP",
|
||||||
|
"char_set": 63,
|
||||||
|
"max_size": 19
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 2
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "d4b92e8099cd29cfdb99aadeeada739bb6858667fc65f528ec484e98a9da21bc"
|
||||||
|
}
|
||||||
25
db/db-sqlx-maria/.sqlx/query-daac5e937aeac2f106eb89154b431fa8bd1bd7baa95e51704fdcdf50bd970a1d.json
generated
Normal file
25
db/db-sqlx-maria/.sqlx/query-daac5e937aeac2f106eb89154b431fa8bd1bd7baa95e51704fdcdf50bd970a1d.json
generated
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "SELECT time FROM mcaptcha_pow_fetched_stats\n WHERE \n config_id = (\n SELECT \n config_id FROM mcaptcha_config \n WHERE \n captcha_key = ?\n AND\n user_id = (\n SELECT \n ID FROM mcaptcha_users WHERE name = ?))\n ORDER BY time DESC",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "time",
|
||||||
|
"type_info": {
|
||||||
|
"type": "Timestamp",
|
||||||
|
"flags": "NOT_NULL | UNSIGNED | BINARY | TIMESTAMP",
|
||||||
|
"char_set": 63,
|
||||||
|
"max_size": 19
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 2
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "daac5e937aeac2f106eb89154b431fa8bd1bd7baa95e51704fdcdf50bd970a1d"
|
||||||
|
}
|
||||||
36
db/db-sqlx-maria/.sqlx/query-dd5ff10b88fa6f374e105b6bed9e34e0870ac8dd7ce36dfb09d13a1b7005b2eb.json
generated
Normal file
36
db/db-sqlx-maria/.sqlx/query-dd5ff10b88fa6f374e105b6bed9e34e0870ac8dd7ce36dfb09d13a1b7005b2eb.json
generated
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "SELECT name, password FROM mcaptcha_users WHERE name = ?",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "name",
|
||||||
|
"type_info": {
|
||||||
|
"type": "VarString",
|
||||||
|
"flags": "NOT_NULL | UNIQUE_KEY | NO_DEFAULT_VALUE",
|
||||||
|
"char_set": 224,
|
||||||
|
"max_size": 400
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "password",
|
||||||
|
"type_info": {
|
||||||
|
"type": "Blob",
|
||||||
|
"flags": "NOT_NULL | BLOB | NO_DEFAULT_VALUE",
|
||||||
|
"char_set": 224,
|
||||||
|
"max_size": 262140
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 1
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "dd5ff10b88fa6f374e105b6bed9e34e0870ac8dd7ce36dfb09d13a1b7005b2eb"
|
||||||
|
}
|
||||||
25
db/db-sqlx-maria/.sqlx/query-dd9b4dec39405ff19af21faabb6a7c3bb3207e7e785fe15357146b88c6c27f01.json
generated
Normal file
25
db/db-sqlx-maria/.sqlx/query-dd9b4dec39405ff19af21faabb6a7c3bb3207e7e785fe15357146b88c6c27f01.json
generated
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "SELECT secret FROM mcaptcha_users WHERE name = ?",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "secret",
|
||||||
|
"type_info": {
|
||||||
|
"type": "VarString",
|
||||||
|
"flags": "NOT_NULL | UNIQUE_KEY | NO_DEFAULT_VALUE",
|
||||||
|
"char_set": 224,
|
||||||
|
"max_size": 200
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 1
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "dd9b4dec39405ff19af21faabb6a7c3bb3207e7e785fe15357146b88c6c27f01"
|
||||||
|
}
|
||||||
36
db/db-sqlx-maria/.sqlx/query-df6de3b96afcfb7f364f98954995e506b19e80e7f88204405d970c360ad5e1a0.json
generated
Normal file
36
db/db-sqlx-maria/.sqlx/query-df6de3b96afcfb7f364f98954995e506b19e80e7f88204405d970c360ad5e1a0.json
generated
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "SELECT difficulty_factor, visitor_threshold FROM mcaptcha_levels WHERE\n config_id = (\n SELECT config_id FROM mcaptcha_config where captcha_key= (?)\n AND user_id = (SELECT ID from mcaptcha_users WHERE name = ?)\n )\n ORDER BY difficulty_factor ASC;",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "difficulty_factor",
|
||||||
|
"type_info": {
|
||||||
|
"type": "Long",
|
||||||
|
"flags": "NOT_NULL | NO_DEFAULT_VALUE",
|
||||||
|
"char_set": 63,
|
||||||
|
"max_size": 11
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "visitor_threshold",
|
||||||
|
"type_info": {
|
||||||
|
"type": "Long",
|
||||||
|
"flags": "NOT_NULL | NO_DEFAULT_VALUE",
|
||||||
|
"char_set": 63,
|
||||||
|
"max_size": 11
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 2
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "df6de3b96afcfb7f364f98954995e506b19e80e7f88204405d970c360ad5e1a0"
|
||||||
|
}
|
||||||
12
db/db-sqlx-maria/.sqlx/query-e2b0b85f2afac1cbca43ce684641bf75ef070e44ce3d00404fc6151d2f4d7bcf.json
generated
Normal file
12
db/db-sqlx-maria/.sqlx/query-e2b0b85f2afac1cbca43ce684641bf75ef070e44ce3d00404fc6151d2f4d7bcf.json
generated
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "INSERT INTO mcaptcha_pow_solved_stats \n (config_id, time) VALUES ((SELECT config_id FROM mcaptcha_config where captcha_key= ?), ?)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 2
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "e2b0b85f2afac1cbca43ce684641bf75ef070e44ce3d00404fc6151d2f4d7bcf"
|
||||||
|
}
|
||||||
25
db/db-sqlx-maria/.sqlx/query-e2c30dafa790b388a193ad8785c0a7d88d8e7a7558775e238fe009f478003e46.json
generated
Normal file
25
db/db-sqlx-maria/.sqlx/query-e2c30dafa790b388a193ad8785c0a7d88d8e7a7558775e238fe009f478003e46.json
generated
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "\n SELECT\n psuedo_id\n FROM\n mcaptcha_psuedo_campaign_id\n ORDER BY ID ASC LIMIT ? OFFSET ?;",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "psuedo_id",
|
||||||
|
"type_info": {
|
||||||
|
"type": "VarString",
|
||||||
|
"flags": "NOT_NULL | UNIQUE_KEY | NO_DEFAULT_VALUE",
|
||||||
|
"char_set": 224,
|
||||||
|
"max_size": 400
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 2
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "e2c30dafa790b388a193ad8785c0a7d88d8e7a7558775e238fe009f478003e46"
|
||||||
|
}
|
||||||
12
db/db-sqlx-maria/.sqlx/query-e4d9bf156a368dcee1433dd5ced9f1991aa15f84e0ade916433aada40f68f0aa.json
generated
Normal file
12
db/db-sqlx-maria/.sqlx/query-e4d9bf156a368dcee1433dd5ced9f1991aa15f84e0ade916433aada40f68f0aa.json
generated
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "\n DELETE FROM\n mcaptcha_psuedo_campaign_id\n WHERE config_id = (\n SELECT config_id FROM mcaptcha_config WHERE captcha_key = ?\n );",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 1
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "e4d9bf156a368dcee1433dd5ced9f1991aa15f84e0ade916433aada40f68f0aa"
|
||||||
|
}
|
||||||
25
db/db-sqlx-maria/.sqlx/query-e6569a6064d0e07abea4c0bd4686cdfdaac64f0109ac40efaed06a744a2eaf5e.json
generated
Normal file
25
db/db-sqlx-maria/.sqlx/query-e6569a6064d0e07abea4c0bd4686cdfdaac64f0109ac40efaed06a744a2eaf5e.json
generated
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "SELECT name from mcaptcha_users WHERE name = ?",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "name",
|
||||||
|
"type_info": {
|
||||||
|
"type": "VarString",
|
||||||
|
"flags": "NOT_NULL | UNIQUE_KEY | NO_DEFAULT_VALUE",
|
||||||
|
"char_set": 224,
|
||||||
|
"max_size": 400
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 1
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "e6569a6064d0e07abea4c0bd4686cdfdaac64f0109ac40efaed06a744a2eaf5e"
|
||||||
|
}
|
||||||
47
db/db-sqlx-maria/.sqlx/query-e91116ebce127833488130cf1060e0817e5677f39588632452b8d621688c405a.json
generated
Normal file
47
db/db-sqlx-maria/.sqlx/query-e91116ebce127833488130cf1060e0817e5677f39588632452b8d621688c405a.json
generated
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "SELECT \n avg_traffic, \n peak_sustainable_traffic, \n broke_my_site_traffic \n FROM \n mcaptcha_sitekey_user_provided_avg_traffic \n WHERE \n config_id = (\n SELECT \n config_id \n FROM \n mcaptcha_config \n WHERE \n captcha_key = ? \n AND user_id = (\n SELECT \n id \n FROM \n mcaptcha_users \n WHERE \n NAME = ?\n )\n )\n ",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "avg_traffic",
|
||||||
|
"type_info": {
|
||||||
|
"type": "Long",
|
||||||
|
"flags": "NOT_NULL | NO_DEFAULT_VALUE",
|
||||||
|
"char_set": 63,
|
||||||
|
"max_size": 11
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "peak_sustainable_traffic",
|
||||||
|
"type_info": {
|
||||||
|
"type": "Long",
|
||||||
|
"flags": "NOT_NULL | NO_DEFAULT_VALUE",
|
||||||
|
"char_set": 63,
|
||||||
|
"max_size": 11
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "broke_my_site_traffic",
|
||||||
|
"type_info": {
|
||||||
|
"type": "Long",
|
||||||
|
"flags": "",
|
||||||
|
"char_set": 63,
|
||||||
|
"max_size": 11
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 2
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
true
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "e91116ebce127833488130cf1060e0817e5677f39588632452b8d621688c405a"
|
||||||
|
}
|
||||||
36
db/db-sqlx-maria/.sqlx/query-ed943cbf7e16536d81010255ce2f5beb207b2b9d44cb859fa9f2233405b80ae0.json
generated
Normal file
36
db/db-sqlx-maria/.sqlx/query-ed943cbf7e16536d81010255ce2f5beb207b2b9d44cb859fa9f2233405b80ae0.json
generated
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "SELECT name, password FROM mcaptcha_users WHERE email = ?",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "name",
|
||||||
|
"type_info": {
|
||||||
|
"type": "VarString",
|
||||||
|
"flags": "NOT_NULL | UNIQUE_KEY | NO_DEFAULT_VALUE",
|
||||||
|
"char_set": 224,
|
||||||
|
"max_size": 400
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "password",
|
||||||
|
"type_info": {
|
||||||
|
"type": "Blob",
|
||||||
|
"flags": "NOT_NULL | BLOB | NO_DEFAULT_VALUE",
|
||||||
|
"char_set": 224,
|
||||||
|
"max_size": 262140
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 1
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "ed943cbf7e16536d81010255ce2f5beb207b2b9d44cb859fa9f2233405b80ae0"
|
||||||
|
}
|
||||||
12
db/db-sqlx-maria/.sqlx/query-f987c4568ab28271d87af47f473b18cf41130a483333e81d5f50199758cbb98b.json
generated
Normal file
12
db/db-sqlx-maria/.sqlx/query-f987c4568ab28271d87af47f473b18cf41130a483333e81d5f50199758cbb98b.json
generated
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "INSERT INTO mcaptcha_pow_analytics \n (config_id, time, difficulty_factor, worker_type)\n VALUES ((SELECT config_id FROM mcaptcha_config where captcha_key= ?), ?, ?, ?)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 4
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "f987c4568ab28271d87af47f473b18cf41130a483333e81d5f50199758cbb98b"
|
||||||
|
}
|
||||||
12
db/db-sqlx-maria/.sqlx/query-f9f2ed1b2f47828d5d976d2e470e106d54b8a2357f9d525ef0cdb1f7965aa61c.json
generated
Normal file
12
db/db-sqlx-maria/.sqlx/query-f9f2ed1b2f47828d5d976d2e470e106d54b8a2357f9d525ef0cdb1f7965aa61c.json
generated
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "-- SPDX-FileCopyrightText: 2023 Aravinth Manivannan <realaravinth@batsense.net>\n--\n-- SPDX-License-Identifier: AGPL-3.0-or-later\n\n-- mark a notification as read\nUPDATE mcaptcha_notifications\n SET read_notification = TRUE\nWHERE \n mcaptcha_notifications.id = ?\nAND\n mcaptcha_notifications.rx = (\n SELECT\n id\n FROM\n mcaptcha_users\n WHERE\n name = ?\n );\n",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 2
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "f9f2ed1b2f47828d5d976d2e470e106d54b8a2357f9d525ef0cdb1f7965aa61c"
|
||||||
|
}
|
||||||
12
db/db-sqlx-maria/.sqlx/query-fc717ff0827ccfaa1cc61a71cc7f71c348ebb03d35895c54b011c03121ad2385.json
generated
Normal file
12
db/db-sqlx-maria/.sqlx/query-fc717ff0827ccfaa1cc61a71cc7f71c348ebb03d35895c54b011c03121ad2385.json
generated
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"db_name": "MySQL",
|
||||||
|
"query": "DELETE FROM mcaptcha_sitekey_user_provided_avg_traffic\n WHERE config_id = (\n SELECT config_id \n FROM \n mcaptcha_config \n WHERE\n captcha_key = ?\n AND \n user_id = (SELECT ID FROM mcaptcha_users WHERE name = ?)\n );",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 2
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "fc717ff0827ccfaa1cc61a71cc7f71c348ebb03d35895c54b011c03121ad2385"
|
||||||
|
}
|
||||||
@@ -12,11 +12,11 @@ authors = ["realaravinth <realaravinth@batsense.net>"]
|
|||||||
async-trait = "0.1.51"
|
async-trait = "0.1.51"
|
||||||
db-core = {path = "../db-core"}
|
db-core = {path = "../db-core"}
|
||||||
futures = "0.3.15"
|
futures = "0.3.15"
|
||||||
sqlx = { version = "0.5.13", features = [ "runtime-actix-rustls", "mysql", "time", "offline" ] }
|
sqlx = { version = "0.7", features = [ "runtime-tokio-rustls", "mysql", "time"] }
|
||||||
uuid = { version = "1.4.0", features = ["v4", "serde"] }
|
uuid = { version = "1.4.0", features = ["v4", "serde"] }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
actix-rt = "2"
|
actix-rt = "2"
|
||||||
sqlx = { version = "0.5.13", features = [ "runtime-actix-rustls", "mysql", "time", "offline" ] }
|
sqlx = { version = "0.7", features = [ "runtime-tokio-rustls", "mysql", "time" ] }
|
||||||
db-core = {path = "../db-core", features = ["test"]}
|
db-core = {path = "../db-core", features = ["test"]}
|
||||||
url = { version = "2.2.2", features = ["serde"] }
|
url = { version = "2.2.2", features = ["serde"] }
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ pub mod dev {
|
|||||||
|
|
||||||
pub mod prelude {
|
pub mod prelude {
|
||||||
pub use super::*;
|
pub use super::*;
|
||||||
pub use db_core::prelude::*;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
@@ -61,7 +60,7 @@ impl Connect for ConnectionOptions {
|
|||||||
let mut connect_options =
|
let mut connect_options =
|
||||||
sqlx::mysql::MySqlConnectOptions::from_str(&fresh.url).unwrap();
|
sqlx::mysql::MySqlConnectOptions::from_str(&fresh.url).unwrap();
|
||||||
if fresh.disable_logging {
|
if fresh.disable_logging {
|
||||||
connect_options.disable_statement_logging();
|
connect_options = connect_options.disable_statement_logging();
|
||||||
}
|
}
|
||||||
fresh
|
fresh
|
||||||
.pool_options
|
.pool_options
|
||||||
@@ -988,12 +987,8 @@ impl MCDatabase for Database {
|
|||||||
&self,
|
&self,
|
||||||
captcha_id: &str,
|
captcha_id: &str,
|
||||||
) -> DBResult<String> {
|
) -> DBResult<String> {
|
||||||
struct ID {
|
|
||||||
psuedo_id: String,
|
|
||||||
}
|
|
||||||
|
|
||||||
let res = sqlx::query_as!(
|
let res = sqlx::query_as!(
|
||||||
ID,
|
PsuedoID,
|
||||||
"SELECT psuedo_id FROM
|
"SELECT psuedo_id FROM
|
||||||
mcaptcha_psuedo_campaign_id
|
mcaptcha_psuedo_campaign_id
|
||||||
WHERE
|
WHERE
|
||||||
@@ -1070,6 +1065,28 @@ impl MCDatabase for Database {
|
|||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
/// Get all psuedo IDs
|
||||||
|
async fn analytics_get_all_psuedo_ids(&self, page: usize) -> DBResult<Vec<String>> {
|
||||||
|
const LIMIT: usize = 50;
|
||||||
|
let offset = LIMIT * page;
|
||||||
|
|
||||||
|
let mut res = sqlx::query_as!(
|
||||||
|
PsuedoID,
|
||||||
|
"
|
||||||
|
SELECT
|
||||||
|
psuedo_id
|
||||||
|
FROM
|
||||||
|
mcaptcha_psuedo_campaign_id
|
||||||
|
ORDER BY ID ASC LIMIT ? OFFSET ?;",
|
||||||
|
LIMIT as i64,
|
||||||
|
offset as i64
|
||||||
|
)
|
||||||
|
.fetch_all(&self.pool)
|
||||||
|
.await
|
||||||
|
.map_err(|e| map_row_not_found_err(e, DBError::CaptchaNotFound))?;
|
||||||
|
|
||||||
|
Ok(res.drain(0..).map(|r| r.psuedo_id).collect())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
@@ -1135,3 +1152,7 @@ impl From<InternaleCaptchaConfig> for Captcha {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct PsuedoID {
|
||||||
|
psuedo_id: String,
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT id, time, difficulty_factor, worker_type FROM mcaptcha_pow_analytics\n WHERE \n config_id = (\n SELECT \n config_id FROM mcaptcha_config \n WHERE \n key = $1\n )\n ORDER BY ID\n OFFSET $2 LIMIT $3\n ",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "id",
|
||||||
|
"type_info": "Int4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "time",
|
||||||
|
"type_info": "Int4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "difficulty_factor",
|
||||||
|
"type_info": "Int4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 3,
|
||||||
|
"name": "worker_type",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Text",
|
||||||
|
"Int8",
|
||||||
|
"Int8"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "017576128f1c63aee062799a33f872457fe19f5d6429d0af312dc00c244b31cb"
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT config_id, duration, name, key from mcaptcha_config WHERE\n key = $1 AND\n user_id = (SELECT ID FROM mcaptcha_users WHERE name = $2) ",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "config_id",
|
||||||
|
"type_info": "Int4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "duration",
|
||||||
|
"type_info": "Int4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "name",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 3,
|
||||||
|
"name": "key",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Text",
|
||||||
|
"Text"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "02deb524bb12632af9b7883975f75fdc30d6775d836aff647add1dffd1a4bc00"
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "INSERT INTO mcaptcha_pow_confirmed_stats \n (config_id, time) VALUES ((SELECT config_id FROM mcaptcha_config WHERE key = $1), $2)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Text",
|
||||||
|
"Timestamptz"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "044e2036a518de2ccac9318ccba07f7ce10e4a1c1d51d0128ea5e8cb94358ac5"
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "INSERT INTO mcaptcha_sitekey_user_provided_avg_traffic (\n config_id,\n avg_traffic,\n peak_sustainable_traffic,\n broke_my_site_traffic\n ) VALUES ( \n (SELECT config_id FROM mcaptcha_config WHERE key = ($1)\n AND user_id = (SELECT ID FROM mcaptcha_users WHERE name = $2)\n ), $3, $4, $5)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Text",
|
||||||
|
"Text",
|
||||||
|
"Int4",
|
||||||
|
"Int4",
|
||||||
|
"Int4"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "0840af95cc17c8ea6fc994e53696d4dec39ef9b4b6dd6c58c21cc44ccbb4bd09"
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "DELETE FROM mcaptcha_sitekey_user_provided_avg_traffic\n WHERE config_id = (\n SELECT config_id \n FROM \n mcaptcha_config \n WHERE\n key = ($1) \n AND \n user_id = (SELECT ID FROM mcaptcha_users WHERE name = $2)\n );",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Text",
|
||||||
|
"Text"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "0e7a1a38019c5e88ebd096fc5f6031aaa7f337fe735aa44c4e31bd6e51163749"
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT key, name, config_id, duration FROM mcaptcha_config WHERE\n user_id = (SELECT ID FROM mcaptcha_users WHERE name = $1) ",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "key",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "name",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "config_id",
|
||||||
|
"type_info": "Int4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 3,
|
||||||
|
"name": "duration",
|
||||||
|
"type_info": "Int4"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Text"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "16864df9cf9a69c299d9ab68bac559c48f4fc433541a10f7c1b60717df2b820e"
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "UPDATE mcaptcha_users set name = $1\n WHERE name = $2",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Varchar",
|
||||||
|
"Text"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "1e9fe69b23e4bfa7bb369455753100307e334e8dbaf02ff37cda08992fe95910"
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "-- SPDX-FileCopyrightText: 2023 Aravinth Manivannan <realaravinth@batsense.net>\n--\n-- SPDX-License-Identifier: AGPL-3.0-or-later\n\n-- gets all unread notifications a user has\nSELECT \n mcaptcha_notifications.id,\n mcaptcha_notifications.heading,\n mcaptcha_notifications.message,\n mcaptcha_notifications.received,\n mcaptcha_users.name\nFROM\n mcaptcha_notifications \nINNER JOIN \n mcaptcha_users \nON \n mcaptcha_notifications.tx = mcaptcha_users.id\nWHERE \n mcaptcha_notifications.rx = (\n SELECT \n id \n FROM \n mcaptcha_users\n WHERE\n name = $1\n )\nAND \n mcaptcha_notifications.read IS NULL;\n",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "id",
|
||||||
|
"type_info": "Int4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "heading",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "message",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 3,
|
||||||
|
"name": "received",
|
||||||
|
"type_info": "Timestamptz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 4,
|
||||||
|
"name": "name",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Text"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "213ac909efb60f7f5e095fe2d3d1ec4f98fde7d84de011272c788aaf825b6ae2"
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT\n key\n FROM\n mcaptcha_config\n WHERE\n config_id = (\n SELECT\n config_id\n FROM\n mcaptcha_psuedo_campaign_id\n WHERE\n psuedo_id = $1\n );",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "key",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Text"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "21cdf28d8962389d22c8ddefdad82780f5316737e3d833623512aa12a54a026a"
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "INSERT INTO mcaptcha_config\n (key, user_id, duration, name)\n VALUES ($1, (SELECT ID FROM mcaptcha_users WHERE name = $2), $3, $4)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Varchar",
|
||||||
|
"Text",
|
||||||
|
"Int4",
|
||||||
|
"Varchar"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "307245aaf5b0d692448b80358d6916aa50c507b35e724d66c9b16a16b60e1b38"
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT email FROM mcaptcha_users WHERE name = $1",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "email",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Text"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
true
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "30ba202b601dd07f41798775c7c59fde7deeae759ec959df46734a66ffd78df7"
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "\n DELETE FROM\n mcaptcha_psuedo_campaign_id\n WHERE config_id = (\n SELECT config_id FROM mcaptcha_config WHERE key = ($1)\n );",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Text"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "30d8945806b4c68b6da800395f61c1e480839093bfcda9c693bf1972a65c7d79"
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "UPDATE mcaptcha_users set secret = $1\n WHERE name = $2",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Varchar",
|
||||||
|
"Text"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "3b1c8128fc48b16d8e8ea6957dd4fbc0eb19ae64748fd7824e9f5e1901dd1726"
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT EXISTS (\n SELECT 1 from mcaptcha_config WHERE key = $1 \n AND user_id = (SELECT ID FROM mcaptcha_users WHERE name = $2)\n )",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "exists",
|
||||||
|
"type_info": "Bool"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Text",
|
||||||
|
"Text"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
null
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "3eb1c43ffd2378c4dd59975568c3a180b72d13008f294a91f3e76b785dba295b"
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT time FROM mcaptcha_pow_confirmed_stats \n WHERE \n config_id = (\n SELECT config_id FROM mcaptcha_config \n WHERE \n key = $1\n AND\n user_id = (\n SELECT \n ID FROM mcaptcha_users WHERE name = $2))\n ORDER BY time DESC",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "time",
|
||||||
|
"type_info": "Timestamptz"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Text",
|
||||||
|
"Text"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "4303f5c6ef98e0de9d8d3c2d781d3ffaa3dee5f7d27db831d327b26f03ba9d68"
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "insert into mcaptcha_users \n (name , password, email, secret) values ($1, $2, $3, $4)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Varchar",
|
||||||
|
"Text",
|
||||||
|
"Varchar",
|
||||||
|
"Varchar"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "45d9e9fb6344fe3a18c2529d50c935d3837bfe25c96595beb6970d6067720578"
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT EXISTS (SELECT 1 from mcaptcha_users WHERE email = $1)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "exists",
|
||||||
|
"type_info": "Bool"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Text"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
null
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "47fa50aecfb1499b0a18fa9299643017a1a8d69d4e9980032e0d8f745465d14f"
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT secret FROM mcaptcha_users WHERE ID = (\n SELECT user_id FROM mcaptcha_config WHERE key = $1\n )",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "secret",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Text"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "494d2aed281e1408aeda3606b0814db75aea2878783a2e2f11a4feb6fc48e938"
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT EXISTS (SELECT 1 from mcaptcha_config WHERE key = $1)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "exists",
|
||||||
|
"type_info": "Bool"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Text"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
null
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "4a5dfbc5aeb2bab290a09640cc25223d484fbc7549e5bc54f33bab8616725031"
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "UPDATE mcaptcha_config SET key = $1 \n WHERE key = $2 AND user_id = (SELECT ID FROM mcaptcha_users WHERE name = $3)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Varchar",
|
||||||
|
"Text",
|
||||||
|
"Text"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "507bea10c7f8417c5b1430211d0137299cd561333bf47f7b4887d0ef801d1ea4"
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "UPDATE mcaptcha_config SET name = $1, duration = $2\n WHERE user_id = (SELECT ID FROM mcaptcha_users WHERE name = $3)\n AND key = $4",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Varchar",
|
||||||
|
"Int4",
|
||||||
|
"Text",
|
||||||
|
"Text"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "570c22f19fe0b97d78086038c8ef82509dce0bae704d80f9f031c1c47e6a6572"
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT difficulty_factor, visitor_threshold FROM mcaptcha_levels WHERE\n config_id = (\n SELECT config_id FROM mcaptcha_config WHERE key = ($1)\n AND user_id = (SELECT ID from mcaptcha_users WHERE name = $2)\n )\n ORDER BY difficulty_factor ASC;",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "difficulty_factor",
|
||||||
|
"type_info": "Int4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "visitor_threshold",
|
||||||
|
"type_info": "Int4"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Text",
|
||||||
|
"Text"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "717771c42737feb3f4ca13f2ab11361073ea17b55562a103f660149bf049c5c6"
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "INSERT INTO mcaptcha_pow_fetched_stats \n (config_id, time) VALUES ((SELECT config_id FROM mcaptcha_config WHERE key = $1), $2)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Text",
|
||||||
|
"Timestamptz"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "726a794f7599b78ab749d9f887f5c28db38f072b41f691bde35d23ba0dd72409"
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "DELETE FROM mcaptcha_levels \n WHERE config_id = (\n SELECT config_id FROM mcaptcha_config where key = ($1) \n AND user_id = (\n SELECT ID from mcaptcha_users WHERE name = $2\n )\n )",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Text",
|
||||||
|
"Text"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "7c96ae73dd73c1b0e073e3ac78f87f4cba23fdb2cdbed9ba9b0d55f33655582e"
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "INSERT INTO mcaptcha_users \n (name , password, secret) VALUES ($1, $2, $3)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Varchar",
|
||||||
|
"Text",
|
||||||
|
"Varchar"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "81c779ed4bb59f8b94dea730cbda31f7733ef16d509a3ed607388b5ddef74638"
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT psuedo_id FROM\n mcaptcha_psuedo_campaign_id\n WHERE\n config_id = (SELECT config_id FROM mcaptcha_config WHERE key = ($1));\n ",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "psuedo_id",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Text"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "839dfdfc3543b12128cb2b44bf356cd81f3da380963e5684ec3624a0ea4f9547"
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT time FROM mcaptcha_pow_solved_stats \n WHERE config_id = (\n SELECT config_id FROM mcaptcha_config \n WHERE \n key = $1\n AND\n user_id = (\n SELECT \n ID FROM mcaptcha_users WHERE name = $2)) \n ORDER BY time DESC",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "time",
|
||||||
|
"type_info": "Timestamptz"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Text",
|
||||||
|
"Text"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "84484cb6892db29121816bc5bff5702b9e857e20aa14e79d080d78ae7593153b"
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT difficulty_factor, visitor_threshold FROM mcaptcha_levels WHERE\n config_id = (\n SELECT config_id FROM mcaptcha_config WHERE key = ($1)\n ) ORDER BY difficulty_factor ASC;",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "difficulty_factor",
|
||||||
|
"type_info": "Int4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "visitor_threshold",
|
||||||
|
"type_info": "Int4"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Text"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "9753721856a47438c5e72f28fd9d149db10c48e677b4613bf3f1e8487908aac8"
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT duration FROM mcaptcha_config \n WHERE key = $1",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "duration",
|
||||||
|
"type_info": "Int4"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Text"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "ad196ab3ef9dc32f6de2313577ccd6c26eae9ab19df5f71ce182651983efb99a"
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT EXISTS (SELECT 1 from mcaptcha_users WHERE name = $1)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "exists",
|
||||||
|
"type_info": "Bool"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Text"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
null
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "ad23588ee4bcbb13e208460ce21e2fa9f1373893934b530b339fea10360b34a8"
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "INSERT INTO mcaptcha_pow_analytics \n (config_id, time, difficulty_factor, worker_type)\n VALUES ((SELECT config_id FROM mcaptcha_config WHERE key = $1), $2, $3, $4)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Text",
|
||||||
|
"Int4",
|
||||||
|
"Int4",
|
||||||
|
"Varchar"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "af47990880a92c63d1cf5192203899c72621479dc6bb47859fb4498264b78033"
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "-- SPDX-FileCopyrightText: 2023 Aravinth Manivannan <realaravinth@batsense.net>\n--\n-- SPDX-License-Identifier: AGPL-3.0-or-later\n\n-- mark a notification as read\nUPDATE mcaptcha_notifications\n SET read = TRUE\nWHERE \n mcaptcha_notifications.id = $1\nAND\n mcaptcha_notifications.rx = (\n SELECT\n id\n FROM\n mcaptcha_users\n WHERE\n name = $2\n );\n",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Int4",
|
||||||
|
"Text"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "b465e974155aeaaa128896d4261505a32845dbe52dac07908c1d16810bfde4dc"
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "\n DELETE FROM\n mcaptcha_pow_analytics\n WHERE\n config_id = (\n SELECT config_id FROM mcaptcha_config WHERE key = $1\n )\n ",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Text"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "b67da576ff30a1bc8b1c0a79eff07f0622bd9ea035d3de15b91f5e1e8a5fda9b"
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "UPDATE mcaptcha_users set email = $1\n WHERE name = $2",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Varchar",
|
||||||
|
"Text"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "b97d810814fbeb2df19f47bcfa381bc6fb7ac6832d040b377cf4fca2ca896cfb"
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user