Skip to content

Commit

Permalink
Merge branch 'release/2.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
TheScown committed Nov 12, 2015
2 parents 2bfae39 + c9103ed commit 9570fcd
Show file tree
Hide file tree
Showing 245 changed files with 17,432 additions and 7,946 deletions.
2 changes: 1 addition & 1 deletion .bowerrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"directory": "src/main/webapp/static/lib/"
"directory": "src/main/webapp/static/bower_components/"
}
17 changes: 16 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,21 @@ target/

# Archetype
filter-dev.properties
src/main/webapp/lib/
src/test/js/lib/
.vagrant/

src/main/webapp/static/bower_components/
node_modules/
.grunt/
spec-runner.html

# Vagrant
cookbooks/
tmp

# Git
*.BACKUP.*
*.BASE.*
*.LOCAL.*
*.REMOTE.*
*.orig
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ branches:
- develop
install: true
script: mvn test -P production

7 changes: 7 additions & 0 deletions Cheffile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
site 'https://supermarket.getchef.com/api/v1'

cookbook 'apt'

cookbook 'redis',
:git => '[email protected]:phlipper/chef-redis.git',
:ref => 'v0.5.6'
17 changes: 17 additions & 0 deletions Cheffile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
SITE
remote: https://supermarket.getchef.com/api/v1
specs:
apt (2.7.0)

GIT
remote: [email protected]:phlipper/chef-redis.git
ref: v0.5.6
sha: 7476279fc9c8727f082b8d77b5e1922dc2ef437b
specs:
redis (0.5.6)
apt (>= 0.0.0)

DEPENDENCIES
apt (>= 0)
redis (>= 0)

57 changes: 57 additions & 0 deletions Gruntfile.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
module.exports = (grunt) ->
jasmineRequireTemplate = require 'grunt-template-jasmine-requirejs'

jasmineSpecRunner = 'spec-runner.html'

sourcePath = 'src/main/webapp/static/js/find/**/*.js'

documentation = 'doc'

testRequireConfig = [
'src/main/webapp/static/js/require-config.js'
'src/test/js/test-require-config.js'
]

specs = 'src/test/js/spec/**/*.js'
serverPort = 8000
host = "http://localhost:#{serverPort}/"

grunt.initConfig
pkg: grunt.file.readJSON 'package.json'
clean: [
jasmineSpecRunner
'bin'
'.grunt'
documentation
]
connect:
server:
options:
port: serverPort
jasmine:
test:
src: sourcePath
options:
host: host
keepRunner: true
outfile: jasmineSpecRunner
specs: specs
template: jasmineRequireTemplate
templateOptions:
requireConfigFile: testRequireConfig
watch:
test:
files: [
'src/**/*.js'
'test/**/*.js'
]
tasks: ['test']

grunt.loadNpmTasks 'grunt-contrib-connect'
grunt.loadNpmTasks 'grunt-contrib-jasmine'
grunt.loadNpmTasks 'grunt-contrib-watch'

grunt.registerTask 'default', ['test']
grunt.registerTask 'test', ['connect:server', 'jasmine:test']
grunt.registerTask 'browser-test', ['connect:server:keepalive']
grunt.registerTask 'watch-test', ['watch:test']
78 changes: 62 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
# HP Find
[![Build Status](https://travis-ci.org/hpautonomy/find.svg?branch=master)](https://travis-ci.org/hpautonomy/find)

HP Find is a web application backed by [IDOL OnDemand](https://www.idolondemand.com)
HP Find is a web application backed by [Haven OnDemand](https://www.idolondemand.com)

A live preview of HP Find can be found at [find.idolondemand.com](http://find.idolondemand.com).

## Key Features
* Querying IDOL OnDemand indexes
* Viewing IDOL OnDemand results
* Suggested related searches from IDOL OnDemand
* Querying Haven OnDemand indexes
* Viewing Haven OnDemand results
* Suggested related searches from Haven OnDemand

## Building HP Find
Building HP Find requires the following to be installed

* [Apache Maven 3](http://maven.apache.org)
* [NodeJS](http://nodejs.org)

The jetty:run goal will stand up a local web server for development. The package goal will build a war file.
[NPM](https://www.npmjs.com/) and [Bower](http://bower.io/) are used to manage dependencies. These are automatically
run in the maven process-sources phase.

Running with the production profile will minify the Javascript and CSS, and bless the CSS for older versions of Internet Explorer.
The maven jetty:run goal will stand up a local web server for development. The package goal will build a war file.

Running with the production profile will minify the Javascript and CSS, and bless the CSS for older versions of Internet
Explorer.

When developing the develop profile should be used. You will need to create a copy of src/main/filters/filter-dev.properties.example in the same directory.
This should be named filter-dev.properties. This file should be ignored by git.
This should be named filter-dev.properties.

## HP Find setup
You'll need to install [Tomcat](http://tomcat.apache.org) to run the HP Find war file.
Expand All @@ -33,23 +37,65 @@ If using the jetty:run goal, the properties can be set on the command line
The properties you'll need to set are:

* -Dhp.find.home . This is the directory where the webapp will store log files and the config.json file.
* -Dfind.https.proxyHost . Optional property. The host for the https proxy. Set this if you need a proxy server to talk to IDOL OnDemand.
* -Dfind.https.proxyPort . Optional property. The port for the https proxy. Set this if you need a proxy server to talk to IDOL OnDemand. Defaults to 80 if find.https.proxyHost is defined.
* -Dhp.find.persistentState . Optional property. The persistence mode for the application, which determines where
sessions, token proxies and caches are stored. Possible options are REDIS or INMEMORY. Defaults to REDIS.
* -Dfind.https.proxyHost . Optional property. The host for the https proxy. Set this if you need a proxy server to talk
to Haven OnDemand.
* -Dfind.https.proxyPort . Optional property. The port for the https proxy. Set this if you need a proxy server to talk
to Haven OnDemand. Defaults to 80 if find.https.proxyHost is defined.

## Configuring HP Find
Once you've started HP Find, you'll need to configure HP Find. When run for the first time, a login screen will appear. The credentials for this are in the config file.
## Vagrant
HP Find includes a Vagrant file, which will provision an Ubuntu 12.04 VM running a Redis server, which will by default
be used to store sessions.

This will take you to the Settings Page. You'll need an IOD API key. Once provided, you can configure which IOD indexes you wish to allow searching against.
The Vagrantfile requires several plugins, which will be installed if they are not installed already.

You can also configure a user to allow these settings to be changed later. The current password is the password you used to login.
The new password will be stored in the config file as a BCrypt hash.
The VM has the IP address 192.168.242.242, and can be accessed via DNS with the name hp-find-backend.

Once you've configured HP Find, save the config file with the save changes button, and logout. You will be redirected to the Search page. You can access the settings page again by pointing your browser at /find/login (there is no link to this in the UI).
The Redis runs on port 6379.

## Configuring HP Find
Earlier versions of Find had a settings page, but this is currently unavailable. To configure Find, create a config.json
file in your Find home directory.

Below is an example config file:

{
"login": {
"method": "singleUser",
"singleUser": {
"username": "admin",
"hashedPassword": "",
"passwordRedacted" : false
},
"name": "SingleUserAuthentication"
},
"iod": {
"apiKey": "YOUR API KEY",
"application": "YOUR APPLICATION",
"domain": "YOUR DOMAIN",
"activeIndexes": [{
"domain": "PUBLIC_INDEXES",
"name": "wiki_eng"
}]
},
"allowedOrigins": [
"http://mydomain.example.com:8080"
],
"redis": {
"address": {
"host": "hp-find-backend",
"port": 6379
},
"database": 0,
"sentinels": []
}
}

## Is it any good?
Yes.

## License
Copyright 2014-2015 Hewlett-Packard Development Company, L.P.

Licensed under the MIT License (the "License"); you may not use this project except in compliance with the License.
Licensed under the MIT License (the "License"); you may not use this project except in compliance with the License.
52 changes: 52 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

vm_name = 'hp-find-backend'

required_plugins = %w(vagrant-hostsupdater vagrant-librarian-chef vagrant-proxyconf)

required_plugins.each do |plugin|
system "vagrant plugin install #{plugin}" unless Vagrant.has_plugin? plugin
end

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.

# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "hashicorp/precise64"

config.vm.network "private_network", ip: '192.168.242.242'

config.vm.hostname = vm_name

config.vm.provider :virtualbox do |vb|
# Don't boot with headless mode
# Uncomment this if you get stuck at the bootloader
# vb.gui = true

vb.name = vm_name
end

config.vm.provider 'vmware_workstation' do |hv|
hv.name = vm_name
end

config.proxy.http = ENV["http_proxy"]
config.proxy.https = ENV["https_proxy"]
config.proxy.no_proxy = ENV["no_proxy"]

# Enable provisioning with chef solo, specifying a cookbooks path, roles
# path, and data_bags path (all relative to this Vagrantfile), and adding
# some recipes and/or roles.
#
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = "cookbooks"
chef.roles_path = "vagrant/roles"
chef.add_role "redis-server"
end
end
32 changes: 22 additions & 10 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"private": true,
"authors": [
"Alex Scown <[email protected]>",
"Alyona Ivanova <[email protected]>"
"Alyona Ivanova <[email protected]>",
"Daniel Grayling <[email protected]"
],
"moduleType": [
"amd"
Expand All @@ -12,31 +13,42 @@
"ignore": [
"**/.*",
"node_modules",
"src/main/webapp/static/lib",
"src/main/webapp/static/bower_components",
"src/main/test",
"mockups"
],
"dependencies": {
"backbone": "backbone#~1.1.0",
"backbone": "~1.2.0",
"colorbox": "colorbox#~1.5.10",
"fontawesome": "components-font-awesome#~3.2.1",
"jquery": "components/jquery#~1.10.2",
"json": "json2#*",
"underscore": "components/underscore#~1.5.2",
"hp-autonomy-js-whatever": "~2.1.0",
"underscore": "~1.8.3",
"hp-autonomy-js-whatever": "~2.3.0",
"hp-autonomy-login-page": "~1.0.2",
"hp-autonomy-settings-page": "~0.1.0",
"hp-autonomy-bootstrap-2": "~2.3.2",
"hp-autonomy-fieldtext-js": "~1.1.0",
"hp-autonomy-js-parametric-refinement": "~0.1.1",
"requirejs": "~2.1.15",
"requirejs-text": "~2.0.13",
"requirejs-i18n": "~2.0.4"
"requirejs-i18n": "~2.0.4",
"icheck": "~1.0.2",
"moment": "~2.10.3",
"eonasdan-bootstrap-datetimepicker": "~4.14.30",
"bootstrap-timepicker": "tarruda/bootstrap-datetimepicker",
"hp-autonomy-hod-sso-js": "~0.5.0",
"hp-autonomy-js-databases-view": "~0.4.0"
},
"devDependencies": {
"hp-autonomy-js-testing-utils": "~1.0.2"
"hp-autonomy-js-testing-utils": "~1.1.1",
"jasmine-jquery": "~2.1.0"
},
"resolutions": {
"underscore": "~1.5.2",
"hp-autonomy-js-whatever": "~2.1.0",
"jquery": "~1.10.2"
"underscore": "~1.8.3",
"hp-autonomy-js-whatever": "~2.3.0",
"jquery": "~1.10.2",
"backbone": "~1.2.1",
"jasmine": ">=2"
}
}
30 changes: 30 additions & 0 deletions install/find.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!upstart
description "HP Find"
author "Copyright 2015 Hewlett-Packard Development Company, L.P. Licensed under the MIT License (the 'License'); you may not use this file except in compliance with the License."

start on startup
stop on shutdown

env HOME=/opt/find #ISO installation directory
env USER=find # Linux user to run ISO as
env PORT=8080 # Port to run ISO on

env SYSLOG=/var/log/find.sys.log # Where to write startup logging to
env PID=/var/run/find.pid # ISO process id file

env JAVA_BIN=/usr/bin/java # Path to Java 7 binary

script
cd $HOME
echo $$ > $PID
exec sudo -u $USER $JAVA_BIN -jar $HOME/find.jar -Dhp.find.home="$HOME/home/" -Djava.security.egd=file:/dev/./urandom -httpPort $PORT -uriEncoding utf-8 >> $SYSLOG
end script

pre-start script
echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Starting" >> $ISO_SYSLOG
end script

pre-stop script
rm $ISO_PID
echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Stopping" >> $ISO_SYSLOG
end script
Loading

0 comments on commit 9570fcd

Please sign in to comment.