Enterprise deployment of DAVbox

Enterprises may have internal WebDAV-servers or online servers over which they have full control. In that case it is interesting to deploy DAVbox on those servers instead of launching it from the Pincette website. With a local installation it is possible to centralize the configuration file, because DAVbox has a command-line argument that refers to the configuration file via a URL. Each user can then have a private JNLP-URL. When the user later changes the configuration on her computer, DAVbox will attempt to upload it to the server. This way the configuration is always the same everywhere.

The directory and url elements in the configuration file may contain the parameter $​{username}. It will be replaced with the username on user's workstation. It is also possible to use a relative path for the directory, in which case it is resolved against the user's home directory. Combined with the -config-readonly command-line option this provides for a scenario where one configuration file is centrally deployed and where the user can't change any settings.

If you use the Pincette WebDAV-server you can put in the url element something like https://hostname/$​{home}/. This will be replaced with the user's home folder in Pincette. With one configuration you can set up synchronization for all users.

The license file can also be centralized through another command-line argument that refers to the license file via a URL and that can also be set in the JNLP-file. It is then no longer necessary to distribute the license file to end-users, which reduces the set-up for them to zero. Make sure, however, to put a proper access control list on the license file. It is also possible to create a license that is bound to one server. In that case DAVbox only synchronizes with that server. There is no need for access control on the license file then.

Command-line options

-config config-URL
Sets the configuration to a centrally deployed file.
-config-readonly
Removes the possiblity to change the settings, the synchronizations and the exclusions.
-settings-readonly
Removes the possiblity to change the settings.
-synchronizations-readonly
Removes the possiblity to change the synchronizations.
-exclusions-readonly
Removes the possiblity to change the exclusions.
-inclusions-readonly
Removes the possiblity to change the inclusions.
-license license-URL
Uses a centrally deployed license file.
-plugin-interval seconds
The number of seconds between which the plugins are called. The default is 30 seconds.
-remote-plugin plugin-URL
The URL of a JAR-file that is a plugin (see below).
-start JNLP-URL
Sets the JNLP start file. Without it the start-at-login feature will be disabled.
-truststore URL
When your server doesn't have a valid SSL-certificate you can put that certificate in a Java truststore on the server itself. This option should get the URL to the truststore. It will be fetched using the HTTP-protocol.

Configuration file syntax

A configuration file is an XML file with the document element config. The order of the elements inside it is not important. These are the supported elements:

chunked
The value can be true or false. This sets HTTP chunked encoding, which consumes less memory during downloads and uploads. The default value is true.
compression
The value can be true or false. This sets HTTP compression for downloads and uploads. The default value is true.
delete
The value can be true or false. When turned on this actually deletes files locally when they have been deleted on the server. Otherwise the files are moved to a special trash folder in the user's home folder. The default value is false.
exclude
Its value is a filename pattern. Matching files are not synchronised. This element may be repeated.
include
Its value is a filename pattern. Only matching files are synchronised. This element may be repeated.
interval
The interval in minutes between full synchronisations. This does not change the fact that local changes are synchronised immediately. The default value is 1.
notifications
The value can be true or false. The former makes DAVbox show notifications of its operations.
pause
The value can be true or false. When turned on this pauses the synchronisation. The default value is false.
recursion
The value can be true or false. This is for WebDAV-servers that don't support the infinite depth feature when fetching collections. When this is turned on DAVbox will do the recursion itself. The default value is false.
rename
The value can be true or false. When this is turned on files are not overwritten, but renamed first using .1, .2, etc. as the suffix. The default value is false.
rename-depth
The value is a number to indicate how deep file renaming should go before files are deleted. The default value is 10.
start-at-login
The value can be true or false. The former makes DAVbox start when the user logs in. The default value is true.
sync
This element defines a synchronisation couple. It has three subelements, the order of which is not important. The element directory contains the full path of a local directory. The element url contains the URL of a collection on the server. The element direction defines the synchronisation mode. Its value can be both, download or upload.

Sample JNLP-file

<?xml version='1.0' encoding='utf-8'?>
<jnlp codebase="$$codebase">
  <information>
    <title>DAVbox</title>
    <vendor>Pincette bvba</vendor>
    <description>WebDAV synchronization</description>
    <icon href="davbox.png"/>
    <offline-allowed/>
    <shortcut online="false">
      <desktop/>
      <menu/>
    </shortcut>
  </information>
  <security>
    <all-permissions />
  </security>
  <update check="timeout" policy="prompt-run"/>
  <resources>
    <j2se version="1.7+"/>
    <jar href="davbox.jar" version="1.3" main="true"/>
    <property name="apple.awt.UIElement" value="true"/>
  </resources>
  <application-desc>
    <argument>-config</argument>
    <argument>$$contextdavbox/config.xml</argument>
    <argument>-config-readonly</argument>
    <argument>-license</argument>
    <argument>$$contextdavbox/license.xml</argument>
    <argument>-start</argument>
    <argument>$$contextdavbox/launch.jnlp</argument>
  </application-desc>
</jnlp>

Sample configurations

<?xml version='1.0' encoding='UTF-8'?>
<config>
  <exclude>.*</exclude>
  <exclude>~$*</exclude>
  <exclude>~*.tmp</exclude>
  <exclude>/act/</exclude>
  <exclude>/configuration/</exclude>
  <exclude>/groups/</exclude>
  <exclude>/lost+found/</exclude>
  <exclude>/meta/</exclude>
  <exclude>/users/</exclude>
  <exclude>/view/</exclude>
  <exclude>/web/</exclude>
  <start-at-login>true</start-at-login>
  <interval>5</interval>
  <notifications>true</notifications>
  <rename>false</rename>
  <rename-depth>10</rename-depth>
  <recursion>false</recursion>
  <chunked>true</chunked>
  <compression>true</compression>
  <pause>false</pause>
  <delete>true</delete>
  <sync>
    <directory>/Users/$​{username}/Documents/Keynote</directory>
    <url>https://$​{username}@re.pincette.net/doc/Keynote/</url>
    <direction>both</direction>
  </sync>
  <sync>
    <directory>/Users/$​{username}/Documents/Notebooks</directory>
    <url>https://$​{username}@re.pincette.net/doc/Notebooks/</url>
    <direction>download</direction>
  </sync>
  <!-- Synchronizes the local folder DAVbox, which is in the home folder of
the user, with the user's home folder on Pincette. -->
  <sync>
    <directory>DAVbox</directory>
    <url>https://re.pincette.net/$​{home}</url>
    <direction>upload</direction>
  </sync>
</config>
<?xml version='1.0' encoding='UTF-8'?>
<config>
  <include>.pdf</include>
  <start-at-login>true</start-at-login>
  <interval>5</interval>
  <notifications>true</notifications>
  <rename>false</rename>
  <rename-depth>10</rename-depth>
  <recursion>false</recursion>
  <chunked>true</chunked>
  <compression>true</compression>
  <pause>false</pause>
  <delete>true</delete>
  <sync>
    <directory>/Users/$​{username}/Documents/Keynote</directory>
    <url>https://$​{username}@re.pincette.net/doc/Keynote/</url>
    <direction>both</direction>
  </sync>
  <sync>
    <directory>/Users/$​{username}/Documents/Notebooks</directory>
    <url>https://$​{username}@re.pincette.net/doc/Notebooks/</url>
    <direction>download</direction>
  </sync>
  <!-- Synchronizes the local folder DAVbox, which is in the home folder of
the user, with the user's home folder on Pincette. -->
  <sync>
    <directory>DAVbox</directory>
    <url>https://re.pincette.net/$​{home}</url>
    <direction>upload</direction>
  </sync>
</config>

Sample uninstall JNLP-file

<?xml version='1.0' encoding='utf-8'?>
<jnlp codebase="$$codebase">
  <information>
    <title>Uninstall DAVbox</title>
    <vendor>Pincette bvba</vendor>
    <description>Uninstall DAVbox</description>
    <icon href="davbox.png"/>
    <offline-allowed/>
  </information>
  <security>
    <all-permissions />
  </security>
  <update check="timeout" policy="prompt-run"/>
  <resources>
    <j2se version="1.7+"/>
    <jar href="davbox.jar" version="1.3" main="true"/>
    <property name="apple.awt.UIElement" value="true"/>
  </resources>
  <application-desc main-class="be.re.app.davbox.Uninstall"/>
</jnlp>

Plugins

DAVbox has a simple plugin API, which allows you to check for changes on the server in another way than WebDAV collection tree fetches at regular intervals. It comes with a sample plugin for the Pincette document management system.

A plugin can be placed in the subfolder "Plugins" of the settings folder, which depends on your system. You can also provide a plugin centrally on the server with the "-remote-plugin" command-line options. When DAVbox is loaded with Java Web Start there will be security restrictions, because it is sandboxed. For example, it is not possible to access certain system properties.