mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-12 10:35:39 +00:00
Compare commits
11 Commits
aria-label
...
fix-144
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
65c92ee96e | ||
|
|
1c9e242d7e | ||
|
|
3cb0ca38ec | ||
|
|
3cd38511fa | ||
|
|
d765bd7491 | ||
|
|
8e33e75659 | ||
|
|
c00857dd28 | ||
|
|
d010a1cbd4 | ||
|
|
453be36201 | ||
|
|
d4967626ee | ||
|
|
2ee0a0ae5f |
43
.env.docker-compose
Normal file
43
.env.docker-compose
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
MCAPTCHA_debug=false
|
||||||
|
MCAPTCHA_commercial=false
|
||||||
|
MCAPTCHA_source_code=https://github.com/mCaptcha/mCaptcha
|
||||||
|
MCAPTCHA_allow_registration=false
|
||||||
|
MCAPTCHA_allow_demo=false
|
||||||
|
|
||||||
|
# database
|
||||||
|
DATABASE_URL=postgres://postgres:password@mcaptcha_postgres:5432/postgres
|
||||||
|
MCAPTCHA_database_POOL=4
|
||||||
|
|
||||||
|
# redis
|
||||||
|
MCAPTCHA_redis_URL=redis://mcaptcha_redis
|
||||||
|
MCAPTCHA_redis_POOL=4
|
||||||
|
|
||||||
|
# server
|
||||||
|
PORT=7001
|
||||||
|
MCAPTCHA_server_DOMAIN=localhost
|
||||||
|
MCAPTCHA__server_COOKIE_SECRET=pleasereplacethiswithrandomstring # PLEASE SET RANDOM STRING. MIN LENGTH=32
|
||||||
|
MCAPTCHA__server_IP= 0.0.0.0
|
||||||
|
|
||||||
|
|
||||||
|
# captcha
|
||||||
|
MCAPTCHA_captcha_SALT=pleasereplacethiswithrandomstring # PLEASE SET RANDOM STRING. MIN LENGTH=32
|
||||||
|
MCAPTCHA_captcha_GC=30
|
||||||
|
MCAPTCHA_captcha_RUNNERS=4
|
||||||
|
MCAPTCHA_captcha_QUEUE_LENGTH=2000
|
||||||
|
MCAPTCHA_captcha_ENABLE_STATS=true
|
||||||
|
MCAPTCHA_captcha_DEFAULT_DIFFICULTY_STRATEGY_avg_traffic_difficulty=50000 # almost instant solution
|
||||||
|
MCAPTCHA_captcha_DEFAULT_DIFFICULTY_STRATEGY_broke_my_site_traffic_difficulty=3000000 # roughly 1.5s
|
||||||
|
MCAPTCHA_captcha_DEFAULT_DIFFICULTY_STRATEGY_peak_sustainable_traffic_difficulty=5000000 # greater than 3.5s
|
||||||
|
MCAPTCHA_captcha_DEFAULT_DIFFICULTY_STRATEGY_duration=30 # cooldown period in seconds
|
||||||
|
MCAPTCHA_captcha_DEFAULT_DIFFICULTY_STRATEGY_avg_traffic_time=1 # almost instant solution
|
||||||
|
MCAPTCHA_captcha_DEFAULT_DIFFICULTY_STRATEGY_peak_sustainable_traffic_time=3
|
||||||
|
MCAPTCHA_captcha_DEFAULT_DIFFICULTY_STRATEGY_broke_my_site_traffic_time=5
|
||||||
|
|
||||||
|
|
||||||
|
# SMTP
|
||||||
|
#MCAPTCHA_smtp_FROM=
|
||||||
|
#MCAPTCHA_smtp_REPLY=
|
||||||
|
#MCAPTCHA_smtp_URL=
|
||||||
|
#MCAPTCHA_smtp_USERNAME=
|
||||||
|
#MCAPTCHA_smtp_PASSWORD=
|
||||||
|
#MCAPTCHA_smtp_PORT=
|
||||||
@@ -31,6 +31,10 @@ RUN cargo build --release
|
|||||||
|
|
||||||
FROM debian:bookworm 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 set -ex; \
|
||||||
|
apt-get update; \
|
||||||
|
DEBIAN_FRONTEND=noninteractive \
|
||||||
|
apt-get install -y --no-install-recommends curl
|
||||||
RUN useradd -ms /bin/bash -u 1001 mcaptcha
|
RUN useradd -ms /bin/bash -u 1001 mcaptcha
|
||||||
WORKDIR /home/mcaptcha
|
WORKDIR /home/mcaptcha
|
||||||
COPY --from=rust /src/target/release/mcaptcha /usr/local/bin/
|
COPY --from=rust /src/target/release/mcaptcha /usr/local/bin/
|
||||||
|
|||||||
@@ -9,11 +9,8 @@ services:
|
|||||||
image: mcaptcha/mcaptcha:latest
|
image: mcaptcha/mcaptcha:latest
|
||||||
ports:
|
ports:
|
||||||
- 7000:7000
|
- 7000:7000
|
||||||
environment:
|
env_file:
|
||||||
DATABASE_URL: postgres://postgres:password@mcaptcha_postgres:5432/postgres # set password at placeholder
|
- .env.docker-compose
|
||||||
MCAPTCHA_redis_URL: "redis://mcaptcha_redis/"
|
|
||||||
RUST_LOG: "debug"
|
|
||||||
PORT: 7000
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- mcaptcha_postgres
|
- mcaptcha_postgres
|
||||||
- mcaptcha_redis
|
- mcaptcha_redis
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ copy() {
|
|||||||
mkdir $TARGET_DIR/docs
|
mkdir $TARGET_DIR/docs
|
||||||
cp docs/DEPLOYMENT.md $TARGET_DIR/docs
|
cp docs/DEPLOYMENT.md $TARGET_DIR/docs
|
||||||
cp docs/CONFIGURATION.md $TARGET_DIR/docs
|
cp docs/CONFIGURATION.md $TARGET_DIR/docs
|
||||||
|
cp config/default.toml $TARGET_DIR/config.toml
|
||||||
|
|
||||||
get_bin
|
get_bin
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ export const solveCaptchaRunner = async (e: Event): Promise<void> => {
|
|||||||
}
|
}
|
||||||
if (resp.type === "progress") {
|
if (resp.type === "progress") {
|
||||||
if (width < 80) {
|
if (width < 80) {
|
||||||
width = (resp.nonce / max_recorded_nonce) * 100;
|
width = Number(resp.nonce / max_recorded_nonce) * 100;
|
||||||
setWidth(width);
|
setWidth(width);
|
||||||
}
|
}
|
||||||
console.log(`received nonce ${resp.nonce}`);
|
console.log(`received nonce ${resp.nonce}`);
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ body {
|
|||||||
display: flex;
|
display: flex;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
background-color: #f6f6f6;
|
||||||
|
border: 2px solid #e5e5e5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.widget__noscript-container {
|
.widget__noscript-container {
|
||||||
@@ -98,6 +100,29 @@ body {
|
|||||||
margin: 2px;
|
margin: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (prefers-color-scheme: dark) {
|
||||||
|
.widget__container {
|
||||||
|
background-color: #1c1c1c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.widget__inner-container {
|
||||||
|
background-color: #1c1c1c;
|
||||||
|
border: 2px solid #656569;
|
||||||
|
}
|
||||||
|
|
||||||
|
.widget__verification-container {
|
||||||
|
color: rgb(232, 230, 227);
|
||||||
|
}
|
||||||
|
|
||||||
|
.widget__mcaptcha-brand-name {
|
||||||
|
color: #7d94f9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.widget__mcaptcha-info-link {
|
||||||
|
color: #7d94f9;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* progress bar courtesy of https://codepen.io/Bizzy-Coding/pen/poOymVJ?editors=1111 */
|
/* progress bar courtesy of https://codepen.io/Bizzy-Coding/pen/poOymVJ?editors=1111 */
|
||||||
.progress__bar {
|
.progress__bar {
|
||||||
position: relative;
|
position: relative;
|
||||||
@@ -113,3 +138,9 @@ body {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
width: 0%;
|
width: 0%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (prefers-color-scheme: dark) {
|
||||||
|
.progress__bar {
|
||||||
|
background: unset;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user