Compare commits
31 Commits
16edc19638
...
f701ddc465
Author | SHA1 | Date | |
---|---|---|---|
f701ddc465 | |||
2c07a69b90 | |||
0de551f1de | |||
2488ef0125 | |||
aa2e764262 | |||
1202219e98 | |||
112597084c | |||
4f64404ffa | |||
c39b53c721 | |||
bd2e343601 | |||
85ee2b2549 | |||
154551aeaf | |||
7b10c3508a | |||
61c96629a1 | |||
8644075a09 | |||
81bfa75eec | |||
de0dd4e36a | |||
f9d7a63738 | |||
0ef6f8288f | |||
2f23e4dadb | |||
5cf5fac8f4 | |||
8e143db354 | |||
1237c9706e | |||
1add0b4cfe | |||
6920d6d9b0 | |||
27e92660f1 | |||
743e5ba410 | |||
8039b1c807 | |||
9ef84ba63a | |||
56e5ae6629 | |||
4443131516 |
16
moneymgr_backend/Cargo.lock
generated
16
moneymgr_backend/Cargo.lock
generated
@@ -87,7 +87,7 @@ dependencies = [
|
||||
"mime",
|
||||
"percent-encoding",
|
||||
"pin-project-lite",
|
||||
"rand 0.9.1",
|
||||
"rand 0.9.2",
|
||||
"sha1",
|
||||
"smallvec",
|
||||
"tokio",
|
||||
@@ -724,9 +724,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "clap"
|
||||
version = "4.5.41"
|
||||
version = "4.5.42"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "be92d32e80243a54711e5d7ce823c35c41c9d929dc4ab58e1276f625841aadf9"
|
||||
checksum = "ed87a9d530bb41a67537289bafcac159cb3ee28460e0a4571123d2a778a6a882"
|
||||
dependencies = [
|
||||
"clap_builder",
|
||||
"clap_derive",
|
||||
@@ -734,9 +734,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "clap_builder"
|
||||
version = "4.5.41"
|
||||
version = "4.5.42"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "707eab41e9622f9139419d573eca0900137718000c517d47da73045f54331c3d"
|
||||
checksum = "64f4f3f3c77c94aff3c7e9aac9a2ca1974a5adf392a8bb751e827d6d127ab966"
|
||||
dependencies = [
|
||||
"anstream",
|
||||
"anstyle",
|
||||
@@ -2298,7 +2298,7 @@ dependencies = [
|
||||
"light-openid",
|
||||
"log",
|
||||
"mime_guess",
|
||||
"rand 0.9.1",
|
||||
"rand 0.9.2",
|
||||
"rust-embed",
|
||||
"rust-s3",
|
||||
"rust_xlsxwriter",
|
||||
@@ -2741,9 +2741,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rand"
|
||||
version = "0.9.1"
|
||||
version = "0.9.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97"
|
||||
checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1"
|
||||
dependencies = [
|
||||
"rand_chacha 0.9.0",
|
||||
"rand_core 0.9.3",
|
||||
|
@@ -8,7 +8,7 @@ env_logger = "0.11.8"
|
||||
log = "0.4.27"
|
||||
diesel = { version = "2.2.12", features = ["postgres", "r2d2"] }
|
||||
diesel_migrations = "2.2.0"
|
||||
clap = { version = "4.5.41", features = ["env", "derive"] }
|
||||
clap = { version = "4.5.42", features = ["env", "derive"] }
|
||||
actix-web = "4.11.0"
|
||||
actix-cors = "0.7.1"
|
||||
actix-multipart = "0.7.2"
|
||||
@@ -24,7 +24,7 @@ tokio = "1.45.1"
|
||||
futures-util = "0.3.31"
|
||||
serde_json = "1.0.141"
|
||||
light-openid = "1.0.4"
|
||||
rand = "0.9.1"
|
||||
rand = "0.9.2"
|
||||
ipnet = { version = "2.11.0", features = ["serde"] }
|
||||
lazy-regex = "3.4.1"
|
||||
jwt-simple = { version = "0.12.12", default-features = false, features = ["pure-rust"] }
|
||||
|
@@ -29,7 +29,7 @@ pub struct AppConfig {
|
||||
/// Unsecure : for development, bypass authentication, using the account with the given
|
||||
/// email address by default
|
||||
#[clap(long, env)]
|
||||
pub unsecure_auto_login_email: Option<String>,
|
||||
unsecure_auto_login_email: Option<String>,
|
||||
|
||||
/// PostgreSQL database host
|
||||
#[clap(long, env, default_value = "localhost")]
|
||||
@@ -126,6 +126,14 @@ pub struct AppConfig {
|
||||
/// Redis password
|
||||
#[clap(long, env, default_value = "secretredis")]
|
||||
redis_password: String,
|
||||
|
||||
/// Application download URL
|
||||
#[clap(
|
||||
long,
|
||||
env,
|
||||
default_value = "https://gitea.communiquons.org/pierre/MoneyMgr/releases/download/latest/moneymgr_mobile_arm64-v8a.apk"
|
||||
)]
|
||||
pub apk_download_url: String,
|
||||
}
|
||||
|
||||
lazy_static::lazy_static! {
|
||||
@@ -140,9 +148,17 @@ impl AppConfig {
|
||||
&ARGS
|
||||
}
|
||||
|
||||
/// Get auto login email (if not empty)
|
||||
pub fn unsecure_auto_login_email(&self) -> Option<&str> {
|
||||
match self.unsecure_auto_login_email.as_deref() {
|
||||
None | Some("") => None,
|
||||
s => s,
|
||||
}
|
||||
}
|
||||
|
||||
/// Check if auth is disabled
|
||||
pub fn is_auth_disabled(&self) -> bool {
|
||||
self.unsecure_auto_login_email.is_some()
|
||||
self.unsecure_auto_login_email().is_some()
|
||||
}
|
||||
|
||||
/// Get auth cookie domain
|
||||
|
@@ -70,6 +70,7 @@ impl Default for ServerConstraints {
|
||||
struct ServerConfig {
|
||||
auth_disabled: bool,
|
||||
oidc_provider_name: &'static str,
|
||||
apk_download_url: &'static str,
|
||||
accounts_types: &'static [AccountTypeDesc],
|
||||
constraints: ServerConstraints,
|
||||
}
|
||||
@@ -79,6 +80,7 @@ impl Default for ServerConfig {
|
||||
Self {
|
||||
auth_disabled: AppConfig::get().is_auth_disabled(),
|
||||
oidc_provider_name: AppConfig::get().openid_provider().name,
|
||||
apk_download_url: AppConfig::get().apk_download_url.as_str(),
|
||||
constraints: Default::default(),
|
||||
accounts_types: &ACCOUNT_TYPES,
|
||||
}
|
||||
|
@@ -182,7 +182,7 @@ impl FromRequest for AuthExtractor {
|
||||
}
|
||||
|
||||
// Check if login is hard-coded as program argument
|
||||
if let Some(email) = &AppConfig::get().unsecure_auto_login_email {
|
||||
if let Some(email) = &AppConfig::get().unsecure_auto_login_email() {
|
||||
let user = users_service::get_user_by_email(email).map_err(|e| {
|
||||
log::error!("Failed to retrieve dev user: {e}");
|
||||
ErrorPreconditionFailed("Unable to retrieve dev user!")
|
||||
|
@@ -38,7 +38,7 @@ async fn main() -> std::io::Result<()> {
|
||||
db_connection::initialize_conn().expect("Failed to connect to PostgresSQL database!");
|
||||
|
||||
// Auto create default account, if requested
|
||||
if let Some(mail) = &AppConfig::get().unsecure_auto_login_email {
|
||||
if let Some(mail) = &AppConfig::get().unsecure_auto_login_email() {
|
||||
users_service::create_or_update_user(mail, "Anonymous")
|
||||
.await
|
||||
.expect("Failed to create default account!");
|
||||
|
@@ -1,8 +1,10 @@
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
import 'package:moneymgr_mobile/services/router/routes_list.dart';
|
||||
import 'package:moneymgr_mobile/services/storage/expenses.dart';
|
||||
import 'package:moneymgr_mobile/services/storage/prefs.dart';
|
||||
import 'package:moneymgr_mobile/utils/ocr_utils.dart';
|
||||
@@ -55,7 +57,9 @@ class ScanScreen extends HookConsumerWidget {
|
||||
fileContent: value.$1!,
|
||||
fileMimeType: "application/pdf",
|
||||
);
|
||||
restartScan();
|
||||
if (context.mounted) {
|
||||
context.pushReplacement(scansPage);
|
||||
}
|
||||
},
|
||||
onRescan: restartScan,
|
||||
),
|
||||
|
@@ -19,7 +19,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||
version: 1.0.0+1
|
||||
|
||||
environment:
|
||||
sdk: ^3.8.2
|
||||
sdk: ^3.8.3
|
||||
|
||||
# Dependencies specify other packages that your package needs in order to work.
|
||||
# To automatically upgrade your package dependencies to the latest versions
|
||||
@@ -111,7 +111,7 @@ dev_dependencies:
|
||||
flutter_launcher_icons: ^0.14.4
|
||||
|
||||
# Generate source code
|
||||
build_runner: ^2.5.4
|
||||
build_runner: ^2.6.0
|
||||
|
||||
# Riverpod code generation
|
||||
riverpod_generator: ^2.6.5
|
||||
|
2715
moneymgr_web/package-lock.json
generated
2715
moneymgr_web/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -18,26 +18,26 @@
|
||||
"@mdi/react": "^1.6.1",
|
||||
"@mui/icons-material": "^7.1.2",
|
||||
"@mui/material": "^7.1.2",
|
||||
"@mui/x-charts": "^8.8.0",
|
||||
"@mui/x-data-grid": "^8.8.0",
|
||||
"@mui/x-date-pickers": "^8.8.0",
|
||||
"@mui/x-charts": "^8.9.2",
|
||||
"@mui/x-data-grid": "^8.9.2",
|
||||
"@mui/x-date-pickers": "^8.9.0",
|
||||
"date-and-time": "^3.6.0",
|
||||
"dayjs": "^1.11.13",
|
||||
"filesize": "^10.1.6",
|
||||
"qrcode.react": "^4.2.0",
|
||||
"react": "^19.1.0",
|
||||
"react-dom": "^19.1.0",
|
||||
"react": "^19.1.1",
|
||||
"react-dom": "^19.1.1",
|
||||
"react-router": "^7.6.3",
|
||||
"react-router-dom": "^7.6.3",
|
||||
"ts-pattern": "^5.7.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.31.0",
|
||||
"@types/react": "^19.1.8",
|
||||
"@types/react-dom": "^19.1.6",
|
||||
"@vitejs/plugin-react": "^4.6.0",
|
||||
"eslint": "^9.26.0",
|
||||
"eslint-plugin-react-dom": "^1.49.0",
|
||||
"@eslint/js": "^9.32.0",
|
||||
"@types/react": "^19.1.9",
|
||||
"@types/react-dom": "^19.1.7",
|
||||
"@vitejs/plugin-react": "^4.7.0",
|
||||
"eslint": "^9.31.0",
|
||||
"eslint-plugin-react-dom": "^1.52.3",
|
||||
"eslint-plugin-react-hooks": "^5.2.0",
|
||||
"eslint-plugin-react-refresh": "^00.4.20",
|
||||
"eslint-plugin-react-x": "^1.52.3",
|
||||
|
@@ -3,6 +3,7 @@ import { APIClient } from "./ApiClient";
|
||||
export interface ServerConfig {
|
||||
auth_disabled: boolean;
|
||||
oidc_provider_name: string;
|
||||
apk_download_url: string;
|
||||
accounts_types: AccountType[];
|
||||
constraints: ServerConstraints;
|
||||
}
|
||||
|
@@ -280,6 +280,8 @@ function CreatedToken(p: { token: TokenWithSecret }): React.ReactElement {
|
||||
The API token was successfully created. Please note the following
|
||||
information as they won't be available next.
|
||||
<br />
|
||||
API URL : <CopyTextChip text={APIClient.ActualBackendURL()} />
|
||||
<br />
|
||||
Token ID: <CopyTextChip text={p.token.id.toString()} />
|
||||
<br />
|
||||
Token value: <CopyTextChip text={p.token.token} />
|
||||
|
@@ -1,5 +1,6 @@
|
||||
import { mdiApi, mdiCash } from "@mdi/js";
|
||||
import Icon from "@mdi/react";
|
||||
import AndroidIcon from "@mui/icons-material/Android";
|
||||
import CloudDownloadIcon from "@mui/icons-material/CloudDownload";
|
||||
import LogoutIcon from "@mui/icons-material/Logout";
|
||||
import SettingsIcon from "@mui/icons-material/Settings";
|
||||
@@ -10,6 +11,7 @@ import MenuItem from "@mui/material/MenuItem";
|
||||
import Toolbar from "@mui/material/Toolbar";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import * as React from "react";
|
||||
import { ServerApi } from "../api/ServerApi";
|
||||
import { useAuthInfo } from "./BaseAuthenticatedPage";
|
||||
import { DarkThemeButton } from "./DarkThemeButtonWidget";
|
||||
import { PublicModeButton } from "./PublicModeButtonWidget";
|
||||
@@ -100,6 +102,18 @@ export function MoneyWebAppBar(p: {
|
||||
</MenuItem>
|
||||
</RouterLink>
|
||||
|
||||
{/* APK download */}
|
||||
<RouterLink to={ServerApi.Config.apk_download_url}>
|
||||
<MenuItem>
|
||||
<ListItemIcon>
|
||||
<AndroidIcon />
|
||||
</ListItemIcon>
|
||||
<ListItemText secondary="Scan expenses from your smartphone">
|
||||
Mobile Application
|
||||
</ListItemText>
|
||||
</MenuItem>
|
||||
</RouterLink>
|
||||
|
||||
<Divider />
|
||||
|
||||
{/* Sign out */}
|
||||
|
Reference in New Issue
Block a user