Compare commits
9 Commits
1.0.2
...
ae0d46b79c
Author | SHA1 | Date | |
---|---|---|---|
ae0d46b79c | |||
737d7f76d4 | |||
cf0e42ff0e | |||
d2fa9bf9ee | |||
fb5a85311c | |||
288d334615 | |||
87f017fc42 | |||
43fb8dcda6 | |||
a3b9c7cdb1 |
@ -6,7 +6,7 @@ name: default
|
|||||||
steps:
|
steps:
|
||||||
# Frontend
|
# Frontend
|
||||||
- name: web_build
|
- name: web_build
|
||||||
image: node:23
|
image: node:24
|
||||||
volumes:
|
volumes:
|
||||||
- name: web_app
|
- name: web_app
|
||||||
path: /tmp/web_build
|
path: /tmp/web_build
|
||||||
|
38
README.md
38
README.md
@ -3,10 +3,46 @@
|
|||||||
|
|
||||||
Open Source web-based personal expenses tool.
|
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
|
## Setup dev env
|
||||||
1. Install prerequisites:
|
1. Install prerequisites:
|
||||||
1. docker
|
1. docker
|
||||||
2. docker-compose
|
2. docker compose
|
||||||
3. rust
|
3. rust
|
||||||
4. node
|
4. node
|
||||||
|
|
||||||
|
10
docker_prod/.env.sample
Normal file
10
docker_prod/.env.sample
Normal 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
3
docker_prod/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
.env
|
||||||
|
storage
|
||||||
|
auth/users.json
|
5
docker_prod/auth/clients.yaml
Normal file
5
docker_prod/auth/clients.yaml
Normal 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
|
79
docker_prod/docker-compose.yml
Normal file
79
docker_prod/docker-compose.yml
Normal 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}
|
@ -27,7 +27,7 @@ light-openid = "1.0.4"
|
|||||||
rand = "0.9.1"
|
rand = "0.9.1"
|
||||||
ipnet = { version = "2.11.0", features = ["serde"] }
|
ipnet = { version = "2.11.0", features = ["serde"] }
|
||||||
lazy-regex = "3.4.1"
|
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"
|
mime_guess = "2.0.5"
|
||||||
rust-embed = { version = "8.7.2" }
|
rust-embed = { version = "8.7.2" }
|
||||||
sha2 = "0.11.0-pre.5"
|
sha2 = "0.11.0-pre.5"
|
||||||
|
@ -14,7 +14,7 @@ use std::process::Command;
|
|||||||
struct Args {
|
struct Args {
|
||||||
/// URL to Money manager API
|
/// URL to Money manager API
|
||||||
#[arg(short('U'), long, env, default_value = "http://localhost:8000/api")]
|
#[arg(short('U'), long, env, default_value = "http://localhost:8000/api")]
|
||||||
matrix_gw_url: String,
|
moneymgr_url: String,
|
||||||
|
|
||||||
/// Token ID
|
/// Token ID
|
||||||
#[arg(short('i'), long, env)]
|
#[arg(short('i'), long, env)]
|
||||||
@ -39,7 +39,8 @@ struct Args {
|
|||||||
fn main() {
|
fn main() {
|
||||||
let args: Args = Args::parse();
|
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}");
|
log::debug!("Full URL: {full_url}");
|
||||||
|
|
||||||
let key = HS256Key::from_bytes(args.token_secret.as_bytes());
|
let key = HS256Key::from_bytes(args.token_secret.as_bytes());
|
||||||
|
75
moneymgr_web/package-lock.json
generated
75
moneymgr_web/package-lock.json
generated
@ -16,7 +16,7 @@
|
|||||||
"@mdi/react": "^1.6.1",
|
"@mdi/react": "^1.6.1",
|
||||||
"@mui/icons-material": "^7.1.0",
|
"@mui/icons-material": "^7.1.0",
|
||||||
"@mui/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-data-grid": "^8.3.1",
|
||||||
"@mui/x-date-pickers": "^8.3.1",
|
"@mui/x-date-pickers": "^8.3.1",
|
||||||
"date-and-time": "^3.6.0",
|
"date-and-time": "^3.6.0",
|
||||||
@ -27,11 +27,11 @@
|
|||||||
"react-dom": "^19.1.0",
|
"react-dom": "^19.1.0",
|
||||||
"react-router": "^7.6.0",
|
"react-router": "^7.6.0",
|
||||||
"react-router-dom": "^7.6.0",
|
"react-router-dom": "^7.6.0",
|
||||||
"ts-pattern": "^5.7.0"
|
"ts-pattern": "^5.7.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/js": "^9.26.0",
|
"@eslint/js": "^9.27.0",
|
||||||
"@types/react": "^19.1.4",
|
"@types/react": "^19.1.5",
|
||||||
"@types/react-dom": "^19.1.5",
|
"@types/react-dom": "^19.1.5",
|
||||||
"@vitejs/plugin-react": "^4.4.1",
|
"@vitejs/plugin-react": "^4.4.1",
|
||||||
"eslint": "^9.26.0",
|
"eslint": "^9.26.0",
|
||||||
@ -1145,13 +1145,16 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@eslint/js": {
|
"node_modules/@eslint/js": {
|
||||||
"version": "9.26.0",
|
"version": "9.27.0",
|
||||||
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.26.0.tgz",
|
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.27.0.tgz",
|
||||||
"integrity": "sha512-I9XlJawFdSMvWjDt6wksMCrgns5ggLNfFwFvnShsleWruvXM514Qxk8V246efTw+eo9JABvVz+u3q2RiAowKxQ==",
|
"integrity": "sha512-G5JD9Tu5HJEu4z2Uo4aHY2sLV64B7CDMXxFzqzjl3NKd6RVzSXNoE80jk7Y0lJkTTkjiIhBAqmlYwjuBY3tvpA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://eslint.org/donate"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@eslint/object-schema": {
|
"node_modules/@eslint/object-schema": {
|
||||||
@ -1588,15 +1591,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@mui/x-charts": {
|
"node_modules/@mui/x-charts": {
|
||||||
"version": "8.3.1",
|
"version": "8.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/@mui/x-charts/-/x-charts-8.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/@mui/x-charts/-/x-charts-8.4.0.tgz",
|
||||||
"integrity": "sha512-jZClK40++ftcMwCeHKudGKmazd0MsgnrIP6RhYi2lH1kg0jK2upueokyxVIIxqquwWsQYE3WsflJBP61DvYXOQ==",
|
"integrity": "sha512-XXXt6cHgpTTkLWIImBy0OPD0FwuOdux4AprP/0Zvs0PXuM9D9eeN1piZvo5gjZbPHSsCzIyZzwx9PGncFScgEQ==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.27.1",
|
"@babel/runtime": "^7.27.1",
|
||||||
"@mui/utils": "^7.0.2",
|
"@mui/utils": "^7.0.2",
|
||||||
"@mui/x-charts-vendor": "8.3.1",
|
"@mui/x-charts-vendor": "8.4.0",
|
||||||
"@mui/x-internals": "8.3.1",
|
"@mui/x-internals": "8.4.0",
|
||||||
"bezier-easing": "^2.1.0",
|
"bezier-easing": "^2.1.0",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"prop-types": "^15.8.1",
|
"prop-types": "^15.8.1",
|
||||||
@ -1624,9 +1627,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@mui/x-charts-vendor": {
|
"node_modules/@mui/x-charts-vendor": {
|
||||||
"version": "8.3.1",
|
"version": "8.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/@mui/x-charts-vendor/-/x-charts-vendor-8.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/@mui/x-charts-vendor/-/x-charts-vendor-8.4.0.tgz",
|
||||||
"integrity": "sha512-UcUa7HDIpSfeVBYgeHewWoVALcB4Gg9we53l78j2cyadYBZOWdtLj8fezo9zAhxfZ5s9T+1yIyuD+CCnYJnUpQ==",
|
"integrity": "sha512-0VvwJSeFezJTnjoKg5YUbbI82a60+VZfH2RyqaosmKH516lKYKSCuAFmkj4vUBP6+ZJPZDW5mWI3VhwD4DN6hg==",
|
||||||
"license": "MIT AND ISC",
|
"license": "MIT AND ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.27.1",
|
"@babel/runtime": "^7.27.1",
|
||||||
@ -1648,6 +1651,26 @@
|
|||||||
"robust-predicates": "^3.0.2"
|
"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": {
|
"node_modules/@mui/x-data-grid": {
|
||||||
"version": "8.3.1",
|
"version": "8.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/@mui/x-data-grid/-/x-data-grid-8.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/@mui/x-data-grid/-/x-data-grid-8.3.1.tgz",
|
||||||
@ -2229,9 +2252,9 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/@types/react": {
|
"node_modules/@types/react": {
|
||||||
"version": "19.1.4",
|
"version": "19.1.5",
|
||||||
"resolved": "https://registry.npmjs.org/@types/react/-/react-19.1.4.tgz",
|
"resolved": "https://registry.npmjs.org/@types/react/-/react-19.1.5.tgz",
|
||||||
"integrity": "sha512-EB1yiiYdvySuIITtD5lhW4yPyJ31RkJkkDw794LaQYrxCSaQV/47y5o1FMC4zF9ZyjUjzJMZwbovEnT5yHTW6g==",
|
"integrity": "sha512-piErsCVVbpMMT2r7wbawdZsq4xMvIAhQuac2gedQHysu1TZYEigE6pnFfgZT+/jQnrRuF5r+SHzuehFjfRjr4g==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"csstype": "^3.0.2"
|
"csstype": "^3.0.2"
|
||||||
@ -3494,6 +3517,16 @@
|
|||||||
"url": "https://opencollective.com/eslint"
|
"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": {
|
"node_modules/espree": {
|
||||||
"version": "10.3.0",
|
"version": "10.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz",
|
||||||
@ -5448,9 +5481,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/ts-pattern": {
|
"node_modules/ts-pattern": {
|
||||||
"version": "5.7.0",
|
"version": "5.7.1",
|
||||||
"resolved": "https://registry.npmjs.org/ts-pattern/-/ts-pattern-5.7.0.tgz",
|
"resolved": "https://registry.npmjs.org/ts-pattern/-/ts-pattern-5.7.1.tgz",
|
||||||
"integrity": "sha512-0/FvIG4g3kNkYgbNwBBW5pZBkfpeYQnH+2AA3xmjkCAit/DSDPKmgwC3fKof4oYUq6gupClVOJlFl+939VRBMg==",
|
"integrity": "sha512-EGs8PguQqAAUIcQfK4E9xdXxB6s2GK4sJfT/vcc9V1ELIvC4LH/zXu2t/5fajtv6oiRCxdv7BgtVK3vWgROxag==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/tslib": {
|
"node_modules/tslib": {
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
"@mdi/react": "^1.6.1",
|
"@mdi/react": "^1.6.1",
|
||||||
"@mui/icons-material": "^7.1.0",
|
"@mui/icons-material": "^7.1.0",
|
||||||
"@mui/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-data-grid": "^8.3.1",
|
||||||
"@mui/x-date-pickers": "^8.3.1",
|
"@mui/x-date-pickers": "^8.3.1",
|
||||||
"date-and-time": "^3.6.0",
|
"date-and-time": "^3.6.0",
|
||||||
@ -29,11 +29,11 @@
|
|||||||
"react-dom": "^19.1.0",
|
"react-dom": "^19.1.0",
|
||||||
"react-router": "^7.6.0",
|
"react-router": "^7.6.0",
|
||||||
"react-router-dom": "^7.6.0",
|
"react-router-dom": "^7.6.0",
|
||||||
"ts-pattern": "^5.7.0"
|
"ts-pattern": "^5.7.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/js": "^9.26.0",
|
"@eslint/js": "^9.27.0",
|
||||||
"@types/react": "^19.1.4",
|
"@types/react": "^19.1.5",
|
||||||
"@types/react-dom": "^19.1.5",
|
"@types/react-dom": "^19.1.5",
|
||||||
"@vitejs/plugin-react": "^4.4.1",
|
"@vitejs/plugin-react": "^4.4.1",
|
||||||
"eslint": "^9.26.0",
|
"eslint": "^9.26.0",
|
||||||
|
Reference in New Issue
Block a user