aboutsummaryrefslogtreecommitdiffstats
path: root/atuin-common/src (follow)
Commit message (Collapse)AuthorAge
* chore: move crates into crates/ dir (#1958)Ellie Huxtable2024-04-18
| | | | I'd like to tidy up the root a little, and it's nice to have all the rust crates in one place
* feat(server): add me endpoint (#1954)Ellie Huxtable2024-04-16
|
* feat(gui): add base structure (#1935)Ellie Huxtable2024-04-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * initial * ui things * cargo * update, add history refresh button * history page a bit better, add initial dotfiles page * re-org layout * bye squigglies * add dotfiles ui, show aliases * add default shell detection * put stats in a little drawer, alias import changes * use new table for aliases, add alias deleting * support adding aliases * close drawer when added, no alias autocomplete * clippy, format * attempt to ensure gdk is installed ok * sudo * no linux things on mac ffs * I forgot we build for windows too... end of day * remove tauri backend from workspace
* feat(dotfiles): add alias import (#1938)Ellie Huxtable2024-04-10
| | | | | | | * feat(dotfiles): add alias import * things * clippy clappy
* perf(dotfiles): cache aliases and read straight from file (#1918)Ellie Huxtable2024-04-03
| | | | | | | | | | | | | * cache aliases when set locally * handle rebuild on sync and tidy things a bit * support all shells except nu * make clippy happy * fmt * fix for no features
* chore(ci): run rust build/test/check on 3 platforms (#1675)Ellie Huxtable2024-02-05
| | | | | | | * chore(ci): run rust build/test/check on 3 platforms * need to properly test windows * do not need to strip here, and windows has a suffix anyway
* Add xonsh support (#1375)Matthieu LAURENT2024-01-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add basic xonsh support * Add init xonsh command * Add Xonsh install instructions in docs * Add xonsh ctrl-R search * update xonsh script and instructions Summary of changes: * Added duration to postcommand hook * Switched main search operation to use `subproccess.run()` rather than running as an xonsh shell command - this a) allows us to capture stderr without needing a temporary file and b) avoids a weird broken-buffer state that results from running a fullscreen TUI and then programmatically editing the buffer * Added support for immediately executing chosen command via `__atuin_accept__:` (like bash/zsh/fish) * strip newline from command before sending to atuin * Add basic xonsh support * Add init xonsh command * Add xonsh ctrl-R search * Remove advanced-install guide (was accidentally re-added during rebase) * Clean up Xonsh doesn't import private functions into the local namespace when sourcing a file * Add xonsh ro readme * Respect ATUIN_NOBIND * Format with black, and improve PEP8 compliance * Add up search * Format rust code --------- Co-authored-by: Joseph Montanaro <jfmonty2@gmail.com>
* feat: Add change-password command & support on server (#1615)TymanWasTaken2024-01-29
| | | | | | | | | | | * Add change-password command & support on server * Add a test for password change * review: run format --------- Co-authored-by: Ellie Huxtable <ellie@elliehuxtable.com>
* Escape control characters using caret notation (#1585)Peter Holloway2024-01-18
| | | Instead of using their equivalent hex codes.
* Stop control characters being printed to terminal (#1576)Peter Holloway2024-01-17
| | | | | | | | | | | | | | | | | | | | | If a previous command in the history contained a literal control character (eg via Ctrl-v, Ctrl-[), when the command was printed, the control character was printed and whatever control sequence it was part of was interpreted by the terminal. For instance, if a command contained the SGR sequence `^[[31m`, all subsequent output from `atuin history list` would be in red. Slightly less of a problem, control characters would also not appear in the interactive search widget although they would be printed when selected. This meant `echo '^[[31foo'` would appear as `echo '[31foo'`. When the entry was selected, the same problem as before would occur and, for the example above, `echo 'foo'` would be printed with 'foo' in red. When copied, this command would not behave the same as the original as it would be missing the control sequence. This adds an extension trait to add a method to anything that behaves like a string to escape ascii control characters and return a string that can be printed safely. This string can then be copied and run directly without having to add the control characters back.
* feat: rework record sync for improved reliability (#1478)Ellie Huxtable2024-01-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * feat: rework record sync for improved reliability So, to tell a story 1. We introduced the record sync, intended to be the new algorithm to sync history. 2. On top of this, I added the KV store. This was intended as a simple test of the record sync, and to see if people wanted that sort of functionality 3. History remained syncing via the old means, as while it had issues it worked more-or-less OK. And we are aware of its flaws 4. If KV syncing worked ok, history would be moved across KV syncing ran ok for 6mo or so, so I started to move across history. For several weeks, I ran a local fork of Atuin + the server that synced via records instead. The record store maintained ordering via a linked list, which was a mistake. It performed well in testing, but was really difficult to debug and reason about. So when a few small sync issues occured, they took an extremely long time to debug. This PR is huge, which I regret. It involves replacing the "parent" relationship that records once had (pointing to the previous record) with a simple index (generally referred to as idx). This also means we had to change the recordindex, which referenced "tails". Tails were the last item in the chain. Now that we use an "array" vs linked list, that logic was also replaced. And is much simpler :D Same for the queries that act on this data. ---- This isn't final - we still need to add 1. Proper server/client error handling, which has been lacking for a while 2. The actual history implementation on top This exists in a branch, just without deletions. Won't be much to add that, I just don't want to make this any larger than it already is The _only_ caveat here is that we basically lose data synced via the old record store. This is the KV data from before. It hasn't been deleted or anything, just no longer hooked up. So it's totally possible to write a migration script. I just need to do that. * update .gitignore * use correct endpoint * fix for stores with length of 1 * use create/delete enum for history store * lint, remove unneeded host_id * remove prints * add command to import old history * add enable/disable switch for record sync * add record sync to auto sync * satisfy the almighty clippy * remove file that I did not mean to commit * feedback
* feat: add semver checking to client requests (#1456)Ellie Huxtable2023-12-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * feat: add semver checking to client requests This enforces that the client and the server run the same major version in order to sync successfully. We're using the `Atuin-Version` http header to transfer this information If the user is not on the same MAJOR, then they will see an error like this > Atuin version mismatch! In order to successfully sync, the client and the server must run the same *major* version > Client: 17.1.0 > Server: 18.1.0 > Error: could not sync records due to version mismatch This change means two things 1. We will now only increment major versions if there is a breaking change for sync 2. We can now add breaking changes to sync, for any version >17.1.0. Clients will fail in a meaningful way. * lint, fmt, etc * only check for client newer than server * Add version header to client too
* chore(deps): uuidv7 stable (#1451)Conrad Ludgate2023-12-16
|
* Add bash support to `enter_accept` (#1316)Ellie Huxtable2023-10-21
|
* Add fish support for `enter_accept` (#1315)Ellie Huxtable2023-10-20
| | | | | | | | * Add fish support for `enter_accept` Also fixes shell detection. Who trusted me to write jetlagged code last night huh? * Document
* Add enter_accept to immediately execute an accepted command (#1311)Ellie Huxtable2023-10-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * make enter execute the command, tab copy it * Add config for enter_accept enter_accept will make Atuin immediately accept an execute a command when selected. It defaults to false in our binary, but the default config enables it. This means that users who already use atuin will not default to the new behaviour unless they opt in, but new users will have it by default. Thanks to @davidhewitt for the patch and bulk of this implementation! Currently we have it just for zsh, but I'll follow up with other shells (unless anyone beats me to it :D) * Add docs * we need to tidy up the ui code anyway * Check if using zsh * Update docs/docs/config/config.md Co-authored-by: Conrad Ludgate <conradludgate@gmail.com> --------- Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com> Co-authored-by: Conrad Ludgate <conradludgate@gmail.com>
* replace chrono with time (#806)Conrad Ludgate2023-09-11
| | | | | | | | | * replace chrono with time * Fix test chrono usage --------- Co-authored-by: Ellie Huxtable <ellie@elliehuxtable.com>
* Run formatting (#1202)Ellie Huxtable2023-08-30
|
* Add workspace mode, enable if in git repo (#1053)Ellie Huxtable2023-07-14
| | | | | | | | | * Add workspace mode, enable if in git repo * Fix tests * Should now be good * Page filter modes correctly if in workspace
* Add total history count to the index API (#1102)Ellie Huxtable2023-07-14
| | | | Thought it would be fun to collect some cool stats, maybe put them on atuin.sh.
* Add new sync (#1093)Ellie Huxtable2023-07-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add record migration * Add database functions for inserting history No real tests yet :( I would like to avoid running postgres lol * Add index handler, use UUIDs not strings * Fix a bunch of tests, remove Option<Uuid> * Add tests, all passing * Working upload sync * Record downloading works * Sync download works * Don't waste requests * Use a page size for uploads, make it variable later * Aaaaaand they're encrypted now too * Add cek * Allow reading tail across hosts * Revert "Allow reading tail across hosts" Not like that This reverts commit 7b0c72e7e050c358172f9b53cbd21b9e44cf4931. * Handle multiple shards properly * format * Format and make clippy happy * use some fancy types (#1098) * use some fancy types * fmt * Goodbye horrible tuple * Update atuin-server-postgres/migrations/20230623070418_records.sql Co-authored-by: Conrad Ludgate <conradludgate@gmail.com> * fmt * Sort tests too because time sucks * fix features --------- Co-authored-by: Conrad Ludgate <conradludgate@gmail.com>
* record encryption (#1058)Conrad Ludgate2023-06-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * record encryption * move paserk impl * implicit assertions * move wrapped cek * add another test * use host * undo stray change * more tests and docs * fmt * Update atuin-client/src/record/encryption.rs Co-authored-by: Matteo Martellini <matteo@mercxry.me> * Update atuin-client/src/record/encryption.rs Co-authored-by: Matteo Martellini <matteo@mercxry.me> * typo --------- Co-authored-by: Matteo Martellini <matteo@mercxry.me>
* Add RecordIndex data structure (#1059)Ellie Huxtable2023-06-19
| | | | | | | | | | | | | | | | | | | | | | * Add RecordIndex data structure This allows us to compare two sets of record stores, and return a list of diffs. With these diffs, we should be able to sync the two stores * Remove server handler, will follow up with this * Make clippy happy * Add tests and docs for diffs in both directions * Update atuin-common/src/record.rs Co-authored-by: Conrad Ludgate <conradludgate@gmail.com> --------- Co-authored-by: Conrad Ludgate <conradludgate@gmail.com>
* Key values (#1038)Ellie Huxtable2023-06-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * wip * Start testing * Store host IDs, not hostnames Why? Hostnames can change a lot, and therefore host filtering can be funky. Really, all we want is a unique ID per machine + do not care what it might be. * Mostly just write a fuckload of tests * Add a v0 kv store I can push to * Appending works * Add next() and iterate, test the pointer chain * Fix sig * Make clippy happy and thaw the ICE * Fix tests' * Fix tests * typed builder and cleaner db trait --------- Co-authored-by: Conrad Ludgate <conrad.ludgate@truelayer.com>
* Allow server configured page size (#994)Ellie Huxtable2023-05-21
| | | | | | | * Allow server configured page size * Backwards compat via semver checks * Correct header name
* feat: add delete account option (attempt 2) (#980)Yannick Ulrich2023-05-16
| | | | | | | | | | | | | | | * Added DELETE register endpoint * Added remove function to database * Added unregister to client * Updated docs * Renamed functions * Reformatting * Used execute instead of fetch in delete_user
* Switch to uuidv7 (#864)Ellie Huxtable2023-04-11
| | | | | | | | | * Add uuid_v7 * Actually use the new uuid * Add a test to ensure all uuids are unique, even in a tight loop * Make clippy happy
* Add `atuin status` (#830)Ellie Huxtable2023-03-30
| | | | Useful for debugging, checking the state of things, and for if you forget your username!
* chore: use fork of skim (#803)Conrad Ludgate2023-03-26
| | | | | | | | | * use fuzzy-matcher instead of skim switch to a search-engine abstraction * fmt * fix deprecated warnings
* Add history deletion (#791)Ellie Huxtable2023-03-20
| | | | | | | | | | | | | * Drop events. I'd still like to do them, but differently * Start adding delete api stuff * Set mailmap * Delete delete delete * Fix tests * Make clippy happy
* Prefer PWD environment variable over cwd if available to better support ↵Patrick Decat2023-03-14
| | | | symbolic links (#783)
* Windows support (#754)YummyOreo2023-03-05
| | | | | | | | | | | | | | | | | | | * adds support for getting home dir in windows * fixes bug * adds windows server support + build for linux ^| todo: test server on linux * improvements to redability * removes comment * returns if windows when importing auto * this should be here, to prevent double inputs * adds explanation to why we have to throw away 1 event in the tui * better message when running atuin import on windows + spell fix
* Fix race condition in directory tests (#748)cyqsimon2023-03-02
|
* Add local event log storage (#390)Ellie Huxtable2022-11-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add event data structures This adds the data structures required to start syncing events, rather than syncing history directly. Adjust event Fix Add event data structure to client * Add server event table sql * Add client event table migration Adjust migration * Insert into event table from client * Add event merge function Right now this just ensures we have the right amount of events given the history we have BUT it will also be used to merge CREATE/DELETE events, resulting in history being deleted :) * Make CI happy * Adjust * we don't limit history length any more * Update atuin-client/src/database.rs Co-authored-by: Conrad Ludgate <conradludgate@gmail.com> * fix usage * Fix typo * New Rust, new clippy stuff Co-authored-by: Conrad Ludgate <conradludgate@gmail.com>
* Add automatic update checking (#555)Ellie Huxtable2022-10-14
| | | | | | | | | | | | | | | | | | | | | | | | * Add automatic update checking * Add setting to opt out of update checks * Document options * no * no * also no * Make clippy happy * Update atuin-client/src/settings.rs Co-authored-by: Conrad Ludgate <conradludgate@gmail.com> * fix features Co-authored-by: Conrad Ludgate <conradludgate@gmail.com> Co-authored-by: Conrad Ludgate <conrad.ludgate@truelayer.com>
* add some error messages (#510)Conrad Ludgate2022-10-07
| | | | | * add some error messages * fmt
* history list (#340)Conrad Ludgate2022-04-25
|
* Bump uuid from 0.8.2 to 1.0.0 (#311)dependabot[bot]2022-04-22
| | | | | | | | | | | | | | | | | | | | | * Bump uuid from 0.8.2 to 1.0.0 Bumps [uuid](https://github.com/uuid-rs/uuid) from 0.8.2 to 1.0.0. - [Release notes](https://github.com/uuid-rs/uuid/releases) - [Commits](https://github.com/uuid-rs/uuid/compare/0.8.2...1.0.0) --- updated-dependencies: - dependency-name: uuid dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * patch Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Conrad Ludgate <conrad.ludgate@truelayer.com>
* refactor (#327)Conrad Ludgate2022-04-22
|
* Initial implementation of calendar API (#298)Ellie Huxtable2022-04-13
| | | | | | | | | | | This can be used in the future for sync so that we can be more intelligent with what we're doing, and only sync up what's needed I'd like to eventually replace this with something more like a merkle tree, hence the hash field I've exposed, but that can come later Although this does include a much larger number of count queries, it should also be significantly more cache-able. I'll follow up with that later, and also follow up with using this for sync :)
* goodbye warp, hello axum (#296)Conrad Ludgate2022-04-12
|
* Re-add macro_use to atuin-common (#107)Ellie Huxtable2021-05-10
| | | | | | | | | | | * Re-add macro_use to atuin-common When build as a dependency, the macro is available from another crate. When you try to build common by itself, the macro is not found. Magic, huh? * chore: remove unneeded use - clippy is confused Co-authored-by: Conrad Ludgate <conradludgate@gmail.com>
* some changes :shrug: (#83)Conrad Ludgate2021-05-09
| | | | | * make everything a cow * fmt + clippy
* fix some bugs (#90)Conrad Ludgate2021-05-09
| | | | | * fix some bugs * format
* remove dyn Reply (#48)Conrad Ludgate2021-05-07
| | | | | | | | | | | * cleanup reply types * cleanup error api * small update * improve api some more * fmt
* Update docs, unify on SQLx, bugfixes (#40)Ellie Huxtable2021-04-25
| | | | | | | | | * Begin moving to sqlx for local too * Stupid scanners should just have a nice cup of tea Random internet shit searching for /.env or whatever * Remove diesel and rusqlite fully
* Use cargo workspaces (#37)Ellie Huxtable2021-04-20
* Switch to Cargo workspaces Breaking things into "client", "server" and "common" makes managing the codebase much easier! client - anything running on a user's machine for adding history server - handles storing/syncing history and running a HTTP server common - request/response API definitions, common utils, etc * Update dockerfile