35 Commits

Author SHA1 Message Date
16ccecd428 Merge pull request 'Update Rust crate clap to 4.5.53' (#147) from renovate/clap-4.x into main
Some checks failed
continuous-integration/drone/push Build is failing
2025-11-22 00:09:33 +00:00
fab66a5b15 Merge pull request 'Update dependency @types/react to ^19.2.6' (#146) from renovate/react into main
Some checks failed
continuous-integration/drone/push Build is failing
2025-11-22 00:09:24 +00:00
fbe49868ba Update Rust crate clap to 4.5.53
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-11-21 00:12:30 +00:00
a61477b6e4 Update dependency @types/react to ^19.2.6
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-11-21 00:12:26 +00:00
a1fd245202 Merge pull request 'Update dependency build_runner to v2.10.4' (#145) from renovate/build_runner-2.x into main
Some checks failed
continuous-integration/drone/push Build is failing
2025-11-20 00:10:11 +00:00
ef16a50ab6 Update dependency build_runner to v2.10.4
Some checks failed
renovate/artifacts Artifact file update failure
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-11-20 00:10:01 +00:00
d75a27f872 Merge pull request 'Update dependency @mui/x-data-grid to ^8.18.0' (#144) from renovate/mui-x-data-grid-8.x into main
Some checks failed
continuous-integration/drone/push Build is failing
2025-11-19 00:09:36 +00:00
0eff821e5d Merge pull request 'Update Rust crate clap to 4.5.52' (#143) from renovate/clap-4.x into main
Some checks failed
continuous-integration/drone/push Build is failing
2025-11-19 00:09:29 +00:00
d456cff4b4 Update dependency @mui/x-data-grid to ^8.18.0
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-11-18 00:11:03 +00:00
fdefc7bf0b Update Rust crate clap to 4.5.52
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-11-18 00:11:00 +00:00
e4a53aa2f3 Merge pull request 'Update dependency @mui/x-charts to ^8.18.0' (#142) from renovate/mui-x-charts-8.x into main
Some checks failed
continuous-integration/drone/push Build is failing
2025-11-17 00:09:51 +00:00
004f2b84fb Merge pull request 'Update react' (#141) from renovate/react into main
Some checks failed
continuous-integration/drone/push Build is failing
2025-11-17 00:09:44 +00:00
004615b2c0 Update dependency @mui/x-charts to ^8.18.0
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-11-16 00:10:28 +00:00
0eee3507d0 Update react
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-11-16 00:10:24 +00:00
2cc9ea5caa Merge pull request 'Update dependency build_runner to v2.10.3' (#140) from renovate/build_runner-2.x into main
Some checks failed
continuous-integration/drone/push Build is failing
2025-11-15 00:10:39 +00:00
8ace9a9b2b Update dependency build_runner to v2.10.3
Some checks failed
renovate/artifacts Artifact file update failure
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-11-15 00:10:28 +00:00
1a5bf5700c Merge pull request 'Update dependency build_runner to v2.10.2' (#139) from renovate/build_runner-2.x into main
Some checks failed
continuous-integration/drone/push Build is failing
2025-11-13 00:10:01 +00:00
f4bc3ff611 Update dependency build_runner to v2.10.2
Some checks failed
renovate/artifacts Artifact file update failure
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-11-13 00:09:52 +00:00
4968850cd3 Merge pull request 'Update dependency eslint-plugin-react-x to ^1.53.1' (#138) from renovate/eslint-plugin-react-x-1.x into main
Some checks failed
continuous-integration/drone/push Build is failing
2025-11-12 00:12:37 +00:00
9f22e28a48 Merge pull request 'Update dependency eslint to ^9.39.1' (#137) from renovate/eslint-9.x into main
Some checks failed
continuous-integration/drone/push Build is failing
2025-11-12 00:12:32 +00:00
fb55106e45 Update dependency eslint-plugin-react-x to ^1.53.1
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-11-11 00:14:17 +00:00
d24a8b5fb0 Update dependency eslint to ^9.39.1
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-11-11 00:14:04 +00:00
9102877489 Merge pull request 'Update dependency @mui/x-date-pickers to ^8.17.0' (#136) from renovate/mui-x-date-pickers-8.x into main
Some checks failed
continuous-integration/drone/push Build is failing
2025-11-10 00:09:18 +00:00
3b756feb42 Update dependency @mui/x-date-pickers to ^8.17.0
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-11-10 00:09:08 +00:00
1675acea04 Merge pull request 'Update dependency @mui/x-data-grid to ^8.17.0' (#135) from renovate/mui-x-data-grid-8.x into main
Some checks failed
continuous-integration/drone/push Build is failing
2025-11-09 00:10:55 +00:00
2a6c7c083c Update dependency @mui/x-data-grid to ^8.17.0
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-11-08 00:08:58 +00:00
c3c90d4279 Merge pull request 'Update dependency @mui/x-charts to ^8.17.0' (#134) from renovate/mui-x-charts-8.x into main
Some checks failed
continuous-integration/drone/push Build is failing
2025-11-07 00:11:50 +00:00
d37571e763 Merge pull request 'Update Rust crate sha2 to 0.11.0-rc.3' (#133) from renovate/sha2-0.x into main
Some checks failed
continuous-integration/drone/push Build is failing
2025-11-07 00:11:47 +00:00
65d60161cd Update dependency @mui/x-charts to ^8.17.0
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-11-06 00:12:24 +00:00
a4d323318d Update Rust crate sha2 to 0.11.0-rc.3
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-11-06 00:12:20 +00:00
69d3e816af Merge pull request 'Update dependency @eslint/js to ^9.39.1' (#132) from renovate/eslint-js-9.x into main
Some checks failed
continuous-integration/drone/push Build is failing
2025-11-05 00:10:17 +00:00
0935f7194d Merge pull request 'Update Rust crate lazy-regex to 3.4.2' (#131) from renovate/lazy-regex-3.x into main
Some checks failed
continuous-integration/drone/push Build is failing
2025-11-05 00:10:13 +00:00
9a1256f005 Update dependency @eslint/js to ^9.39.1
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-11-04 00:14:00 +00:00
7b81f2c8c4 Update Rust crate lazy-regex to 3.4.2
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-11-04 00:13:57 +00:00
4cd448208b Improve backend code quality
Some checks failed
continuous-integration/drone/push Build is failing
2025-11-03 19:08:46 +01:00
11 changed files with 451 additions and 441 deletions

View File

@@ -717,9 +717,9 @@ dependencies = [
[[package]] [[package]]
name = "clap" name = "clap"
version = "4.5.51" version = "4.5.53"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4c26d721170e0295f191a69bd9a1f93efcdb0aff38684b61ab5750468972e5f5" checksum = "c9e340e012a1bf4935f5282ed1436d1489548e8f72308207ea5df0e23d2d03f8"
dependencies = [ dependencies = [
"clap_builder", "clap_builder",
"clap_derive", "clap_derive",
@@ -727,9 +727,9 @@ dependencies = [
[[package]] [[package]]
name = "clap_builder" name = "clap_builder"
version = "4.5.51" version = "4.5.53"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75835f0c7bf681bfd05abe44e965760fea999a5286c6eb2d59883634fd02011a" checksum = "d76b5d13eaa18c901fd2f7fca939fefe3a0727a953561fefdf3b2922b8569d00"
dependencies = [ dependencies = [
"anstream", "anstream",
"anstyle", "anstyle",
@@ -941,9 +941,9 @@ dependencies = [
[[package]] [[package]]
name = "crypto-common" name = "crypto-common"
version = "0.2.0-rc.4" version = "0.2.0-rc.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a8235645834fbc6832939736ce2f2d08192652269e11010a6240f61b908a1c6" checksum = "919bd05924682a5480aec713596b9e2aabed3a0a6022fab6847f85a99e5f190a"
dependencies = [ dependencies = [
"hybrid-array", "hybrid-array",
] ]
@@ -1152,13 +1152,13 @@ dependencies = [
[[package]] [[package]]
name = "digest" name = "digest"
version = "0.11.0-rc.3" version = "0.11.0-rc.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dac89f8a64533a9b0eaa73a68e424db0fb1fd6271c74cc0125336a05f090568d" checksum = "ea390c940e465846d64775e55e3115d5dc934acb953de6f6e6360bc232fe2bf7"
dependencies = [ dependencies = [
"block-buffer 0.11.0-rc.5", "block-buffer 0.11.0-rc.5",
"const-oid 0.10.1", "const-oid 0.10.1",
"crypto-common 0.2.0-rc.4", "crypto-common 0.2.0-rc.5",
] ]
[[package]] [[package]]
@@ -2044,9 +2044,9 @@ checksum = "d4345964bb142484797b161f473a503a434de77149dd8c7427788c6e13379388"
[[package]] [[package]]
name = "lazy-regex" name = "lazy-regex"
version = "3.4.1" version = "3.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "60c7310b93682b36b98fa7ea4de998d3463ccbebd94d935d6b48ba5b6ffa7126" checksum = "191898e17ddee19e60bccb3945aa02339e81edd4a8c50e21fd4d48cdecda7b29"
dependencies = [ dependencies = [
"lazy-regex-proc_macros", "lazy-regex-proc_macros",
"once_cell", "once_cell",
@@ -2055,9 +2055,9 @@ dependencies = [
[[package]] [[package]]
name = "lazy-regex-proc_macros" name = "lazy-regex-proc_macros"
version = "3.4.1" version = "3.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ba01db5ef81e17eb10a5e0f2109d1b3a3e29bac3070fdbd7d156bf7dbd206a1" checksum = "c35dc8b0da83d1a9507e12122c80dea71a9c7c613014347392483a83ea593e04"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@@ -2297,7 +2297,7 @@ dependencies = [
"rust_xlsxwriter", "rust_xlsxwriter",
"serde", "serde",
"serde_json", "serde_json",
"sha2 0.11.0-rc.2", "sha2 0.11.0-rc.3",
"tempfile", "tempfile",
"thiserror 2.0.17", "thiserror 2.0.17",
"tokio", "tokio",
@@ -3300,13 +3300,13 @@ dependencies = [
[[package]] [[package]]
name = "sha2" name = "sha2"
version = "0.11.0-rc.2" version = "0.11.0-rc.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d1e3878ab0f98e35b2df35fe53201d088299b41a6bb63e3e34dada2ac4abd924" checksum = "19d43dc0354d88b791216bb5c1bfbb60c0814460cc653ae0ebd71f286d0bd927"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"cpufeatures", "cpufeatures",
"digest 0.11.0-rc.3", "digest 0.11.0-rc.4",
] ]
[[package]] [[package]]

View File

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

View File

@@ -22,10 +22,6 @@ pub struct AppConfig {
#[clap(short = 'S', long, env, default_value = "")] #[clap(short = 'S', long, env, default_value = "")]
secret: String, 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 /// Unsecure : for development, bypass authentication, using the account with the given
/// email address by default /// email address by default
#[clap(long, env)] #[clap(long, env)]
@@ -161,23 +157,6 @@ impl AppConfig {
self.unsecure_auto_login_email().is_some() 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 /// Get app secret
pub fn secret(&self) -> &str { pub fn secret(&self) -> &str {
let mut secret = self.secret.as_str(); let mut secret = self.secret.as_str();

View File

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

View File

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

View File

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

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

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