Find shared folder IDs used in WebDAV URLs

P J. d 2 years ago updated 9 months ago 1


In short, I'm wondering if there is a way to determine the share ID's that are part of the WebDAV URL's for shared folders?

It might be that my question turns out to be pointless, having completely overlooked a much easier way to do what I am trying to achieve. In that case, please do not hesitate to let me know.
Here's the longer story behind the question:

What I did:

I try to achieve offering my users a dedicated folder for backup purposes.

I therefore duplicated the 'home folder' idea by creating a dedicated user ("Backup user") that has access to a folder that contains a folder for each users, named exactly as the user, and shared each folder -as an 'anonymous share' with 'My Backups' as share name- to the specific user. This was a manual action, which is doable in my 25-user case, that works perfectly fine.

What I'm trying to achieve:

I'd like to offer the users this folder as a WebDAV target for their local installation of the Duplicati backup tool and provide them with simple instructions.

What is the 'problem':

The entire setup works as expected. However, the URL that points directly to the shared folder, is different for each user and can only be found through manual 'translation' from the URL that is visible in the webbrowser when selecting the 'My Backups' folder in the webinterface.


The URL found in the webinterface looks like: "https://www.domain.com/filerun/#/10:41", where both numbers '10' and '41' seem specific for that particular shared folder.

The corresponding WebDAV URL looks like: "https://www.domain.com/filerun/dav.php/@Shares/(10)%20Backup%20User/(41)%20My%20Backups/"

What I try to accomplish then:

It would be much easier for the user if there would be a 'friendly' URL mapping option based on the application URL and the username. The generic URL ""https://www.domain.com/filerun/backup" would then be rewritten as the WebDAV URL mentioned above, with the numbers 10 and 41 being specific for the user.

I can probably use the IIS rewrite module for that, but I would need to find the numbers (in this case 10 and 41) for each user without login on their behalf, since I use AD-authentication and cannot (and do not want to) do so.

Thus is my question:

Is there a way to determine the ID's that are part of the WebDAV URL's for shared folders?

I found that I can read them directly from the MySQL database in the 'df_modules_shares' table, but as I suffer from disappearing shares (see my other topic) it would still be desirable to be able to recreate a share without the need for deleting any Nextcloud folder sync settings and recreating them by using "friendly" URL's...