Yandex Disk - connection via WebDAV protocol. Remote access via WebDAV protocol


There is only one sad thing about pleasant communication with Yandex Disk: the small allocated volume. Even if there is an opportunity to add space, it is still not enough.

The application from Yandex developers does not allow you to work with several accounts at the same time, standard Windows tools unable to connect multiple network drives from one address.

A solution has been found. This is technology WebDAV and client CarotDAV. This technology allows you to connect to storage, copy files from your computer to the cloud and back.

Using CarotDAV you can also “transfer” files from one storage (account) to another.

Tip: download Portable version and write the folder with the program to a USB flash drive. This version allows the client to work without installation. This way you can access your storage from any computer. In addition, the installed application may refuse to launch its second copy.

So, we have decided on the tools, now let's start implementation. Launch the client, go to the menu "File", "New Connection" and choose "WebDAV".

In the window that opens, assign a name to our new connection, enter your Yandex account login and password.
In field "URL" write the address. For Yandex Disk it is like this:
https://webdav.yandex.ru

If, for security purposes, you want to enter your username and password each time, then check the checkbox indicated in the screenshot below.

Click "OK".

If necessary, we create several connections with different data (login-password).

Cloud opens double click by the connection icon.

For simultaneous connection for several accounts you need to run another copy of the program (double click on executable file or label).

You can work with these windows as with regular folders: copy files back and forth and delete them. Control occurs through the built-in context menu client. Drag-n-drop also works.

Summarize. An obvious plus this decision– files are stored in the cloud and do not take up space on your hard drive. You can also create an unlimited number of Disks.

Among the minuses, I note the following: the speed of file processing depends on the speed of the Internet connection. Another disadvantage is that there is no way to receive public links for sharing files.

For the second case, you can create a separate account and work in normal mode through the application, and use disks connected through the client as storage.

Like this interesting way connect Yandex Disk via WebDAV client. This solution will be convenient for those who plan to work with two or more cloud storages.

Details root News January 17, 2011

WebDAV- protected network protocol high level, running on top of HTTP to access directories and files. But in in this case I would not like to burden you with terms, but very briefly show the principle and methodology of WebDAV in ISPConfig 3. Simply put, I will show you how to run it so that it works, in order to ask you why is this even necessary?

Setting up WebDAV

To begin with, I will tell you the following picture. ISPConfig 3 installed on the material Ideal Server - Ubuntu 10.10 has a feature. It consists in the fact that when you connect to your site via FTP, the login and password are set exactly as you specified in the settings. This is logical, but when you install something through the site, you will get a completely different result. The files are rewritten to another group and user www-data and www-data. And this threatens that files and directories from another owner will become unavailable for writing and deleting. And then I thought, if access to files is closed for an FTP user, then the way out of this situation would be to use WebDAV.

Let's start by setting up our hosting control panel ISPConfig 3 Let's go to the sites section - Webdav User item.

Here we can add access WebDAV for each site separately. To do this we click on the button Add a new WebDAV user:

In this form we select a website for which we need to open access via WebDAV protocol, as well as the login and password for this directory. The directory itself, or rather its name, we indicate in the field Directory.

When finished, apply and save our settings for WebDAV by clicking the save button. The setup, as can be seen from the material, is kept to a minimum, so you should not have any complications.

Continuing the topic of the WebDAV protocol, I will show what a connection via the WebDAV protocol looks like in Windows 7. I will use only the resources of the operating system itself Windows systems 7 (home extended).

Connecting to our server using the WebDAV protocol looks like connecting a network drive, so I will describe the simplest and quick way. Let's open Computer on the desktop or from Start(for example, Windows XP has an icon with the name My computer). In the window that opens Computer we must connect a network drive, if my memory serves me right then starting from Windows Vista additional settings hidden by default, but in order to open this panel you need to use our open window press a key Alt, which will expand these additions, where we select Service - Connect network drive... :

In my case, to connect via the WebDAV protocol, I indicate the network name as the address of the Internet page, yes, you are not mistaken with http:// I draw your attention to the fact that the site name is exactly the one you created in the ISPConfig 3 hosting control panel, but in my case there is a redirect (WWW redirect material), so the link automatically redirects to http://www.. Let's return to the settings when specifying the address, press the button Ready, Windows will make the connection, if everything is successful, the system will ask for a login and password, in my test connection I used the login llirikkswww and the password 123456. As a result, we will get a connected resource which we access as a simple local disk.

Alternative connections to WebDAV

The simplest alternative is an Internet browser, I personally checked for Internet Explorer, Mozilla Firefox, Google Chrome. Everyone connected to the server as one and requested a login and password (The server address, login and password remain unchanged for any connection).

I think if you have already checked this method connection, they realized that this type can be considered nothing more than an alternative, but not the main method of connection due to the lack of the ability to download or change files located on the WebDAV network resource, only viewing and downloading files.

Conclusion about WebDAV in ISPConfig 3

Here I would like to hear your personal opinion about this service and its physical implementation. My personal opinion: this can be useful for collective work on the site, for example for sending or collective work with files. As an example for a photo center for uploading graphic files. For large office solutions for working on one project, for example project + estimate + documentation + commercial proposals.

I would like to hear your opinion, what the hell Does anyone really need this :)))

Updated: September 16, 2014 Views: 9969

If, as an introduction, I began to describe the advantages of cloud data storage, you would think that I had just been defrosted after twenty years of suspended animation or that I was seriously abusing sleeping pills :). Therefore, I will say briefly, in programmer terms: when I was faced with the task of making a program that could work with files on multiple storages without being tied to the API of a specific service (we were talking about backup), it turned out that it was not so simple. I decided to tell you about all the subtleties and pitfalls of the work done in this article.

WebDAV

WebDAV (Web Distributed Authoring and Versioning) is a protocol for transferring and working with data, built on top of HTTP 1.1. It should be noted here that the transmission can be either secure or unsecured. There is no security in the protocol itself, but it can be added through the implementation of authentication on the web server and encryption via SSL, therefore, in this case, HTTPS will be used instead of HTTP.

DAV was originally developed for collaborative creation and editing of web pages, but in the process of use it found application as a network distributed file system, effective for working in a high-load environment and supporting unstable connections. Thus, DAV is suitable for managing files on web servers, in other words, implementing cloud information storage, where it was used. With its help, you can perform basic operations on files contained on the server, carry out advanced operations, such as: blocking, obtaining metadata, version control and others. This protocol became a replacement for the good old FTP, whose time has come to an end.

WebDAV provides seven commands:

  • PROPFIND - getting the properties of an object on the server in XML format;
  • PROPPATCH - changing object properties;
  • MKCOL - create a folder on the server;
  • COPY - copying on the server side;
  • MOVE - moving on the server side;
  • LOCK - lock an object;
  • UNLOCK - remove lock from an object.

Thus, WebDAV allows you to change the properties of objects stored on the server, perform a search based on properties, lock an object (in our case, a file) to allow only one user to edit it in a distributed environment in which many users can have access, manage file versions (via legacy check -in, -out commands), as well as perform advanced list-based file access control.

In addition, WebDAV supports legacy commands: GET - to download a file, PUT - to upload to the server, and DELETE - to delete an object. We won't look at all commands; in my case, to implement the functionality of the utility, I needed only four.

Currently, Microsoft, Mozilla, Novell, IBM and others are involved in the development of the protocol. Therefore, you should not be surprised that WebDAV support is present in many Microsoft products (including Internet Explorer, Explorer, IIS web server and others), the Mozilla Firefox browser, Novell, and IBM products. Additionally, by installing plugins you can “make friends” with the protocol Total Commander and FAR.

As already mentioned, on Windows remote storage WebDAV can be connected to Explorer as additional disk. You can do the same in OS X by organizing the connection to the WebDAV server as an additional directory in the Finder browser.

Possible solutions

I was faced with the task of connecting and organizing work with data on two file storages: Yandex.Disk and Dropbox. Both of these services support the WebDAV protocol. By registering your mail on Yandex, you automatically get access to 10 GB of cloud storage, which you can connect to not only through standard client, but also using a third-party tool (for example, your own program) via the WebDAV protocol. When you register for Dropbox you get 5 GB disk space, which can be used through a standard client. However, to access the storage via WebDAV, you must go through additional registration. As a result, as it turned out, this access is not free, however, after registration, free access is given for two weeks. The storage sizes can be increased: either through an additional payment, or by participating in various promotions carried out by services, for example, finding bugs and reporting them to developers.

When I needed to write a program to work with the WebDAV protocol, the first thing I did was look at the Win32 API to see if there were functions for this, similar to those available for working with FTP. Looking ahead, I’ll note that I had a tight deadline, so I didn’t intend to use API level functions. As you might expect, the Win32 API, starting with the Windows Vista version, includes the WebDAV API. It includes one enumeration, three structures and a set of functions. I thought this was a good sign, since there would certainly be higher-level solutions based on the standard API and I wouldn't have to linger with API functions.

Then Delphi XE3 came to hand, and I decided to check what tools it had for working with the WebDAV protocol. It turned out that it (on the Indy Clients tab of the component palette) contains the IdWebDav component. I already thought that this was the end of the research... But it turned out that this component does not connect to Yandex in any way (Yandex.Disk was a higher priority service for me, so I primarily carried out all the tests on it).

Then I decided to use the old, but time-tested Synapse networking library for Delphi. In addition, there is an excellent site on the RuNet containing several articles devoted to this library, www.webdelphi.ru. At first, the work went well, and I was able to implement several functions of the protocol: creating a folder, downloading files, getting object properties. But the most important function - uploading files to the server from a local computer - was never implemented. It became sad: there is no sensible information about this protocol on the Internet. Bing found several paid sets of components for working with the network, one of which, out of curiosity, I decided to use to find out whether it was possible to upload a file to Yandex.Disk. This one turned out to be Clever Internet Suite. Having created a component of the clWebDav class, we managed to upload a file to the server with one line of code:

where stream is a file stream previously created for reading.

Great, but the cost of this product is off-putting: more than $500. that is, what is not gud. If you want to use this method, then pay attention to the version of the library: you can connect to Yandex only using version 7.0 and higher; if you use version 6.0, which is widespread on the Internet, then uploading data to the server will not be possible. I got tired of playing around with Delphi and decided to turn to dotNET and C#.

Connect to Yandex.disk + create a collection

Since WebDAV runs on top of HTTP/S, I decided to use the HttpWebRequest and HttpWebResponse classes, which have been included in the .NET Framework since version 2.0. In this case, we will use the .NET Framework 4.0 - I’ll tell you why below. In short, the first of the listed classes represents an HTTP request, the second represents an HTTP response. Our task is to correctly formulate the request so that the WebDAV server can understand it. To find out how to correctly formulate requests to the WebDAV server, please refer to the Yandex documentation on using the WebDAV protocol.

Next action Let's write a small program that can perform four operations: create a folder on a remote host, upload an object, download an object, and delete an object. These operations are sufficient for most manufacturing applications. For simplicity, let's create a WinForms application. In a few words I’ll tell you about my program. It is a console application launched by a batch file on a schedule. Its main action is uploading files to a remote host, while its tasks include correct processing of the mask for selecting files, as well as processing the paths on which they are located, plus correct creation in the cloud, a folder hierarchy similar to that hosted on local disk. Moreover, since the program runs in automatic mode, it creates a log file. In today's program we will skip these steps (obviously they are off topic) and focus on the WebDAV protocol.

Please note: when creating a project template, it is better to use .NET Framework 4.0 as a basis. And although support for WebDAV appeared in the second version, tests showed that the same program, recompiled using .NET 4, works twice as fast, and this concerns the speed of working with files and sending them.

After creating the application template, place four buttons on its form. The first operation we will implement will be creating a folder (or collection). She is the simplest of all. Note: although Yandex.Disk works over a secure HTTP protocol S, the folder can be created via HTTP. We will also need four input fields on the form: to specify the address of the remote host (for now we will aim at Yandex.Disk: https://webdav.yandex.ru/), to enter the username, password (for authentication on Yandex) and to enter the folder name , which we want to create in the cloud (Fig. 1). Please note: the server address must be entered along with the protocol, in this case https://.

First of all, include namespaces in your code: using System.Net; - for working with the network and using System.IO; - for file I/O. Then create a handler for the click event on the CreateDir button. Write the following code in it:

String folder = folderEdit.Text; String url = urlEdit.Text; String userName = nameEdit.Text; String password = passwordEdit.Text; url += folder; url = url.TrimEnd(); HttpWebRequest request = HttpWebRequest.Create(url) as HttpWebRequest; request.Credentials = new NetworkCredential(userName, password); request.Method = WebRequestMethods.Http.MkCol; HttpWebResponse response = (HttpWebResponse)request.GetResponse(); HttpStatusCode code = response.StatusCode;

Let's discuss the code briefly. At the beginning, for convenience, we place the data from the input fields into variables: folder name, host address, user name and password. Next, we form the URL: add the name to the host address folder being created. Like HTTP, WebDAV has a standard port number - 443, so it is not necessary to specify it. Now, based on the URL, we can create an HTTP request object, which is done in the next line. After creation, you need to fill in some of its properties. That is, it is necessary to specify the data that will be sent to the server in the request header. Let's look at the Yandex documentation (link given above). Required parameters include authentication information. Yandex accepts this data in two forms: Basic - login and password, QAuth - token using the QAuth protocol. We will choose the first path. However, in this case the data must be encoded. This is done by an object of the NetworkCredential class, whose constructor receives the name and password as strings. The created object of this class is assigned to the Credentials property of the request object. Next line we tell what command we want to execute - MKCOL. In this case, no data is required to be transmitted/received, and immediately after this we send the request. Next, we can see what response the server returned; if successful, the response will be the Created string. The HttpWebRequest class defines many responses for all cases of joint communication between the client and server.

The WebDAV protocol does not allow creating several subfolders in one request, for example /folder1/folder2/; You can create only one folder: /folder1/. If the directory exists, and the sent request tries to create a directory of the same name, then the server will generate an exception that must be caught with a try/catch construct. The above example does not handle exceptions, so if you use this code in your application, do not forget to add it. If you need to find out whether a directory exists or not, then you can use the PROPFIND request, and then receive and parse the server response containing information in XML format about the objects available on the server. But this will take a long time, and, in my opinion, it is better to use the MKCOL request and, if a folder of the same name is present, handle the exception. Thus, in my console utility, I create a folder hierarchy. In addition, if a directory of the same name already exists, it is entered.

Deleting an object

Deleting a file and/or directory using the WebDAV protocol is as simple as creating a collection. To implement this task, use the above code, in which you need to replace the line specifying the method executed by the server with the following:

Request.Method = "DELETE";

As you can see, the WebRequestMethods.Http class does not have a Delete method, but we can specify the desired method as a string. It will be sent to the server, the main thing is that it is able to process and execute this method, and the WebDAV server, as we know, is capable of this.

In this case, it is also better to use a try/catch construct to catch an exception that may occur due to the absence of the object to be deleted.

Downloading a file

To download a file from a cloud storage using the WebDAV protocol, you do not need to do much manipulation with the existing code. But first, upload a file to the cloud using standard means (via the web interface or desktop Yandex client). According to the plan, when downloading a file, in the fourth (lower) input field we will enter the name of the file that we want to download. We will assign the same name to the result file on the local computer. Please note that on the server we can specify /Software/file.txt and access to the file in the Software folder will be obtained, however, the folder will not be automatically created in the local file system, so it must first be created. In short, we will download the ZuneSetupPkg.exe file (an indispensable tool for working with Windows Phone, which I often have to reinstall on other people’s computers, so I always have it at hand - in the cloud) from the root of Yandex.Disk to the directory with the executable file.

In the handler for clicking on the Download button, after initializing the variables, creating a request object and setting Credentials, set the method type: GET (see the source in the materials for the number). Then, having received the server response (an HttpWebResponse class object), we declare variables for reading data:

Int byteTransferRate = 8192; // Buffer size byte bytes = new byte; // Buffer int bytesRead = 0; long totalBytesRead = 0; long contentLength = long.Parse(response.GetResponseHeader("Content-Length"));

In the last line of code, we read the file size from the response header from the server and save it to a variable. Next, we create a file stream to write a file to disk:

FileStream fs = new FileStream(fileToDownload, FileMode.Create, FileAccess.Write);

Then we receive the stream from the server:

Stream s = response.GetResponseStream();

We read data from it in portions and write it to a file until there is something to write:

Do ( bytesRead = s.Read(bytes, 0, bytes.Length); if (bytesRead > 0) ( totalBytesRead += bytesRead; fs.Write(bytes, 0, bytesRead); ) ) while (bytesRead > 0);

After all the data has been written to the file, close both streams and the server response. While reading data, we increased the totalBytesRead variable by the number of bytes read. In this case, if there are no errors, the size of this variable should become equal to the size that we calculated from the header, and if this is so, then the file was downloaded correctly and we display a message about this (Fig. 2), but if the sizes are not equal, then a failure occurred , we also inform the user about this.

This code is not without exceptions that need to be caught, among them: (404) the file cannot be found (on the server), it is impossible to write to the specified location, and many others.

Uploading a file to the server

The last operation, without which our utility will be incomplete, is uploading the file to the remote host. This is the most “cunning” operation. The operations discussed above did not cause the slightest difficulty, but this one turned out to be cooler! I have already said that there were difficulties with the implementation of file loading when using other development tools. And not everything was smooth in C#. First, in the documentation, we’ll look at what request Yandex is waiting for to upload a file (Fig. 3).

IN full-fledged program it is necessary to download several files at once (at the user’s request), select files by mask, create a directory hierarchy and, finally, handle errors. We, in order not to pound water in a mortar, will omit all this and concentrate on loading one given file, without creating folders and handling errors. We'll leave all this to you as homework. So, in the program I prepared, the UpdateFile method is called from the button click handler, the host name and the name of the downloaded file, which are taken from the corresponding input fields, are passed to it. The beginning of the method itself is similar to those discussed above, however, now in the request header we send the PUT command to be executed by the server, that is, we express our desire to download the file. If when performing previous requests we did not particularly rely on the documentation, then this time it will be very useful to us: we will include in the request header all the fields recommended by Yandex, as well as some additional ones. So, let's look at the header code, and then discuss the problems:

Request.ContentLength = fileLength; request.KeepAlive = false; request.ReadWriteTimeout = -1; request.Timeout = -1; request.AllowWriteStreamBuffering = false; request.PreAuthenticate = true; request.SendChunked = false; request.ContentType = "application/binary"; request.ProtocolVersion = HttpVersion.Version11; request.ServicePoint.ConnectionLimit = 1; request.AllowAutoRedirect = false; //request.Expect = "100-continue"; request.ServicePoint.Expect100Continue = true; request.Accept = "*/*";

The values ​​of some parameters are derived by scientific poking. Some properties depend on others. So, it is better to disable the persistent connection (second line), because this will generate an exception about the impossibility of simultaneous reading and writing to the stream. The next two properties set the timeout for reading and writing to the network stream. A value of -1 means infinity. The size of the downloaded file may be indefinitely large, so we cannot predict the time it will take to download it. The next property: AllowWriteStreamBuffering is very interesting, it enables or disables buffering of data before sending. When enabled, the sent file is first loaded into memory, and only then uploaded to the server. The strangeness of this property is that on some hosts you can upload a file without problems by disabling buffering, but on others an exception will pop up about the need for buffering. This may be due to some registry or communication settings; I also don’t rule out differences between services. If buffering is enabled and a large file is sent to the server, there may be insufficient resources (SystemOutOfMemory exception). You can add a checkbox to your program to enable or disable buffering. If buffering is disabled, then the PreAuthenticate flag (the next property) must be enabled, which sends authentication data along with the header. Next parameter SendChunked (only for Yandex.Disk) allows you to upload files of a predetermined size to a remote host, to which Dropbox responds with an exception. Next, we indicate the type of data being transferred, the version of the protocol used (11 means 1.1), and the number of possible HTTP connections: there is no need for more than one. We disable automatic redirection. To set the following recommended field: “Expect: 100-continue”, which includes waiting for a response for a download request, you cannot use the commented out property, you must use the code in the line below: request.ServicePoint.Expect100Continue = true;. The last property of the HTTP header includes a mask for the received objects; in our case, any files are accepted: with an arbitrary name and extension.

After the request is formed, we need to receive a network stream in which we will record the data sent to the server. We also open the local file for reading. We allocate a byte buffer for temporary storage of data read from the file; then in a loop we begin to read and send, writing data to the stream. After this, we close the network and file streams, in general, as usual. Having received a response from the server, we check the HTTP status to see if it is equal to the Created flag and compare the file size with the number of bytes transferred; if both conditions are met, then the transfer is successful, otherwise there is a problem.

Results

This concludes the development of our utility. In it we have implemented all the planned functionality - the four most necessary commands, without which no file management manager on a remote host can do. We did not become tied to the services of a specific hosting, using its API, we developed a universal application that communicates with the server using the standard WebDAV protocol. This allowed our program, using one code, to connect to several servers at once (I tested on Yandex.disk and Dropbox). However, as we have seen, different services interpret and support the protocol slightly differently.

I leave the further development of the program to you; during the course of the article I pointed out possible improvements: this includes loading several files, creating a hierarchy of folders, parallelizing loading, and much more. If you dig deeper into WebDAV protocol, you can implement other commands to manage content on the server.

On this note, I want to wish you good luck in all your endeavors and be more outdoors :). See you on the pages of ][!

In this post, we'll talk about a great add-on for Internet Information Services (IIS) called WebDAV. WebDAV is a protocol for accessing shared files and folders via the Internet, somewhat similar to FTP. File transfer using the WebDAV protocol can be carried out through various firewalls and firewalls, transmitted information can be encrypted, and working with files and folders is much more convenient, completely reminiscent of the service public access to files and folders in Windows.

Together with Windows release Server 2008 Microsoft presented an updated version of the WebDAV module for IIS 7. This module has significantly expanded the capabilities, convenience and security of using WebDAV to access files on the Internet, in addition, it now supports multi-user work and file locking.

In this article we will talk about how to install WebDAV on Windows 7 and Windows Server 2008 R2, how to set it up and how you can access files and folders that are shared network access via WebDAV.

Let me remind you again that WebDAV is an extension of IIS, so if you do not already have IIS installed, do so (as you probably remember in both Windows 7 and Windows Server 2008 R2, IIS comes by default, but for security reasons this component must be enabled separately). Installing WebDAV in Windows 7 and Windows 2008 R2 is slightly different.



Setting up WebDAV publishing in the IIS manager

In this step, we will enable WebDAV for the IIS site and give content editing rights to the local administrator.

  1. In IIS Manager, expand the site tree and select DefaultWebSite.
  2. As shown in the picture, click on the element WebDAVAuthoringRules.
  3. On the WebDAV Authoring Rules page, click in the right column( Actions) via link EnableWebDAV
  4. After enabling WebDAV, we will create rules for accessing content by clicking the button AddAuthoringRule.
  5. In the Add Authoring Rule window, specify:
  6. In IIS Control Panel, select the option Authentication.
  7. In the authentication window, activate Windows authentication (WindowsAuthentication) If IIS will only work as a WebDAV server, anonymous authentication can be disabled.
  8. Return to the Default Web Site level and select Authorization Rules(or .Net Authorization Rules)
  9. Create Allow a rule (or make sure that it already exists) in which the administrator would be allowed to access the server (in my case, such a rule already existed, and all users - All Users, including the administrator, were allowed access to IIS).

Let's now try to connect to the WebDAV site from account administrator, for which in the command line type:

Net use * http://localhost/

As a result, a new network drive will appear in the system, connected from the server using WebDAV.

Advice. If you try to connect a directory via WebDav the error “ System error 67 has occurred. The network name cannot be found.", in Windows 8/Windows Server 2012, try installing the component Desktop Experience and make sure that the service Web Client launched.

If you need to share a specific folder on the disk, you need to create an IIS virtual directory. To do this, click right click mouse over the site and select ‘Add New Virtual Directory’:

Specify the alias (the name of the IIS virtual directory) and the path to the folder to which you want to share access and click OK.

Now to connect this catalog, you need to use the command:

Net use * http://site/projects

A network drive connected via WebDAV looks like this:

As you can see, WebDAV is an excellent tool for remote access to files and folders in Windows over the HTTP protocol, which can be used even through firewall. Additionally, since WebDAV is based on IIS, this means that in this architecture we can use various security technologies and IIS controls, including HTTPS to encrypt the data transferred (with regular HTTP, all information is transferred in clear text, except the password, which is encrypted when using Windows Authentication).

Let's describe a few more aspects of using WebDAV


The iPad tablet computer is convenient for using the Internet and working with documents on business trips, trips, and just anywhere. iWork programs can import files previously saved in /Documents, or download them from a WebDAV server or from MobileMe (which, strictly speaking, is also accessed via WebDAV). At the same time, MobileMe is significantly inferior to Dropbox in terms of synchronization capabilities, and does not work on Linux and Android. In addition, Pages, Keynote and Numbers do not support Dropbox, which is simply an exemplary cloud synchronization server.

The solution is to make a directory accessible via WebDAV and synchronized with Dropbox. I have a “black box” at home – a Netgear ReadyNAS file server on Linux. Everything will work on it.

There are two difficulties in the whole story: a dynamic external IP address and synchronization with Dropbox.
The first can be solved by registering with DynDNS and setting up the router to automatically notify DynDNS about an IP change. Many modern routers have this feature. If it is not there, you need to install the DynDNS client on some constantly running computer in home network, for example, on a file server.
You can borrow for free on dyndns.org Domain name, through which you will connect to your server from anywhere in the world, without worrying about the IP address. In addition to the DNS service itself, the service provides information on your IP address and the history of its changes.

For proper operation The WebDAV server will need to configure port forwarding on the router. Then the router will redirect the request received to your IP address to specified computer from internal network. Therefore, it is important in the DHCP server rules on the router to specify a static internal IP address for the computer on which it is running WebDAV server. The static IP address is specified by the corresponding MAC address of the network adapter.

Now let's set up Port Forwarding. Everyone knows that the HTTP protocol corresponds to port 80, SSH – 22, HTTPS – 443. For WebDAV, we just need 443/HTTPS. In the NAT tab of your router settings, specify rules for ports 443, 22 and, preferably, 80.

Most likely, you will also have to open external access to the services of your internal network so that you can freely access the WebDAV server.

You may need SSH for remote control the internals of the server, and it’s simply a sin not to use HTTP. If you are not going to host your site on a server at home, then it is advisable to at least put a “stub” so as not to tease those interested open page router settings.

Many modem routers do not have the NAT Loopback function (dlink.ru/ru/faq/160/139.html), so from the inside you will not be able to see what your service looks like from the Internet. You can only make sure that everything works from another computer in another location, or from a smartphone via 3G.

Half the work is done, all that remains is to install the WebDAV server on your computer or file server, and set up synchronization with Dropbox. Netgear NAS devices include, among other things, the ability to access network resources via WebDAV. In general, I must say that Netgear is very good in this regard: high access speed over Gigabit LAN, many functions that you may need, a bunch of access protocols and normal Linux on board.

Open the page NAS settings, enable access via the WebDAV protocol to the required folders:

In addition, connect the directory with files for the web server, which runs over the HTTP protocol, so that http://yourname.dyndns.org does not display a list shared resources, and your site or stub page:

Now everything should work: external access via WebDAV, SSH and HTTP to your resources.

If you want to add the ability to synchronize with Dropbox to what has already been done, you will need to install the Dropbox service on the system. In my case, I have to tinker with this by connecting over the network via SSH, since NAS server no monitor with graphical interface. If Dropbox is already running on your device, install it as a different user. The site has detailed instructions on how to do this: http://wiki.dropbox.com/TipsAndTricks/TextBasedLinuxInstall
After installation, dropbox will provide a link that needs to be activated on the site, after which synchronization will begin. To successfully solve our problem, you need to make a symbolic link that will connect the Dropbox folder with a directory accessible via WebDAV, or immediately install the unpack .tar.gz archive with Dropbox in the parent folder containing the shared resource:

On the ReadyNAS, shared directories are stored in /c/, and the archive with the dropbox service must be unpacked into the same directory.

On the tablet (which is why everything was started), when importing documents from the Internet, you need to specify the server address (and folder), as well as a name and password:

Server address: https://yourname.dyndns.org
Username, password: Your credentials on the NAS

After successful authentication, the program will display a list of folders from which you can import data and where you can save documents.

Of course, on Mac OS and Windows you can also connect to network folder for reading and writing. However, in Windows Vista and Windows 7, WebDAV works, to put it mildly, through one place; connecting through Explorer will not work. But everything works through the command line:

net use * https://yourname.dyndns.org/yourdirectory







2024 gtavrl.ru.