summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-10-14Use gpgtar instead of gpg | tar and change write to moveHEADmasterAaron Ball
Added pathtoabs function to convert relative paths to absolute. This is used now because we have to change dir contexts to use gpgtar, since it doesn't support the tar change dir functionality. Variablized sleep time. Changed archive write process to a move process. This is safer and faster (though still somewhat dangerous given we write to memory and move to storage). Previoiusly, we tarred the /tmp/dec- directory, piped to gpg, and redirected stdout to the gpg archive. This was incredibly dangerous, because on larger archives, loss of power or process crash could yield a corrupted destination archive. Now we encrypte the entire archive to memory so processing time is minimally a factor, then move to storage over the old one. This significantly speeds up write operations for large archives.
2018-04-19pathtoabs: Added comments and better error handlingAaron Ball
If chdir returns anything other than 0 now, we return errno to indicate that something went wrong with determination of the absolute path. Also added errno.h include to handle errno values.
2018-04-19Added random temp path generationAaron Ball
This now calls mkdtemp to generate a random extraction path. This will help secure the program, as well as preventing temp dir collisions when running multiple instances simultaneously. Added pathtoabs function which converts the specified path to its absolute path equivelant. This function enables extraction into a temp dir outside of the start working directory without invalidating relative paths.
2018-04-19encarchive: early return on archive open failureAaron Ball
Return code 1 on failure with a error message.
2018-04-19Makefile: added debug target and set std to gnu99Aaron Ball
2018-04-14Initial commitAaron Ball
No encryption is supported yet. Only supports archive decompression and extraction and enumeration.
2018-04-07Added backgrounded writebackAaron Ball
This allows the user to open the encrypted archive and detach from the polling operation. Because of this, the command line syntax has changed a bit. We now require an action before the archive name: open, close, and status. Open (obviously) opens the archive and close the opposite. Status will tell if the archive is opened or close. It will also detect stale pidfiles and clean them up of the corresponding process is not running. Note that default writeback duration is 15 seconds and it not configurable [yet].
2018-04-07Handle more signalsAaron Ball
Previously, we just handled sigint. Now we also trap sigterm, sigkill, sigquit, and sighup. These will [hopefully] prevent data loss in the event we receive unexpected signals. Also removed a couple of messages that printed to stdout.
2018-04-04Implemented scheduled writebackAaron Ball
Now we write back to encrypted storage on a loop every 15 seconds. We also catch SIGINT (Ctrl + c) and execute a clean shutdown process. This will reduce the likelihood of data loss.
2018-04-04Added key exists checkAaron Ball
Previously, if the KEY variable was unset, a new archive would be created and would overwrite the original, losing all data (this is a brand new script after all). Now we check not only that KEY is set, but that KEY can be found with 'gpg --list-keys'. Also added newline on "Re-encrypting for shutdown" message.
2018-04-04Initial commit of gpgsecureAaron Ball
This is just a very basic version. It requires the user to shutdown the decrypted archive. It does however write to RAM (/tmp) so the decrypted copies never touch permanent storage. In the event that it does touch persistent storage, all of the files are shredded on shutdown of the archive.

Generated by cgit