28 Commits

Author SHA1 Message Date
b2da9b5dc5 Merge pull request 'Update Rust crate zxcvbn to v3' (#12) from renovate/zxcvbn-3.x into develop
All checks were successful
ci/woodpecker/push/dockerize Pipeline was successful
ci/woodpecker/push/deploy Pipeline was successful
ci/woodpecker/cron/dependencies Pipeline was successful
Reviewed-on: #12
2025-07-19 10:48:44 +00:00
ff578ab849 🐛 Use of the zxcvbn::Score enum
All checks were successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/audit Pipeline was successful
2025-07-19 12:31:39 +02:00
0cffafcd77 Update Rust crate zxcvbn to v3
Some checks failed
ci/woodpecker/pr/lint Pipeline failed
ci/woodpecker/pr/audit unknown status
2025-07-15 06:07:18 +00:00
e88ad47af9 Merge pull request 'Update Rust crate rand to 0.9.0' (#8) from renovate/rand-0.x into develop
All checks were successful
ci/woodpecker/push/dockerize Pipeline was successful
ci/woodpecker/push/deploy Pipeline was successful
ci/woodpecker/cron/dependencies Pipeline was successful
Reviewed-on: #8
2025-07-13 19:10:20 +00:00
bf6c3d5cb0 🐛 Apply getrandom requirements to support wasm-unknown-unknown
All checks were successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/audit Pipeline was successful
See https://docs.rs/getrandom/latest/getrandom/#webassembly-support
2025-07-13 20:43:23 +02:00
2f101bedc3 Merge pull request 'Update rust Docker tag to v1.88' (#17) from renovate/rust-1.x into develop
All checks were successful
ci/woodpecker/push/dockerize Pipeline was successful
ci/woodpecker/push/deploy Pipeline was successful
ci/woodpecker/cron/dependencies Pipeline was successful
Reviewed-on: #17
2025-06-29 11:46:22 +00:00
30b118a621 Update rust Docker tag to v1.88
All checks were successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/audit Pipeline was successful
2025-06-27 00:01:39 +00:00
cf359b4950 🐛 Fix issues raised by clippy
Some checks failed
ci/woodpecker/pr/lint Pipeline failed
ci/woodpecker/pr/audit unknown status
2025-06-09 14:18:40 +02:00
c101fba07c Merge pull request 'Update Rust crate thiserror to v2' (#11) from renovate/thiserror-2.x into develop
All checks were successful
ci/woodpecker/push/dockerize Pipeline was successful
ci/woodpecker/push/deploy Pipeline was successful
ci/woodpecker/cron/dependencies Pipeline was successful
Reviewed-on: #11
2025-06-09 09:38:30 +00:00
01778866e0 Merge pull request 'Update Rust crate turf to 0.10.0' (#9) from renovate/turf-0.x into develop
All checks were successful
ci/woodpecker/cron/dependencies Pipeline was successful
Reviewed-on: #9
2025-06-08 20:37:54 +00:00
2bfa5161ee Merge pull request 'Update Rust crate reqwest to 0.12.0' (#5) from renovate/reqwest-0.x into develop
All checks were successful
ci/woodpecker/push/dockerize Pipeline was successful
ci/woodpecker/push/deploy Pipeline was successful
ci/woodpecker/cron/dependencies Pipeline was successful
Reviewed-on: #5
2025-05-03 10:18:57 +00:00
ae57282dda Update Rust crate thiserror to v2
All checks were successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/audit Pipeline was successful
2025-05-03 00:01:52 +00:00
0e022fabef Update Rust crate turf to 0.10.0
All checks were successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/audit Pipeline was successful
2025-05-03 00:01:45 +00:00
b0623a3f1b Update Rust crate reqwest to 0.12.0
All checks were successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/audit Pipeline was successful
2025-05-03 00:01:41 +00:00
56afe2688d Update Rust crate rand to 0.9.0
Some checks failed
ci/woodpecker/pr/lint Pipeline failed
ci/woodpecker/pr/audit unknown status
2025-05-03 00:01:39 +00:00
66179ba858 Merge pull request '🐛 Versions are always displayed with the "-modified" suffix (step 2)' (#16) from fix/versions-always-modified into develop
All checks were successful
ci/woodpecker/push/dockerize Pipeline was successful
ci/woodpecker/push/deploy Pipeline was successful
ci/woodpecker/cron/dependencies Pipeline was successful
Reviewed-on: #16
2025-05-02 19:37:03 +00:00
63f82eab07 🔇 Undo temporary logs
All checks were successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/audit Pipeline was successful
2025-05-02 21:08:36 +02:00
f00adf9276 🔨 Add profile section to the Cargo.toml file 2025-05-02 20:56:18 +02:00
216b4cee80 🔊 Add another logs to the Dockerfile 2025-05-02 20:23:57 +02:00
cdc02a601d 🔊 Deploy web app on commit on this branch (TEMP !!!)
All checks were successful
ci/woodpecker/push/dockerize Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/audit Pipeline was successful
2025-05-02 20:04:50 +02:00
8bcb479b57 Add logs
All checks were successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/audit Pipeline was successful
2025-05-02 19:47:01 +02:00
b9d5c25137 Merge pull request '🐛 Versions are always displayed with the "-modified" suffix' (#15) from fix/versions-always-modified into develop
All checks were successful
ci/woodpecker/push/dockerize Pipeline was successful
ci/woodpecker/push/deploy Pipeline was successful
Reviewed-on: #15
2025-05-02 16:20:32 +00:00
e9fb20ad6e 🐛 Install git-lfs
All checks were successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/audit Pipeline was successful
2025-05-02 17:46:35 +02:00
d98222cd4a Merge pull request '🐛 Hide the preloader once the app loaded' (#14) from fix/hide-preloaded-once-the-app-loaded into develop
All checks were successful
ci/woodpecker/push/dockerize Pipeline was successful
ci/woodpecker/push/deploy Pipeline was successful
Reviewed-on: #14
2025-05-02 13:05:49 +00:00
c6effdfa15 🐛 Hide preloader once the app loaded
All checks were successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/audit Pipeline was successful
2025-05-02 14:51:57 +02:00
f17986fa16 Merge pull request '🐛 404 error returned on js loading' (#13) from fix/404-on-js-loading into develop
All checks were successful
ci/woodpecker/push/dockerize Pipeline was successful
ci/woodpecker/push/deploy Pipeline was successful
Reviewed-on: #13
2025-05-02 12:02:34 +00:00
cc65e7d5ff 🐛 Let dioxus add the preload script during the building process
All checks were successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/audit Pipeline was successful
2025-05-02 13:29:52 +02:00
1f42eaa37c Merge pull request 'Ensure that the linters and builds pass before merging a PR' (#7) from ci/add-checks-on-mr into develop
All checks were successful
ci/woodpecker/push/dockerize Pipeline was successful
ci/woodpecker/push/deploy Pipeline was successful
Reviewed-on: #7
2025-05-02 07:41:57 +00:00
8 changed files with 44 additions and 40 deletions

View File

@@ -13,7 +13,7 @@ config = "./spellcheck.toml"
[dependencies]
# Errors
anyhow = "1.0.75"
thiserror = "1.0.50"
thiserror = "2.0.0"
# Async
async-std = "1.12.0"
@@ -26,12 +26,12 @@ tokio-stream = "0.1.15"
# Utils
base64 = "0.22.0"
const_format = "0.2.32"
rand = "0.8.5"
rand = "0.9.1"
validator = { version = "0.17.0", features = ["derive"] }
# Http client
reqwest = "0.11.24"
reqwest = "0.12.0"
# Password strength estimation
zxcvbn = "2.2.2"
zxcvbn = { version = "3.0.0", features = ["ser"] }
# Image processing/conversion
image = "0.25.1"
# Get the application version
@@ -44,13 +44,16 @@ tracing = "0.1.40"
tracing-forest = "0.1.6"
# SCSS -> CSS + usage in rust code
turf = "0.9.3"
turf = "0.10.0"
# Dioxus
dioxus-free-icons = { version = "0.9", features = ["ionicons", "font-awesome-solid"] }
modx = "0.1.4"
[target.'cfg(target_family = "wasm")'.dependencies]
# Utils
getrandom = { version = "0.3.2", features = ["wasm_js"] }
# Logging/tracing
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
tracing-web = "0.1.3"
@@ -65,6 +68,7 @@ matrix-sdk = { git = "https://github.com/matrix-org/matrix-rust-sdk.git", rev =
[target.'cfg(not(target_family = "wasm"))'.dependencies]
# Utils
time = "0.3.36"
getrandom = { version = "0.3.2" }
# Logging/tracing
tracing-subscriber = { version = "0.3.18", features = ["env-filter", "time"] }
@@ -75,9 +79,24 @@ dioxus = { version = "0.6.3", features = ["desktop"] }
# Matrix
matrix-sdk = { git = "https://github.com/matrix-org/matrix-rust-sdk.git", rev = "fa6066b8", default-features = false, features = ["rustls-tls"] }
[target.wasm32-unknown-unknown]
rustflags = ['--cfg', 'getrandom_backend="wasm_js"']
[build-dependencies]
regex = "1.10.3"
[profile]
[profile.wasm-dev]
inherits = "dev"
opt-level = 1
[profile.server-dev]
inherits = "dev"
[profile.android-dev]
inherits = "dev"
[package.metadata.turf]
minify = true

View File

@@ -9,11 +9,13 @@ WORKDIR /usr/src/beau-gosse-du-92
# git is required by the git-version crate
RUN apt update \
&& apt install -y --no-install-recommends git \
&& apt install -y --no-install-recommends git git-lfs \
&& apt clean
COPY . .
# Workaround waiting for the dioxus 0.7 release (cf. https://github.com/DioxusLabs/dioxus/issues/4238)
ENV RUSTFLAGS="--cfg getrandom_backend=\"wasm_js\""
RUN dx build -r --platform web -- -j ${JOBS_NB}

View File

@@ -124,7 +124,7 @@ fn export_variables(tasks: Vec<Task>) {
"#[allow(dead_code)]\nmod {} {{\n",
task.module_name
)) {
println!("{}", err);
println!("{err}");
return;
};
@@ -143,14 +143,14 @@ fn export_variables(tasks: Vec<Task>) {
}
for variable in variables {
if let Err(err) = dst_file.write_fmt(format_args!(" pub {}\n", variable)) {
println!("{}", err);
if let Err(err) = dst_file.write_fmt(format_args!(" pub {variable}\n")) {
println!("{err}");
break;
}
}
if let Err(err) = dst_file.write(b"}\n") {
println!("{}", err);
println!("{err}");
};
}
}

View File

@@ -1,4 +1,4 @@
FROM rust:1.86 AS builder
FROM rust:1.88 AS builder
RUN apt update \
&& apt install -y --no-install-recommends libclang-dev hunspell \

View File

@@ -220,25 +220,5 @@
</div>
</div>
</div>
<script type="module" async>
import init from "{base_path}/wasm/beau-gosse-du-92.js";
// Ensure that everything needed to render preloader has been downloaded
// before fetching the wasm bundle.
window.onload=function() {
init("{base_path}/wasm/beau-gosse-du-92_bg.wasm").then(
wasm => {
const preloader = document.getElementById("preloader");
if (preloader !== undefined) {
preloader.style.display = 'none';
}
if (wasm.__wbindgen_start == undefined) {
wasm.main();
}
}
);
}
</script>
</body>
</html>

View File

@@ -3,7 +3,7 @@ use std::future::Future;
use std::sync::OnceLock;
use std::{collections::HashMap, future::IntoFuture};
use rand::distributions::{Alphanumeric, DistString};
use rand::distr::{Alphanumeric, SampleString};
use reqwest::Result as RequestResult;
use tracing::error;
@@ -124,7 +124,7 @@ async fn fetch_dicebear_svg(
// TODO: Use configuration file
let url = "dicebear.tools.adrien.run";
let seed = Alphanumeric.sample_string(&mut rand::thread_rng(), 16);
let seed = Alphanumeric.sample_string(&mut rand::rng(), 16);
let type_str = r#type.to_string();
let url = format!(
"https://{url}/8.x/{type_str}/svg?seed={seed}&randomizeIds=true{}{}",

View File

@@ -214,6 +214,11 @@ input {
font-family: inherit;
}
// Hide the preloader as soon as the application is loaded and ready to be rendered
#preloader {
display: none;
}
#main {
height: 100%;
width: 100%;

View File

@@ -4,7 +4,7 @@ use const_format::formatcp;
use dioxus::prelude::*;
use tracing::{debug, error, warn};
use validator::{Validate, ValidateArgs, ValidateEmail, ValidationError, ValidationErrors};
use zxcvbn::zxcvbn;
use zxcvbn::{zxcvbn, Score};
use crate::{
domain::model::session::Session,
@@ -348,14 +348,14 @@ fn validate_id(id: &Option<String>, process: &Process) -> Result<(), ValidationE
}
struct PasswordValidationResult {
score: u8,
score: Score,
rating: f64, // 0 <= rating <= 1
suggestions: Vec<String>,
}
impl PasswordValidationResult {
pub fn new() -> Self {
PasswordValidationResult {
score: 0,
score: Score::Zero,
rating: 0.0,
suggestions: Vec::<String>::new(),
}
@@ -366,9 +366,7 @@ fn compute_password_score(
password: &str,
with_suggestions: Option<bool>,
) -> Option<PasswordValidationResult> {
let Ok(estimate) = zxcvbn(password, &[]) else {
return None;
};
let estimate = zxcvbn(password, &[]);
let mut result = PasswordValidationResult::new();
result.score = estimate.score();
@@ -396,7 +394,7 @@ fn validate_password(password: &Option<String>, process: &Process) -> Result<(),
if let Some(password) = password {
if let Some(result) = compute_password_score(password, Some(true)) {
// TODO: To configuration?
if result.score <= 2 {
if [Score::Zero, Score::One, Score::Two].contains(&result.score) {
let mut err = ValidationError::new(TOO_WEAK_PASSWORD_ERROR_NAME);
err.add_param(Cow::from("score"), &result.score);
err.add_param(Cow::from("rating"), &result.rating);