Captcha error silence
This commit is contained in:
parent
cc712a0e99
commit
f7a8069859
3 changed files with 10 additions and 8 deletions
9
justfile
9
justfile
|
@ -32,8 +32,7 @@ build-container-release:
|
||||||
podman build -t fb-server -f container/Containerfile .
|
podman build -t fb-server -f container/Containerfile .
|
||||||
|
|
||||||
# Builds a release container and runs it
|
# Builds a release container and runs it
|
||||||
start-release: start-postgres-dev clean-podman init-sqlx build-container-release
|
start-release: start-postgres-dev clean-podman init-sqlx build-container-release create-network
|
||||||
podman network create {{network}} --ignore
|
|
||||||
podman run -d --network {{network}} -e {{env_string}} -p 8080:8080 --name frostbyte fb-server
|
podman run -d --network {{network}} -e {{env_string}} -p 8080:8080 --name frostbyte fb-server
|
||||||
|
|
||||||
# Initializes the database, runs migrations and then prepares sqlx
|
# Initializes the database, runs migrations and then prepares sqlx
|
||||||
|
@ -45,10 +44,14 @@ init-sqlx:
|
||||||
|
|
||||||
# Starts a postgres container for development
|
# Starts a postgres container for development
|
||||||
[private]
|
[private]
|
||||||
start-postgres-dev:
|
start-postgres-dev: create-network
|
||||||
podman rm -f {{pg_container}}
|
podman rm -f {{pg_container}}
|
||||||
podman run --network {{network}} --name {{pg_container}} -e POSTGRES_PASSWORD={{pg_pass}} -d -p {{pg_port}}:5432 docker.io/postgres:16.1-alpine
|
podman run --network {{network}} --name {{pg_container}} -e POSTGRES_PASSWORD={{pg_pass}} -d -p {{pg_port}}:5432 docker.io/postgres:16.1-alpine
|
||||||
|
|
||||||
|
[private]
|
||||||
|
create-network:
|
||||||
|
podman network create {{network}} --ignore
|
||||||
|
|
||||||
# Forcefully stops and removes the frostbyte container
|
# Forcefully stops and removes the frostbyte container
|
||||||
[private]
|
[private]
|
||||||
clean-podman:
|
clean-podman:
|
||||||
|
|
|
@ -84,13 +84,14 @@ pub struct CaptchaResponse {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Request a captcha from the captcha service
|
/// Request a captcha from the captcha service
|
||||||
|
#[allow(unreachable_code, unused_variables)]
|
||||||
#[post("/captcha")]
|
#[post("/captcha")]
|
||||||
pub async fn captcha_request(cstate: Data<CaptchaState>) -> Result<impl Responder> {
|
pub async fn captcha_request(cstate: Data<CaptchaState>) -> Result<impl Responder> {
|
||||||
unimplemented!("Captcha is currently disabled");
|
unimplemented!("Captcha is currently disabled");
|
||||||
return Ok(HttpResponse::InternalServerError().json("Error"));
|
return Ok(HttpResponse::InternalServerError().json("Error"));
|
||||||
|
|
||||||
// This might block the thread a bit too long
|
// This might block the thread a bit too long
|
||||||
// let (answer, svg) = get_captcha();
|
let (answer, svg) = get_captcha();
|
||||||
|
|
||||||
// let id = rand_core::OsRng.next_u32() as i32;
|
// let id = rand_core::OsRng.next_u32() as i32;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use rand::{Rng, RngCore};
|
use rand::Rng;
|
||||||
|
|
||||||
// This will do for now
|
// This will do for now
|
||||||
pub fn hex_string(length: usize) -> String {
|
pub fn hex_string(length: usize) -> String {
|
||||||
|
@ -9,11 +9,9 @@ pub fn hex_string(length: usize) -> String {
|
||||||
}
|
}
|
||||||
|
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_random_hex_string() {
|
fn test_random_hex_string() {
|
||||||
let s = hex_string(16);
|
let s = super::hex_string(16);
|
||||||
assert_eq!(s.len(), 16);
|
assert_eq!(s.len(), 16);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue