[APP] CloudDAVMod various versions for firmware V4+ (01/2022)

As I mentioned in the other thread…

UPDATES: CloudDAVMod v1.0-04.04.03-113 for firmware V4 now released to public! More info from the top post. Enjoy (-:

Hi Nazar,
First, I wanted to thank you for all your work.

I was able to install the DAVMod on my MyCloud v04.04.03-113, I went to “https://mycloud#####/MyCloud#####/” without difficulties but when I want to go on “HTTPS://device#######-########.wd2go.com[:PORT]/HOSTNAME” stated in the help section, it says :
You don’t have permission to access /MyCloud##### on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
I tried to open the ports 443 et 80 on both my box and mycloud but it changed nothing.
I’m sure I’m close to succeed but I’m stuck.
Any idea ?

Thanks for reading !

It’s issue with relay mode, I’ve replied you here CloudDAVMod v1.0 for WD My Cloud firmware V4 - Page 1 | TeaNazaR.comTeaNazaR.com

I’ve been working on the version 1.1 of this CloudDAVMod during my free time. See changes/fixes in the screenshot below. Would love to see ideas/suggestions for improvements from you guys. However please be advised, this is purely Web-based so suggestion to add fancy backend processing request such as file sharing is a no go.

Couple of suggestions that may improve usability. :slight_smile:

The “Size” column or value showing the size of a Share or folder. Currently a Share/folder is just a “-” (at least for me) and only the files themselves show a size.

The “Filter” option searching all folders rather than just the current folder.

Adding more navigation options beyond just “parent directory” to make it easier to navigate to a higher folder when buried several folders deep. For example:
Root Share directory | Share | Subfolder within Share | Subfolder within Subfolder

My not be easily possible or others may not care, but ability for the end user to control the font size/ font color/background color (or use an image)/etc rather than being a fixed color. Or instructions on how to change them via CSS if the mod uses CSS.

Perhaps more detailed disk usage stats than are provided via the Dashboard. Total free, total used, etc.

One more suggestion for usability.

Allow the user to either copy the help page contents or print it out. One may want to have a print out or save the contents of the help file and the URL/port information for later access when offsite to gain remote access. For what ever reason both IE and Firefox on Win 7 wouldn’t select the Help dialog box contents so I could copy it for later printing out.

Edit to add: Another suggestion. Noticed that while streaming audio media via the “stream all” option it will stream via alphabetical order (or apparently in the order of the entry listing when changing the sort order via the name, last modified, size colums). Would be nice to have the option to stream by track order if possible. And include the track listing as a column to allow one to sort via track order.

1 Like

Thanks for the great suggestions and I love it, believe me it’s not entirely impossible as I do web dev a lot. But let me respond with first, this mod is based on Apache’s basic Index Listing, see similar images here. There is absolutely no backend CGI interpreter processing such as PHP/Perl/Python etc. All it does is to use HTML/JS/CSS manipulate the existing Index Listings with some WebDAV commands from the frontend. Thus there’s lots of limitations as the original idea was to make it simple and fast without CGI since MyCloud is already known to be slow even noticeable from the Dashboard. I could easily introduce CGIs but it would defeat the purpose and should not have started with Apache’s Index Listing in the first place.

Size: Shouldn’t this the default behavior of any file manager? Take a look at Windows Explorer, the size column is blank. Also same goes to several other remote file manager like WinSCP. I think each folders needs to be traversed prior before calculating the content size. The file manager doesn’t know how deep each folder is. Doing a deep traverse is time and process consuming.

But from your suggestion, think the least I could do is to reveal “only” the root share sizes. Could you help to confirm the content of /tmp/share_size ? (this is being updated by the Dashboard, I’m still on older firmware) It should contain something like below:

2326814595875	/shares/Public

The separator for the above size and path is not a space but a tab. If you could confirm it, I could add to the root shares and add estimated disk usage to the stat line, see screenshot:

Search: The reason why this is not implemented is stated in the help section:

***Note that this is only a list search filter, it doesn’t search inside folders. Deep search is not implemented technically due to the WebDAV ‘PROPFIND’ infinity command which could consume lots of resources to search deep into sub-folders, thus stalling the MyCloud.

In simpler terms, if I turn on this feature and do a search in some unknowingly deep paths, MyCloud could freeze (already tried, resulted in pull power cord). Even this ‘PROPFIND’ infinity command is not recommended on normal WebDAV servers unless it’s a very high end raid racks.

Tree: If you’re referring to going backwards up to the tree level, it’s already there on the top left section “Index of”. Each path separated by the front slash “/” is clickable when you’re deep into the paths. But if you meant going into the tree, then limitation applies similar to the “Size” and “Search” as described previously. Each deep levels needs to be traversed prior, time and process consuming when using CGI. And with ‘PROPFIND’ infinity command it will hang the MyCloud.

Theme: This mod theme was inspired from Apaxy, modified a lot for adaption. Feel free to modify them if you know CSS, original source from http://adamwhitcroft.com/apaxy/ but you’ll need to unminify them first because I’ve compressed them to optimize bandwidth (even the WebUI contents has been gzipped dynamically).

Stats: See the “Size” reply previously.

Help Select: The help dialog won’t appear in print previews unless you [print-screen]. I previously restricted the help text selections to quick fix a touch scroll bug in some mobile views. I’ve got a workaround removed the restriction in future release (you can now select and copy in the help dialog).

Media Track: Erm currently there’s no way in HTML5 that you could read a media’s meta tag (where the track number is located) unless the metadata is already loaded (means each media needs to be partially loaded by play trigger to allow to listen for metadata events). Other web based media players uses indexes that has already been preloaded by background process probably CGI or prescribed meta files.

For the Size issue I may not have been clear I was referring to the web page interface.

Here is the listing for the /tmp/share_size file on my v4.x My Cloud running the latest firmware.

4096	/shares/TimeMachineBackup
16384	/shares/Public
113322406349	/shares/Movies
802381085	/shares/Music
4096	/shares/SmartWare
1492888319	/shares/1Unwatched
1438999605	/shares/Music_Videos
131070598789	/shares/TV
4831953323	/shares/{share name redacted}
62174219	/shares/Pictures

On the Search option I forgot about the information in the help file that explains some of that. And total face palm on the tree navigation of the “Index of…” on the web page interface. Didn’t realize that was hot/clickable. Now that I know makes navigating the web page interface a bit quicker.

For much of the rest I figured much wouldn’t be possible due to the back end. Just throwing it out there publicly for discussion so others can see what is and what is not possible the back end coding.

On the media track issue I figured the only way to solve that problem would to be to include numbering on the file name. I assume there is no way to use a Playlist (m3u) type file to play media through the web interface as one possible way around having to rename a large number of files for those who want to play music in track order.

Yes2 I’m in the same page as you are :slight_smile: The folder size in the WebUI is by default blanked as “-” which I meant is similar to any other file manager such as Windows Explorer because they don’t pre-calculate the folder content size due to depth process constrain. I didn’t recall seeing any file manager showing the folder size unless it’s indexed prior.

Now that you’ve confirmed the /tmp/share_size file and its contents, I can safely map those share size onto ONLY the front page of the WebUI (where the root shares being displayed) e.g. from your screenshot, the size column for row “Movies/” will be shown as “113.3G” calculated based on your “/tmp/share_size” content “113322406349 /shares/Movies”. Note that the size will still be “-” for the rest of the sub-folders or if it can’t find the exact share to map the size in the front page (probably newer shares not yet updated by the Dashboard).

Thanks for this great suggestion and helping to confirm the /tmp/share_size, this will be in the next release. Also in the next release, both the disk usage (based on /tmp/share_size) and disk size (based on /DataVolume size) on every page in the stats area.

Np.

Np. I’ve placed this in the “Help” section to make it clear. Basically anything you hover and the cursor changes to “hand” or any other than the default “pointer”, it’s clickable, left-click for items, right-click for list context-menu:

Np. Appreciate them, we need to have suggestions then debate them for implementation :slight_smile: “cough2” WD :stuck_out_tongue:

I understand this. I usually have my tracks renamed to “artist - album - track# - song.ext” because at some point of time, I’ll need to depend on the filename instead of meta tags i.e. searching from console. During my IRC era, I’ve created an eggdrop bot to auto recursively rename files according to it’s ID3 tags. You could use something like this http://www.softpointer.com/tr_help/0201_renaming_files.htm

But put renaming aside, lets discuss. I could download, parse the m3u on a click file event then play its contents. But the problem is the m3u content is not quite standardized. Some are with paths (absolute/relative) and some are just filenames, then some are with URLs or URIs.

  1. Should I lay some rules for the m3u content? I.e. no originating paths/URL/URI and only filenames? Like splitting the slashes and only returning the last token which is the filename. This means the original media file stated in the m3u list needs to resides in the same path as the m3u list.

  2. What happens when in a folder, there’s mixed audio and m3u files? How can the WebUI handle this when the “Stream all” button is clicked? Should the priority be for files? Then you can manually stream each m3u list but this is without the shuffle/loop functions provided by the “Stream all” button because this button collects media files from only in the list. It can’t wait for an external AJAX call trying to load the m3u.

Edited: This just pops in my mind as I was about to go to sleep :stuck_out_tongue: How about if you need the audio to be played in ID3 tag track order, place the m3u file (contents with the desired track order, paths/URLs/URIs will be stripped if any) in the same path?

Then upon displaying the WebUI of that particular media path, the WebUI detects a m3u file in the list with the exact folder name i.e. “My Tracks.m3u”, tries to load this file then maps each m3u content list to the file list. And when you click “Stream all”, if the m3u file is present and contents matches the file list, the WebUI will now play according to the mapped track order instead of list order. However clicking on the m3u file alone does nothing except normal file download and if the m3u file is not present or can’t be mapped, it will play as per-list view (sorted by the columns).

If this is ok, I’ll have to work on it especially the track → list mapping part…

The M3U track list is a tough one as you point out due to its structure.

This is probably a good way to handle it. Hopefully others will chime in with their views. It may be that playlists are not that big of an issue or desire.

Ok. I’m not sure which playlist editor you’re using. But when you generate the m3u, does it goes according to the track order? Else trying to accomplish this would be a haste. I assumed the content will be as per this Wiki M3U - Wikipedia

Ok think I’ve pulled it off. Let me know your thoughts. My filenames are already with track # and I don’t want to rename them but I “intentionally” shuffled the M3U content as though it’s listed by track #.

#EXTM3U
#EXTINF:263,Dream Theater - Another Day
(1992) Images and Words\02 Dream Theater - Another Day.mp3
#EXTINF:330,Dream Theater - Surrounded
(1992) Images and Words\04 Dream Theater - Surrounded.mp3
#EXTINF:572,Dream Theater - Metropolis - Part I- 'The Miracle And The Sleeper' 
(1992) Images and Words\05 Dream Theater - Metropolis - Part I- The Miracle and the Sleeper.mp3
#EXTINF:423,Dream Theater - Under a Glass Moon
(1992) Images and Words\06 Dream Theater - Under a Glass Moon.mp3
#EXTINF:151,Dream Theater - Wait for Sleep
(1992) Images and Words\07 Dream Theater - Wait for Sleep.mp3
#EXTINF:690,Dream Theater - Learning to Live
(1992) Images and Words\08 Dream Theater - Learning to Live.mp3
#EXTINF:494,Dream Theater - Pull Me Under
(1992) Images and Words\01 Dream Theater - Pull Me Under.mp3
#EXTINF:501,Dream Theater - Take the Time
(1992) Images and Words\03 Dream Theater - Take the Time.mp3
  1. Save the M3U in the same folder, named exactly as the folder name with m3u ext “(1992) Images and Words.m3u”.

  2. Intentionally reverse the file list by descending “Name” sort order to play the tracks from the last to first. I’m doing this because it would look hideous in mobile view all cramped up if I were to add another “Track” column. So this is kind of virtual track order.

  3. Click on the “Stream all” button and the last track #8 in the m3u starts playing.

So if there’s a m3u file in the same path, it will map and play by order of the tracks in the m3u content. Use the sort “Name” column to reverse the track order:

Edited: If the M3U file is present and successfully loaded then parsed, there’ll be a short notification. If there’s issue with the M3U or the tracks doesn’t match the file list, it will throw error and just proceed playing with the default file listing order:

Ok I can’t resist the temptation to include CGIs. I’ve implemented them :stuck_out_tongue: but sparingly. Note majority functions is still using WebDAV commands but with some bash (seems faster than PHP/Perl/Python on MyCloud). I’m still improvising on the ideas…additionally maybe like some system stats like CPU/RAM usage etc. more ideas welcomed.

Here’s what’s gonna be in the next release…for now…Edited:-

New: Search recursively by any type/size/modified deep into paths via Unix find. Detailed properties and folder usage via Unix stat/du in Content-Menu. Image preview with navigation/zoom/pan/rotate support. M3U playlist track order and track title support. Used and total share sizes in stats panel. Root shares sizes on home page size column. Range selections to expand or reverse with [SHIFT] or Content-Menu. Export selections to CSV formated file.

Updated: JQuery v3.1.0. Improved help sections, subtitle error detection and page loadings. Changed to client side column sortings to adapt the new search and range select functions, hence toggling selections are now affected only on visible parts/filtered items and all selections will now reset during filtering. Allow browser’s autocomplete in inputs. Allow text selections in help dialog. Visual alerts when certain functions are restricted. Filesize in media streamer status. List tooltips will now show root share sizes in home page and show track order and track title when the new available M3U playlist support loads. Retain copied item selections when navigating back to its originating path. Folder size column are now displayed as 4K block size unless populated from shares in the home page.

Fixed: Minor installer bug and codes cleanup. Parts display exceeding item list. Keyboard sort tooltips. Stats size not including less than 1Kbytes items. [CTRL]+A, [CTRL]+C and [CTRL]+V shortcuts behavior when there’s text input. Vary header Chrome caching issues. Case-sensitive and folder rename. RegExp filters. AJAX arrays.


Search with wildcards, Type: Any, Files or Folders. Size: <1MB, <100MB, <1GB or >=1GB. Days modified: <1day, <1week, <1month, <1year or >=1year. (anything I missed?)

**Properties** from a single selected item r-click context-menu, File or folder properties via Unix `stat` and folder usage via `du`. ![|690x380](upload://6nJ0fKpRx3YY8W49lqY3JO6ArQl.png)

**Range selections** i.e. select one item, hold shift key then select another 2nd last item. Export to selections to CSV file. ![|650x500](upload://sg4DvFjFHQZexd0vDSMavpQXuDk.png)

Nice. System stats like CPU/RAM usage would be a nice touch since there isn’t much of that listed in the Dashboard. For the CPU/RAM usage would it be general usage or would there be detailed usage that would show which service is sucking up the CPU or RAM? What about the ability to save a log file of the system stats? What about including the temperature?

Another thought just popped into my head, what about adding the reboot and or shutdown option to the web UI to allow one to shut down or reboot their My Cloud remotely?

I could use details from top. Maybe poll every 5secs.

Erm which log, all in /var/log? Actually there’s a neat trick, you can SSH in then symlink or bind even the rootfs into the exiting shares. E.g. I’ve one only in my share since I’m the admin /shares/Nazar/.root/ and I’m able to access almost everything from this CloudDAVMod WebUI! :stuck_out_tongue:

I could use the details from S.M.A.R.T. status. Or just this /tmp/drive_smart_temp.

No problem, will include this… there’s a lot CGIs can do I can even allow SSH commands (maybe in the future). I’ll just have to work on the security for admin only access and find a space in the WebUI to squeeze them, perhaps another :gear: icon then a panel dedicated for these advanced features. Keep the ideas/suggestions coming, I’ll try to implement whichever possible during my free time…

System panel for MyCloud Dashboard admin; CPU/RAM/DISK/process usage, S.M.A.R.T. temperature, run simple SSH commands, reboot/shutdown.

I’ve placed it in the help section. Near the top close X button, there’ll be a gear :gear: icon, tooltip as “System panel for MyCloud admin”. When non-admin users click on it, they will be prompted for another login, obviously restricted. But when an admin user clicks on it, it will go straight into the screen below and this icon will change to a refresh icon. I’ve decided not to do polling but added that refresh button instead as it’s spiking the CPU 1-10% on idle thus this is expensive on the MyCloud.

I’m starting to work on the “Simple SSH command”. Do you still need the logs included? If yes which of them, or all? Or you can just get it from how I mentioned in the previous post.

These might be simple Unix command outputs but the coding process is lengthy. I’m taking a break for awhile…

On the logs, I’m not sure what to do there. I was thinking along the lines of just having the ability to save the log files to one’s local PC. Some folks have asked how view the log files and short of either using SSH or exporting a system dump file through the Dashboard there isn’t an easy way for the average user to gain access to the log files. Not sure if access to the log files is a useful feature, was just throwing things against the wall. :slight_smile:

Like the system panel. Hopefully others will give feedback. It hopefully can be used to see what is causing a My Cloud to behave sluggishly, whether its a RAM issue or to many processes running (or a specific process).

Ok noted about the logs. Will take a look which logs the Dashboard is collecting, never seen it before. Or easier I’ll just add a tar gzip download link for all the logs in /var/log.

The SSH in sys panel is now complete, with simple color support. You can run all possible Unix commands even with pipe redirections i.e. ps -ef|grep root and STDIN/OUT/ERR non-TTY redirections i.e. ps -ef>>process.log 2>/dev/null but NOT those which sleeps i.e. tail -f (will never return, have to refresh then issue a kill manually) or those interactive ones which requires user input i.e. passwd (will immediately returned due to no TTY).

Done with the logs. Few things to fix on mobile view before I release it. Maybe in a few days time…