Commit Graph

37 Commits

Author SHA1 Message Date
Sebastian Jeltsch 84ac7a0463 Extend CLI's user/admin capabilities and disallow change/delete operations on admins from UI. #83 2025-07-11 11:23:15 +02:00
Sebastian Jeltsch a84c5784b1 Push responsibility of handling missing site_url down the stack to its consumers. #79
Different use-cases may employ different strategies. For example, emailing falls back to non-sensical values for development, while constructing back-redirection links for OAuth has a hard dependency on site_url. The latter requires editing the config anyway so it certainly seems reasonable to ask users to also sepecify a url even if it's just "http:localhost:4000".
2025-07-10 13:39:36 +02:00
Sebastian Jeltsch 1b651baeb9 Include OpenApi schema exports (w/o swagger UI) into default build and add auth OpenAPI to docs. 2025-06-22 16:25:59 +02:00
Sebastian Jeltsch 257387c7ee Replace "open-api run" subcomands --port with --address. #22 2025-06-22 12:37:13 +02:00
Sebastian Jeltsch 5a61369c50 Wire up command-line argument for geoip database. 2025-05-28 15:01:59 +02:00
Sebastian Jeltsch 5152cf9000 Replace vendored refinery with a more proper fork stripping all the unused bits and bobs. 2025-05-27 22:01:06 +02:00
Sebastian Jeltsch 2b9d65074f Best effort attach other *.db files found in <traildepot>/data.
All the admin operations do not properly qualify tables, views... . To
be generally useful, this is also missigng schema-handling for multiple
dbs.
We could just rely on migration files fully qualifying, however this
wouldn't work well with db renames. We also don't want to store
migration state for "test.db" in "main.db".
2025-05-22 15:28:30 +02:00
Sebastian Jeltsch fe2e8cfda4 Clean up Sqlite connection setup, no-parallel reads for in-memory dbs, and add a placeholder storage for persisting apalis queues. 2025-04-23 11:56:36 +02:00
Sebastian Jeltsch d6b199587d Update to Rust edition 2024. 2025-04-20 07:36:26 +02:00
Sebastian Jeltsch e0ad4a898c Extend trailbase-sqlites execution model to allow for parallel reads. This reduces the latency long-tail for slow reads.
Note that this complicates the APIs, since it pushes the responsibility
of declaring a query a read or write to the user to then be scheduled
appropriately.

Add `.(read_|)query_row_f` APIs similar to rusqlites
`conn.query_row` accepting a `|row| -> Result<T>` to reduce the use of
`Row` and `Rows`.

Make benchmarks more isolated by not sharing a DB across runs
accumulating writes.
2025-04-15 12:15:40 +02:00
Sebastian Jeltsch eecab32d39 Minor: consistent tokio and env_logger dependencies. 2025-04-14 09:25:44 +02:00
Sebastian Jeltsch 79a2dbd155 Fix: JSON API schemas are now properly tied to API rather than table with correct expansion config. 2025-04-09 11:48:06 +02:00
Sebastian Jeltsch 503d7cae9b Pass connection constructor to prepare for broader concurrency models. 2025-04-08 10:05:56 +02:00
Sebastian Jeltsch f7cce2dc44 Fix logging: deterministically and separately initialize log and tracing. 2025-04-04 13:23:26 +02:00
Sebastian Jeltsch b12deb7702 Clean out Table and View metadata and move more responsibility to RecordApi. 2025-04-02 14:53:04 +02:00
Sebastian Jeltsch 4da0e42183 Minor: clean up some email code and add more tests. 2025-03-31 12:21:28 +02:00
Sebastian Jeltsch 8237368937 Minor: don't hard code server authority in tests. 2025-03-08 21:44:23 +01:00
Sebastian Jeltsch 9cb2e1983c Add --demo mode to redact PII from logs. 2025-03-07 10:00:36 +01:00
Sebastian Jeltsch 527974284f Update Rust and JS deps. 2025-02-27 00:59:20 +01:00
Sebastian Jeltsch 925e4ff9d4 Remove more accidental logs as a result of forking refinery. 2025-02-12 14:38:52 +01:00
Sebastian Jeltsch 9f1a198441 Add a TLS test using self-signed certs. 2025-01-29 23:43:42 +01:00
Sebastian Jeltsch 31e8421451 Updating and cleaning up some Rust deps. 2025-01-26 21:29:44 +01:00
Sebastian Jeltsch ade3b78862 Update Rust deps fixing swagger builds. 2025-01-18 12:11:04 +01:00
Sebastian Jeltsch 4ae0966810 Update Axum to 0.8. 2025-01-06 11:36:04 +01:00
Sebastian Jeltsch a323429c05 Depend on forked refinery crates. 2025-01-03 10:32:37 +01:00
Sebastian Jeltsch 7ef775db78 Rename trailbase-core to trailbase (avoided directory rename for now).
Still can't publish a crate due to refinery. Refinery's latest release
doesn't work with the already weathered rusqlite.
2025-01-02 15:27:18 +01:00
Sebastian Jeltsch 746f0c1108 Make connection constructor synchronous. 2024-12-16 17:00:51 +01:00
Sebastian Jeltsch 765401af35 Trigger sqlite log writes on a specific span. 2024-12-07 13:38:44 +01:00
Sebastian Jeltsch 1b5c957415 Move SQLite orchestration into trailbase-sqlite and fix js-runtime completion bug with true async (previously libsql was sync under the hood). 2024-12-04 16:57:15 +01:00
Sebastian Jeltsch 6cbea390fb Herculean migration from libsql's rust bindings to plain rusqlite+SQLite.
There's a couple of reasons:

* As for the rust bindings: they're sub-par to rusqlite, though
  rusqlite is amazing. Even libsql-server uses rusqlite over their own
  bindings. The bindings are missing features such as update hooks
  and the hard-coded execution model suffers from lock congestion.
* We've fixed bugs (e.g. trivial null ptr accesses went unnoticed),
  raised issues, and tried to add missing functionality such as update
  hooks. It's unclear if the rust-bindings are a priority or covered by
  the principles laid out in the libsql manifesto. From the outside it
  looks like focus has shifted to https://github.com/penberg/limbo.
* As for the C-libsql fork for SQLite itself, it's getting more and
  more outdated (2024-01-30 (3.45.1)) and it's unclear when and if the
  ideas from the manifesto will manifest.

Looking forward this opens the door for TrailBase to:

* Bundle more recent versions of SQLite
* Implement more performant, better scaling execution models.
* Implement realtime APIs for subscribing to data changes.
2024-12-04 13:03:06 +01:00
Sebastian Jeltsch d27b20e33e Fix: benchmark build. 2024-11-18 12:27:48 +01:00
Sebastian Jeltsch 69bd8a3978 Make number of JS V8-isolate threads user-configurable via CLI. 2024-11-15 14:14:14 +01:00
Sebastian Jeltsch dc261e3405 Release v0.2.0 with JS/ES6/TS runtime based on V8-engine and dotnet client. 2024-11-14 21:37:35 +01:00
Sebastian Jeltsch 8fa26c246f Minor: Write out js runtime to traildepot and rely on relative includes. Also some opportunistic cleanups along the way. 2024-11-14 20:45:37 +01:00
Sebastian Jeltsch d15202c749 PoC: Integration of V8-engine and rustyscript runtime.. 2024-11-14 20:45:37 +01:00
Sebastian Jeltsch 2803de7567 Re-re-license from AGPLv3 to the weaker copyleft OSL-3.0.
After spending too much time researching licenses, my laymen
understanding makes me feel that OSL-3.0 will be a better match given
TrailBase's rare dual use as a standalone backend or framework.

It tried to outline the reasoning in the README.md. I would appreciate
input from anyone more experienced with licenses.
For now, I would like to turn my attention back to more technical issues
:hide:.
2024-11-02 12:35:10 +01:00
Sebastian Jeltsch bdb3735840 Squash all commits for a fresh start.
This is only to avoid accidentally leaking any secrets from early development especially in the light of short-sha attacks.
2024-10-30 23:38:56 +01:00