Skip to content
jkloetzke edited this page Jul 1, 2012 · 1 revision

PeerDrive is configured with a single configuration file. Depending on the mode the server is run the configuration file has a different name. If you run the server stand alone the file is called server/peerdrive.config, otherwise etc/app.config in the release package. In both cases the actual contents of the file is the same.

[
	{peerdrive, [
		{sys_store, {"stores/sys", "", "file"}},
		{interfaces, [
			% see interfaces chapter
		]}
	]}
]

Server interfaces

Currently there are three interface modules available. They provide the access to the documents stored in PeerDrive. Add them, as comma separated list, to the ‘interfaces’ section.

‘native’ interface

The ‘native’ interface is used by PeerDrive aware applications to use the full feature set. This interface should typically be always loaded. Add the following statement to the interfaces section to enable it:

{native, [Options]}

where Options is a, possibly empty, comma separated list of the following options:

  • {port, Port}: Changes the default TCP listening port of the native interface to Port (default: 4567, will change in the future).
  • {ip, "x.x.x.x"}: Bind to a specific network interface. By default the native interface is bound to the loopback interface 127.0.0.1.

‘vfs’ interface

The ‘vfs’ interface provides access to the stores through a FUSE (Unix) or Dokan (Windows) mountpoint. You typically want to enable this interface too, otherwise you can’t access the files in PeerDrive with regular file managers or applications. Add the following statement to the interfaces section to enable it:

{vfs, [Options]}

where Options is a, possibly empty, comma separated list of the following options:

  • Common options
    • {mountpoint, "path"}: Absolute or realtive path to the mount point. The directory must exist and you must have appropriate access rights. Default: “vfs”.
  • FUSE options (ignored on Windows)
    • default_permissions: By default FUSE doesn’t check file access permissions. As PeerDrive doesn’t implement any policy either any user might read/write the files. This option enables permission checking, restricting access based on file mode. It is usually useful together with the ‘allow_other’ mount option.
    • allow_other: This option overrides the security measure restricting file access to the user running the PeerDrive server. This requires that the user_allow_other option is enabled in /etc/fuse.conf, otherwise only root may enable this option.
    • {max_read, Size}: Limit maximum read size to `Size’ bytes
    • {user_id, UId}: The numeric user id of the mount owner
    • {group_id, GId}: The numeric group id of the mount owner
    • {uid, UId}: The numeric user id of the files owner (default: 0).
    • {gid, GId}: The numeric group id of the files owner (default: 0).
    • {umask, UMask}: The umask applied to all access permissions, that is all permissions that are turned off (default: 0). It’s best to use octal notation: e.g. 8#022 which disables write access for group and others.
  • Dokan/Windows options
    • {threads, Num}: Number of Dokan threads
    • {debug_output, Type}: Control Dokan debug output. Possible values:
      • false: Disable debug output (default)
      • true: Send debug output to debugger
      • stderr: Send debug output to console stderr
    • {drive_type, Type}: Set Dokan drive type
      • hdd: Fixed drive (default)
      • removable: Removable drive
      • network: Network drive (needs Dokan network provider)

‘netstore’ interface

The ‘netstore’ interface shares one or more stores through the network. Other PeerDrive servers may mount these shares through a ‘net’ store. Add the following statement to the interfaces section to enable it:

{netstore, [Options]}

where Options is a comma separated list of the following options:

  • {stores, [Stores]}: List of store labels (strings) which are shared
  • {ip, "x.x.x.x"}: Bind to a specific network interface
  • {port, Port}: TCP listening port (default: 4568, will change in the future)

Clone this wiki locally