Off unless MCP_ENABLED=true. Runs inside the web app (stateless Streamable
HTTP, JSON responses), so no extra container or supervisord program.
- Tools run the REST views in-process as the caller, so permissions,
sharing, validation and transaction rules stay the API's.
- 11 curated tools with compact output, plus search_api/call_api to reach
every other API endpoint from the OpenAPI schema.
- OAuth protected-resource metadata (RFC 9728) and a WWW-Authenticate hint
on 401s, so MCP clients find the existing OAuth server and DCR.
- GET /api/transactions/summary/: totals per currency and type, optionally
grouped by category, tag, entity, account or month.
API changes found while testing it:
- Writes no longer need Django model permissions, which nothing granted;
access now matches the web UI (signed-in user, scoped querysets, owner-only
edits of shared objects). API tokens and OAuth apps can now write for
regular users.
- Account group owner is read-only; it could be set to another user.
- Reject negative installment, recurring, DCA and exchange-rate amounts, a
zero recurrence interval, and performance on non-investment accounts.
- Accounts can be archived; group_id/exchange_currency_id are optional;
category accepts null; currency prefix/suffix keep their spaces.
- Transactions filter by tags and entities.
- OpenAPI: separate request schemas (COMPONENT_SPLIT_REQUEST) and real
descriptions for the viewsets and DCA chart actions.
Transactions, installment plans and recurring transactions take a nested
sub_transactions list; their amount becomes the parts' sum. Changing only
the amount of a split transaction, or adding parts to a transfer, is a
validation error.
An import run can now be given an account, and every transaction it
creates goes into that account instead of the one the profile maps. This
lets a single profile serve several accounts at the same bank, for
statements that only name the account in a header cell or not at all,
instead of keeping one copy of the profile per account.
- ImportRun gets an optional `account` (SET_NULL), shown on the run card.
- The upload form offers the user's active accounts when the profile
imports transactions, and leaves the field out for profiles that import
accounts, currencies, categories, tags or entities.
- CSV and Excel rows take the run's account before deduplication, so
rules comparing `account` check against the picked account. The
profile's account mapping is skipped for these rows.
- QIF files use the run's account instead of the account named after the
file.
- The import API accepts an optional `account_id`, limited to accounts
the user can access, rejected for profiles that don't import
transactions, and returns `account` on import runs.
Leaving the account empty keeps the current behaviour.
Closes#538
- /api/investment-classes/ to list, create, edit and delete asset classes
- Accounts return their asset class and take investment_class_id, filterable
by investment_class
- Unique names and targets up to 100% are checked in the model, shared by the
form and the API
Import uploads were always written to /usr/src/app/temp, presets were
read from /usr/src/app/import_presets and the caches lived in /var/tmp,
so WYGIWYH only worked from the Docker image's layout. Running it as a
systemd service with a strict sandbox, or on an immutable distro like
NixOS, needs these folders to follow the app or be configurable.
- Presets are read from IMPORT_PRESETS_ROOT, the import_presets folder
next to the app.
- Uploads wait in IMPORT_TEMP_ROOT, the temp folder next to the app by
default, and movable with the IMPORT_TEMP_ROOT env var. The web views,
the API and the import service all use it.
- The file-based caches live under CACHE_ROOT, /var/tmp by default, and
movable with the CACHE_ROOT env var.
In the Docker image the app sits in /usr/src/app, so every default
resolves to the same folder as before.
The import service checked that a file was inside the temp folder with a
plain string prefix, which also accepted sibling folders such as
/usr/src/app/temp-other. It now compares paths.
CI no longer needs to create /usr/src/app before running the tests.
Fixes#472
Investments are accounts flagged as investments; performance is derived from their transactions. Linked transfers are contributions and withdrawals (average cost, realized gains), unlinked transactions are gains or losses, and income comes from the accounts' income entities.
- Unit-priced (exchange currency) or value-tracked accounts
- Money-weighted return (XIRR), annualized after a year
- Totals converted along each currency's exchange chain, with currency effect
- Investments list and detail pages; buy/sell/income use the transfer and transaction forms
- GET /api/accounts/<id>/performance/
ImportProfile and ImportRun had no owner, and neither the web views nor the
REST viewsets filtered by the requesting user, so any authenticated user could
read, edit and delete every other user's import profiles and runs
(GHSA-q668-h56g-mfp4).
- ImportProfile is now a SharedObject, with share and take-ownership views
like transaction rules; the global unique constraint on name is dropped.
- ImportRun is now an OwnedObject owned by the uploader, so runs made with a
shared profile stay private to whoever ran them.
- Existing runs are backfilled with the owner of their imported
transactions; existing profiles stay unowned and usable by everyone.
The rules endpoints were one instance of a pattern repeated across every
SharedObject-backed app. Route the rest through the same helper.
DCA entries were the worst case and are strictly wider than the reported
rules bug: DCAEntry has an unscoped default manager, so filtering by
strategy__id alone reached entries on strategies the caller could not see
at all. No public or shared strategy was needed -- only a guessable
integer. strategy_entry_add/edit/delete now resolve through the parent
strategy with via="strategy".
Every SharedObject delete view carried an inverted condition:
if obj.owner != request.user and request.user in obj.shared_with.all():
obj.shared_with.remove(request.user)
else:
obj.delete()
An object its owner had made public matched neither branch's intent and
fell through to delete(), so any authenticated user could destroy it.
Confirmed reachable for accounts, account groups, categories, tags,
entities and DCA strategies. The owner now deletes, a shared user revokes
only their own access, and anyone else gets a 403.
The API viewsets had no object-level check at all. DjangoModelPermissions
gated them shut for ordinary users, who hold no model permissions, so this
was not reachable in a default install -- but the check belongs there
regardless, and a user granted change_account in the admin could write any
visible account. SharedObjectPermission adds it for the SharedObject
viewsets, leaving reads to SharedObjectManager.
account_toggle_untracked only flips the calling user's own row in the
untracked_by m2m, so it takes READ rather than EDIT.
Refs GHSA-83g9-vjqf-2j5q