2
0
MasterPassword/platform-independent/cli-c
2017-09-04 14:48:40 -04:00
..
cli Some more refactoring. 2017-09-03 17:00:35 -04:00
.gitignore Only distribute release tags, include TAG and VERSION. 2017-09-04 14:48:40 -04:00
bashcomplib Re-organize the project into a better hierarchy. 2017-03-06 13:40:39 -05:00
bashlib Re-organize the project into a better hierarchy. 2017-03-06 13:40:39 -05:00
build Remove some pointless local's. 2017-09-04 14:29:25 -04:00
clean Improve clean methods. 2017-04-22 12:20:52 -04:00
CMakeLists.txt We don't need libscrypt when linking against sodium. 2017-04-08 16:20:58 -04:00
core Updated C core and cli build and scripts. 2017-03-21 14:07:40 -04:00
distribute Only distribute release tags, include TAG and VERSION. 2017-09-04 14:48:40 -04:00
install Move instructions into cli-c for distribution. 2017-09-04 14:17:20 -04:00
lib Updated C core and cli build and scripts. 2017-03-21 14:07:40 -04:00
mpw_tests.xml Updated C core and cli build and scripts. 2017-03-21 14:07:40 -04:00
mpw-cli-tests Test script for CLI. 2017-08-30 09:38:23 -04:00
mpw.bashrc Re-organize the project into a better hierarchy. 2017-03-06 13:40:39 -05:00
mpw.completion.bash Re-organize the project into a better hierarchy. 2017-03-06 13:40:39 -05:00
README.md Move instructions into cli-c for distribution. 2017-09-04 14:17:20 -04:00

Native CLI

This is a command-line terminal interface to the Master Password standard implementation.

To use the app, you'll first need to build it, then install it into your system's PATH.

Building

To build the code to run on your specific system, run the build command:

./build

Note that the build depends on your system having certain dependencies already installed. By default, you'll need to have at least libsodium, libjson-c and libncurses installed.

Details

The build script comes with a default configuration which can be adjusted. Full details on the build script are available by opening the build script file.

[targets='...'] [mpw_feature=0|1 ...] [CFLAGS='...'] [LDFLAGS='...'] ./build [cc arguments ...]

By default, the build script only builds the mpw target. You can specify other targets or all to build all available targets. These are the currently available targets:

  • mpw : The main app. It needs: mpw_sodium, optionally supports: mpw_color, mpw_json.
  • mpw-bench : A benchmark utility. It needs: mpw_sodium.
  • mpw-tests : An algorithm test suite. It needs: mpw_sodium, mpw_xml.

It is smart to build the test suite along with the app, eg.:

targets='mpw mpw-tests' ./build

The needed and supported features determine the dependencies that the build will require. The following features exist:

  • mpw_sodium : Use Sodium for the crypto implementation. It needs libsodium.
  • mpw_json : Support JSON-based user configuration format. It needs libjson-c.
  • mpw_color : Show a colorized identicon. It needs libncurses.
  • mpw_xml : Support XML parsing. It needs libxml2.

By default, all features are enabled. Each feature can be disabled or enabled explicitly by prefixing the build command with an assignment of it to 0 or 1, eg.:

mpw_color=0 ./build

As a result of this command, you'd build the mpw target (which supports mpw_color) without color support. The build no longer requires libncurses but the resulting mpw binary will not have support for colorized identicons.

You can also pass CFLAGS or LDFLAGS to the build, or extra custom compiler arguments as arguments to the build script. For instance, to add a custom library search path, you could use:

LDFLAGS='-L/usr/local/lib' ./build

Testing

Once the client is built, you should run a test suite to make sure everything works as intended.

There are currently two test suites:

  • mpw-tests : Tests the Master Password algorithm implementation.
  • mpw-cli-tests : Tests the CLI application.

The mpw-tests suite is only available if you enabled its target during build (see "Details" above).

The mpw-cli-tests is a Bash shell script, hence depends on your system having Bash available.

Installing

Once you're happy with the result, you can install the mpw application into your system's PATH.

Generally, all you need to do is copy the mpw file into a PATH directory, eg.:

cp mpw /usr/local/bin/

The directory that you should copy the mpw file into will depend on your system. Also note that cp is a POSIX command, if your system is not a POSIX system (eg. Windows) you'll need to adjust accordingly.

There is also an install script to help with this process, though it is a Bash script and therefore requires that you have Bash installed:

./install

After installing, you should be able to run mpw and use it from anywhere in the terminal:

mpw -h
mpw google.com