找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
听天命
印
查看: 2|回复: 0

自托管家庭账本 / 个人财务系统yuvomi

[复制链接]

64

主题

6

回帖

40万

积分

管理员

积分
400364

最佳新人活跃会员热心会员推广达人宣传达人灌水之王突出贡献优秀版主荣誉管理论坛元老

发表于 2 小时前 | 显示全部楼层 |阅读模式
✅ 镜像基础信息

  • 镜像地址:ghcr.io/ulsklyc/yuvomi:latest
  • 容器内端口:3000
  • 数据库:SQLite 文件数据库,单文件,无需 MySQL/Postgres
  • 技术栈:Node.js + Vue 前端
  • 架构:amd64,arm64 一般也支持
  • 启动依赖:必须配套 .env 文件,很多密钥、管理员配置都在 .env 里,没有 .env 直接启动会报错
✅ 核心功能

  • 收支记账:收入、支出、转账、预算,支持定期重复账单(房租、月供)
  • 多账户:银行卡、现金、零钱、理财账户,账户之间转账
  • 分类 + 标签:收支分类(餐饮、交通、医疗等)+ 自定义标签,方便筛选统计
  • 报表图表:月度 / 年度汇总、收支趋势、分类占比饼图,预算执行对比
  • 多用户:支持家庭成员共用一套账本,权限隔离
  • 附件单据:上传小票、发票照片(就是配置里的 documents 存储)
  • 模块扩展:./modules 目录用来加载自定义扩展模块
  • 自动备份:内置备份功能,备份文件输出到 /backups 挂载目录
  • PWA:手机浏览器添加到桌面,手机记账很方便
📂 挂载目录说明(对应你 compose)

  • ${DATA_DIR:-./data}:/data:核心目录,存放 sqlite 数据库 yuvomi.db + 程序运行缓存,备份重点备份这个文件夹
  • ${BACKUP_DIR:-./backups}:/backups:自动备份文件存放目录
  • ${MODULES_DIR:-./modules}:/app/modules:扩展模块挂载,放自定义插件
  • ${DOCUMENT_STORAGE_LOCAL_DIR:-./documents}{DOCUMENT_STORAGE_LOCAL_PATH:-/documents}:发票小票等上传附件存储;DOCUMENT_STORAGE_LOCAL_ENABLED=false 默认关闭本地文档存储,需要手动改成 true 才生效

docker-compose文件内容:
  1. services:
  2.   yuvomi:
  3.     image: ghcr.io/ulsklyc/yuvomi:latest
  4.     build: .                          # optional: use --build to build locally instead
  5.     container_name: yuvomi
  6.     restart: unless-stopped
  7.     ports:
  8.       # Host-Port aus .env (OIKOS_HTTP_PORT); App im Container bleibt auf 3000.
  9.       - "0.0.0.0:${OIKOS_HTTP_PORT:-3000}:3000"
  10.     volumes:
  11.       - ${DATA_DIR:-./data}:/data
  12.       - ${BACKUP_DIR:-./backups}:/backups
  13.       # Drop Yuvomi modules into ./modules, or set MODULES_DIR=/path/to/modules in
  14.       # .env. The app reads that name inside the container too, so environment:
  15.       # below pins it to /app/modules; the .env value only moves the mount source.
  16.       - ${MODULES_DIR:-./modules}:/app/modules
  17.       # Optional local documents folder. BOTH ends come from the .env: the app
  18.       # writes to DOCUMENT_STORAGE_LOCAL_PATH, so mounting at a fixed /documents
  19.       # would send uploads into the container layer as soon as anyone changes
  20.       # that path - and they would be gone on the next pull && up -d.
  21.       - ${DOCUMENT_STORAGE_LOCAL_DIR:-./documents}:${DOCUMENT_STORAGE_LOCAL_PATH:-/documents}
  22.     # Bewusst die Kurzform, nicht `path:`/`required:` (Issue #765): die Langform
  23.     # gibt es erst ab Compose v2.24, und Synology DSM, QNAP und ältere Distros
  24.     # liefern älter - dort scheitert schon das Einlesen mit
  25.     # "services.yuvomi.env_file.0 must be a string", also noch vor dem ersten
  26.     # Start. Die Langform stand hier für Git-/GitOps-Stacks ohne .env (#698);
  27.     # dieser Weg geht seitdem über docs/docker-compose.portainer.yml, das jede
  28.     # Variable einzeln aufführt. Seit die Secrets beim ersten Start entstehen,
  29.     # liefe ein Stack ohne .env mit der Langform zwar an; die Kurzform bleibt
  30.     # trotzdem, weil sie auf jeder Compose-Version liest, und ohne .env bricht
  31.     # sie mit "env file not found" ab, bevor etwas startet.
  32.     env_file:
  33.       - .env
  34.     environment:
  35.       - NODE_ENV=production
  36.       - DB_PATH=${DB_PATH:-/data/yuvomi.db}
  37.       - BACKUP_DIR=/backups
  38.       - MODULES_DIR=/app/modules
  39.       # Local document storage (optional): set to true to store uploaded documents on the mounted /documents folder.
  40.       - DOCUMENT_STORAGE_LOCAL_ENABLED=${DOCUMENT_STORAGE_LOCAL_ENABLED:-false}
  41.       - DOCUMENT_STORAGE_LOCAL_PATH=${DOCUMENT_STORAGE_LOCAL_PATH:-/documents}
  42.       # Secure cookies come from .env (the installer sets them):
  43.       #   - Reverse proxy + HTTPS → SESSION_SECURE=true, TRUST_PROXY=1
  44.       #   - Direct HTTP access     → SESSION_SECURE=false, TRUST_PROXY=loopback
  45.       # Default when unset (e.g. a .env that does not carry the line): false,
  46.       # so direct HTTP login keeps working out of the box.
  47.       - SESSION_SECURE=${SESSION_SECURE:-false}

  48.     healthcheck:
  49.       test: ["CMD", "node", "-e", "require('http').get('http://localhost:3000/health', r => process.exit(r.statusCode === 200 ? 0 : 1))"]
  50.       interval: 30s
  51.       timeout: 10s
  52.       retries: 3
  53.       start_period: 10s
复制代码

.env:
  1. # Yuvomi - Environment Variables
  2. # Copy this file to .env and adjust the values.

  3. # Server
  4. PORT=3000
  5. NODE_ENV=production
  6. # LOG_LEVEL=info   # debug, info, warn, error (default: info)
  7. # The app's own files (scripts, styles, language files) are compressed once with a
  8. # high Brotli level and then served from memory - about 5 MB of RAM and, spread over
  9. # the first requests after a start, some 25 s of CPU on one core in the background.
  10. # Set to off to compress per request at a low level instead, as it was before.
  11. # STATIC_BROTLI=off
  12. # Address the app listens on (default: all interfaces). Leave unset in a container:
  13. # the published port reaches the app only when it listens on all interfaces. Set to
  14. # 127.0.0.1 when Node runs directly on the host behind a reverse proxy on that host.
  15. # IP addresses only: a host name (localhost included) is refused, and so is an IPv6
  16. # address with a zone ID (fe80::1%eth0).
  17. # Not the same as OIKOS_HTTP_BIND below, which is where the container engine
  18. # publishes the port.
  19. # BIND_ADDRESS=127.0.0.1

  20. # Container host port mapping (compose maps OIKOS_HTTP_PORT:3000).
  21. # The app inside the container always listens on 3000; change only the host port here.
  22. OIKOS_HTTP_PORT=3000
  23. # Host bind address for the published port (podman-compose.yml only; default 0.0.0.0).
  24. # Set to 127.0.0.1 for rootless Podman behind a reverse proxy on the same host.
  25. # OIKOS_HTTP_BIND=0.0.0.0
  26. # TZ=Europe/Berlin   # Container timezone (default: UTC). Affects log timestamps
  27. #                    # and the automated-backup schedule, and is the DEFAULT for
  28. #                    # the household zone. Since v2.34.0 the household zone is a
  29. #                    # setting of its own (Settings > Account > Appearance >
  30. #                    # Region), and that setting wins where both are present -
  31. #                    # TZ lives in the compose file, which you cannot reach on
  32. #                    # Umbrel, TrueNAS or Unraid. Whichever applies is the zone
  33. #                    # used wherever a time has no zone of its own: the calendar
  34. #                    # day server jobs call "today", events pushed to Google or
  35. #                    # Outlook, the due times of CalDAV reminders synced into
  36. #                    # Tasks, and the times in the exported calendar feed -
  37. #                    # subscribers read those in this zone, so a wrong zone
  38. #                    # shifts every appointment.

  39. # Container storage paths (bind mounts)
  40. # DATA_DIR=./data              # Host folder for the database and stored app data
  41. # BACKUP_DIR=./backups         # Host folder for scheduled backups
  42. # MODULES_DIR=./modules        # Host folder for third-party drop-in modules (see MODULES.md)
  43. # These are HOST paths, used by docker-compose.yml / podman-compose.yml to build the
  44. # volume mapping. Inside the container the app always uses /data, /backups and
  45. # /app/modules (the compose files and the Quadlet set DB_PATH, BACKUP_DIR and
  46. # MODULES_DIR accordingly), so a host path here only moves the mount source. Do not
  47. # pass this file to a bare `docker run --env-file`: nothing pins those names there,
  48. # and BACKUP_DIR=./backups would point the app at /app/backups, which is outside the
  49. # mounted volume and not writable.
  50. # On SELinux systems (RHEL/Fedora/CentOS Stream) use podman-compose.yml — it adds
  51. # the :Z relabel automatically so the container can access these folders.

  52. # Installing modules from Settings (Settings → Modules → Add custom module).
  53. # Off by default. What it opens: an admin in a browser session can put
  54. # same-origin script into modules/ from the web interface (ZIP upload or GitHub
  55. # URL), with no shell or file access to the server. A module installed that way
  56. # stays off until an admin approves it in a browser session, and the web
  57. # interface deletes only what it installed. Set true only if you mount modules/
  58. # and want that; otherwise copy module folders into modules/ by hand as before.
  59. # MODULES_ALLOW_WEB_INSTALL=false

  60. # Secrets from files (Docker/Podman secrets, Vault Agent): instead of putting a value
  61. # here, point <NAME>_FILE at a file that holds it, e.g.
  62. #   SESSION_SECRET_FILE=/run/secrets/session_secret
  63. #   DB_ENCRYPTION_KEY_FILE=/run/secrets/db_encryption_key
  64. # Works for SESSION_SECRET, DB_ENCRYPTION_KEY and the other secrets in this file
  65. # (client secrets, passwords, API keys). Set either <NAME> or <NAME>_FILE, not both;
  66. # a missing or empty file stops the start. Line breaks at the end of the file are ignored.
  67. # The app reads the file as uid 1000 (568 on TrueNAS), not as root: give the file
  68. # that owner and mode 600 (see "Secrets from Files" in docs/installation.md).

  69. # Session
  70. # The placeholder below is not a secret: it is printed in this repository, so
  71. # anyone who can reach your instance could forge a session cookie and sign in as
  72. # any user. The app refuses to start until you replace it. Generate a value with
  73. # `openssl rand -base64 48`, or delete the line: with SESSION_SECRET unset, Yuvomi
  74. # generates one on the first start and keeps it in .secrets/SESSION_SECRET next to
  75. # the database. Changing it later only signs everyone out once.
  76. SESSION_SECRET='SESSION_SECRET'
复制代码



回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|精简版|手机版|小黑屋|嗐!无思百忧,祇自重兮 ( 京ICP备18055970号|京ICP备18055970号 )晋公网安备 14010902001813号 本站总访问量次. 您是第个小伙伴

GMT+8, 2026-11-23 12:32 , Processed in 0.053959 second(s), 6 queries , Redis On.

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表