Marketplace Add-Ons

Nuxeo Drive 1.x Admin Documentation

Updated: October 16, 2020

Usually Nuxeo Drive is automatically initialized at first startup. This includes:

  • The creation of the configuration folder: <user_home>/.nuxeo-drive
  • The creation of the local folder: <user_home>/.Nuxeo Drive
  • The initialization of the SQLite database: <user_home>/.nuxeo-drive/nxdrive.db

However, you might want to do this initialization manually, for example to preset the Nuxeo server URL and proxy configuration before launching Nuxeo Drive for the first time. This can be useful for the deployment of Nuxeo Drive on a large set of desktops, allowing end users to work on a preconfigured instance, only needing to provide their credentials at first startup.

Note that this process can be scripted for an automated deployment.

Prerequisite

If an existing instance of Nuxeo Drive is installed first make sure you reset it before running manual initialization:

  1. Quit Nuxeo Drive.
  2. Remove the .nuxeo-drive directory:

    OS X / Linux

    rm -rf ~/.nuxeo-drive
    

    Windows

    rmdir /S /Q "C:\users\<username>\.nuxeo-drive"
    

  3. Remove the Nuxeo Drive directory:

    OS X / Linux

    rm -rf ~/Nuxeo\ Drive/
    

    Windows

    rmdir /S /Q "C:\users\<username>\documents\Nuxeo Drive"
    

Configuration Folder

OS X / Linux

mkdir ~/.nuxeo-drive
touch ~/.nuxeo-drive/nxdrive.db

Windows

mkdir "C:\users\<username>\.nuxeo-drive"

Device Id Generation

The device_config table of the SQLite database needs a unique id as a primary key of its single row (device_id column). You first need to generate this id, for example with Python:

$ python
    Python 2.7.3 (default, Sep 26 2013, 20:03:06)
    [GCC 4.6.3] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import uuid
    >>> uuid.uuid1().hex
    '1bd6686882c111e391a6c8f733c9742b'
    >>> exit()

SQLite Database Initialization

  1. Connect to the empty SQLite database.

    OS X / Linux

    sqlite3 ~/.nuxeo-drive/nxdrive.db
    

    Windows

    1. Install and open SqliteBrowser.
    2. Click on New Database and save it under C:\users\<username>\.nuxeo-drive\nxdrive.db.
    3. Click Cancel in the Edit table definition window.
  2. Create the device_config and server_bindings tables.

    OS X / Linux

    Execute the following queries in the Terminal.

            CREATE TABLE device_config (
                device_id VARCHAR NOT NULL,
                client_version VARCHAR,
                proxy_config VARCHAR,
                proxy_type VARCHAR,
                proxy_server VARCHAR,
                proxy_port VARCHAR,
                proxy_authenticated BOOLEAN,
                proxy_username VARCHAR,
                proxy_password BLOB,
                proxy_exceptions VARCHAR,
                auto_update BOOLEAN,
                PRIMARY KEY (device_id),
                CHECK (proxy_authenticated IN (0, 1))
            );
            CREATE TABLE server_bindings (
                local_folder VARCHAR NOT NULL,
                server_url VARCHAR,
                remote_user VARCHAR,
                remote_password VARCHAR,
                remote_token VARCHAR,
                server_version VARCHAR,
                update_url VARCHAR,
                last_sync_date INTEGER,
                last_event_log_id INTEGER,
                last_filter_date INTEGER,
                last_ended_sync_date INTEGER,
                last_root_definitions VARCHAR,
                PRIMARY KEY (local_folder)
            );
    

    Windows

    1. Click on the Execute SQL tab.
    2. Copy paste the previous queries and click on Execute SQL (blue arrow).
    3. Click on Database Structure and check the device_config and server_bindings tables have been created.
  3. Insert the single row in device_config.

    Use the previously generated id for the device_id column, and set your proxy settings as in the examples below.

    Manual proxy configuration

    INSERT INTO device_config (device_id, proxy_config, proxy_type,
    proxy_server, proxy_port, proxy_authenticated, auto_update) VALUES
    ('1bd6686882c111e391a6c8f733c9742b', 'Manual', 'http', '10.218.9.82',
    '80', 0, 0);
    

    System proxy configuration

    INSERT INTO device_config (device_id, proxy_config, proxy_authenticated, auto_update) VALUES
    ('1bd6686882c111e391a6c8f733c9742b', 'System', 0, 0);
    

    No proxy configuration

    INSERT INTO device_config (device_id, proxy_config, proxy_authenticated, auto_update) VALUES
    ('1bd6686882c111e391a6c8f733c9742b', 'None', 0, 0);
    
  4. Insert a row in server_bindings . Use your local folder path, the Nuxeo server URL, the Nuxeo server version and the Nuxeo Drive update site URL as in the example below.

    OS X / Linux

    INSERT INTO server_bindings (local_folder, server_url, server_version, update_url) VALUES ('/home/<username>/Nuxeo Drive', '<protocol>://<host>:<port>/nuxeo/', '6.0', 'http://community.nuxeo.com/static/drive/');
    

    Windows

    INSERT INTO server_bindings (local_folder, server_url, server_version, update_url) VALUES ('C:\users\<username>\documents\Nuxeo Drive', '<protocol>://<host>:<port>/nuxeo/', '6.0', 'http://community.nuxeo.com/static/drive/');
    

  5. Quit SQLite.

    OS X / Linux

    .exit
    

    Windows

    Click on Write Changes and close SqliteBrowser.

Start Nuxeo Drive

The Settings popup should appear waiting for the user's credentials only.