598. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 7/6/2017 8:23:35 PM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

598.1 Files compared

# Location File Last Modified
1 OSCIF_CTT_v4_build 1.zip\rails_prisme README.md Wed May 31 03:59:06 2017 UTC
2 OSCIF_CTT_v4_build 1.zip\rails_prisme README.md Mon Jul 3 23:39:18 2017 UTC

598.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 2 640
Changed 1 2
Inserted 0 0
Removed 0 0

598.3 Comparison options

Whitespace
Character case Differences in character case are significant
Line endings Differences in line endings (CR and LF characters) are ignored
CR/LF characters Not shown in the comparison detail

598.4 Active regular expressions

No regular expressions were active.

598.5 Comparison detail

  1   == README
  2  
  3   You need t o first ge t JRuby, h ere is the  link to t he 64 bit  msi instal ler:
  4  
  5   https://s3 .amazonaws .com/jruby .org/downl oads/9.1.8 .0/jruby_w indows_x64 _9_1_8_0.e xe
  6  
  7   Get JRuby' s complete  jar file.   You can  put it any where you  want just  remember w here you p ut it!
  8   I put it i n the dire ctory wher e JRuby is  installed .
  9  
  10   https://s3 .amazonaws .com/jruby .org/downl oads/9.1.8 .0/jruby-c omplete-9. 1.8.0.jar
  11  
  12   In rails r oot you wi ll find a  file calle d setup.ba t.template .
  13   Move this  file to se tup.bat, t hen you wi ll need to  modify th e followin g environm ent variab les:
  14  
  15   GEM_HOME :  (this is  in line 2,  make sure  you creat e the dire ctory you  reference) <br>
  16   JAVA_HOME  : (Line 4) <br>
  17   JRUBY_JAR:  (This ref erences JR uby's comp lete jar f ile.  Line  8)<br>
  18  
  19   From a dos  shell mak e sure you  are in ra ils root ( you can se e the app  directory  right?), a nd run:
  20   ```
  21   setup.bat
  22   ```
  23  
  24   Now that y our enviro nment is s etup you n eed to ins tall bundl er:
  25   ```
  26   gem instal l bundler
  27   ```
  28  
  29   Install yo ur bundle!
  30   ```
  31   bundle ins tall
  32   ```
  33  
  34   <hr>
  35   <br>
  36   <h3>RAILS_ COMMON - g it submodu le</h3>
  37   We have mo ved the pr op loader  and loggin g code int o a git re pository a t https:// github.com /VA-CTT/ra ils_common .git so th at the cod e can
  38   be shared  with rails _komet and  the PRISM E project
  39  
  40  
  41   To pull th e latest c ode do the  following  (replace  my usernam e with you rs where a ppropriate .):
  42   * VCS -> U pdate Proj ect - from  within Ru byMine (ht tps://www. jetbrains. com/help/r uby/2016.1 /installin g-and-laun ching.html )
  43   * open .gi tignore an d comment  out /lib/r ails__comm on with a  #
  44   * open a t erminal an d navigate  to rails_ prisme/lib
  45   * git subm odule add  https://cs hupp@ DNS                 : PORT
  46   * open .gi tignore an d uncommen t /lib/rai ls__common
  47   * run git  reset from  within th e lib/rail s_common d irectory
  48   * run git   rm -f --c ached rail s_common f rom within  the lib/r ails_commo n director y if the l ine above  fails
  49  
  50  
  51   ```
  52   git reset  .
  53   ```
  54  
  55   You should  now see a n rails_co mmon direc tory under  the lib d irectory.
  56  
  57   In RubyMin e you may  see a mess age concer ning rails _common be ing under  source con trol. If/w hen you do , click th e add root  button. T his will a llow you t o make cha nges withi n the rail s_komet pr oject to t he code in  rails_com mon and co mmit those  changes a s well.
  58  
  59  
  60   <hr>
  61   Now you ne ed to run  (after ins talling ma ven)
  62   ```
  63   jars.bat
  64   ```
  65   This will  set up the  ISAAC stu ff and dow nloads all  of the ne cessary ja rs
  66  
  67   run:
  68  
  69   ```
  70   startup.ba t
  71   ```
  72  
  73   To bring u p the serv er
  74  
  75   BTW, on wi ndows you  will have  to install :<br><br>
  76   **Java Cry ptography  Extension  (JCE) Unli mited Stre ngth Juris diction Po licy Files **
  77   <br><br>Go ogle has p lenty of h elp for th is install  on your j dk/jre.
  78  
  79   <br>
  80   <hr>
  81   <h1>Passwo rd Recover y</h1>
  82   In every w ar file th ere is the  following  file: WEB -INF/confi g/prisme_s uper_user. yml
  83   Copy this  file to /a pp/prismeD ata, then  edit it (s elf explan atory).  R estart pri sme and lo g in.
  84  
  85   <br>
  86   <hr>
  87   <h1>Oracle  Setup</h1 >
  88  
  89   1 - Downlo ad Oracle  Express Ed ition for  Oracle 12g  at:  http ://www.ora cle.com/te chnetwork/ database/d atabase-te chnologies /express-e dition/dow nloads/ind ex.html 
  90       Unzip  the packag e and run  the SETUP  applicatio n. This wi ll set up  the databa se as a se rvice and  establish  your syste m password  for the d atabase.
  91  
  92   2 - Downlo ad SQL Dev eloper fro m Oracle a t:  http:/ /www.oracl e.com/tech network/de veloper-to ols/sql-de veloper/do wnloads/in dex.html
  93       This t ool will a llow you t o connect  to our Ora cle databa se instanc es includi ng your lo cal expres s database . Unzip th is file an d locate t he sqldeve loper appl ication in  the root  directory  to launch  the tool.
  94  
  95   3 - Launch  SQL Devel oper and c onnect to  your local  Express e dition as  **system**  at the de fault port  **1521**  with the S ID as **xe **.
  96  
  97   4 - Run th e followin g commands  to create  the PRISM E users ch anging the  **some_pa ssword** t o a secure  password.
  98   ```
  99   -- USER SQ L
  100   CREATE USE R PRISME_D EV IDENTIF IED BY som e_password  ;
  101   -- ROLES
  102   GRANT "DBA " TO PRISM E_DEV ;
  103   GRANT "CON NECT" TO P RISME_DEV  ;
  104  
  105   -- USER SQ L
  106   CREATE USE R PRISME_T EST IDENTI FIED BY so me_passwor d ;
  107   -- ROLES
  108   GRANT "DBA " TO PRISM E_TEST ;
  109   GRANT "CON NECT" TO P RISME_TEST  ;
  110  
  111   -- USER SQ L
  112   CREATE USE R PRISME_P ROD IDENTI FIED BY so me_passwor d ;
  113   -- ROLES
  114   GRANT "DBA " TO PRISM E_PROD ;
  115   GRANT "CON NECT" TO P RISME_PROD  ;
  116   ```
  117  
  118   5 - Create  the PRISM E_PROFILE  for settin g up sessi on connect ions and c onnection  idle_time.
  119  
  120   ```
  121   --create a  profile a nd assign  it to user s
  122   CREATE PRO FILE PRISM E_PROFILE
  123       LIMIT  SESSIONS_P ER_USER 50 0
  124       IDLE_T IME UNLIMI TED;
  125       
  126   ALTER USER  PRISME_DE V PROFILE  PRISME_PRO FILE;
  127   ALTER USER  PRISME_TE ST PROFILE  PRISME_PR OFILE;
  128   ALTER USER  PRISME_PR OD PROFILE  PRISME_PR OFILE;
  129  
  130   --ALTER PR OFILE PRIS ME_PROFILE  
  131   --  LIMIT  IDLE_TIME  UNLIMITED;
  132  
  133   --select *  from user _resource_ limits a 
  134   --where a. resource_n ame in ('I DLE_TIME', 'CONNECT_T IME');
  135   ```
  136  
  137   6 - Update  the oracl e_database .yml file  in the PRI SME applic ation to r eflect the  connectio n to Oracl e using th e users an d password s establis hed above  in the res pective en vironments .
  138  
  139   ```
  140   default: & default
  141     adapter:  oracle_en hanced
  142     database : xe
  143     pool: 10 00
  144  
  145   developmen t:
  146     <<: *def ault
  147     url: jdb c:oracle:t hin:@local host:1521: xe
  148     username : PRISME_D EV
  149     password : some_pas sword
  150  
  151   follow the  bouncing  ball for t he rest...
  152  
  153   ```
  154  
  155   7 - Open u p a termin al rails c onsole in  the rails  root direc tory for P RISME (thi s step doe s not appl y when set ting up AI TC boxes)
  156   ```
  157   rails cons ole
  158   ```
  159  
  160   This shoul d run the  migrations  creating  all of the  tables in  your conf igured Ora cle databa se based o n your Rai ls environ ment. If y ou can ope n the rail s console  successful ly then yo u are good  to go.
  161  
  162   8 - On AIT C boxes, m ove the or acle_datab ase.yml fi le to /app /prismeDat a if you a re using O racle. Oth erwise the  H2 databa se will be  the defau lt.
  163  
  164   What if yo u want to  use H2?
  165   The standa rd databas e.yml file  is config ured for t he H2 data base that  was migrat ed into yo ur war.  I f you are  deploying  to a stand ard AITC b ox, just"
  166   ```
  167   cd /app/pr ismeData
  168   mv oracle_ database.y ml oracle_ database.y ml.bak
  169   ```
  170   the standa rd databas e.yml file  (h2) will  be used.
  171   **Caution* * -- if yo u see in t he prismeD ata direct ory both a  productio n and test  h2 databa se you hav e to know  which one  has your d ata. You c an set whi ch one is  used
  172   by looking  for the s tring 'pro duction' a nd 'test'  in the WEB -INF/web.x ml file an d changing  it to wha tever is a ppropriate .
  173  
  174   If do not  have a pri smeData di rectory on  your syst em, after  your deplo y stop the  app.  Ent er into th e WEB-INF  directory  of your de ploy. in t he config  directory  you will s ee
  175   oracle_dat abase.yml.   Move it  to a bak a nd restart .
  176  
  177  
  178   <br>
  179   <h1>Start  up PRISME< /h1>
  180   You can no w bring up  the serve r:
  181  
  182   ```
  183   startup.ba t
  184   ```
  185  
  186   Your rails  server wi ll come li stening on  port 3000 .  Just hi t:<BR>
  187   (Be aware  that the s erver will  show a ha rmless exc eption whe n it comes  up.)
  188  
  189   http://loc alhost:300 0
  190  
  191   <h2>Load S ervice and  Service P roperties  for your e nvironment </h2>
  192   There is s eed data f or the fol lowing env ironments:
  193   <ol>
  194       <li>LO CALHOST -  http://loc alhost:por t/rails_pr isme/utili ties/seed_ services?d b=localhos t</li>
  195       <li>VA _DEV_DB -  http://pat h_to_prism e:port/rai ls_prisme/ utilities/ seed_servi ces?db=va_ dev_db</li >
  196       <li>AI TC_DEV_DB  - http://p ath_to_pri sme:port/r ails_prism e/utilitie s/seed_ser vices?db=a itc_dev_db </li>
  197       <li>AI TC_SQA_DB  - http://p ath_to_pri sme:port/r ails_prism e/utilitie s/seed_ser vices?db=a itc_sqa_db </li>
  198       <li>AI TC_TEST_DB  - http:// path_to_pr isme:port/ rails_pris me/utiliti es/seed_se rvices?db= aitc_test_ db</li>
  199   </ol>
  200  
  201   <p>If any  of the dat a specifyi ng the loc ations or  credential s for any  of these e nvironment s change t hen we wil l need to  update the  seed file s accordin gly. If, a fter runni ng for you r environm ent, you a re not con necting to  a given s ervice the n go into  services a nd update  the url(s)  and user  credential s and re-t est.</p> 
  202  
  203  
  204   <hr>
  205   <a href="# roles">Rol es</a>
  206   <h1>Fetchi ng roles f rom PRISME </h1>
  207  
  208   Prisme can  easily di splay the  roles for  all users  registered  with the  system.
  209  
  210   For exampl e,  hittin g the foll owing url:
  211   ```
  212   http://loc alhost:300 0/roles/ge t_roles?id =cshupp@gm ail.com&pa ssword=csh upp@gmail. com
  213   ```
  214  
  215   Will show  the roles  in html fo rmat.  We  note that  only two c gi paramet ers are re quired (id , and pass word).
  216  
  217   To get the m in JSON  format we  can do the  following  (note the  .json):
  218   ```
  219   http://loc alhost:300 0/roles/ge t_roles.js on?id=cshu pp@gmail.c om&passwor d=cshupp@g mail.com
  220   ```
  221  
  222   Or (note t he additio nal 'forma t' cgi par ameter):
  223   ```
  224   http://loc alhost:300 0/roles/ge t_roles?fo rmat=json& id=cshupp@ gmail.com& password=c shupp@gmai l.com
  225   ```
  226  
  227   Modifying  the reques t header t o 'applica tion/json'  will also  work.
  228  
  229   Below is a  sample ja va applica tion which  shows how  to parse  the json.   The resul ts might l ook like:
  230  
  231   http://loc alhost:300 0/roles/ge t_roles.js on?id=cshu pp%40gmail .com&passw ord=cshupp %40gmail.c om<br>
  232   Role 0 is  super_user <br>
  233   Role 1 is  read_only< br>
  234   Role 2 is  editor<br>
  235   Role 3 is  reviewer<b r>
  236  
  237   ```
  238   package ex amples.pri sme.roles. json;
  239  
  240   import jav a.io.Buffe redReader;
  241   import jav a.io.Input StreamRead er;
  242   import jav a.net.Http URLConnect ion;
  243   import jav a.net.URL;
  244   import jav a.net.URLE ncoder;
  245   import org .json.JSON Array;
  246   import org .json.JSON Exception;
  247   import org .json.JSON Object;
  248  
  249   public cla ss RoleFet chSample {
  250           
  251           pr ivate stat ic final S tring JSON _ROLES = " http://loc alhost:300 0/roles/ge t_roles.js on";
  252           
  253           pu blic Strin g fetchJSO N(String u ser, Strin g password ) throws E xception {
  254                    Stri ng userEnc oded = URL Encoder.en code(user,  "UTF-8");
  255                    Stri ng passwor dEncoded =  URLEncode r.encode(p assword, " UTF-8");
  256                    Stri ng urlStri ng = JSON_ ROLES + "? id=" + use rEncoded +  "&passwor d=" + pass wordEncode d;
  257                    Syst em.out.pri ntln(urlSt ring);
  258                    URL  prismeRole sUrl = new  URL(urlSt ring);
  259                    Http URLConnect ion urlCon nection =  null;
  260                    Stri ngBuilder  result = n ew StringB uilder();
  261                    try  {
  262                             urlCon nection =  (HttpURLCo nnection)  prismeRole sUrl.openC onnection( );
  263                             Buffer edReader r  = new Buf feredReade r(new Inpu tStreamRea der(urlCon nection.ge tInputStre am()));
  264                             String  line = nu ll;
  265                             while  ((line = r .readLine( )) != null ) {
  266                                      result.a ppend(line );
  267                             }
  268                    } fi nally {
  269                             urlCon nection.di sconnect() ;
  270                    }
  271                    retu rn result. toString() ;
  272           }
  273           
  274           pu blic void  parseRoleJ SON(String  jsonStrin g) throws  JSONExcept ion {
  275           JS ONArray ro lesArray =  new JSONA rray(jsonS tring);
  276           in t length =  rolesArra y.length() ;
  277           fo r (int i =  0; i < le ngth; i++)  {
  278                    JSON Object obj  = rolesAr ray.getJSO NObject(i) ;
  279                    Stri ng role =  obj.getStr ing("name" );
  280                    Syst em.out.pri ntln("Role  " + i + "  is " + ro le);
  281           }
  282           }
  283           
  284           pu blic stati c void mai n(String[]  args) thr ows Except ion{
  285                    Role FetchSampl e r = new  RoleFetchS ample();
  286                    r.pa rseRoleJSO N(r.fetchJ SON("cshup p@gmail.co m", "cshup p@gmail.co m"));
  287           }
  288  
  289   }
  290  
  291   ```
  292  
  293   <hr>
  294   <h1>Specia l routes</ h1>
  295   If you are  on the ho mepage, ap pending th e followin g to your  url:<br>
  296  
  297   **/utiliti es/warmup* *
  298  
  299   will take  you to pri sme's warm up page.   You would  call this  whenever y ou restart  the Apach e SSOI ser ver (not P risme).
  300   This will  open a pag e that wil l, via aja x, motivat e 500 http (s) reques ts to get  Apache's w orkers war m and toas ty. 
  301   Obviously,  this will  not work  if you hit  prisme lo cally.  Pr isme must  be hit thr ough SSOI.
  302   This page  has anothe r nice fea ture.  The  page it r eloads 500  times sho w all the  header inf ormation
  303   prisme get s from SSO I (includi ng any oth ers).  If  you want t o snoop on  SSOI this  is the pl ace to go.
  304  
  305   Appending: <br>
  306  
  307   **/utiliti es/time_st ats**
  308  
  309   This page  will show  you two st atistics:< br><br>
  310  
  311   <ol>
  312       <li>Re quest Time  in Apache  -- How mu ch time el apsed betw een apache  getting t he request  from your  browser t o apache p lacing the  headers o n the wire .
  313       If thi s time is  large, SSO I may be t o blame.</ li>
  314       <li>Ti me from Ap ache to Ra ils -- The  time Apac he receive d the requ est to the  time rail s recieved  it.  It d oes not in clude the  time Rails  spent ren dering the  page. If  the other  statistic  is small s uspect net work laten cy.</li>
  315  
  316   Appending: <br>
  317   **/utiliti es/log_lev el?level=d ebug**
  318  
  319   Will chang e the log  level.  To  see a lis t of curre nt levels  try changi ng 'debug'  to 'showl evels'.
  320  
  321