dyne / tomb

the Crypto Undertaker
https://dyne.org/software/tomb
GNU General Public License v3.0
1.35k stars 153 forks source link

Pre close hooks? #265

Closed vekexasia closed 7 years ago

vekexasia commented 7 years ago

It would be nice to have a way to specify a pre-close hooks so that we can perform clean ups of other sort or perform backups.

jaromil commented 7 years ago

Yes, I intended to re-visit this part of the code since long now and complete the set of calls as well document them properly. So thanks for bringing up the issue. I suggest we have 4 callbacks:

pre-open()
post-open()
pre-close()
post-close()

Anything else?

vekexasia commented 7 years ago

Hello, not actually. I think we might have everything we need with those hooks.

(no pressure) when do you think you might be able to implement these hooks?

jaromil commented 7 years ago

Started branch exec-hooks here https://github.com/dyne/Tomb/commit/056d0174f496b47925baf349b92877263801cdfd Let me know what do you think. This may break existing post-hooks scripts, hence renaming the hooks file its necessary to avoid undesired consequences.

vekexasia commented 7 years ago

WoW that was fast. looks good to me. We just need to update the Wiki and that's it?

jaromil commented 7 years ago

You can use the branch assuming it won't change much. I'll wait for people to notice this and review it. It may still benefit from some new test units to cover the case.

vekexasia commented 7 years ago

What do you think about watching exit code and avoid proceeding if an error occurred in the process?

vekexasia commented 7 years ago

A sample use case would be forcing the backup in pre-close hook using an alternative crypto solution such as tar + gpg & backup it to an external USB drive that must be attached.

jaromil commented 7 years ago

good idea, applicable only in case of pre-* functions. but not in pre-open: I was spacing out :^) if not open, there is no hook file :^D

vekexasia commented 7 years ago

I was wondering indeed how you could manage the pre-open hook.

but it could be helpful in pre-close hook for the use case mentioned above :)

jaromil commented 7 years ago

yep, its implemented (simply as open or close) always in the exec-hooks branch. let me know about your experience and if you manage to implement your usecase.

jaromil commented 7 years ago

ping. shall we merge this branch then? I see no blockers.

vekexasia commented 7 years ago

yup :)

On Sat, Jun 10, 2017 at 11:18 AM, Jaromil notifications@github.com wrote:

ping. shall we merge this branch then? I see no blockers.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dyne/Tomb/issues/265#issuecomment-307553417, or mute the thread https://github.com/notifications/unsubscribe-auth/AAMPSxDfRFTnMtQ8JCSteakc3R4zelUqks5sCl9vgaJpZM4NxGLm .

--

Andrea Baccega [image: Email]me@andreabaccega.com [image: Hangouts]vekexasia@gmail.com [image: Personal site] http://www.andreabaccega.com/ [image: Linkedin Profile] http://it.linkedin.com/in/andreabaccega [image: Facebook] https://www.facebook.com/andrea.baccega [image: Google+] https://plus.google.com/109217393200753135791 [image: Twitter] http://twitter.com/veke87 [image: StackOverflow] http://stackoverflow.com/users/314407/andrea-baccega [image: GitHub] https://github.com/vekexasia