Skip to content

Files workflow #12052

Closed
Closed

Description

@karlitschek

There are usecases where someone want´s to plug a 3rd party system or any workflow into the ownCloud upload/download/share actions.

Examples are:

  • Everytime someone uploads a file the virusscanner needs to run and than delete or move the file and send a notification. This partly exists in the current virusscanner app already.
  • Everytime a file is uploaded or changed a copy of it has to be put into a 3rd party filestorage for archiving because of legal regulations.
  • Everytime someone shares a file with someone or this person gownloads the shared file the file has to be automatically encrypted by a 3rd party tool that ownCloud executes. Alternatively the file has to be digitally signed by this 3rd party tool.
  • Everytime a file is uploded into a specific folder a copy is put into a second folder and the files is automatically converted to pdf and password protected by an external cli tool.
  • Everytime someone uploads a csv file into a specific folder an external python script is called to do scientific analysis of the data and puts a report into the same folder later.

The ownCloud core should make it happen that all this actions can be added to ownCloud as apps to plug into the ownCloud file workflow. Some of this external scripts or applications are long running so we can´t do everything synchronously.
What we need is an extension to the current API/hooks that make it possible to implement this external file workflows.

Activity

  1. karlitschek commented on Nov 8, 2014

    @karlitschek
    ContributorAuthor

    @bantu @DeepDiver1975 as discussed. Would be great if you could look into that.

  2. karlitschek commented on Nov 8, 2014

    @karlitschek
    ContributorAuthor
  3. LukasReschke commented on Nov 8, 2014

    @LukasReschke
    Contributor

    Isn't this quite similiar to #12024?

  4. karlitschek commented on Nov 8, 2014

    @karlitschek
    ContributorAuthor

    Yes. It actually is :-)

  5. DeepDiver1975 commented on Nov 8, 2014

    @DeepDiver1975
    Contributor

    If you all agree I will sit together with @jancborchardt and think about the UX of this feature. We will come up with sone mockups.

  6. karlitschek commented on Nov 8, 2014

    @karlitschek
    ContributorAuthor

    Absolutely!
    But the expectation for the v1.0 of this feature is to have no user interface at all but have only the necessary hooks and APIs to make implementation of this features in apps possible. If you want to build one if the use cases for testing than this would be cool too of course :-)

  7. PVince81 commented on Nov 10, 2014

    @PVince81
    Contributor

    The question is also, what to do with the old hooks/proxies ? Because it sounds like this will add yet another hook/proxy mechanism. Or... we need to try and reuse the existing architecture and just add a few new hooks for apps to hook into.

  8. jancborchardt commented on Nov 10, 2014

    @jancborchardt
    Contributor

    Yeah, this sounds more like something which should be done in the background it seems, no user interface should be there / is needed for now.

  9. karlitschek commented on Nov 10, 2014

    @karlitschek
    ContributorAuthor

    First we should think about the proper architecture and APIs to enable this. @bantu @DeepDiver1975 Perhaps you guys have an idea already.
    I don´t think we should kill the old hook system yet because it actually works well and is widely used.

  10. bantu commented on Nov 10, 2014

    @bantu

    Asynchronous processing is hard with PHP, due to its single threaded shared nothing architecture.

    A generic solution for immediately starting an asynchronous task: gather all execution details, make a HTTP request with the job details to a job handler. Depending on the web server and PHP configuration, this may or may not work well. In an nginx + php-fpm setup, this will especially not result in the immediate creation of a thread; the job will merely be queued in the webserver. The tricky part nevertheless is not to create too many async jobs as they might block other PHP requests at some point. Furthermore, all jobs are constrained by PHP timeouts etc. Also see http://stackoverflow.com/a/5666094

    Other generic solutions include adding individual jobs to a queue that are then processed and removed by background processes. In a constrained PHP environment, this queue would be stored in the RDBMS database, which is not the ideal place to store such a queue, especially because job deletion is expensive. Not sure this is going to scale so well with a lot of background job workers, some DB tricks might be necessary. In a non-constrained environment, proper queuing software could be used.

    Instead of submitting jobs to a queue, it is also possible to consider the whole working set and mark items that have been processes, possibly with multiple states as explained in #12024. This solution costs more storage, which may however be negligible. Also see my comment #12024 (comment)

    I am not sure there is a one fits it all solution.

  11. karlitschek commented on Nov 10, 2014

    @karlitschek
    ContributorAuthor

    Another option would be to not change the current hook system but to only add an API/hook that implements this:
    From an app perspective that want´s to implement a workflow like that:

    • Whenever a file is uploaded give me the file and stop the uploading operation so that I can handle something asynchronously.
    • Whenever I´m done with processing the file I just inject/upload the file again. Maybe normal WebDAV is enough.
  12. bantu commented on Nov 10, 2014

    @bantu

    @karlitschek Stopping the upload operation and then reuploading does not sound asynchronous at all. What do you want to tell the user? "Upload operation was successful"? But then, he won't be able to access the file as it is being processed in the background.

  13. bantu commented on Nov 10, 2014

    @bantu

    Everytime someone uploads a file the virusscanner needs to run and than delete or move the file and send a notification. This partly exists in the current virusscanner app already.

    If this runs synchronously after the file was completely uploaded, the file has to be reread and this might further delay the operation. If this is run asynchronously, an infected file might be distributed. IMO the correct solution is to have this synchronous but use streaming. Basically stream the file from the browser through the virus scanner onto target storage. If the file is found to be affected, the virusscanner aborts the whole operation.

  14. 5 remaining items

  15. DeepDiver1975 commented on Dec 1, 2014

    @DeepDiver1975
    Contributor

    @PVince81 @bantu I need input on the ideas above - not too sure about this approach to be honest ..

  16. DeepDiver1975 commented on Jan 6, 2015

    @DeepDiver1975
    Contributor

    @karlitschek if this feature is still on our roadmap - I'd like to push this to OC8.1

  17. karlitschek commented on Jan 6, 2015

    @karlitschek
    ContributorAuthor

    definitely 8.1

  18. modified the milestones: , on Jan 6, 2015
  19. modified the milestones: , on Mar 2, 2015
  20. DeepDiver1975 commented on Mar 2, 2015

    @DeepDiver1975
    Contributor

    Pushing to 8.2 - still needs discussion ...

  21. modified the milestones: backlog, on Jul 3, 2015
  22. MorrisJobke commented on Aug 29, 2015

    @MorrisJobke
    Contributor

    @janklostermann this is what we talked about ;)

  23. lock commented on Aug 3, 2019

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  24. locked as resolved and limited conversation to collaborators on Aug 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions