Getting Set Up
- Install Ruby 2.5
- Install NodeJS (latest, not LTS)
- Install Yarn
- Install PostgreSQL v9.5+
- In PostgreSQL pgAdmin, create a user called "vhp". Set the permissions to "Can Log In". Create a random password and set that password for the vhp user. Put that password into secrets.yml (see next bullet). Create two databases: "vhp" and "vhp_test"
- Create a config/secrets.yml based on config/secrets.default.yml. Follow the comments in that file.
$ yarn install
$ bundle install
$ rails db:schema:load
$ rails data:all
$ rails server
Finding useful commands
To find out useful commands for working with data:
$ rails -T
Rebuild the database
If db/schema.rb
has changed recently, you'll need to rebuild the database:
$ rails db:schema:load
Reload the production data
To load the production data from Chromium and HTTPD:
$ rails data:all
This is the equivalent of running:
$ rails data:clear data:chromium data:httpd data:writing
To skip the clone from github,
$ rails data:chromium:nogit
$ rails data:httpd:nogit
Useful commands:
$ rails server
$ rails console
The CWE csv file
To download a copy of the CWE csv file, go to https://cwe.mitre.org/data/downloads.html and download the latest Research Concepts csv listed under 'Navigate CWE'.
Place the csv file in lib/taggers/resources/cwes.csv
On line 677 of the file, near the end of the line, change the double quotes around "<script"
to single quotes 'script'