ggilder / bitrot Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Rather than panicking in any of the Execute
methods or subroutines, we should return an error. That way, we can assert against the error in test, and it will bubble up as the return value of parser.Parse()
so that we can handle it properly in production.
cc @faun
bitrot should print stats about read performance during its scan, both for general feedback and to evaluate the effect of configuration like #24
Related to #3
Right now it appears that comparison succeeds even if paths are deleted, and the exit code is still 0
At a high level, measure time each invocation takes. Perhaps measure data throughput as well.
Seems like all the output is going to stderr
Currently the program aborts if any permission errors are encountered. Perhaps it would be better to generate a partial manifest and report on those permission errors?
Track a matching pair of add and delete with the same checksum as a rename (like git).
Example:
bitrot compare ORIGINAL COPY
gzip should be adequate.
When a manifest file is written out, we should store a checksum of that file for additional verification. Possibly store in the filename itself?
A manifest could have a top-level checksum computed from all the file checksums, so that two manifests could be compared quickly, with examination of the file-level information only necessary if the top-level checksums differ.
In practice this might not be worth it for manifests below a certain (probably high) number of entries, however.
This could be a start: http://play.golang.org/p/WX8tMJeCxu
Right now comparison only fails if we detect corruption (so deletions/additions are ok). It would be useful to have a "diff" mode to validate that contents of two folders are the same (ignoring path moves).
First is better for emailed reports, last is better for command-line usage
There must be an update to the behavior of go-flags because with the current version bitrot panics immediately.
The stages of manifest generation, primarily checksumming, should be able to be split across a configurable number of threads for potential performance improvements.
Per #36, we need user-accessible functions to manage stored manifests.
Should include:
"rotate" could be automatically triggered every time the program is run
Example:
bitrot validate path
This would validate the checksums in the most recent manifest in that directory.
For better collision resistance https://en.wikipedia.org/wiki/Secure_Hash_Algorithms
Allow at least a few seconds of variance
Related to #3
Rather than hardcoding the buffer as in:
984ad1b#diff-9760522737d016dbb14a572c2b290548R54
For unchanged directory, output currently looks something like:
Comparing to previous manifest from 20200113T182158Z
SUCCESS
8 files compared.
Unchanged paths: 8
Added paths: 0
Deleted paths: 0
Renamed paths: 0
Modified paths: 0
Flagged paths: 0
Unchanged paths: 8
Added paths: 0
Deleted paths: 0
Renamed paths: 0
Modified paths: 0
Flagged paths: 0
Wrote manifest in /Users/gabriel/.bitrot/manifests
Prevent the application from generating checksums for .DS_Store files or similar by adding builtin exclusions. Perhaps adding a configuration file format to the home directory would make this configurable globally. Additionally adding the ability using a command line flag to exclude a filetype, directory or regular expression pattern.
Don't place inside analyzed folders — instead store in user's home dir (make configurable especially for testing).
Then we probably need some functions to manage stored snapshots - list, remove, etc. And snapshots should maybe be automatically deleted logrotate style. (Which needs configuration for how many to keep, which should also be stored in home.)
So perhaps there is a setting for config dir and for manifest dir. (Not necessarily user-configurable though)
It's useful to know how many paths are unchanged
Example:
bitrot generate [--exclude PATHS...] path
This would output a manifest JSON file in path/.bitrot/manifest-DATE-CHECKSUM.json
If a previous manifest exists, it will compare the new and old manifests and generate a report.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.