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:
- Quit Nuxeo Drive.
Remove the
.nuxeo-drive
directory:OS X / Linuxrm -rf ~/.nuxeo-drive
Windowsrmdir /S /Q "C:\users\<username>\.nuxeo-drive"
Remove the
Nuxeo Drive
directory:OS X / Linuxrm -rf ~/Nuxeo\ Drive/
Windowsrmdir /S /Q "C:\users\<username>\documents\Nuxeo Drive"
Configuration Folder
mkdir ~/.nuxeo-drive
touch ~/.nuxeo-drive/nxdrive.db
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
Connect to the empty SQLite database.
OS X / Linux
sqlite3 ~/.nuxeo-drive/nxdrive.db
Windows
- Install and open SqliteBrowser.
- Click on New Database and save it under
C:\users\<username>\.nuxeo-drive\nxdrive.db
. - Click Cancel in the Edit table definition window.
Create the
device_config
andserver_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
- Click on the Execute SQL tab.
- Copy paste the previous queries and click on Execute SQL (blue arrow).
- Click on Database Structure and check the
device_config
andserver_bindings
tables have been created.
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);
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 / LinuxINSERT 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/');
WindowsINSERT 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/');
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.