Thursday, 28 March 2013

Creating a version TeamMentor which uses the new GitUserData.config file

Introduced in the 3.3 version of TM is a new feature to load the UserData repository from an external location (GitHub or local folder).

This post shows how to set it up.

First step is to get the latest version of TeamMentor from GitHub, where we can clone it locally or download the zip file

image

Using the Zip file has an example, unzip the 10Mb file into a local folder, and click on start_TeamMentor.bat

image

This will open an empty TM site, and a new Library_Data folder should had been created:

image

With this default structure:

image

Now in GitHub (or on a local folder), create a new Git Repository (which should be marked as private, since security sensitive data will be stored here)

image

Once the repository is created, copy its git url (in this case git@github.com:TMClients/Site_vulnerabilities.teammentor.net.git )

image

Back in the local copy of TeamMentor, open the TBot page:

image

which will require an admin account:

image

After login, open the Edit GitUserLocation

image

And enter the Git url copied from GitHub:

image

After the data is saved, go back to the commands list:

image

Go to the Reload Server Objects

image

And click on ‘Reload UserData’:

image

After that step is completed, if you look at the Library_Data folder, you should see a new UserData folder in there (that uses the git repository name as part of its path)

image

Inside it, you will see the README.md that was received from GitHub, and a new TMSecretData.config and Users folder

image

Back in TBot’s page, if you click on any link you should be redirected to the login page, and you will need to login again using the default admin credentials (this happens because the current browser cookie is pointing
to the admin user that is in XmlDatabase\User_Data and not in the newly created XmlDatabase\User_Data_Git_Site_vulnerabilities.teammentor.net :

image

After logging in, open the Edit SecretData command:

image

Which should look like this (with correct values for the Rijndael and SMTP fields):

image

The value that we want to change is the Libraries_Git_Repositories, which should point to the Git repo we want to add to this TM instance. In this case:

image

Add the git url as an item in the Libraries_Git_Repositories Javascript array:

image

After the data is saved, open the Reload Server Objects again:

image

And this time around click on the Reload Cache button:

image

Once that is completed, if your open the XmlDatabase/TM_Libraries folder, you should see a new Vulnerabilities subfolder

image

Which is in fact a git clone:

image

of the git repository configured on the Libraries_Git_Repositories value

image

Quickly opening the main TM page, will now show the Vulnerabilities Library:

image

Final step is to do manually commit the changes made to the User_Data_Git_Site_vulnerabilities.teammentor.net local repository (note: auto commit and push is disabled on the UserData when running TM from localhost)

image

Which will put those updates in GitHub

image

Now that we have this GitHub repository configured, we can configure the Git UserLocation of live QA server:

image

And after reloading the cache:
image

The https://tm-vulnerabilities.azurewebsites.net will now have the Lib_Vulnerabilities library

 image
Post a Comment