Open-source personal finance manager. Self-hosted, privacy-first.
Configure allowedHosts in Vite for frontend access and healthcheck (#1)
Vitor Amaral de Meloa1ada93159cc
diff --git a/docker-compose.prod.yml b/docker-compose.prod.ymlindex 8ad835c6..ae394b7a 100644--- a/docker-compose.prod.yml+++ b/docker-compose.prod.yml@@ -22,7 +22,7 @@ services:redis:image: redis:7-alpinehealthcheck:- test: ["CMD", "redis-cli", "ping"]+ test: [ "CMD", "redis-cli", "ping" ]interval: 5stimeout: 3sretries: 5@@ -36,7 +36,7 @@ services:volumes:- pgdata:/var/lib/postgresql/datahealthcheck:- test: ["CMD-SHELL", "pg_isready -U postgres"]+ test: [ "CMD-SHELL", "pg_isready -U postgres" ]interval: 5stimeout: 3sretries: 5@@ -53,6 +53,7 @@ services:- "3000:80"environment:BACKEND_URL: http://backend:8000+ FRONTEND_URL: http://localhost:3000depends_on:- backendrestart: unless-stoppeddiff --git a/docker-compose.yml b/docker-compose.ymlindex a84388b8..0a01b368 100644--- a/docker-compose.yml+++ b/docker-compose.yml@@ -24,7 +24,7 @@ services:redis:image: redis:7-alpinehealthcheck:- test: ["CMD", "redis-cli", "ping"]+ test: [ "CMD", "redis-cli", "ping" ]interval: 5stimeout: 3sretries: 5@@ -38,7 +38,7 @@ services:volumes:- pgdata:/var/lib/postgresql/datahealthcheck:- test: ["CMD-SHELL", "pg_isready -U postgres"]+ test: [ "CMD-SHELL", "pg_isready -U postgres" ]interval: 5stimeout: 3sretries: 5@@ -57,6 +57,7 @@ services:- "3000:5173"environment:BACKEND_URL: http://backend:8000+ FRONTEND_URL: http://localhost:3000depends_on:- backendvolumes:diff --git a/frontend/package-lock.json b/frontend/package-lock.jsonindex 455b3246..8d5f7ee9 100644--- a/frontend/package-lock.json+++ b/frontend/package-lock.json@@ -102,6 +102,7 @@"integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==","dev": true,"license": "MIT",+ "peer": true,"dependencies": {"@babel/code-frame": "^7.29.0","@babel/generator": "^7.29.0",@@ -1364,9 +1365,9 @@"license": "MIT"},"node_modules/@hono/node-server": {- "version": "1.19.9",- "resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-1.19.9.tgz",- "integrity": "sha512-vHL6w3ecZsky+8P5MD+eFfaGTyCeOHUIFYMGpQGbrBTSmNNoxv0if69rEZ5giu36weC5saFuznL411gRX7bJDw==",+ "version": "1.19.11",+ "resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-1.19.11.tgz",+ "integrity": "sha512-dr8/3zEaB+p0D2n/IUrlPF1HZm586qgJNXK1a9fhg/PzdtkK7Ksd5l312tJX2yBuALqDYBlG20QEbayqPyxn+g==","dev": true,"license": "MIT","engines": {@@ -1667,6 +1668,7 @@"integrity": "sha512-2I0gnIVPtfnMw9ee9h1dJG7tp81+8Ob3OJb3Mv37rx5L40/b0i7djjCVvGOVqc9AEIQyvyu1i6ypKdFw8R8gQw==","dev": true,"license": "MIT",+ "peer": true,"engines": {"node": "^14.21.3 || >=16"},@@ -4166,6 +4168,7 @@"integrity": "sha512-oH72nZRfDv9lADUBSo104Aq7gPHpQZc4BTx38r9xf9pg5LfP6EzSyH2n7qFmmxRQXh7YlUXODcYsg6PuTDSxGg==","dev": true,"license": "MIT",+ "peer": true,"dependencies": {"undici-types": "~7.16.0"}@@ -4176,6 +4179,7 @@"integrity": "sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w==","devOptional": true,"license": "MIT",+ "peer": true,"dependencies": {"csstype": "^3.2.2"}@@ -4186,6 +4190,7 @@"integrity": "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==","devOptional": true,"license": "MIT",+ "peer": true,"peerDependencies": {"@types/react": "^19.2.0"}@@ -4255,6 +4260,7 @@"integrity": "sha512-klQbnPAAiGYFyI02+znpBRLyjL4/BrBd0nyWkdC0s/6xFLkXYQ8OoRrSkqacS1ddVxf/LDyODIKbQ5TgKAf/Fg==","dev": true,"license": "MIT",+ "peer": true,"dependencies": {"@typescript-eslint/scope-manager": "8.56.1","@typescript-eslint/types": "8.56.1",@@ -4573,6 +4579,7 @@"integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==","dev": true,"license": "MIT",+ "peer": true,"bin": {"acorn": "bin/acorn"},@@ -4847,6 +4854,7 @@}],"license": "MIT",+ "peer": true,"dependencies": {"baseline-browser-mapping": "^2.9.0","caniuse-lite": "^1.0.30001759",@@ -5837,6 +5845,7 @@"integrity": "sha512-VmQ+sifHUbI/IcSopBCF/HO3YiHQx/AVd3UVyYL6weuwW+HvON9VYn5l6Zl1WZzPWXPNZrSQpxwkkZ/VuvJZzg==","dev": true,"license": "MIT",+ "peer": true,"dependencies": {"@eslint-community/eslint-utils": "^4.8.0","@eslint-community/regexpp": "^4.12.1",@@ -6140,13 +6149,13 @@}},"node_modules/express-rate-limit": {- "version": "8.2.1",- "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-8.2.1.tgz",- "integrity": "sha512-PCZEIEIxqwhzw4KF0n7QF4QqruVTcF73O5kFKUnGOyjbCCgizBBiFaYpd/fnBLUMPw/BWw9OsiN7GgrNYr7j6g==",+ "version": "8.3.1",+ "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-8.3.1.tgz",+ "integrity": "sha512-D1dKN+cmyPWuvB+G2SREQDzPY1agpBIcTa9sJxOPMCNeH3gwzhqJRDWCXW3gg0y//+LQ/8j52JbMROWyrKdMdw==","dev": true,"license": "MIT","dependencies": {- "ip-address": "10.0.1"+ "ip-address": "10.1.0"},"engines": {"node": ">= 16"@@ -6777,11 +6786,12 @@}},"node_modules/hono": {- "version": "4.12.2",- "resolved": "https://registry.npmjs.org/hono/-/hono-4.12.2.tgz",- "integrity": "sha512-gJnaDHXKDayjt8ue0n8Gs0A007yKXj4Xzb8+cNjZeYsSzzwKc0Lr+OZgYwVfB0pHfUs17EPoLvrOsEaJ9mj+Tg==",+ "version": "4.12.7",+ "resolved": "https://registry.npmjs.org/hono/-/hono-4.12.7.tgz",+ "integrity": "sha512-jq9l1DM0zVIvsm3lv9Nw9nlJnMNPOcAtsbsgiUhWcFzPE99Gvo6yRTlszSLLYacMeQ6quHD6hMfId8crVHvexw==","dev": true,"license": "MIT",+ "peer": true,"engines": {"node": ">=16.9.0"}@@ -6859,6 +6869,7 @@}],"license": "MIT",+ "peer": true,"dependencies": {"@babel/runtime": "^7.28.4"},@@ -6961,9 +6972,9 @@}},"node_modules/ip-address": {- "version": "10.0.1",- "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.0.1.tgz",- "integrity": "sha512-NWv9YLW4PoW2B7xtzaS3NCot75m6nK7Icdv0o3lfMceJVRfSoQwqD4wEH5rLwoKJwUiZ/rfpiVBhnaF0FK4HoA==",+ "version": "10.1.0",+ "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.1.0.tgz",+ "integrity": "sha512-XXADHxXmvT9+CRxhXg56LJovE+bmWnEWB78LB83VZTprKTmaC5QfruXocxzTZ2Kl0DNwKuBdlIhjL8LeY8Sf8Q==","dev": true,"license": "MIT","engines": {@@ -8655,6 +8666,7 @@"resolved": "https://registry.npmjs.org/react/-/react-19.2.4.tgz","integrity": "sha512-9nfp2hYpCwOjAN+8TZFGhtWEwgvWHXqESH8qT89AT/lWklpLON22Lc8pEtnpsZz7VmawabSU0gCjnj8aC0euHQ==","license": "MIT",+ "peer": true,"engines": {"node": ">=0.10.0"}@@ -8664,6 +8676,7 @@"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.4.tgz","integrity": "sha512-AXJdLo8kgMbimY95O2aKQqsz2iWi9jMgKJhRBAxECE4IFxfcazB2LmzloIoibJI3C12IlY20+KFaLv+71bUJeQ==","license": "MIT",+ "peer": true,"dependencies": {"scheduler": "^0.27.0"},@@ -8676,6 +8689,7 @@"resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.71.2.tgz","integrity": "sha512-1CHvcDYzuRUNOflt4MOq3ZM46AronNJtQ1S7tnX6YN4y72qhgiUItpacZUAQ0TyWYci3yz1X+rXaSxiuEm86PA==","license": "MIT",+ "peer": true,"engines": {"node": ">=18.0.0"},@@ -8745,6 +8759,7 @@"resolved": "https://registry.npmjs.org/react-redux/-/react-redux-9.2.0.tgz","integrity": "sha512-ROY9fvHhwOD9ySfrF0wmvu//bKCQ6AeZZq1nJNtbDC+kk5DuSuNX/n6YWYF/SYy7bSba4D4FSz8DJeKY/S/r+g==","license": "MIT",+ "peer": true,"dependencies": {"@types/use-sync-external-store": "^0.0.6","use-sync-external-store": "^1.4.0"@@ -8931,7 +8946,8 @@"version": "5.0.1","resolved": "https://registry.npmjs.org/redux/-/redux-5.0.1.tgz","integrity": "sha512-M9/ELqF6fy8FwmkpnF0S3YKOqMyoWJ4+CS5Efg2ct3oY9daQvd/Pc71FpGZsVsbl3Cpb+IIcjBDUnnyBdQbq4w==",- "license": "MIT"+ "license": "MIT",+ "peer": true},"node_modules/redux-thunk": {"version": "3.1.0",@@ -9835,6 +9851,7 @@"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==","devOptional": true,"license": "Apache-2.0",+ "peer": true,"bin": {"tsc": "bin/tsc","tsserver": "bin/tsserver"@@ -10070,6 +10087,7 @@"integrity": "sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA==","dev": true,"license": "MIT",+ "peer": true,"dependencies": {"esbuild": "^0.27.0","fdir": "^6.5.0",@@ -10408,6 +10426,7 @@"resolved": "https://registry.npmjs.org/zod/-/zod-4.3.6.tgz","integrity": "sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==","license": "MIT",+ "peer": true,"funding": {"url": "https://github.com/sponsors/colinhacks"}diff --git a/frontend/vite.config.ts b/frontend/vite.config.tsindex 889ce04b..9657832a 100644--- a/frontend/vite.config.ts+++ b/frontend/vite.config.ts@@ -1,7 +1,14 @@-import { defineConfig } from 'vite'-import react from '@vitejs/plugin-react'import tailwindcss from '@tailwindcss/vite'+import react from '@vitejs/plugin-react'import path from 'path'+import { defineConfig } from 'vite'++const frontendHost = (() => {+ const url = process.env.FRONTEND_URL+ if (!url) return []+ const withoutProto = url.replace(/^https?:\/\//, '')+ return [withoutProto.split(/[:/]/)[0]]+})()export default defineConfig({plugins: [react(), tailwindcss()],@@ -13,6 +20,7 @@ export default defineConfig({server: {port: 5173,host: '0.0.0.0',+ allowedHosts: frontendHost,proxy: {'/api': {target: process.env.BACKEND_URL ?? 'http://localhost:8000',