You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thank you @sbs20 for your work on this project.
I'm thinking of setting up this project with a couple of family scanners; I want, however, to be able to sort the scanned files by user, with no user intervention.
I respect the goal of this project is to keep it lean, and introducing the concept of users feels out-of-scope for you (even though there's a basic auth mechanism). Given the response to #357, and taking into account the introduction of afterScan (#483), I'm trying to come up with something that leverages the hooks mechanism, while keeping it fairly generic/extensible.
As far as I can tell (and please correct me if I'm wrong), the afterScan hook looks like the one I'm looking for, but it only receives information concerning the file that was just scanned.
I was thinking of something along these lines:
Put some proxy in front of scanservjs that performs some form of authentication; might be basic auth, might be single sign-on, ...
This proxy would forward the request to scanservjs with additional headers (e.g. X-Forwarded-For, X-authentik-username, ...)
A user triggers a scan action via the Scanservjs UI.
afterScan receives the file information after the scan, along with the original HTTP request headers that triggered the scan.
Custom user code can do whatever operation it wants, this time with the original request information tied to the resulting file.
This, however, relies on scanservjs propagating the HTTP request headers from user click to afterScan; I'm not sure this is the best way of achieving this, so I'm hoping you have better suggestions. The reason for going with HTTP headers is because it feels "fairly" generic, since it allows other ways of sorting/enhancing files (deciding other processing pipelines based on this).
First of all, thank you @sbs20 for your work on this project.
I'm thinking of setting up this project with a couple of family scanners; I want, however, to be able to sort the scanned files by user, with no user intervention.
I respect the goal of this project is to keep it lean, and introducing the concept of users feels out-of-scope for you (even though there's a basic auth mechanism). Given the response to #357, and taking into account the introduction of
afterScan
(#483), I'm trying to come up with something that leverages the hooks mechanism, while keeping it fairly generic/extensible.As far as I can tell (and please correct me if I'm wrong), the
afterScan
hook looks like the one I'm looking for, but it only receives information concerning the file that was just scanned.I was thinking of something along these lines:
scanservjs
that performs some form of authentication; might be basic auth, might be single sign-on, ...X-Forwarded-For
,X-authentik-username
, ...)afterScan
receives the file information after the scan, along with the original HTTP request headers that triggered the scan.This, however, relies on
scanservjs
propagating the HTTP request headers from user click toafterScan
; I'm not sure this is the best way of achieving this, so I'm hoping you have better suggestions. The reason for going with HTTP headers is because it feels "fairly" generic, since it allows other ways of sorting/enhancing files (deciding other processing pipelines based on this).Some use-cases:
Again, thank you very much for your work, and wishes of a happy holiday season.
The text was updated successfully, but these errors were encountered: