QA/BrowserID/BrowserID Basic Install: Difference between revisions

no edit summary
No edit summary
Line 1: Line 1:
Back To ==> [[QA/Browser_Technologies/Services | Mozilla BT Services]]
Back To ==> [[QA/Browser_Technologies/Services | Mozilla BT Services]]


== Instructions for doing a basic install of BrowserID on Mac or Linux ==
== Instructions for doing a basic install of Persona/BrowserID on Mac or Linux ==
Latest information:
Latest information:
* Original installs were done with node v0.4.x
* Original installs were done with node v0.4.x
Line 7: Line 7:


* As of March 2013, we are using v0.8.17
* As of March 2013, we are using v0.8.17
* BrowserID now has a requirement for expat-devel library
* Persona/BrowserID now has a requirement for expat-devel library
** sudo yum -y install expat-devel for CentOS/Fedora/RHEL
** sudo yum -y install expat-devel for CentOS/Fedora/RHEL
** similar for Ubuntu (apt-get install)
** similar for Ubuntu (apt-get install)
Line 26: Line 26:
* mysql for testing
* mysql for testing


Note: Mac OS should already have the first four, so you should only need to install node, npm, git, etc. before installing BrowserID.
Note: Mac OS should already have the first four, so you should only need to install node, npm, git, etc. before installing Persona/BrowserID.


Note 2: With the latest CentOS 6 used for the Linux portion of this document, the following packages were already installed: gcc, g++, make, openssl, git
Note 2: With the latest CentOS 6 used for the Linux portion of this document, the following packages were already installed: gcc, g++, make, openssl, git
Line 32: Line 32:


== Installing Node.js and NPM ==
== Installing Node.js and NPM ==
* Use the very latest node/npm install to maximize compatibility with gmp and BrowserID:
* Use the very latest node/npm install to maximize compatibility with gmp and Persona/BrowserID:
  For example: node v0.6.5 with npm 1.1.0-alpha-6
  For example: node v0.6.5 with npm 1.1.0-alpha-6


Line 153: Line 153:
  Make sure /usr/local/bin is in your path
  Make sure /usr/local/bin is in your path


== Installing BrowserID ==
== Installing Persona/BrowserID ==
* From your home directory, run the following
* From your home directory, run the following
  $ git clone git://github.com/mozilla/browserid
  $ git clone git://github.com/mozilla/browserid
Line 177: Line 177:
  $ npm install
  $ npm install


== Installing BrowserID from RPMs ==
== Installing Persona/BrowserID from RPMs ==
* Content to be added soon-ish...
* Content to be added soon-ish...


== Installing BrowserID with support for Locales ==
== Installing Persona/BrowserID with support for Locales ==
* In order to run localized versions of BrowserID (localized strings), the following apps/libs must first be installed: svn, gettext (which should include xgettext, msgfmt, etc.).
* NOTE: This entire section is out of date. See the following links for more information:
** https://github.com/mozilla/anodejsholidayseason/blob/localization/localization/localization_part_1.md
** https://github.com/mozilla/anodejsholidayseason/blob/localization/localization/localization_part_2.md
** https://github.com/mozilla/anodejsholidayseason/blob/localization/localization/localization_part_3.md
* In order to run localized versions of Persona/BrowserID (localized strings), the following apps/libs must first be installed: svn, gettext (which should include xgettext, msgfmt, etc.).
** Ubuntu: sudo apt-get install svn gettext
** Ubuntu: sudo apt-get install svn gettext
** RHEL/Fedora/CentOS: sudo yum -y install svn gettext
** RHEL/Fedora/CentOS: sudo yum -y install svn gettext
Line 189: Line 193:
* If XCode is installed, svn should already be available
* If XCode is installed, svn should already be available


* Continue with the installation of BrowserID:
* Continue with the installation of Persona/BrowserID:
  git clone git://github.com/mozilla/browserid
  git clone git://github.com/mozilla/browserid
  cd browserid
  cd browserid
Line 203: Line 207:
* or check the locale listing in the browserid/locale directory
* or check the locale listing in the browserid/locale directory


== Running BrowserID ==
== Running Persona/BrowserID ==
* Run the following command to start up the BrowserID services
* Run the following command to start up the Persona/BrowserID services
  $ npm start
  $ npm start


Line 211: Line 215:
  browserid (2379): error: Cannot read database from /<YOUR INSTALL DIR>/browserid/var/authdb.json
  browserid (2379): error: Cannot read database from /<YOUR INSTALL DIR>/browserid/var/authdb.json


* This is OK, since there may be no current DB for BrowserID and one has to be made on first use.
* This is OK, since there may be no current DB for Persona/BrowserID and one has to be made on first use.


* You should also see that the following services have started:
* You should also see that the following services have started:
Line 250: Line 254:
  IP_ADDRESS=<YOUR LOCAL IP> nohup npm start 1>> MYLog.log 2>>MYLog.log &
  IP_ADDRESS=<YOUR LOCAL IP> nohup npm start 1>> MYLog.log 2>>MYLog.log &


== Using BrowserID ==
== Using Persona/BrowserID ==
* To create an account and sign in and out, use the client address and port
* To create an account and sign in and out, use the client address and port
  http://127.0.0.1:10001
  http://127.0.0.1:10001
Line 259: Line 263:
* Note: the keysigner, verifier, and dbwriter are active behind the scenes, so no user interaction is needed here.
* Note: the keysigner, verifier, and dbwriter are active behind the scenes, so no user interaction is needed here.


* You can use this "client" and this server as you would the Beta or Production BrowserID environments. The only missing element is the "content" of the client site, which, in this case, is basically limited to creation, signing in, adding emails, signing out, etc.
* You can use this "client" and this server as you would the Beta or Production Persona/BrowserID environments. The only missing element is the "content" of the client site, which, in this case, is basically limited to creation, signing in, adding emails, signing out, etc.




== Creating and Using BrowserID Accounts ==
== Creating and Using Persona/BrowserID Accounts ==
* You can create an account on the client (http://127.0.0.1:10001/) or onthe server (http://127.0.0.1:10001/).
* You can create an account on the client (http://127.0.0.1:10001/) or onthe server (http://127.0.0.1:10001/).
* The email verification does not actually get sent because there is nothing hooked up to do this.
* The email verification does not actually get sent because there is nothing hooked up to do this.
Line 302: Line 306:


== Logging ==
== Logging ==
* The BrowserID logs exist in your browserid/var/log directory
* The Persona/BrowserID logs exist in your browserid/var/log directory
  browserid.log
  browserid.log
  compress.log
  compress.log
Line 325: Line 329:
* Note: These logs now have time/date stamps.
* Note: These logs now have time/date stamps.


== BrowserID Processes ==
== Persona/BrowserID Processes ==
* If you search for "node" processes, you will see that seven are actively running:
* If you search for "node" processes, you will see that seven are actively running:
  node ./scripts/run_locally.js
  node ./scripts/run_locally.js
Line 338: Line 342:
  node /<YOUR INSTALL DIR>/browserid/bin/static
  node /<YOUR INSTALL DIR>/browserid/bin/static


== Quitting BrowserID ==
== Quitting Persona/BrowserID ==
* Hitting CTRL-c from the terminal window where you ran "npm start" should kill all "node" processes.
* Hitting CTRL-c from the terminal window where you ran "npm start" should kill all "node" processes.
* If you are running from the background (for example to trap all STDOUT and STDERR messages), just look for and kill the following process:
* If you are running from the background (for example to trap all STDOUT and STDERR messages), just look for and kill the following process:
Line 366: Line 370:


== Running Unit Tests ==
== Running Unit Tests ==
* The front-end, back-end, and "headless" unit tests can be run from a local install of BrowserID.
* The front-end, back-end, and "headless" unit tests can be run from a local install of Persona/BrowserID.
* The back-end and "headless" unit tests have now been combined and can be run with the single command "npm test"
* The back-end and "headless" unit tests have now been combined and can be run with the single command "npm test"
* Also the updated back-end unit tests now use phantomjs, so following the instructions in the previous sections for installing it and setting the path.
* Also the updated back-end unit tests now use phantomjs, so following the instructions in the previous sections for installing it and setting the path.
Line 381: Line 385:
  http://<YOUR LOCAL IP>:10002/test/
  http://<YOUR LOCAL IP>:10002/test/
  Example: http://50.50.50.50:10002/test/
  Example: http://50.50.50.50:10002/test/
  (where 10002 is port value for local BrowserID server/PIA/IP)
  (where 10002 is port value for local Persona/BrowserID server/PIA/IP)


* You can use this IP and the running BrowserID instance to execute the unit tests in any browser on your desktop, a VM, or other machines that can see the desktop/IP.
* You can use this IP and the running Persona/BrowserID instance to execute the unit tests in any browser on your desktop, a VM, or other machines that can see the desktop/IP.


* Note: you can no longer run the front-end unit tests against Stage or Prod. You can still run them against Dev
* Note: you can no longer run the front-end unit tests against Stage or Prod. You can still run them against Dev
Line 479: Line 483:


== Running a Load Test on the localhost ==
== Running a Load Test on the localhost ==
* Start up BrowserID with some required environment variables
* Start up Persona/BrowserID with some required environment variables
  CREATE_TEST_USERS=2000 BROWSERID_FAKE_VERIFICATION=1 NODE_ENV=test_mysql npm start
  CREATE_TEST_USERS=2000 BROWSERID_FAKE_VERIFICATION=1 NODE_ENV=test_mysql npm start
* This will start BrowserID and create a test set of 2000 users and make use of a test mysql database.
* This will start Persona/BrowserID and create a test set of 2000 users and make use of a test mysql database.


* In another terminal start up the load_gen application
* In another terminal start up the load_gen application
Line 487: Line 491:


* Redirecting STDOUT and STDERR
* Redirecting STDOUT and STDERR
  Example for BrowserID:
  Example for Persona/BrowserID:
  CREATE_TEST_USERS=2000 BROWSERID_FAKE_VERIFICATION=1 NODE_ENV=test_mysql nohup npm start 1>> NPM1.log 2>>NPM1.log &
  CREATE_TEST_USERS=2000 BROWSERID_FAKE_VERIFICATION=1 NODE_ENV=test_mysql nohup npm start 1>> NPM1.log 2>>NPM1.log &
  Example for load_gen:
  Example for load_gen:
Line 513: Line 517:


* Error tracking
* Error tracking
** Standard HTTP messages and BrowserID messages (info, debug, warn, error) can be tracked from the STDOUT of "npm start"
** Standard HTTP messages and Persona/BrowserID messages (info, debug, warn, error) can be tracked from the STDOUT of "npm start"
** Specific types of BrowserID activity and errors can be tracked from the STDOUT of "load_gen"
** Specific types of Persona/BrowserID activity and errors can be tracked from the STDOUT of "load_gen"
*** Examples:
*** Examples:
*** error: can't certify key: non-200 status: 400NaNBad Request: that email does not belong to you
*** error: can't certify key: non-200 status: 400NaNBad Request: that email does not belong to you
Confirmed users
3,727

edits