Compare commits
35 Commits
5a2ceb8bf6
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 16ccecd428 | |||
| fab66a5b15 | |||
| fbe49868ba | |||
| a61477b6e4 | |||
| a1fd245202 | |||
| ef16a50ab6 | |||
| d75a27f872 | |||
| 0eff821e5d | |||
| d456cff4b4 | |||
| fdefc7bf0b | |||
| e4a53aa2f3 | |||
| 004f2b84fb | |||
| 004615b2c0 | |||
| 0eee3507d0 | |||
| 2cc9ea5caa | |||
| 8ace9a9b2b | |||
| 1a5bf5700c | |||
| f4bc3ff611 | |||
| 4968850cd3 | |||
| 9f22e28a48 | |||
| fb55106e45 | |||
| d24a8b5fb0 | |||
| 9102877489 | |||
| 3b756feb42 | |||
| 1675acea04 | |||
| 2a6c7c083c | |||
| c3c90d4279 | |||
| d37571e763 | |||
| 65d60161cd | |||
| a4d323318d | |||
| 69d3e816af | |||
| 0935f7194d | |||
| 9a1256f005 | |||
| 7b81f2c8c4 | |||
| 4cd448208b |
34
moneymgr_backend/Cargo.lock
generated
34
moneymgr_backend/Cargo.lock
generated
@@ -717,9 +717,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "clap"
|
||||
version = "4.5.51"
|
||||
version = "4.5.53"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4c26d721170e0295f191a69bd9a1f93efcdb0aff38684b61ab5750468972e5f5"
|
||||
checksum = "c9e340e012a1bf4935f5282ed1436d1489548e8f72308207ea5df0e23d2d03f8"
|
||||
dependencies = [
|
||||
"clap_builder",
|
||||
"clap_derive",
|
||||
@@ -727,9 +727,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "clap_builder"
|
||||
version = "4.5.51"
|
||||
version = "4.5.53"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "75835f0c7bf681bfd05abe44e965760fea999a5286c6eb2d59883634fd02011a"
|
||||
checksum = "d76b5d13eaa18c901fd2f7fca939fefe3a0727a953561fefdf3b2922b8569d00"
|
||||
dependencies = [
|
||||
"anstream",
|
||||
"anstyle",
|
||||
@@ -941,9 +941,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
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"
|
||||
checksum = "6a8235645834fbc6832939736ce2f2d08192652269e11010a6240f61b908a1c6"
|
||||
checksum = "919bd05924682a5480aec713596b9e2aabed3a0a6022fab6847f85a99e5f190a"
|
||||
dependencies = [
|
||||
"hybrid-array",
|
||||
]
|
||||
@@ -1152,13 +1152,13 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "digest"
|
||||
version = "0.11.0-rc.3"
|
||||
version = "0.11.0-rc.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dac89f8a64533a9b0eaa73a68e424db0fb1fd6271c74cc0125336a05f090568d"
|
||||
checksum = "ea390c940e465846d64775e55e3115d5dc934acb953de6f6e6360bc232fe2bf7"
|
||||
dependencies = [
|
||||
"block-buffer 0.11.0-rc.5",
|
||||
"const-oid 0.10.1",
|
||||
"crypto-common 0.2.0-rc.4",
|
||||
"crypto-common 0.2.0-rc.5",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2044,9 +2044,9 @@ checksum = "d4345964bb142484797b161f473a503a434de77149dd8c7427788c6e13379388"
|
||||
|
||||
[[package]]
|
||||
name = "lazy-regex"
|
||||
version = "3.4.1"
|
||||
version = "3.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "60c7310b93682b36b98fa7ea4de998d3463ccbebd94d935d6b48ba5b6ffa7126"
|
||||
checksum = "191898e17ddee19e60bccb3945aa02339e81edd4a8c50e21fd4d48cdecda7b29"
|
||||
dependencies = [
|
||||
"lazy-regex-proc_macros",
|
||||
"once_cell",
|
||||
@@ -2055,9 +2055,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "lazy-regex-proc_macros"
|
||||
version = "3.4.1"
|
||||
version = "3.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4ba01db5ef81e17eb10a5e0f2109d1b3a3e29bac3070fdbd7d156bf7dbd206a1"
|
||||
checksum = "c35dc8b0da83d1a9507e12122c80dea71a9c7c613014347392483a83ea593e04"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@@ -2297,7 +2297,7 @@ dependencies = [
|
||||
"rust_xlsxwriter",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sha2 0.11.0-rc.2",
|
||||
"sha2 0.11.0-rc.3",
|
||||
"tempfile",
|
||||
"thiserror 2.0.17",
|
||||
"tokio",
|
||||
@@ -3300,13 +3300,13 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "sha2"
|
||||
version = "0.11.0-rc.2"
|
||||
version = "0.11.0-rc.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d1e3878ab0f98e35b2df35fe53201d088299b41a6bb63e3e34dada2ac4abd924"
|
||||
checksum = "19d43dc0354d88b791216bb5c1bfbb60c0814460cc653ae0ebd71f286d0bd927"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"cpufeatures",
|
||||
"digest 0.11.0-rc.3",
|
||||
"digest 0.11.0-rc.4",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
@@ -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.51", features = ["env", "derive"] }
|
||||
clap = { version = "4.5.53", 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.1"
|
||||
lazy-regex = "3.4.2"
|
||||
jwt-simple = { version = "0.12.13", default-features = false, features = ["pure-rust"] }
|
||||
mime_guess = "2.0.5"
|
||||
rust-embed = { version = "8.7.2" }
|
||||
sha2 = "0.11.0-rc.2"
|
||||
sha2 = "0.11.0-rc.3"
|
||||
base16ct = "0.2.0"
|
||||
httpdate = "1.0.3"
|
||||
chrono = "0.4.42"
|
||||
|
||||
@@ -22,10 +22,6 @@ 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)]
|
||||
@@ -161,23 +157,6 @@ 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();
|
||||
|
||||
@@ -63,21 +63,20 @@ 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) {
|
||||
if c.to_str().unwrap_or("") == file.sha512.as_str() {
|
||||
return Ok(HttpResponse::NotModified().finish());
|
||||
}
|
||||
if let Some(c) = req.headers().get(header::IF_NONE_MATCH)
|
||||
&& 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) {
|
||||
if date.add(Duration::from_secs(1))
|
||||
if let Ok(date) = httpdate::parse_http_date(date_str)
|
||||
&& date.add(Duration::from_secs(1))
|
||||
>= time_utils::unix_to_system_time(file.time_create as u64)
|
||||
{
|
||||
return Ok(HttpResponse::NotModified().finish());
|
||||
}
|
||||
{
|
||||
return Ok(HttpResponse::NotModified().finish());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,10 +64,10 @@ pub async fn get_list_of_account(
|
||||
});
|
||||
}
|
||||
|
||||
if let Some(limit) = query.limit {
|
||||
if list.len() > limit {
|
||||
list = list[..limit].to_vec();
|
||||
}
|
||||
if let Some(limit) = query.limit
|
||||
&& list.len() > limit
|
||||
{
|
||||
list = list[..limit].to_vec();
|
||||
}
|
||||
|
||||
Ok(HttpResponse::Ok().json(list))
|
||||
|
||||
@@ -120,16 +120,16 @@ impl FromRequest for AuthExtractor {
|
||||
}
|
||||
|
||||
// Check IP restriction
|
||||
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()
|
||||
);
|
||||
return Err(actix_web::error::ErrorForbidden(
|
||||
"This token cannot be used from this IP address!",
|
||||
));
|
||||
}
|
||||
if let Some(net) = token.ip_net()
|
||||
&& !net.contains(&remote_ip.0)
|
||||
{
|
||||
log::error!(
|
||||
"Trying to use token {:?} from unauthorized IP address: {remote_ip:?}",
|
||||
token.id()
|
||||
);
|
||||
return Err(actix_web::error::ErrorForbidden(
|
||||
"This token cannot be used from this IP address!",
|
||||
));
|
||||
}
|
||||
|
||||
// Check for write access
|
||||
@@ -163,10 +163,10 @@ impl FromRequest for AuthExtractor {
|
||||
};
|
||||
|
||||
// Update last use (if needed)
|
||||
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}");
|
||||
}
|
||||
if token.shall_update_time_used()
|
||||
&& let Err(e) = tokens_service::update_time_used(&token).await
|
||||
{
|
||||
log::error!("Failed to refresh last usage of token! {e}");
|
||||
}
|
||||
|
||||
// Handle tokens expiration
|
||||
|
||||
@@ -23,10 +23,10 @@ impl UpdateInboxEntryQuery {
|
||||
let constraints = ServerConstraints::default();
|
||||
|
||||
// Check inbox entry label
|
||||
if let Some(label) = &self.label {
|
||||
if !constraints.inbox_entry_label.check_str(label) {
|
||||
return Ok(Some("Invalid inbox entry label length!"));
|
||||
}
|
||||
if let Some(label) = &self.label
|
||||
&& !constraints.inbox_entry_label.check_str(label)
|
||||
{
|
||||
return Ok(Some("Invalid inbox entry label length!"));
|
||||
}
|
||||
|
||||
// Check the referenced movement
|
||||
|
||||
@@ -55,12 +55,11 @@ 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!",
|
||||
));
|
||||
}
|
||||
return Ok(Some(
|
||||
"A movement taken at the same time with the same label and the same amount already exists!",
|
||||
));
|
||||
}
|
||||
|
||||
Ok(None)
|
||||
|
||||
@@ -111,7 +111,7 @@ dev_dependencies:
|
||||
flutter_launcher_icons: ^0.14.4
|
||||
|
||||
# Generate source code
|
||||
build_runner: 2.10.1
|
||||
build_runner: 2.10.4
|
||||
|
||||
# Riverpod code generation
|
||||
riverpod_generator: ^2.6.5
|
||||
|
||||
743
moneymgr_web/package-lock.json
generated
743
moneymgr_web/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -18,9 +18,9 @@
|
||||
"@mdi/react": "^1.6.1",
|
||||
"@mui/icons-material": "^7.1.2",
|
||||
"@mui/material": "^7.1.2",
|
||||
"@mui/x-charts": "^8.16.0",
|
||||
"@mui/x-data-grid": "^8.15.0",
|
||||
"@mui/x-date-pickers": "^8.15.0",
|
||||
"@mui/x-charts": "^8.18.0",
|
||||
"@mui/x-data-grid": "^8.18.0",
|
||||
"@mui/x-date-pickers": "^8.17.0",
|
||||
"date-and-time": "^3.6.0",
|
||||
"dayjs": "^1.11.19",
|
||||
"filesize": "^10.1.6",
|
||||
@@ -32,15 +32,15 @@
|
||||
"ts-pattern": "^5.8.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.38.0",
|
||||
"@types/react": "^19.2.2",
|
||||
"@types/react-dom": "^19.2.2",
|
||||
"@eslint/js": "^9.39.1",
|
||||
"@types/react": "^19.2.6",
|
||||
"@types/react-dom": "^19.2.3",
|
||||
"@vitejs/plugin-react": "^4.7.0",
|
||||
"eslint": "^9.32.0",
|
||||
"eslint": "^9.39.1",
|
||||
"eslint-plugin-react-dom": "^1.52.4",
|
||||
"eslint-plugin-react-hooks": "^5.2.0",
|
||||
"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",
|
||||
"typescript": "~5.8.3",
|
||||
"typescript-eslint": "^8.32.1",
|
||||
|
||||
Reference in New Issue
Block a user