11 Commits

Author SHA1 Message Date
eb07a9d5e6 Update Node.js to v24
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-05-27 00:07:30 +00:00
f38482757e Update dependency react-router to ^7.6.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-05-26 00:07:39 +00:00
7e976d903d Update Rust crate tokio to 1.45.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-05-25 00:07:32 +00:00
737d7f76d4 Update dependency @mui/x-charts to ^8.4.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-05-24 00:07:37 +00:00
cf0e42ff0e Update dependency @eslint/js to ^9.27.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-05-23 00:06:54 +00:00
d2fa9bf9ee Update dependency @types/react to ^19.1.5
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-05-22 00:07:20 +00:00
fb5a85311c Update Rust crate jwt-simple to 0.12.12
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-05-21 00:07:25 +00:00
288d334615 Update dependency ts-pattern to ^5.7.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-05-20 00:07:21 +00:00
87f017fc42 OIDC functional
All checks were successful
continuous-integration/drone/push Build is passing
2025-05-19 21:08:51 +02:00
43fb8dcda6 Update 2025-05-19 20:58:50 +02:00
a3b9c7cdb1 Fix bad file name
All checks were successful
continuous-integration/drone/push Build is passing
2025-05-19 19:35:26 +02:00
11 changed files with 236 additions and 38 deletions

View File

@ -6,7 +6,7 @@ name: default
steps:
# Frontend
- name: web_build
image: node:23
image: node:24
volumes:
- name: web_app
path: /tmp/web_build

View File

@ -3,10 +3,46 @@
Open Source web-based personal expenses tool.
**Note :** This project does not handle authentication itself. Instead, it relies on OpenID to achieve users authentication.
## Setup prod env
1. Install prerequisites:
1. docker
2. docker compose
3. git
2. Clone this git repository:
```bash
git clone https://gitea.communiquons.org/pierre/MoneyMgr
cd MoneyMgr/docker_prod
```
3. Copy and adapt env values
```bash
cp .env.sample .env
nano .env
```
4. Create required directories:
```bash
mkdir -p storage/{db,redis-data,redis-conf,minio}
```
5. Start containers
```bash
docker compose up
```
6. Checkout http://localhost:8000/
> The default credentials are `admin` / `admin`
## Setup dev env
1. Install prerequisites:
1. docker
2. docker-compose
2. docker compose
3. rust
4. node

10
docker_prod/.env.sample Normal file
View File

@ -0,0 +1,10 @@
MINIO_ROOT_USER=rootuser
MINIO_ROOT_PASSWORD=rootpassword
DB_USER=db_user
DB_PASSWORD=db_password
REDIS_PASS=redis_password
WEBSITE_ORIGIN=http://localhost:8000
APP_SECRET=secretsecretsecretsecretsecretsecretsecretsecretsecretsecretsecret
AUTH_SECRET_KEY=secretsecretsecretsecretsecretsecretsecretsecretsecretsecretsecret
OIDC_CLIENT_ID=bar
OIDC_CLIENT_SECRET=foo

3
docker_prod/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
.env
storage
auth/users.json

View File

@ -0,0 +1,5 @@
- id: ${OIDC_CLIENT_ID}
name: MoneyMgr
description: Money management tool
secret: ${OIDC_CLIENT_SECRET}
redirect_uri: ${APP_ORIGIN}/oidc_cb

View File

@ -0,0 +1,79 @@
services:
minio:
image: minio/minio
user: "1000"
environment:
- MINIO_ROOT_USER=$MINIO_ROOT_USER
- MINIO_ROOT_PASSWORD=$MINIO_ROOT_PASSWORD
volumes:
- ./storage/minio:/data
command: [ "minio", "server", "/data", "--console-address", ":9090" ]
ports:
- 9000:9000
- 9090:9090
expose:
- 9000
db:
image: postgres
user: "1000"
ports:
- "5432:5432"
expose:
- 5432
environment:
- POSTGRES_USER=$DB_USER
- POSTGRES_PASSWORD=$DB_PASSWORD
- POSTGRES_DB=moneymgr
volumes:
- ./storage/db:/var/lib/postgresql/data
oidc:
image: pierre42100/basic_oidc
user: "1000"
environment:
- LISTEN_ADDRESS=0.0.0.0:9001
- STORAGE_PATH=/storage
- TOKEN_KEY=$AUTH_SECRET_KEY
- WEBSITE_ORIGIN=http://localhost:9001
- OIDC_CLIENT_ID=$OIDC_CLIENT_ID
- OIDC_CLIENT_SECRET=$OIDC_CLIENT_SECRET
- APP_ORIGIN=$WEBSITE_ORIGIN
expose:
- 9001
ports:
- 9001:9001
volumes:
- ./auth:/storage
redis:
image: redis:alpine
user: "1000"
command: redis-server --requirepass ${REDIS_PASS:-secretredis}
expose:
- 6379
volumes:
- ./storage/redis-data:/data
- ./storage/redis-conf:/usr/local/etc/redis/redis.conf
moneymgr:
image: pierre42100/moneymgr_backend
user: "1000"
ports:
- 8000:8000
environment:
- WEBSITE_ORIGIN=${WEBSITE_ORIGIN}
- SECRET=${APP_SECRET}
- DB_HOST=db
- DB_USERNAME=$DB_USER
- DB_PASSWORD=$DB_PASSWORD
- DB_NAME=moneymgr
- OIDC_CONFIGURATION_URL=http://oidc:9001/.well-known/openid-configuration
- OIDC_PROVIDER_NAME=OIDC
- OIDC_CLIENT_ID=$OIDC_CLIENT_ID
- OIDC_CLIENT_SECRET=$OIDC_CLIENT_SECRET
- S3_ENDPOINT=http://minio:9000
- S3_ACCESS_KEY=$MINIO_ROOT_USER
- S3_SECRET_KEY=$MINIO_ROOT_PASSWORD
- REDIS_HOSTNAME=redis
- REDIS_PASSWORD=${REDIS_PASS:-secretredis}

View File

@ -3571,9 +3571,9 @@ dependencies = [
[[package]]
name = "tokio"
version = "1.45.0"
version = "1.45.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2513ca694ef9ede0fb23fe71a4ee4107cb102b9dc1930f6d0fd77aae068ae165"
checksum = "75ef51a33ef1da925cea3e4eb122833cb377c61439ca401b770f54902b806779"
dependencies = [
"backtrace",
"bytes",

View File

@ -20,14 +20,14 @@ anyhow = "1.0.98"
serde = { version = "1.0.219", features = ["derive"] }
rust-s3 = "0.36.0-beta.2"
thiserror = "2.0.12"
tokio = "1.45.0"
tokio = "1.45.1"
futures-util = "0.3.31"
serde_json = "1.0.140"
light-openid = "1.0.4"
rand = "0.9.1"
ipnet = { version = "2.11.0", features = ["serde"] }
lazy-regex = "3.4.1"
jwt-simple = { version = "0.12.11", default-features = false, features = ["pure-rust"] }
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-pre.5"

View File

@ -14,7 +14,7 @@ use std::process::Command;
struct Args {
/// URL to Money manager API
#[arg(short('U'), long, env, default_value = "http://localhost:8000/api")]
matrix_gw_url: String,
moneymgr_url: String,
/// Token ID
#[arg(short('i'), long, env)]
@ -39,7 +39,8 @@ struct Args {
fn main() {
let args: Args = Args::parse();
let full_url = format!("{}{}", args.matrix_gw_url, args.uri);
let full_url = format!("{}{}", args.moneymgr_url, args.uri);
log::debug!("Full URL: {full_url}");
let key = HS256Key::from_bytes(args.token_secret.as_bytes());

View File

@ -16,7 +16,7 @@
"@mdi/react": "^1.6.1",
"@mui/icons-material": "^7.1.0",
"@mui/material": "^7.1.0",
"@mui/x-charts": "^8.3.1",
"@mui/x-charts": "^8.4.0",
"@mui/x-data-grid": "^8.3.1",
"@mui/x-date-pickers": "^8.3.1",
"date-and-time": "^3.6.0",
@ -25,13 +25,13 @@
"qrcode.react": "^4.2.0",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react-router": "^7.6.0",
"react-router": "^7.6.1",
"react-router-dom": "^7.6.0",
"ts-pattern": "^5.7.0"
"ts-pattern": "^5.7.1"
},
"devDependencies": {
"@eslint/js": "^9.26.0",
"@types/react": "^19.1.4",
"@eslint/js": "^9.27.0",
"@types/react": "^19.1.5",
"@types/react-dom": "^19.1.5",
"@vitejs/plugin-react": "^4.4.1",
"eslint": "^9.26.0",
@ -1145,13 +1145,16 @@
}
},
"node_modules/@eslint/js": {
"version": "9.26.0",
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.26.0.tgz",
"integrity": "sha512-I9XlJawFdSMvWjDt6wksMCrgns5ggLNfFwFvnShsleWruvXM514Qxk8V246efTw+eo9JABvVz+u3q2RiAowKxQ==",
"version": "9.27.0",
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.27.0.tgz",
"integrity": "sha512-G5JD9Tu5HJEu4z2Uo4aHY2sLV64B7CDMXxFzqzjl3NKd6RVzSXNoE80jk7Y0lJkTTkjiIhBAqmlYwjuBY3tvpA==",
"dev": true,
"license": "MIT",
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"url": "https://eslint.org/donate"
}
},
"node_modules/@eslint/object-schema": {
@ -1588,15 +1591,15 @@
}
},
"node_modules/@mui/x-charts": {
"version": "8.3.1",
"resolved": "https://registry.npmjs.org/@mui/x-charts/-/x-charts-8.3.1.tgz",
"integrity": "sha512-jZClK40++ftcMwCeHKudGKmazd0MsgnrIP6RhYi2lH1kg0jK2upueokyxVIIxqquwWsQYE3WsflJBP61DvYXOQ==",
"version": "8.4.0",
"resolved": "https://registry.npmjs.org/@mui/x-charts/-/x-charts-8.4.0.tgz",
"integrity": "sha512-XXXt6cHgpTTkLWIImBy0OPD0FwuOdux4AprP/0Zvs0PXuM9D9eeN1piZvo5gjZbPHSsCzIyZzwx9PGncFScgEQ==",
"license": "MIT",
"dependencies": {
"@babel/runtime": "^7.27.1",
"@mui/utils": "^7.0.2",
"@mui/x-charts-vendor": "8.3.1",
"@mui/x-internals": "8.3.1",
"@mui/x-charts-vendor": "8.4.0",
"@mui/x-internals": "8.4.0",
"bezier-easing": "^2.1.0",
"clsx": "^2.1.1",
"prop-types": "^15.8.1",
@ -1624,9 +1627,9 @@
}
},
"node_modules/@mui/x-charts-vendor": {
"version": "8.3.1",
"resolved": "https://registry.npmjs.org/@mui/x-charts-vendor/-/x-charts-vendor-8.3.1.tgz",
"integrity": "sha512-UcUa7HDIpSfeVBYgeHewWoVALcB4Gg9we53l78j2cyadYBZOWdtLj8fezo9zAhxfZ5s9T+1yIyuD+CCnYJnUpQ==",
"version": "8.4.0",
"resolved": "https://registry.npmjs.org/@mui/x-charts-vendor/-/x-charts-vendor-8.4.0.tgz",
"integrity": "sha512-0VvwJSeFezJTnjoKg5YUbbI82a60+VZfH2RyqaosmKH516lKYKSCuAFmkj4vUBP6+ZJPZDW5mWI3VhwD4DN6hg==",
"license": "MIT AND ISC",
"dependencies": {
"@babel/runtime": "^7.27.1",
@ -1648,6 +1651,26 @@
"robust-predicates": "^3.0.2"
}
},
"node_modules/@mui/x-charts/node_modules/@mui/x-internals": {
"version": "8.4.0",
"resolved": "https://registry.npmjs.org/@mui/x-internals/-/x-internals-8.4.0.tgz",
"integrity": "sha512-Z7FCahC4MLfTVzEwnKOB7P1fiR9DzFuMzHOPRNaMXc/rsS7unbtBKAG94yvsRzReCyjzZUVA7h37lnQ1DoPKJw==",
"license": "MIT",
"dependencies": {
"@babel/runtime": "^7.27.1",
"@mui/utils": "^7.0.2"
},
"engines": {
"node": ">=14.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/mui-org"
},
"peerDependencies": {
"react": "^17.0.0 || ^18.0.0 || ^19.0.0"
}
},
"node_modules/@mui/x-data-grid": {
"version": "8.3.1",
"resolved": "https://registry.npmjs.org/@mui/x-data-grid/-/x-data-grid-8.3.1.tgz",
@ -2229,9 +2252,9 @@
"license": "MIT"
},
"node_modules/@types/react": {
"version": "19.1.4",
"resolved": "https://registry.npmjs.org/@types/react/-/react-19.1.4.tgz",
"integrity": "sha512-EB1yiiYdvySuIITtD5lhW4yPyJ31RkJkkDw794LaQYrxCSaQV/47y5o1FMC4zF9ZyjUjzJMZwbovEnT5yHTW6g==",
"version": "19.1.5",
"resolved": "https://registry.npmjs.org/@types/react/-/react-19.1.5.tgz",
"integrity": "sha512-piErsCVVbpMMT2r7wbawdZsq4xMvIAhQuac2gedQHysu1TZYEigE6pnFfgZT+/jQnrRuF5r+SHzuehFjfRjr4g==",
"license": "MIT",
"dependencies": {
"csstype": "^3.0.2"
@ -3494,6 +3517,16 @@
"url": "https://opencollective.com/eslint"
}
},
"node_modules/eslint/node_modules/@eslint/js": {
"version": "9.26.0",
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.26.0.tgz",
"integrity": "sha512-I9XlJawFdSMvWjDt6wksMCrgns5ggLNfFwFvnShsleWruvXM514Qxk8V246efTw+eo9JABvVz+u3q2RiAowKxQ==",
"dev": true,
"license": "MIT",
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
}
},
"node_modules/espree": {
"version": "10.3.0",
"resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz",
@ -4860,9 +4893,9 @@
}
},
"node_modules/react-router": {
"version": "7.6.0",
"resolved": "https://registry.npmjs.org/react-router/-/react-router-7.6.0.tgz",
"integrity": "sha512-GGufuHIVCJDbnIAXP3P9Sxzq3UUsddG3rrI3ut1q6m0FI6vxVBF3JoPQ38+W/blslLH4a5Yutp8drkEpXoddGQ==",
"version": "7.6.1",
"resolved": "https://registry.npmjs.org/react-router/-/react-router-7.6.1.tgz",
"integrity": "sha512-hPJXXxHJZEsPFNVbtATH7+MMX43UDeOauz+EAU4cgqTn7ojdI9qQORqS8Z0qmDlL1TclO/6jLRYUEtbWidtdHQ==",
"license": "MIT",
"dependencies": {
"cookie": "^1.0.1",
@ -4897,6 +4930,37 @@
"react-dom": ">=18"
}
},
"node_modules/react-router-dom/node_modules/cookie": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-1.0.2.tgz",
"integrity": "sha512-9Kr/j4O16ISv8zBBhJoi4bXOYNTkFLOqSL3UDB0njXxCXNezjeyVrJyGOWtgfs/q2km1gwBcfH8q1yEGoMYunA==",
"license": "MIT",
"engines": {
"node": ">=18"
}
},
"node_modules/react-router-dom/node_modules/react-router": {
"version": "7.6.0",
"resolved": "https://registry.npmjs.org/react-router/-/react-router-7.6.0.tgz",
"integrity": "sha512-GGufuHIVCJDbnIAXP3P9Sxzq3UUsddG3rrI3ut1q6m0FI6vxVBF3JoPQ38+W/blslLH4a5Yutp8drkEpXoddGQ==",
"license": "MIT",
"dependencies": {
"cookie": "^1.0.1",
"set-cookie-parser": "^2.6.0"
},
"engines": {
"node": ">=20.0.0"
},
"peerDependencies": {
"react": ">=18",
"react-dom": ">=18"
},
"peerDependenciesMeta": {
"react-dom": {
"optional": true
}
}
},
"node_modules/react-router/node_modules/cookie": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-1.0.2.tgz",
@ -5448,9 +5512,9 @@
}
},
"node_modules/ts-pattern": {
"version": "5.7.0",
"resolved": "https://registry.npmjs.org/ts-pattern/-/ts-pattern-5.7.0.tgz",
"integrity": "sha512-0/FvIG4g3kNkYgbNwBBW5pZBkfpeYQnH+2AA3xmjkCAit/DSDPKmgwC3fKof4oYUq6gupClVOJlFl+939VRBMg==",
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/ts-pattern/-/ts-pattern-5.7.1.tgz",
"integrity": "sha512-EGs8PguQqAAUIcQfK4E9xdXxB6s2GK4sJfT/vcc9V1ELIvC4LH/zXu2t/5fajtv6oiRCxdv7BgtVK3vWgROxag==",
"license": "MIT"
},
"node_modules/tslib": {

View File

@ -18,7 +18,7 @@
"@mdi/react": "^1.6.1",
"@mui/icons-material": "^7.1.0",
"@mui/material": "^7.1.0",
"@mui/x-charts": "^8.3.1",
"@mui/x-charts": "^8.4.0",
"@mui/x-data-grid": "^8.3.1",
"@mui/x-date-pickers": "^8.3.1",
"date-and-time": "^3.6.0",
@ -27,13 +27,13 @@
"qrcode.react": "^4.2.0",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react-router": "^7.6.0",
"react-router": "^7.6.1",
"react-router-dom": "^7.6.0",
"ts-pattern": "^5.7.0"
"ts-pattern": "^5.7.1"
},
"devDependencies": {
"@eslint/js": "^9.26.0",
"@types/react": "^19.1.4",
"@eslint/js": "^9.27.0",
"@types/react": "^19.1.5",
"@types/react-dom": "^19.1.5",
"@vitejs/plugin-react": "^4.4.1",
"eslint": "^9.26.0",