Fileserver-Links in DokuWiki

DokuWiki has always supported links in "UNC" format (also called SMB or CIFS shares) in the form [[\servername\share]]. These are automatically converted by the wiki into file:\\ protocol URLs. The mechanism is convenient for linking to a central file repository in a homogeneous environment (such as a corporate network).

Over the years, browser security mechanisms have evolved - with the focus to protect users as much as possible from attacks from the open Internet. One of these measures prohibits the opening of 'file:\' URLs within the web context. Only Microsoft's Internet Explorer kept the option available for pages in the "Local Intranet" zone.

DokuWiki therefore shows the following message when clicking on a UNC link in all non-IE browsers:

Linking to Windows shares only works in Microsoft Internet Explorer.
You still can copy and paste the link.

Since Internet Explorer is now obsolete and should no longer be used, we show three ways to enable the use of the mechanism in other browsers.

1. Turn off security settings

The easiest way to allow file:\\ URLs is to disable the appropriate security setting in the user's browser.

Depending on the browser, this works via hidden settings or browser extensions to be installed:

Of course, DokuWiki does not know that the user has disabled this security setting and continues to display the warning. This can be deactivated for the entire wiki by creating a local language file in conf/lang/en/lang.php:

<?php
$lang['js']['nosmblinks'] = '';
</code>

Advantages:

  • works with on-board resources and without much IT effort

Disadvantages:

  • the security setting is deactivated for the entire browser - i.e. also on the open Internet
  • the setting must be deactivated in each individual browser for each employee

2. Access the file server via web

An alternative can be to simply make the content of the file server available via HTTP(s). For example, a web server installed directly on the file server could allow simply using [[https://servername/share]] instead of \\servername\share.

Alternatively, it is also possible to simply mount a file server share on the web server running the wiki. If you stick to DokuWiki's naming scheme, this mount can even be done directly in the data/media directory.

Advantages:

  • No security settings are changed

Disadvantages:

  • complex IT setup
  • Access permission handling is limited
  • Files are downloaded and thus copies are created instead of editing them in the central location

3. Protocol handler

Modern browsers and operating systems allow you to register your own protocol handler. Just as the browser knows how to handle https:// URLs, installed programs can define their own protocols. For example, the browser knows that clicking on a skype:// link will open the Skype client.

This mechanism can be used to handle local network links. To do this, a corresponding client program must be installed on the user's operating system and registered as a handler. For example for a locallink:// protocol. The client program then opens the corresponding file server link.

The program must be installed for each user similar to 1. However, automatic installation of programs in large IT networks is a solved problem. Where this is not possible centrally, the program can be downloaded and installed directly from the wiki.

Since the client tool is responsible for opening the link, it is possible to potentially implement additional features here as well. For example, you could react to the fact that a linked file does not exist and open the parent folder instead.

In a feasibility study, CosmoCode developed a first prototype for such a protocol handler. It already works for Windows and Linux systems.

However, further steps are necessary for real use:

  • Client:
    • Mac support
    • Update mechanism
  • Development of a DokuWiki plugin for easy integration:
    • Hooking into UNC protocol handling and generating the correct locallink:// URLs
    • Detection of whether the protocol handler is installed in the user's browser
    • Offer the client download using the correct operating system version
  • Tests and documentation

We assume an additional effort of approx. 3 to 4 days. Please contact us if this solution is of interest to you.

Advantages:

  • No security settings are changed
  • easy setup by installing a DokuWiki plugin
    • Client download by the user, or
    • central installation by IT

Disadvantages:

  • an installation of the client is necessary on each user system