GitRepositorySynchronizerV1/README.md

20 lines
1.8 KiB
Markdown
Raw Permalink Normal View History

2024-03-14 00:45:56 -04:00
# Git Repository Synchronizer v1
Git Repository Synchronizer is a system that provides individuals the ability to archive a git repository without having to worry about the archive being sabotaged.
2024-03-13 12:46:31 -04:00
GRS creates snapshots when it detects the source repository has been tampered with.
2024-03-14 20:26:50 -04:00
Tampering is detected when the source git repository reduces in size by a certain threshold. The threshold can be set by modifying `thresholdFactor` in `grs.sh`. Setting `thresholdFactor=5` would mean that the source git repository would have to drop by 20% for it to be considered as tampering. The way 20% is derived from a `thresholdFactor` of `5` is by dividing `1` by `thresholdFactor`. In the case where `thresholdFactor=5`; you would divide `1` by `5` resulting in `0.2` which is the ratio for 20%.
2024-03-13 12:46:31 -04:00
The execution cycle can be set by configuring `timer.service` using systemd conventions. The settings default to executing every ten minutes on the hour.
Repositories that are to be archived must be cloned into the `repositories` directory while `grs.sh` is not running a cycle. The safest way to do this is by:
1. Executing `systemctl stop grs.timer`
2. Executing `watch -c "systemctl status grs.service"` to confirm that `grs.sh` is inactive.
2024-03-14 16:25:54 -04:00
3. Cloning a git repository into the `repositories` directory.\
Example:
2024-03-13 12:46:31 -04:00
1. `cd repositories`
2. `git clone --recursive https://git.mgoder.com/mg/GitRepositorySynchronizerV1.git`
4. Executing `systemctl start grs.timer`
2024-03-13 12:36:16 -04:00
NOTE:\
2024-03-13 12:46:31 -04:00
The reasoning behind the usage of "v1" is due to it being possible to develop a better solution using a C++ compiler. It would use system memory as a temporary cache to compare the pulled git changes instead of having the previous snapshot always in storage. This would reduce the strain on the storage medium and cut the storage footprint in half.