mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-11 10:05:41 +00:00
Compare commits
5 Commits
feat-progr
...
feat-help-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4426057fbc | ||
|
|
1f23999c10 | ||
|
|
0a3d93453e | ||
|
|
939fb5f8b9 | ||
|
|
3a787a6592 |
12
.github/workflows/linux.yml
vendored
12
.github/workflows/linux.yml
vendored
@@ -129,12 +129,12 @@ jobs:
|
||||
if: (github.ref == 'refs/heads/master' || github.event_name == 'push') && github.repository == 'mCaptcha/mCaptcha'
|
||||
run: make docker-publish
|
||||
|
||||
# - name: publish bins
|
||||
# if: (github.ref == 'refs/heads/master' || github.event_name == 'push') && github.repository == 'mCaptcha/mCaptcha'
|
||||
# run: ./scripts/publish.sh publish master latest $DUMBSERVE_PASSWORD
|
||||
# env:
|
||||
# DUMBSERVE_PASSWORD: ${{ secrets.DUMBSERVE_PASSWORD }}
|
||||
# GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
|
||||
- name: publish bins
|
||||
if: (github.ref == 'refs/heads/master' || github.event_name == 'push') && github.repository == 'mCaptcha/mCaptcha'
|
||||
run: ./scripts/publish.sh publish master latest $DUMBSERVE_PASSWORD
|
||||
env:
|
||||
DUMBSERVE_PASSWORD: ${{ secrets.DUMBSERVE_PASSWORD }}
|
||||
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
|
||||
|
||||
- name: generate documentation
|
||||
if: matrix.version == 'stable' && (github.repository == 'mCaptcha/mCaptcha')
|
||||
|
||||
12
db/db-sqlx-maria/.sqlx/query-9def82dcec9c8d477824182bb2f71044cc264cf2073ab4f60a0000b435ed0f0b.json
generated
Normal file
12
db/db-sqlx-maria/.sqlx/query-9def82dcec9c8d477824182bb2f71044cc264cf2073ab4f60a0000b435ed0f0b.json
generated
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"db_name": "MySQL",
|
||||
"query": "INSERT INTO\n mcaptcha_track_nonce (level_id, nonce)\n VALUES ((\n SELECT\n level_id\n FROM\n mcaptcha_levels\n WHERE\n config_id = (SELECT config_id FROM mcaptcha_config WHERE captcha_key =?)\n AND\n difficulty_factor = ?\n ), ?);",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 3
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "9def82dcec9c8d477824182bb2f71044cc264cf2073ab4f60a0000b435ed0f0b"
|
||||
}
|
||||
@@ -1163,7 +1163,12 @@ impl MCDatabase for Database {
|
||||
nonce: i32,
|
||||
}
|
||||
|
||||
let res = sqlx::query_as!(
|
||||
async fn inner_get_max_nonce(
|
||||
pool: &MySqlPool,
|
||||
captcha_key: &str,
|
||||
difficulty_factor: u32,
|
||||
) -> DBResult<X> {
|
||||
sqlx::query_as!(
|
||||
X,
|
||||
"SELECT nonce FROM mcaptcha_track_nonce
|
||||
WHERE level_id = (
|
||||
@@ -1179,10 +1184,40 @@ impl MCDatabase for Database {
|
||||
&captcha_key,
|
||||
difficulty_factor as i32,
|
||||
)
|
||||
.fetch_one(&self.pool).await
|
||||
.fetch_one(pool).await
|
||||
.map_err(|e| map_row_not_found_err(e, DBError::CaptchaNotFound))
|
||||
}
|
||||
|
||||
let res = inner_get_max_nonce(&self.pool, captcha_key, difficulty_factor).await;
|
||||
if let Err(DBError::CaptchaNotFound) = res {
|
||||
sqlx::query!(
|
||||
"INSERT INTO
|
||||
mcaptcha_track_nonce (level_id, nonce)
|
||||
VALUES ((
|
||||
SELECT
|
||||
level_id
|
||||
FROM
|
||||
mcaptcha_levels
|
||||
WHERE
|
||||
config_id = (SELECT config_id FROM mcaptcha_config WHERE captcha_key =?)
|
||||
AND
|
||||
difficulty_factor = ?
|
||||
), ?);",
|
||||
&captcha_key,
|
||||
difficulty_factor as i32,
|
||||
0,
|
||||
)
|
||||
.execute(&self.pool)
|
||||
.await
|
||||
.map_err(|e| map_row_not_found_err(e, DBError::CaptchaNotFound))?;
|
||||
|
||||
Ok(res.nonce as u32)
|
||||
let res =
|
||||
inner_get_max_nonce(&self.pool, captcha_key, difficulty_factor).await?;
|
||||
Ok(res.nonce as u32)
|
||||
} else {
|
||||
let res = res?;
|
||||
Ok(res.nonce as u32)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "INSERT INTO\n mcaptcha_track_nonce (level_id, nonce)\n VALUES ((\n SELECT\n level_id\n FROM\n mcaptcha_levels\n WHERE\n config_id = (SELECT config_id FROM mcaptcha_config WHERE key = ($1))\n AND\n difficulty_factor = $2\n ), $3);",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Text",
|
||||
"Int4",
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "e0088cf77c1c3a0184f35d1899a6168023fba021adf281cf1c8f9e8ccfe3a03e"
|
||||
}
|
||||
@@ -1170,7 +1170,12 @@ impl MCDatabase for Database {
|
||||
nonce: i32,
|
||||
}
|
||||
|
||||
let res = sqlx::query_as!(
|
||||
async fn inner_get_max_nonce(
|
||||
pool: &PgPool,
|
||||
captcha_key: &str,
|
||||
difficulty_factor: u32,
|
||||
) -> DBResult<X> {
|
||||
sqlx::query_as!(
|
||||
X,
|
||||
"SELECT nonce FROM mcaptcha_track_nonce
|
||||
WHERE level_id = (
|
||||
@@ -1186,10 +1191,41 @@ impl MCDatabase for Database {
|
||||
&captcha_key,
|
||||
difficulty_factor as i32,
|
||||
)
|
||||
.fetch_one(&self.pool).await
|
||||
.fetch_one(pool)
|
||||
.await
|
||||
.map_err(|e| map_row_not_found_err(e, DBError::CaptchaNotFound))
|
||||
}
|
||||
|
||||
let res = inner_get_max_nonce(&self.pool, captcha_key, difficulty_factor).await;
|
||||
if let Err(DBError::CaptchaNotFound) = res {
|
||||
sqlx::query!(
|
||||
"INSERT INTO
|
||||
mcaptcha_track_nonce (level_id, nonce)
|
||||
VALUES ((
|
||||
SELECT
|
||||
level_id
|
||||
FROM
|
||||
mcaptcha_levels
|
||||
WHERE
|
||||
config_id = (SELECT config_id FROM mcaptcha_config WHERE key = ($1))
|
||||
AND
|
||||
difficulty_factor = $2
|
||||
), $3);",
|
||||
&captcha_key,
|
||||
difficulty_factor as i32,
|
||||
0,
|
||||
)
|
||||
.execute(&self.pool)
|
||||
.await
|
||||
.map_err(|e| map_row_not_found_err(e, DBError::CaptchaNotFound))?;
|
||||
|
||||
Ok(res.nonce as u32)
|
||||
let res =
|
||||
inner_get_max_nonce(&self.pool, captcha_key, difficulty_factor).await?;
|
||||
Ok(res.nonce as u32)
|
||||
} else {
|
||||
let res = res?;
|
||||
Ok(res.nonce as u32)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ DUMBSERVE_PASSWORD=$4
|
||||
DUMBSERVE_HOST="https://$DUMBSERVE_USERNAME:$DUMBSERVE_PASSWORD@dl.mcaptcha.org"
|
||||
|
||||
NAME=mcaptcha
|
||||
KEY=0CBABF3084E84E867A76709750BE39D10ECE01FB
|
||||
KEY=73DAC973A9ADBB9ADCB5CDC4595A08135BA9FF73
|
||||
|
||||
TMP_DIR=$(mktemp -d)
|
||||
FILENAME="$NAME-$2-linux-amd64"
|
||||
|
||||
@@ -52,7 +52,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
<. } .>
|
||||
|
||||
<label class="sitekey-form__label" for="publish_benchmarks">
|
||||
Anonymously publish CAPTCHA performance statistics to help other webmasters
|
||||
Anonymously publish CAPTCHA performance statistics to help other webmasters. <a href="https://mcaptcha.org/blog/introducing-mcaptcha-net">Please see here for more info</a>.
|
||||
<input
|
||||
class="sitekey-form__input"
|
||||
type="checkbox"
|
||||
|
||||
@@ -76,7 +76,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
|
||||
<label class="sitekey-form__label" for="publish_benchmarks">
|
||||
Anonymously publish CAPTCHA performance statistics to help other webmasters
|
||||
Anonymously publish CAPTCHA performance statistics to help other webmasters. <a href="https://mcaptcha.org/blog/introducing-mcaptcha-net">Please see here for more info</a>.
|
||||
<input
|
||||
class="sitekey-form__input"
|
||||
type="checkbox"
|
||||
|
||||
Reference in New Issue
Block a user