@evanj @vijayp
Hello everyone. I have managed to build and run mitro-core on Scientific Linux 6.2 (yes that is old...but any newer release should work also), and access it from a separate machine on my internal network. This has some overlap with #53 but I thought I should file it separately. Here are my notes on the process:
For Scientific Linux (or CentOs or any Redhat Enterprise Linux derivative)
git clone https://github.com/mitro-co/mitro
sudo yum install nodejs.x86_64; yum install postgresql.x86_64; yum install postgresql-server; yum install postgresql-contrib
Install java sdk from website as described in mitro-core/README.md
use the jdk-7u67-linux-x64.rpm
sudo rpm -Uvh jdk-7u67-linux-x64.rpm
sudo yum install npm.noarch
Remember to
export NODE_PATH=/<path-to-mitro>/mitro/browser-ext/api/build/node/lib/node_modules
in your .bashrc or .profile
Run sysctl commands as per mitro-core/README
, if you want to run multiple postgres instances
Run build.sh
as per mitro-core/README
and then the other commands to set up a postgresql db.
If you get an error with:
psql -c 'create database mitro;'
like >>> FATAL: database "<user_name> does not exist'
then run
createdb <user_name> -U <user_name>
followed by psql -c 'create database mitro;'
again
Once that is finished, then build the db:
postgres -d build/postgres
(you may want an & after that to make it run in the background as this process won't return)
And the run the server:
ant server
in the mitro-core directory. Things should be ready to go (you might also want an & here to run in the background)
If you have a problem with 'ant server' indicating 'invalid source release' then you need to install java-1.7.0-openjdk.x86_64 and java-1.7.0-openjdk-devel.x86_64 via yum because the rpm didn't install properly earlier
Test
Connect to: https://localhost:8443/mitro-core/api/BuildMetadata with a browser and you should see
"commit: ... some commit hash
describe: fatal: No names found, cannot describe anything.
build time: ... some date"
Now build the extension and run tests:
cd browser-ext/api
./build.sh
cd js/cli
./runtests.sh FAST && echo "SUCCESS"
To test out the extension in a browser:
Build the 'safari/firefox/chrome'-debug extension in browser-ext/login with 'make safari-debug' (or firefox/chrome)
If you run into problems with 'nopt' not being found then you need to
npm install -g nopt
If that still doesn't work then you can run
npm install nopt
in the browser-ext/third_party/hogan.js/bin directory
Install the extension into the browser (I chose safari...for a chrome install, see the browser-ext/README)
If you don't have a safari extension developer certificate then you will need to sign up for one
Turn on Safari Developer Tools under 'Safari->Preferences'
Under 'Develop' in the tool bar you choose 'Show Extension Builder'
Click on the little '+' to add the safari-debug extension
Navigate to browser-ext/login/build/safari/ and choose the debug.safariextension directory
Click 'install' and the extension should be ready to use
Follow the regular "Sign Up" workflow to add a new user to the postgres db
NOTE: You won't get an email sent to your login email account because emailer2.py is still missing from ansible
NOTE: if you want to use a different machine on your network to test the extension, rather than the mitro server machine, then edit the browser-ext/login/common/config/cofig.debug.js file and change the two 'localhost' entries to an ip address like '192.168.1.66', or wherever the server is running