Skip to content

How to create SiriKali custom backend

mhogomchungu edited this page Aug 1, 2019 · 5 revisions

An extension template looks like below.

To create a custom backend for SiriKali, take this template and then fill up all the options you need and place the file in ~/.config/SiriKali/backends or in $INSTALL_PREFIX/share/SiriKali/backends.

In Microsoft Windows operating system, the extension file can be placed in $SIRIKALI_BINARY_FOLDER/backends and extension programs can be stored in $SIRIKALI_BINARY_FOLDER/bin

The extension file name must have .json extension.

{
        "autoMountsOnVolumeCreation": false,
        "configFileArgument": "--config",
        "configFileNames": [],
        "createControlStructure": "%{createOptions} %{cipherFolder} %{mountPoint}",
        "executableName": "",
        "failedToMountTextList": [],
        "fileExtensions": [],
        "fuseNames": [],
        "idleString": "",
        "mountControlStructure": "%{mountOptions} %{cipherFolder} %{mountPoint} %{fuseOpts}",
        "names": [],
        "passwordFormat": "%{password}",
        "requiresAPassword": false,
        "reverseString": "",
        "successfullyMountedList": [],
        "supportsMountPointPaths": false,
        "unMountCommand": "",
        "version": 1.0,
        "volumePropertiesCommands": [],
        "windowsInstallPathRegistryKey": "",
        "windowsInstallPathRegistryValue": "",
        "windowsUnMountCommand": "",
        "wrongPasswordErrorCode": "",
        "wrongPasswordText": ""
}

Explanation for each option is below:

  • names. This option is required to contain at least one entry in the array. The first entry should be the primary name of the backend and ideally, should be the same as the name of the backend configuration file. This is an array because it is possible for a backend to have multiple entries. Gocryptfs for example has two different entries(gocryptfs and gocryptfs.reverse).

  • fuseNames. This option is required to contain at least one entry in the array. The array should contain backend file system as they show up in the file system entry in /proc/self/mountinfo. This is an array because it is possible for a backend to have multiple entries. Gocryptfs for example has two different entries(fuse.gocryptfs and fuse.gocryptfs-reverse).

  • fileExtensions. If the extension deals with files, then this option should be used to specify file extensions the backend can handle.

  • executableName. This option should contain the name of the executable SiriKali should call to do actual operations of the backend.

  • createControlStructure. This option tells SiriKali what substitutions to make when creating command line arguments to be sent to the backend when creating a volume. A substitution option should be removed if the backend does not use it.

  • mountControlStructure. This option tells SiriKali what substitutions to make when creating command line arguments to be sent to the backend when mounting a volume. A substitution option should be removed if the backend does not use it.

  • autoMountsOnVolumeCreation. This option should contain entry true or entry false. Some backends like cryfs auto mounts their volumes after they create them and some like securefs do not. This option tells SiriKali what to do after a volume is successfully created. This option should be set to true for backends that auto mounts their volumes and set to false for backends that do not.

  • configFileArgument. This option tells SiriKali what string to use when setting a CLI argument for a custom path to a configuration file.

  • passwordFormat. When creating a volume, some backends wants a password to be entered once and others want it to be entered multiple times. This option can be used to tell SiriKali how many times the password should be entered. If the password is to be entered twice, the option should be set to %{password}\n%{password}.

  • requiresAPassword. Some backends require a password and some do not. Set this option to "true" if a backend requires a password to prevent SiriKali from hanging due to a backend waiting for a password that will never arrive.

  • idleString. Some backends have a feature that unmounts a volume after a certain interval of inactivity. Unfortunately, different backends use different strings(-idle for gocryptfs and --unmount-idle for cryfs) when specifying interval argument and this option exists to allow backends to customize it to their particular case.

  • reverseString. Some backend like gocryptfs and encfs have the so called "reverse" mode and unfortunately, each backend use a different commandline argument to set this mode and this option exists to allow custom backends to set the argument to their liking. Example values are --reverse for encfs and -reverse for gocryptfs.

  • unMountCommand. This option is used in Linux and MACOS only and it exists to allow backends to custom a command to run to unmount a file system. If the option is empty, SiriKali uses fusermount -u on Linux and umount on MACOS.

  • windowsUnMountCommand. This option is used in Windows only and it exists to allow backends to customize a command to run to unmount a file system. If the option is empty, SiriKali uses taskkill /F /PID $PROCESS_PID to unmount a file system.

  • volumePropertiesCommands. This option is used to tell SiriKali what command to run to get volume properties of un unlocked volume. It takes an array because a backend may have more than one way to get the information. An example entry for encfs is encfsctl %{cipherFolder} and two example entries for gocryptfs are gocryptfs -info %{cipherFolder} and `gocryptfs -info %{plainFolder}```.

Clone this wiki locally