This is an automated email from the ASF dual-hosted git repository.

kmccusker pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/incubator-milagro-mfa-server.git

commit 3e6244358ed15e5d4d05b7f46f0721066c9bf34d
Author: Pavlin Angelov <[email protected]>
AuthorDate: Mon May 16 13:56:39 2016 +0300

    Improve project install documentation
    
    Update some of the install instructions.
    Change order, wording and add missing information.
    Make them easier to follow.
---
 README.md  | 72 +++++++++++++++++++++++++++++++++++++++-----------------------
 install.sh |  2 +-
 2 files changed, 46 insertions(+), 28 deletions(-)

diff --git a/README.md b/README.md
index 02104c1..9f82ac0 100644
--- a/README.md
+++ b/README.md
@@ -12,20 +12,20 @@ required packages, should be adjusted for the specific 
platform.
 ### Cloning the code from the Git repository
 
 Using standard Git client, clone the code from this repository to a local one.
-The rest of this document assumes that the repository is cloned into 
`<mpin-backend>`.
-Wherever `<mpin-backend>` appears, it should be replaced with the real 
location on your machine.
+The rest of this document assumes that the repository is cloned into 
`<milagro-mfa-server>`.
+Wherever `<milagro-mfa-server>` appears, it should be replaced with the real 
location on your machine.
 
 ### Install with provided script
 
 `install.sh` bash script is provided to ease the install process.
-You can run it from `<mpin-backend>` base directory like this
+You can run it from `<milagro-mfa-server>` base directory like this
 ```
  > ./install.sh
 ```
-you can provide optional argument to the script <mpin-front-end-location> 
where this is an absolute path of
+you can provide optional argument to the script 
<milagro-mfa-js-client-location> where this is an absolute path of
 the location `https://github.com/miracl/milagro-mfa-js-client` is downloaded.
 ```
- > ./install.sh <mpin-front-end-location>
+ > ./install.sh <milagro-mfa-js-client-location>
 ```
 If location provided the install script can initiate the frontend build and 
link the Pin Pad  in the Demo, so the demo is fully operational.
 
@@ -41,17 +41,33 @@ The script install some dependencies from apt-get as 
packages:
     * git ( We use it to get Milagro crypto library)
     * cmake ( We use it to build Milagro crypto library)
 
-Several pip packages would be installed too. They can be reviewed in 
\`<mpin-backend>/requirements/common.txt` and 
`<mpin-backend>/requirements/dev.txt`
+Several pip packages would be installed too. They can be reviewed in 
\`<milagro-mfa-server>/requirements/common.txt` and 
`<milagro-mfa-server>/requirements/dev.txt`
 `INSTALL_TYPE` environment variable is used is control  which file is used. 
You can use “common” or “dev” as values. “common” is used by default
 The script try its best to detect virtualenv and install python packages 
inside one if it is founded.
 
 The script build the needed Milagro Crypto ( Version 1.0.0 )
 
-NOTE: While running the script if config file is already found in dta, rps or 
demo the user would have the option to override it or keep it as it is
+NOTE: While running the script if config file is already found for dta, rps or 
demo the user would have the option to override its content or keep it as it is.
 
 Review the script for more details.
 
-### Installing Prerequisites
+###Part 0: Building the Milagro Crypto Libraries
+If you already have Milagro Crypto Libraries installed you can skip this step
+
+Clone the [_milagro-crypto_ 
repository](https://github.com/miracl/milagro-crypto) and checkout tag `1.0.0`.
+```
+> git clone https://github.com/miracl/milagro-crypto.git
+> git checkout tags/1.0.0
+```
+Follow the instructions for your platform from the milagro-crypto [README 
file](https://github.com/miracl/milagro-crypto/blob/master/README.md#build-instructions).
+
+
+###Part 1: Installation
+Install all dependencies needed for the services to run.
+
+NOTE: If install.sh script is used you can skip this step
+
+#### Installing Prerequisites
 
 **1** Update your package manager tool
 ```
@@ -63,7 +79,7 @@ Review the script for more details.
  > sudo pip install -r requirements/common.txt
 ```
 
-### Building the Milagro Crypto Libraries
+#### Building the Milagro Crypto Libraries
 
 Clone the [_milagro-crypto_ 
repository](https://github.com/miracl/milagro-crypto) 
 ```
@@ -71,19 +87,19 @@ Clone the [_milagro-crypto_ 
repository](https://github.com/miracl/milagro-crypto
 ``` 
 Follow the instructions for your platform from the milagro-crypto [README 
file](https://github.com/miracl/milagro-crypto/blob/master/README.md#build-instructions).
 
-### Getting Credentials
+#### Getting Credentials
 
 Before running any Milagro Services, you should obtain your *Credentials*.
 This is done with the following script:
 ```
- > cd <mpin-backend>
+ > cd <milagro-mfa-server>
  > python scripts/getCommunityCredentials.py .
 ```
 *NOTE:* Make sure you don't miss the dot (.) at the end of the above 
command.<br/>
 **Important:** During the above process you will be asked to enter your e-mail 
address. While this is not mandatory, it is recommended so we can later contact 
you in case of any problems with the service.
-The above script will download a `credentials.json` file into the 
`<mpin-backend>` directory.
+The above script will download a `credentials.json` file into the 
`<milagro-mfa-server>` directory.
 
-### Configuring the Services
+###Part 2: Configuring the Services
 
 The Milagro MFA Services consist of: *Distributed Trusted Authority (D-TA)* 
and *Relying Party Service (RPS)*.
 The Web Application that integrates with the MFA in order to be able to log-in 
users using Milagro, is called *Relying Party Application (RPA)*.
@@ -91,12 +107,14 @@ The installation, and the source code itself include a 
*Demo RPA*, which should
 The initial configuration allows the Demo RPA and the Milagro MFA Services to 
be access from any machine on the local network.
 Further details about configuration options might be found in the 
[Documentation](http://docs.miracl.com/m-pin-core-configuration).
 
+NOTE: If install.sh script is used you can skip this step
+
 #### Configuring the D-TA
 
 The source includes a "default" D-TA configuration file that should serve as a 
template for the actual one. To configure the D-TA perform the following 
steps:<br/>
-**1** Go to the directory `<mpin-backend>/servers` and copy the 
`dta/config_default.py` to `dta/config.py`
+**1** Go to the directory `<milagro-mfa-server>/servers` and copy the 
`dta/config_default.py` to `dta/config.py`
 ```
- > cd <mpin-backend>/servers
+ > cd <milagro-mfa-server>/servers
  > cp dta/config_default.py dta/config.py
 ```
 **2** Generate a hex-encoded 8-byte (or longer) random number. You can do this 
with the following command:
@@ -111,11 +129,11 @@ salt = "038b9f0756b2a2c4"
 ```
 **5** Add/change the `credentialsFile` parameter, specifying the location for 
the credential file that was previously obtained:
 ```
-credentialsFile = "<mpin-backend>/credentials.json"
+credentialsFile = "<milagro-mfa-server>/credentials.json"
 ```
 **6** Change the value of the `backup_file` parameter to the path to file 
where the master secret will be backed up.<br/>
 ```
-backup_file = "<mpin-backend>/backup_dta.json"
+backup_file = "<milagro-mfa-server>/backup_dta.json"
 ```
 **7** Change the value of the `passphrase` parameter as well. You might 
generate a random string for it as well, or write some phrase of your own.<br/>
 **8** Save the file and exit the editor
@@ -123,24 +141,24 @@ backup_file = "<mpin-backend>/backup_dta.json"
 #### Configuring the RPS
 
 The source includes a "default" RPS configuration file that should serve as a 
template for the actual one. To configure the RPS perform the following 
steps:<br/>
-**1** Go to the directory `<mpin-backend>/servers` and copy the 
`rps/config_default.py` to `rps/config.py`
+**1** Go to the directory `<milagro-mfa-server>/servers` and copy the 
`rps/config_default.py` to `rps/config.py`
 ```
- > cd <mpin-backend>/servers
+ > cd <milagro-mfa-server>/servers
  > cp rps/config_default.py rps/config.py
 ```
 **2** Using `vi` or other editor, edit the `rps/config.py` file<br/>
 **3** Add/change the `credentialsFile` parameter, specifying the location for 
the credential file that was previously obtained:
 ```
-credentialsFile = "<mpin-backend>/credentials.json"
+credentialsFile = "<milagro-mfa-server>/credentials.json"
 ```
 **4** Save the file and exit the editor
 
 #### Configuring the Demo RPA
 
 The source includes a "default" Demo RPA configuration file. To configure the 
Demo RPA perform the following steps:<br/>
-**1** Go to the directory `<mpin-backend>/servers` and copy the 
`demo/config_default.py` to `demo/config.py`
+**1** Go to the directory `<milagro-mfa-server>/servers` and copy the 
`demo/config_default.py` to `demo/config.py`
 ```
- > cd <mpin-backend>/servers
+ > cd <milagro-mfa-server>/servers
  > cp demo/config_default.py demo/config.py
 ```
 **2** Generate a base64-encoded 64-byte (or longer) random number. You can do 
this with the following command:
@@ -160,22 +178,22 @@ mpinJSURL = "http://mpin.miracl.com/v4/mpin.js";
 ```
 **6** Save the file and exit the editor
 
-### Running and Testing the Services
+###Part 3: Running and Testing the Services
 
 For development purposes you might run the services from command line. Open 3 
terminals and set the following two environment variables as shown below:
 ```
-export PYTHONPATH=<mpin-backend>/lib:/usr/local/lib/python2.7/site-packages
+export 
PYTHONPATH=<milagro-mfa-server>/lib:/usr/local/lib/python2.7/site-packages
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
 ```
 To run the services, perform the following commands, each in separate terminal:
 ```
- > python dta/dta.py
+ > python servers/dta/dta.py
 ```
 ```
- > python rps/rps.py
+ > python servers/rps/rps.py
 ```
 ```
- > python demo/mpinDemo.py
+ > python servers/demo/mpinDemo.py
 ```
 For more automated execution, you might need to write start/stop scripts in 
`/etc/init.d`
 
diff --git a/install.sh b/install.sh
index 5f1bc7d..8505234 100755
--- a/install.sh
+++ b/install.sh
@@ -18,7 +18,7 @@ function install_dependencies {
 
     # Install the required packages
     VIRTUALENV=$(python -c 'import sys; print hasattr(sys, "real_prefix")' 
2>/dev/null)
-    if [[ $VIRTUALENV ]]
+    if [[ $VIRTUALENV == "True" ]]
     then
         # If in virtualenv use the local provided pip
         # We assume that activation script is used and pip as command points 
to virtualenv pip

Reply via email to