-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pre and Post commands / hooks #5601
Comments
Thanks for a well written feature request. I don't expect this to be implemented in its entirety, but it's a good list to choose from. |
@user9209 "Encrypt data": can the command change the contents of the source file? or creates a copy of the file in another directory with decrypted content? |
As description above:
if %output-file% is not use run it in-place (but file size may change!) The best would be to use pipes (file is read only once from the hdd, all operations are performed and written only once to the hdd) In-place is not always possible (e.g. output-size > input-size does not work whereas OTR is easy implement in-place). So it depends on the implementation. |
Would it be possible to implement blocking synchronous scripts on a folder level? folder b contains copies of your syncthing configuration. you do not need all of the above stuff to implement all of the above stuff if you can go for blocking a folder sync with scripts. further example 1, store encrypted files within the syncthing repo as i wrote within #6009 executing stuff, wich can be changed from the outside world could be a security concern |
Even something simpler would be extremely useful. Use case: I have a script that imports pictures from a dir and do all sorts of processing and outputs that to a export dir. Currently I'm using Syncthing to sync both folder from and to my phone. Ideally I would call my script after Syncthing syncs import and call Syncthing to sync back to phone after exporting is done. I could schedule the script execution periodically or monitor for file changes via inotify but processing while Syncthing is syncing may cause conflicts. |
I have a similar need to run custom commands as "hooks" when certain events happen. Previously I was using custom inotify scripts but they were unefficient and/or unreliable. So I wrote a simple daemon to react to Syncthing events using the REST API, and run configurable commands: stfed. It only supports 3 events (folder down sync finished, file down sync finished, local file conflict), but it works well for my use cases. I'm posting this here in case this is useful for someone else, if not, its open source, so you can fork and/or complain in issues. |
Configurable commands or scripts to run at various point in a file life cycle.
First: You did a great job! Thanks a lot!
Feature-Request: Pre and Post commands What does it means?
Why?
Pull
Global Pre-Pull--Command
Share Pre-Pull--Command
Global Pull-File-Command
Share Pull-File-Command
Global Post-Pull-Command
Share Post-Pull--Command
Push
Global Post-Push--Command
Share Pre-Push--Command
Global / Share Push-File-Command
Global Post-Push-Command
Share Post-Push--Command
By default show global setting in share tab
<global>
For all:
myScriptDoingThinks --filname "%filename%" --hash %hash% --size %size% --ouput %output-file%
Labels:
<filename>.sha3\n<filename>.meta
Exit codes
Samples
Samples for Pre-Pull-Commands
Samples for Pull-File-Command
Samples for Post-Pull-Commands
Samples for Pre-Push-Commands
Samples for Pull-Push-Command
Samples for Post-Push-Commands
Modifikation or addition version of File-Command
encrypt-then-hash --hash %hash% --size %size% --device-id %device-id% -file-list %additional-files%
1. Compares stream matching %hash%
2. Encrypts stream and signing it with cert of %device-id%
3. Generate a sha3-hash of the stream
4. output stream
Final
Many information, some complexity but would to a design, where you can do crazy things.
The text was updated successfully, but these errors were encountered: