Commit graph

53 commits

Author SHA1 Message Date
Horizontal42
51972c0599 update tauri.conf version to 1.2.5 2026-08-12 20:10:40 +03:00
Horizontal42
d6c79b4662 bump cargo version to 1.2.5 2026-08-12 20:10:27 +03:00
Horizontal42
c3bc67bd5b gate every dir-taking IPC command against a Rust-owned trust anchor
load_documents, save_documents, run_backups, backup_deleted_sheet,
open_backups_folder and data_dir_has_documents all took a `dir` param
straight from the frontend and used it unchecked — any IPC caller
(a buggy extension, compromised webview content) could point Rust at
an arbitrary path, and migrate_data_dir's old_dir was the worst of it:
combined with strategy="move" it deletes documents.json and everything
under backups/ at whatever path it's handed.

Add DataDirGate: a path only counts as authorized if it was proven
user-chosen, either just now via the native folder picker or because
it's the data-dir.txt this file itself wrote after a previous
successful commit. save_file/load_file refuse to touch that filename
so the frontend can't forge its own authorization. docs_dir() now
returns Result and every command above goes through it.

migrate_data_dir authorizes the target before copying but only writes
data-dir.txt once every file has actually landed, so a migration that
dies partway leaves the app still pointing at a folder that works.
2026-08-12 20:00:00 +03:00
Horizontal42
3bc946bd44 consistent size cap for OS-opened sheet files
read_text_file (drag&drop) capped sheets at 1MB with an extension
whitelist; get_launch_file and the single-instance file-open handler
only checked the extension. Route both through read_sheet_file so a
file association or second launch gets the same cap.
2026-08-12 19:59:12 +03:00
Horizontal42
dea7314842 move cache file I/O off the async runtime thread
rates.json, market.json and rates-<date>.json reads/writes ran
straight on the tokio worker calling the Tauri command, blocking the
shared async runtime for the duration. Wrap them in
tauri::async_runtime::spawn_blocking via read_file_async/write_atomic_async.
2026-08-12 19:57:55 +03:00
Horizontal42
2d682448c6 dedupe historical-rate map parsing
fetch_historical_rates and fetch_historical_rates_batch each built the
same USD-anchored, uppercased rate map inline. Extract parse_rate_map
and cover it with tests.
2026-08-12 19:56:11 +03:00
Horizontal42
a8121dbc90 share atomic-write bytes helper between write_atomic and image export
write_image_file hand-rolled the same temp+rename dance write_atomic
already did for text, just for bytes. Split write_atomic into a
write_atomic_bytes core and have both callers use it.
2026-08-12 19:54:37 +03:00
Horizontal42
d7b88cc9c9 atomic write for deleted-sheet backups
fs::write left the one safety-net copy of a deleted sheet exposed to
mid-write corruption; use the existing temp+rename helper like every
other user-data write.
2026-08-12 19:54:06 +03:00
Horizontal42
b399b95263 sync Cargo.lock with 1.2.4 2026-08-09 16:33:24 +03:00
Horizontal42
6ab5b9e5d9 update tauri.conf version to 1.2.4 2026-08-09 16:31:24 +03:00
Horizontal42
78538511b8 bump cargo version to 1.2.4 2026-08-09 16:31:04 +03:00
Horizontal42
dad3de70a5
bound migrate_data_dir cleanup to known files, add dialog-verified new_dir 2026-08-09 16:27:08 +03:00
Horizontal42
354705cf15
scope read_text_file to files from real drop events 2026-08-09 16:23:33 +03:00
Horizontal42
55d8401a44
batch historical rates IPC calls with a pooled http client 2026-08-09 15:59:44 +03:00
Horizontal42
c958f30662 Revert "rotate updater signing pubkey"
This reverts commit c0bea836bc.
2026-07-29 15:54:41 +03:00
Horizontal42
c0bea836bc rotate updater signing pubkey 2026-07-29 15:46:13 +03:00
Horizontal42
40cdf22461 sync Cargo.lock with 1.2.3 2026-07-29 15:35:03 +03:00
Horizontal42
8bfe65a1c4 update tauri.conf version to 1.2.3 2026-07-29 15:35:03 +03:00
Horizontal42
2798bfcafa bump cargo version to 1.2.3 2026-07-29 15:35:03 +03:00
Horizontal42
b0f6e9e89b run extensions in a quickjs wasm sandbox
replaces new Function() in the main window; per-script and per-call
interrupt deadlines, memory and stack limits, graceful skip if the
wasm module fails to load. csp script-src drops 'unsafe-eval' for
'wasm-unsafe-eval'.
2026-07-29 14:38:28 +03:00
Horizontal42
5c4f2db2d2 fix clippy collapsible_match warning in safe_name 2026-07-29 14:14:49 +03:00
Horizontal42
a6fc5b90f3 harden safe_name path validation 2026-07-29 14:14:49 +03:00
Horizontal42
f5b1fc038b sync Cargo.lock with 1.2.2 2026-07-16 03:41:10 +03:00
Horizontal42
ca19042af0 update tauri.conf version to 1.2.2 2026-07-16 02:52:03 +03:00
Horizontal42
539fb6eff5 bump cargo version to 1.2.2 2026-07-16 02:49:05 +03:00
Horizontal42
6f6c3b439a bump version to 1.2.1 2026-07-08 15:58:14 +03:00
Horizontal42
c1a7254fdf fix arbitrary file write via write_text_file/write_image_file
Both Tauri commands took a raw path string straight from the frontend
and wrote to it with no validation — any code able to call invoke()
(a compromised or malicious extension script, which run with full page
privileges) could write to any path the OS user has access to, not just
one chosen through the save dialog. Move the save-file dialog into the
Rust command itself so the only path ever used is one the native dialog
returned; the frontend now only sends the content to save.
2026-07-08 15:50:13 +03:00
Horizontal42
f634b1858e fetch market data symbols concurrently instead of sequentially
fetch_market_data hit Yahoo's v8 chart endpoint once per symbol in a
sequential loop — with 9 symbols that's 9 round trips end to end.
join_all fires them together.
2026-07-08 15:47:31 +03:00
Horizontal42
b179f64fb4 bump version to 1.2.0 2026-07-03 13:26:32 +03:00
Horizontal42
8b4e6fc0fe market data: switch to Yahoo v8 chart, drop delisted tickers
v7/finance/quote returns 401 now — Yahoo stopped issuing anonymous
clients the cookie+crumb pair it requires. v8 chart still answers
without auth, one symbol per request instead of one bulk call.
Also dropped SBER/GAZP from the tracked symbols; Yahoo delisted
Russian tickers in 2022, so those two always missed anyway.
2026-07-03 11:51:40 +03:00
Horizontal42
d0d13ec1c0 historical rates: point at frankfurter.dev, fetch on cold start too
api.frankfurter.app 301-redirects to frankfurter.dev now, and the old
host is flaky over reqwest/rustls-tls — talk to the new one directly
(Rust backend, the vite-dev web fallback, and the CSP allowlist).

Separately, a sheet reopened on boot with "on 2024-01-01" in it never
fetched historical rates at all: the fetch only ran from switchDoc()
and the editor's onChange, and the editor's initial text is seeded
directly, bypassing both.
2026-07-03 11:46:47 +03:00
Horizontal42
d28ab6d095 style: cargo fmt src-tauri
Whitespace only, no behavior change — makes the next couple of Rust
commits smaller and easier to read.
2026-07-03 11:44:36 +03:00
Horizontal42
01697daaac bump version to 1.1.0 2026-07-02 06:20:32 +03:00
Horizontal42
fbeca06f2e historical rates: 1000 USD in EUR on 2024-01-01 via frankfurter.app 2026-07-01 22:23:35 +03:00
Horizontal42
bbbcc0497c export sheet as PNG — clipboard + file-save fallback 2026-07-01 20:44:04 +03:00
Horizontal42
661a4500ca live market data via Yahoo Finance: AAPL TSLA NVDA etc 2026-07-01 20:40:40 +03:00
Horizontal42
55a2b6a492 bump version to 1.0.1 2026-07-01 17:37:43 +03:00
Horizontal42
a2dcd6ebba retag as v1.0.0 — first public release under PolyForm Noncommercial 2026-07-01 16:02:00 +03:00
Horizontal42
ca408f9bab bump version to 1.3.0 2026-07-01 14:56:09 +03:00
Horizontal42
9aca062add add search across all sheets and always-on-top toggle
Ctrl+F opens an overlay that searches every document's lines, not just
the active one, and jumps to the hit on click. Always-on-top is a
plain window pin, off by default, toggleable in settings.
2026-07-01 14:54:44 +03:00
Horizontal42
6efae0c706 add auto-update via tauri-plugin-updater
Signed by a new key (public half embedded in tauri.conf.json, private
half + password live in GitHub secrets). CI now signs release artifacts
and publishes latest.json; the app checks on boot and prompts to
install and restart.
2026-07-01 13:58:32 +03:00
Horizontal42
e23d8d3874 bump version to 1.2.0 2026-06-24 00:40:15 +03:00
Horizontal42
b0c46c390c RU math phrases, half/полтора constants, export button
- vocab: EN+RU aliases for abs/log/ln/round; RU already had sqrt/cbrt
- engine: "half"/"a half"/"one half"/"половина" → 0.5; "one and a half"/"полтора"/"полторы" → 1.5 as named constants; widen const union in parser/tokenizer/evaluator/registry
- export: ⤓ button in statusbar dropdown — copy sheet, save .sum, export .txt, print/PDF; write_text_file Tauri command; print media CSS hides chrome
2026-06-24 00:27:06 +03:00
Horizontal42
0c193a406c v1.1.3 2026-06-19 17:30:55 +03:00
Horizontal42
ece0ea1a14 fix white screen on autostart and hotkey toggle 2026-06-19 17:30:54 +03:00
Horizontal42
9fe8dd74f8 apply rustfmt 2026-06-18 22:08:09 +03:00
Horizontal42
abe84b6683 v1.1.2 2026-06-18 22:03:20 +03:00
Horizontal42
2285e7b87e warn users that extensions run with full file access 2026-06-18 22:00:44 +03:00
Horizontal42
165aa65bba add unit tests for safe_name and is_sheet_path 2026-06-18 22:00:44 +03:00
Horizontal42
ec09c93770 remove Numi brand mentions from code and lockfile 2026-06-18 21:51:31 +03:00