Skip to content
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

Custom queries for files_external variable replacement #59

Open
frafl opened this issue Jul 22, 2024 · 0 comments
Open

Custom queries for files_external variable replacement #59

frafl opened this issue Jul 22, 2024 · 0 comments

Comments

@frafl
Copy link

frafl commented Jul 22, 2024

Proposed enhancement:
Nextcloud's own app (files_external) for external storage (webdav,sftp,smb etc.) provides a mechanism for specifying servers, mount paths, user names and credentials using variables. On it's own, it only replaces the variable $user, but other apps can register handlers to replace additional variables. This is what Nextcloud's LDAP app does (see doc for specifying paths for external mount points, the file for the LDAP variable handler and the place, where it is registered).

Obviously, user_backend_sql_raw would be an excellent candidate for an app that uses this interface, i.e., users would specify an array custom_replacements with entries like smbuser=> 'SELECT ...', smbmnt => 'SELECT ...' and davmnt => 'SELECT something_else ...' and use $smbmnt and $smbuser and $davmnt as variables for files_external.

As opposed to other feature requests for additional functionality, such functionality does not hack into Nextcloud's internals in an unpredictable way that might not be future-proof. Except for one detail, the handler mechanism in files_external is quite well designed.

Currently, I have some working draft code that uses a third app that hooks into user_backend_sql_raw to achieve this, but I assume this would be useful for others, too. Thus, I'd like to prepare a pull request, if you're interested. It would take some time (likely not before end of August) until the pull request, as I've stuffed code in a single file/class that must be separated, but I want to check interest first.

Remark: I work for the Federal Office for Radiation Protection in Germany, so the forked repo would become part of OpenBfS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant