-
Notifications
You must be signed in to change notification settings - Fork 1
Mount stores
Currently stores can only be mounted initially via the mount.py script on the command line. Optionally, mount points may be added to sys/fstab so that these mounts may be mounted automatically at startup and/or by peerdrive-applet.py. The syntax of mount.py is the following:
./mount.py --help
Usage: mount.py [options] [[<src>] <label>]
Options:
-h, --help show this help message and exit
-o OPTIONS, --options=OPTIONS
Comma separated string of mount options
-t TYPE, --type=TYPE Store type (default: 'file')
-c CREDENTIALS, --credentials=CREDENTIALS
Credentials to mount store
-p, --persist Save mount label permanently in fstab
-a, --auto Mount store automatically on startup (depends on '-p')
-s SERVER, --server=SERVER
PeerDrive server address (host[:port])
-v, --verbose Verbose output
Depending of the number of arguments mount.py has three modes of operation: list active mounts, mount a store defined in fstab or mount any store.
Just call mount.py without arguments to see all mounted stores.
./mount.py 'stores/user' as 'usr' type 'file' 'stores/rem1' as 'rem1' type 'file'
By default the system store is hidden and only important information is shown. To show everything add the -v option:
./mount.py -v 'stores/sys' as 'sys' type 'file' [4972d6b23867918fc26926e7ee0bc20b] 'stores/user' as 'usr' type 'file' [3585bc67dbcd1d4bbdd9073d47ddded8] 'stores/rem1' as 'rem1' type 'file' [b90ad0360b5d20c56ea9f181518374ac] Unmounted stores: 'stores/rem2' as 'rem2' type 'file' [auto]
This shows the system store, the SId of every store and any currently unmounted store defined in fstab.
To mount a store which is defined in fstab just call mount.py with the label. Based on the example above we could just call
./mount.py rem2
To mount a new store all necessary arguments must be given to actually mount the store. This is at least the source argument, specifying where the store gets its data from, and the label under which the store is mounted, e.g.
./mount.py stores/user usr Mounted 'usr'
If you want to add the store with this label to fstab add the -p option. In this case you might additionally add the -a option to automatically mount the store at startup.
Adding the -v option shows a bit more information about the actual operations that are performed.
There is one common option that may be given to any store: noverify. With this option the store doesn’t check any content hashes. This allows to upload encrypted content which would otherwise be rejected because the contents hash value would not match the key under which is is stored. As such, this option is only needed if you want to put an encrypted store inside this one.
File stores take only the source argument: the path to the directory where the content is stored. No other options are supported currently.
Network stores mount remote stores through the network which are shared by other PeerDrive instances. The store needs at least the source argument which specifies the remote address and store in the following format:
store@server[:port]
where store is the label of the exported store, server is the DNS name or IP address of the remote store server and port is the optional port number.
For TLS the following options may also be given. Most options are directly passed to the Erlang SSL application:
-
tls=deny|optional|required-
deny: No TLS (default) -
optional: Use TLS if available on peer -
required: Always use TLS, fail if server does not support TLS
-
-
cacertfile=cacert.pem: Root certificate(s) -
certfile=my-cert.pem: Client certificate -
keyfile=my-private-key.pem: Client private key -
verify_peer=true: Verify server certificate
Encrypted stores are just a front-end to other stores. They don’t store the data themselves but transparently encrypt and decrypt them before passing it to the backing store. The backing store must have been mounted with the noverify option, otherwise any writes of the encrypted store will fail.
The source argument is the backing stores SId, encoded as URN in the following form: urn:peerdrive:store:000102030405060708090a0b0c0d0e0f. Additionally a password must be specified as credential (-c option for mount.py) in the following format: pwd=secret.