David Dworken
a5f11af150
Add initial code to support unique per-entry IDs
...
This code has two caveats for old entries:
1. the ID is being backfiled with a random per-(device,entry) ID. So the ID won't match cross-device.
2. the server-side ID will still be a random ID that is unrelated to the entry ID
2023-09-22 13:16:24 -07:00
David Dworken
aebf526d1f
Add TODO for a theoretical bug I noticed
2023-09-12 17:51:55 -07:00
David Dworken
c5bdee9ad5
Merge pull request #102 from lsmoura/sergio/no-ctx-ptr
...
Remove context pointers since there is no need to pass around a pointer to an interface
2023-09-06 19:58:08 -07:00
Sergio Moura
ce6484f465
constant context keys
2023-09-05 15:54:47 -04:00
Sergio Moura
a12b0e5f6f
no context pointers
2023-09-05 15:45:17 -04:00
Sergio Moura
83ad8c7b1f
wrap errors with %w instead of using %v
2023-09-05 15:08:55 -04:00
David Dworken
25ec191f1a
Implement pre-saving feature to ensure that long-running/non-terminating commands are saved in hishtory
2023-08-27 14:24:59 -07:00
David Dworken
dc65fffd7b
Add an index on end_time to ensure that initial queries are fast to fix #68
2023-02-18 22:26:18 -08:00
David Dworken
f8b51e49da
Support customizing HISHTORY_PATH for people who want to install hishtory in an alternate location to fix #54
2022-12-16 22:22:57 -08:00
David Dworken
b7533479a3
Fix config corruption bug caused by parallel writes to the same tmp file to fix #47
2022-12-11 19:15:29 -08:00
David Dworken
35444bf56e
Swap ioutil to non-deprecated alternatives + clean up pre-commit errors
2022-11-27 11:59:06 -08:00
David Dworken
86f9d67aff
Fix test failures caused by the cobra install command not respecting the secret key
...
Also added a persistLog() function so that I can easily inspect the hishtory logs from test runs.
2022-11-16 20:28:25 -08:00
David Dworken
49a1035169
Fix flakey test failures by removing cache=shared which is a discouraged mode ( https://www.sqlite.org/sharedcache.html ). WAL is sufficient for our purposes. Plus fix a bug where the TUI would go into an infinite loop if there were zero results.
2022-11-15 23:20:19 -08:00
David Dworken
e3a793c753
Specify WAL when opening the sqlite file to defend against deadlocks
2022-11-12 06:39:37 -08:00
David Dworken
e72ef668ea
Add custom timestamp format as requested in the original HN thread
2022-11-11 17:17:54 -08:00
David Dworken
9c47afbe54
Add TODOs
2022-11-11 17:03:32 -05:00
David Dworken
21a7a48afb
Migrate to logrus so we can auto-rotate the log file
2022-11-09 16:14:44 -08:00
David Dworken
6dea8a989e
Add config option to filter out duplicate history entries as requested in #10
2022-11-03 20:36:36 -07:00
David Dworken
185d2739c7
Add offline mode for hiSHtory
2022-11-03 13:16:45 -07:00
David Dworken
cdc5421a7b
Move testutils to a separate package so as to move test-only code out of the main binary
2022-10-27 21:53:47 -07:00
David Dworken
12163483dd
Add data types for custom columns
2022-10-23 21:42:22 -07:00
David Dworken
51b41aa171
Add custom columns to config + use them in the non-TUI query
2022-10-23 20:54:46 -07:00
David Dworken
ebf8de2b1f
Refactor to enable control-r by default on upgrade + pave the way for prompts in the future
2022-10-23 19:29:29 -07:00
David Dworken
253f2fdc27
Enable control-r binding for new installs + prompt upgrades on whether they want to enable control-r bindings
2022-10-23 16:51:39 -07:00
David Dworken
aa3f449885
Skip recording empty history commands
2022-10-23 15:40:30 -07:00
David Dworken
f337d7affd
Add a new field to the config for enabling control-r search and add undocumented commands to toggle this field from the CLI
2022-10-16 09:29:14 -07:00
David Dworken
bb36a30ded
Avoid partial file writes by writing to a tmp file and then renaming
2022-10-14 16:42:47 -07:00
David Dworken
8002c5e942
Add homedir to context
2022-09-21 20:19:11 -07:00
David Dworken
fb401dab88
Resume using the modernc.org sqlite driver so it works with CGO_ENABLED=0
2022-09-21 19:49:24 -07:00
David Dworken
ceb1becfa6
Fix ctx wiring so installs work properly
2022-09-20 23:30:57 -07:00
David Dworken
694c2e2679
Untested: ctx wired through
2022-09-20 22:28:40 -07:00