DLink DNS-325 - connect via WebDav cloud storage

  • Tutorial
I remember, a long time ago I wrote an article about great opportunities to expand the functionality of NAS'a DNS-325 , and complained in the article that, it’s not working, damn it, get WebDAV on it for connecting, for example, Yandex.Disk. But recently, this happened in some way , using wwwalex , which prompted a feint with editing the source. Details under the cut!

Important. It is understood that fun_plug is already installed and configured , if not, see my first article .

  1. First of all - we update libraries and install important applications
    ipkg update
    ipkg install neon gcc optware-devel
    

  2. Next - download and unpack davfs2 into any directory on NAS, at the time of writing this article is version 1.4.7
    wget http://mirrors.zerg.biz/nongnu/davfs2/davfs2-1.4.7.tar.gz
    tar -xzf davfs2-1.4.7.tar.gz
    

  3. Next, we do a very tough and dangerous thing - we correct the application sources, disabling the verification of the server certificate for validity. In fact, you don’t have to do this, but download the appropriate certificate for each service, then connect it, follow its updates ... But I didn’t figure out how to do this with a minimum of problems, and therefore we are on the path of least resistance.
    We will edit the src / webdav.c file , and specifically, the last line in the ssl_verify function changing return ret to return 0



  4. Compile and install webdav2
    ./configure --prefix=/opt --with-neon=/opt && make && make install
    

  5. Installed. Now through the web interface of NASA we create the user davfs2 and the user group davfs2
    groupadd davfs2
    useradd -g davfs2 davfs2
    

  6. We configure the parameters in the /opt/etc/davfs2/davfs2.conf file.
    In particular, set ask_auth 0



    and cache_dir , for example / mnt / HD / HD_a2 / cache_webdav2
    (the main thing is to remember to create the cache_webdav2 folder and give the user davfs2 the right to do it )



  7. We register the username and password for the desired service, for example, Yandex.Disk in the file / opt / etc / davfs2 / secrets
    in the form
    удаленный_адрес		LOGIN		ПАРОЛЬ
    



  8. Now we can mount a screw, for example, such a command
    /opt/sbin/mount.davfs https://webdav.yandex.ru /mnt/HD/HD_a2/yandex
    

    Moreover, the / mnt / HD / HD_a2 / yandex folder must first be created (and given the rights to the corresponding user).

  9. You can disable storage by the command
    /opt/sbin/umount.davfs /mnt/HD/HD_a2/yandex
    

    Result:





And it would seem that a bright future has arrived, files from Yandex.Disk in the folder are visible, the five-year plan is 3 years old and no one will leave offended? Not really. Reading files is normal. But writing large files or a large number of small ones goes something like this:

  1. The file is quickly and quickly copied to a temporary folder
  2. The webdav2 process is no longer responding. Now you can’t go into folders with mounted remote repositories (you can, but it hangs when you try to get a list of files).

At the same time, the process actually works in the background, and when the files are uploaded to the repository, the mounted repositories will begin to respond. Perhaps I didn’t understand something, or I need to play around with some parameters. A similar problem pops up on the forums, but I did not find a complete solution to it.
However, there are reviews and such that the process freezes tightly, i.e. doesn’t load anything. True, he himself did not come across this.

References



Also popular now: