1 Commits

Author SHA1 Message Date
59935e4b4d Update dependency eslint-plugin-react-dom to ^1.53.1
Some checks failed
continuous-integration/drone/pr Build is failing
continuous-integration/drone/push Build is failing
2025-11-01 00:12:53 +00:00
11 changed files with 558 additions and 568 deletions

View File

@@ -560,9 +560,9 @@ checksum = "89e25b6adfb930f02d1981565a6e5d9c547ac15a96606256d3b59040e5cd4ca3"
[[package]]
name = "binstring"
version = "0.1.7"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0669d5a35b64fdb5ab7fb19cae13148b6b5cbdf4b8247faf54ece47f699c8cef"
checksum = "9a3a3c2603413428303761fae99d4b6d936404208221a44eba47d7c1e6dd03a3"
[[package]]
name = "bitflags"
@@ -717,9 +717,9 @@ dependencies = [
[[package]]
name = "clap"
version = "4.5.53"
version = "4.5.51"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c9e340e012a1bf4935f5282ed1436d1489548e8f72308207ea5df0e23d2d03f8"
checksum = "4c26d721170e0295f191a69bd9a1f93efcdb0aff38684b61ab5750468972e5f5"
dependencies = [
"clap_builder",
"clap_derive",
@@ -727,9 +727,9 @@ dependencies = [
[[package]]
name = "clap_builder"
version = "4.5.53"
version = "4.5.51"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d76b5d13eaa18c901fd2f7fca939fefe3a0727a953561fefdf3b2922b8569d00"
checksum = "75835f0c7bf681bfd05abe44e965760fea999a5286c6eb2d59883634fd02011a"
dependencies = [
"anstream",
"anstyle",
@@ -941,18 +941,18 @@ dependencies = [
[[package]]
name = "crypto-common"
version = "0.2.0-rc.5"
version = "0.2.0-rc.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "919bd05924682a5480aec713596b9e2aabed3a0a6022fab6847f85a99e5f190a"
checksum = "6a8235645834fbc6832939736ce2f2d08192652269e11010a6240f61b908a1c6"
dependencies = [
"hybrid-array",
]
[[package]]
name = "ct-codecs"
version = "1.1.6"
version = "1.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b10589d1a5e400d61f9f38f12f884cfd080ff345de8f17efda36fe0e4a02aa8"
checksum = "dd0d274c65cbc1c34703d2fc2ce0fb892ff68f4516b677671a2f238a30b9b2b2"
[[package]]
name = "ctr"
@@ -1152,13 +1152,13 @@ dependencies = [
[[package]]
name = "digest"
version = "0.11.0-rc.4"
version = "0.11.0-rc.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea390c940e465846d64775e55e3115d5dc934acb953de6f6e6360bc232fe2bf7"
checksum = "dac89f8a64533a9b0eaa73a68e424db0fb1fd6271c74cc0125336a05f090568d"
dependencies = [
"block-buffer 0.11.0-rc.5",
"const-oid 0.10.1",
"crypto-common 0.2.0-rc.5",
"crypto-common 0.2.0-rc.4",
]
[[package]]
@@ -1599,18 +1599,18 @@ checksum = "18492c9f6f9a560e0d346369b665ad2bdbc89fa9bceca75796584e79042694c3"
[[package]]
name = "hmac-sha256"
version = "1.1.12"
version = "1.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad6880c8d4a9ebf39c6e8b77007ce223f646a4d21ce29d99f70cb16420545425"
checksum = "4a8575493d277c9092b988c780c94737fb9fd8651a1001e16bee3eccfc1baedb"
dependencies = [
"digest 0.10.7",
]
[[package]]
name = "hmac-sha512"
version = "1.1.7"
version = "1.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e89e8d20b3799fa526152a5301a771eaaad80857f83e01b23216ceaafb2d9280"
checksum = "b0b3a0f572aa8389d325f5852b9e0a333a15b0f86ecccbb3fdb6e97cd86dc67c"
dependencies = [
"digest 0.10.7",
]
@@ -1998,9 +1998,9 @@ dependencies = [
[[package]]
name = "jwt-simple"
version = "0.12.13"
version = "0.12.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ad8761f175784dfbb83709f322fc4daf6b27afd5bf375492f2876f9e925ef5a"
checksum = "731011e9647a71ff4f8474176ff6ce6e0d2de87a0173f15613af3a84c3e3401a"
dependencies = [
"anyhow",
"binstring",
@@ -2044,9 +2044,9 @@ checksum = "d4345964bb142484797b161f473a503a434de77149dd8c7427788c6e13379388"
[[package]]
name = "lazy-regex"
version = "3.4.2"
version = "3.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "191898e17ddee19e60bccb3945aa02339e81edd4a8c50e21fd4d48cdecda7b29"
checksum = "60c7310b93682b36b98fa7ea4de998d3463ccbebd94d935d6b48ba5b6ffa7126"
dependencies = [
"lazy-regex-proc_macros",
"once_cell",
@@ -2055,9 +2055,9 @@ dependencies = [
[[package]]
name = "lazy-regex-proc_macros"
version = "3.4.2"
version = "3.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c35dc8b0da83d1a9507e12122c80dea71a9c7c613014347392483a83ea593e04"
checksum = "4ba01db5ef81e17eb10a5e0f2109d1b3a3e29bac3070fdbd7d156bf7dbd206a1"
dependencies = [
"proc-macro2",
"quote",
@@ -2297,7 +2297,7 @@ dependencies = [
"rust_xlsxwriter",
"serde",
"serde_json",
"sha2 0.11.0-rc.3",
"sha2 0.11.0-rc.2",
"tempfile",
"thiserror 2.0.17",
"tokio",
@@ -3300,13 +3300,13 @@ dependencies = [
[[package]]
name = "sha2"
version = "0.11.0-rc.3"
version = "0.11.0-rc.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "19d43dc0354d88b791216bb5c1bfbb60c0814460cc653ae0ebd71f286d0bd927"
checksum = "d1e3878ab0f98e35b2df35fe53201d088299b41a6bb63e3e34dada2ac4abd924"
dependencies = [
"cfg-if",
"cpufeatures",
"digest 0.11.0-rc.4",
"digest 0.11.0-rc.3",
]
[[package]]
@@ -4321,9 +4321,9 @@ dependencies = [
[[package]]
name = "zeroize"
version = "1.8.2"
version = "1.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0"
checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde"
dependencies = [
"zeroize_derive",
]

View File

@@ -8,7 +8,7 @@ env_logger = "0.11.8"
log = "0.4.28"
diesel = { version = "2.2.12", features = ["postgres", "r2d2"] }
diesel_migrations = "2.2.0"
clap = { version = "4.5.53", features = ["env", "derive"] }
clap = { version = "4.5.51", features = ["env", "derive"] }
actix-web = "4.11.0"
actix-cors = "0.7.1"
actix-multipart = "0.7.2"
@@ -26,11 +26,11 @@ serde_json = "1.0.145"
light-openid = "1.0.4"
rand = "0.9.2"
ipnet = { version = "2.11.0", features = ["serde"] }
lazy-regex = "3.4.2"
jwt-simple = { version = "0.12.13", default-features = false, features = ["pure-rust"] }
lazy-regex = "3.4.1"
jwt-simple = { version = "0.12.12", default-features = false, features = ["pure-rust"] }
mime_guess = "2.0.5"
rust-embed = { version = "8.7.2" }
sha2 = "0.11.0-rc.3"
sha2 = "0.11.0-rc.2"
base16ct = "0.2.0"
httpdate = "1.0.3"
chrono = "0.4.42"

View File

@@ -22,6 +22,10 @@ pub struct AppConfig {
#[clap(short = 'S', long, env, default_value = "")]
secret: String,
/// Specify whether the cookie should be transmitted only over secure connections
#[clap(long, env)]
pub cookie_secure: bool,
/// Unsecure : for development, bypass authentication, using the account with the given
/// email address by default
#[clap(long, env)]
@@ -157,6 +161,23 @@ impl AppConfig {
self.unsecure_auto_login_email().is_some()
}
/// Get auth cookie domain
pub fn cookie_domain(&self) -> Option<String> {
if cfg!(debug_assertions) {
let domain = self.website_origin.split_once("://")?.1;
Some(
domain
.split_once(':')
.map(|s| s.0)
.unwrap_or(domain)
.to_string(),
)
} else {
// In release mode, the web app is hosted on the same origin as the API
None
}
}
/// Get app secret
pub fn secret(&self) -> &str {
let mut secret = self.secret.as_str();

View File

@@ -63,23 +63,24 @@ pub async fn download(
pub async fn serve_file(req: HttpRequest, file: &File, download_file: bool) -> HttpResult {
if !download_file {
// Check if the browser already knows the etag
if let Some(c) = req.headers().get(header::IF_NONE_MATCH)
&& c.to_str().unwrap_or("") == file.sha512.as_str()
{
if let Some(c) = req.headers().get(header::IF_NONE_MATCH) {
if c.to_str().unwrap_or("") == file.sha512.as_str() {
return Ok(HttpResponse::NotModified().finish());
}
}
// Check if the browser already knows the file by date
if let Some(c) = req.headers().get(header::IF_MODIFIED_SINCE) {
let date_str = c.to_str().unwrap_or("");
if let Ok(date) = httpdate::parse_http_date(date_str)
&& date.add(Duration::from_secs(1))
if let Ok(date) = httpdate::parse_http_date(date_str) {
if date.add(Duration::from_secs(1))
>= time_utils::unix_to_system_time(file.time_create as u64)
{
return Ok(HttpResponse::NotModified().finish());
}
}
}
}
let mut res = HttpResponse::Ok();
res.content_type(file.mime_type.as_str())
.insert_header(("etag", file.sha512.as_str()))

View File

@@ -64,11 +64,11 @@ pub async fn get_list_of_account(
});
}
if let Some(limit) = query.limit
&& list.len() > limit
{
if let Some(limit) = query.limit {
if list.len() > limit {
list = list[..limit].to_vec();
}
}
Ok(HttpResponse::Ok().json(list))
}

View File

@@ -120,9 +120,8 @@ impl FromRequest for AuthExtractor {
}
// Check IP restriction
if let Some(net) = token.ip_net()
&& !net.contains(&remote_ip.0)
{
if let Some(net) = token.ip_net() {
if !net.contains(&remote_ip.0) {
log::error!(
"Trying to use token {:?} from unauthorized IP address: {remote_ip:?}",
token.id()
@@ -131,6 +130,7 @@ impl FromRequest for AuthExtractor {
"This token cannot be used from this IP address!",
));
}
}
// Check for write access
if token.read_only && !req.method().is_safe() {
@@ -163,11 +163,11 @@ impl FromRequest for AuthExtractor {
};
// Update last use (if needed)
if token.shall_update_time_used()
&& let Err(e) = tokens_service::update_time_used(&token).await
{
if token.shall_update_time_used() {
if let Err(e) = tokens_service::update_time_used(&token).await {
log::error!("Failed to refresh last usage of token! {e}");
}
}
// Handle tokens expiration
if token.is_expired() {

View File

@@ -23,11 +23,11 @@ impl UpdateInboxEntryQuery {
let constraints = ServerConstraints::default();
// Check inbox entry label
if let Some(label) = &self.label
&& !constraints.inbox_entry_label.check_str(label)
{
if let Some(label) = &self.label {
if !constraints.inbox_entry_label.check_str(label) {
return Ok(Some("Invalid inbox entry label length!"));
}
}
// Check the referenced movement
if let Some(movement_id) = self.movement_id {

View File

@@ -55,12 +55,13 @@ impl UpdateMovementQuery {
if let Ok(movement) =
get_by_account_label_amount_time(self.account_id, &self.label, self.amount, self.time)
.await
&& Some(movement.id()) != ref_movement
{
if Some(movement.id()) != ref_movement {
return Ok(Some(
"A movement taken at the same time with the same label and the same amount already exists!",
));
}
}
Ok(None)
}

View File

@@ -111,7 +111,7 @@ dev_dependencies:
flutter_launcher_icons: ^0.14.4
# Generate source code
build_runner: 2.10.4
build_runner: 2.10.1
# Riverpod code generation
riverpod_generator: ^2.6.5

File diff suppressed because it is too large Load Diff

View File

@@ -18,11 +18,11 @@
"@mdi/react": "^1.6.1",
"@mui/icons-material": "^7.1.2",
"@mui/material": "^7.1.2",
"@mui/x-charts": "^8.19.0",
"@mui/x-data-grid": "^8.18.0",
"@mui/x-date-pickers": "^8.17.0",
"@mui/x-charts": "^8.16.0",
"@mui/x-data-grid": "^8.15.0",
"@mui/x-date-pickers": "^8.15.0",
"date-and-time": "^3.6.0",
"dayjs": "^1.11.19",
"dayjs": "^1.11.18",
"filesize": "^10.1.6",
"qrcode.react": "^4.2.0",
"react": "^19.2.0",
@@ -32,15 +32,15 @@
"ts-pattern": "^5.8.0"
},
"devDependencies": {
"@eslint/js": "^9.39.1",
"@types/react": "^19.2.6",
"@types/react-dom": "^19.2.3",
"@eslint/js": "^9.38.0",
"@types/react": "^19.2.2",
"@types/react-dom": "^19.2.2",
"@vitejs/plugin-react": "^4.7.0",
"eslint": "^9.39.1",
"eslint-plugin-react-dom": "^1.52.4",
"eslint": "^9.32.0",
"eslint-plugin-react-dom": "^1.53.1",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^00.4.20",
"eslint-plugin-react-x": "^1.53.1",
"eslint-plugin-react-x": "^1.52.9",
"globals": "^16.3.0",
"typescript": "~5.8.3",
"typescript-eslint": "^8.32.1",