Skip to content

Commit

Permalink
Merge pull request #31 from bd2kccd/v1.3.0
Browse files Browse the repository at this point in the history
V1.3.0
  • Loading branch information
kvb2univpitt authored Nov 14, 2016
2 parents 74c31d1 + 725fe03 commit 2d3ed2d
Show file tree
Hide file tree
Showing 296 changed files with 18,005 additions and 3,960 deletions.
28 changes: 11 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# causal-web
Causal web is a Java web-based application that allows users to run causal modeling algorithms on their dataset. The Center for Causal Discovery is hosting this application at the Pittsburgh Supercomputing Center and you can access it at https://ccd2.vm.bridges.psc.edu/ccd

Documentation for using the web application can be found at [http://www.ccd.pitt.edu/wiki/index.php?title=Causal_Web_Application_Quick_Start_and_User_Guide](http://www.ccd.pitt.edu/wiki/index.php?title=Causal_Web_Application_Quick_Start_and_User_Guide)
Documentation for using the web application can be found at [https://bd2kccd.github.io/docs/causal-web/](https://bd2kccd.github.io/docs/causal-web/)

If you want to host the application with your own hardware, follow the instructions below for configuring, building and installing the application.

Expand All @@ -17,18 +17,17 @@ If you want to host the application with your own hardware, follow the instructi
#### Dependencies
Download and uncompress the source code for each of following dependencies:

* [ccd-job-queue-0.1.4](https://github.com/bd2kccd/ccd-job-queue/releases/tag/v0.1.4)
* [ccd-mail-0.2.0](https://github.com/bd2kccd/ccd-mail/releases/tag/v0.2.0)
* [ccd-db-0.6.1](https://github.com/bd2kccd/ccd-db/releases/tag/v0.6.1)
* [ccd-job-queue-0.1.5](https://github.com/bd2kccd/ccd-job-queue/releases/tag/v0.1.5)
* [ccd-mail-0.2.1](https://github.com/bd2kccd/ccd-mail/releases/tag/v0.2.1)
* [ccd-db-0.6.2](https://github.com/bd2kccd/ccd-db/releases/tag/v0.6.2)
* [ccd-commons-0.3.1](https://github.com/bd2kccd/ccd-commons/releases/tag/v0.3.1)

To install the dependencies, go to the top directory of each project and do a maven install by typing **mvn install**.

#### Application
Download and uncompress the application source code [causal-web-1.2.2](https://github.com/bd2kccd/causal-web/releases/tag/v1.2.2). To compile and build the application, go to the directory **causal-web-1.2.2** and type **mvn package**.
Download and uncompress the application source code [causal-web-1.3.0](https://github.com/bd2kccd/causal-web/releases/tag/v1.3.0). To compile and build the application, go to the directory **causal-web-1.3.0** and type **mvn package**.

#### External Dependencies
* [causal-cmd-5.3.0.jar](https://github.com/cmu-phil/tetrad/releases/tag/v5.3.0-20160624)
* [causal-cmd-6.0.0.jar](https://github.com/cmu-phil/tetrad/releases/tag/6.0.0-20161031)

## Configure the software

Expand All @@ -39,7 +38,7 @@ Inside the workspace directory, create another folder called **lib**, for exampl
Copy the **causal-cmd-5.3.0.jar** to the **workspace/lib** folder.

### Configure
There are 4 configuration files to configure located in causal-web-1.2.2/src/main/resources folder:
There are 4 configuration files to configure located in causal-web-1.3.0/src/main/resources folder:
1. **application-hsqldb.properties**: HSQLDB database configurations (for testing only).
2. **application-mysql.properties**: MySQL database configurations
3. **application.properties**: Spring Boot configurations
Expand All @@ -59,11 +58,6 @@ Set the following properties in the **application.properties** file:
spring.mail.username=<gmail username>
spring.mail.password=<gmail username>
```
Set the following properties in the **ccd.properties** file:
```java
// add gmail account
ccd.mail.feedback.to=<gmail username>
```

#### Testing Configuration
Set the following properties in the **application.properties** file:
Expand All @@ -80,18 +74,18 @@ spring.profiles.active=scheduler,mysql
Make sure you set **ccd.server.workspace=/home/tuser/workspace** and **ccd.folder.lib=lib** in the **ccd.properties** file.

## Compile the Program
Go to the **ccd-web** directory and run the command **mvn clean package**. This will create a jar file called **causal-web-1.2.2.jar** in the **/target** folder.
Go to the **causal-web** directory and run the command **mvn clean package**. This will create a jar file called **causal-web-1.3.0.jar** in the **/target** folder.

### Launch the Program
```java
java -jar causal-web-1.2.2.jar
java -jar causal-web-1.3.0.jar
```
To give the program 4GB of memory to run on, type the follow, using the jvm options:
```java
java -Xmx4G -jar causal-web-1.2.2.jar
java -Xmx4G -jar causal-web-1.3.0.jar
```

To launch app in the browser
```
http://localhost:[port]/ccd // default port is 8080, otherwise change to specified port
```
```
30 changes: 23 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>edu.pitt.dbmi</groupId>
<artifactId>causal-web</artifactId>
<version>1.2.2</version>
<version>1.3.0</version>
<packaging>jar</packaging>

<name>causal-web</name>
Expand All @@ -14,14 +14,14 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.5.RELEASE</version>
<version>1.4.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<shiro.version>1.2.4</shiro.version>
<shiro.version>1.3.2</shiro.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
Expand Down Expand Up @@ -53,7 +53,7 @@
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j</artifactId>
<artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand All @@ -77,26 +77,42 @@
<version>${shiro.version}</version>
</dependency>

<dependency>
<groupId>com.auth0</groupId>
<artifactId>auth0-spring-mvc</artifactId>
<version>1.1.1</version>
</dependency>

<dependency>
<groupId>edu.pitt.dbmi</groupId>
<artifactId>ccd-job-queue</artifactId>
<version>0.1.4</version>
<version>0.1.5</version>
<exclusions>
<exclusion>
<groupId>edu.pitt.dbmi</groupId>
<artifactId>ccd-db</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>edu.pitt.dbmi</groupId>
<artifactId>ccd-mail</artifactId>
<version>0.2.0</version>
<version>0.2.1</version>
</dependency>
<dependency>
<groupId>edu.pitt.dbmi</groupId>
<artifactId>ccd-db</artifactId>
<version>0.6.1</version>
<version>0.6.2</version>
</dependency>
<dependency>
<groupId>edu.pitt.dbmi</groupId>
<artifactId>ccd-commons</artifactId>
<version>0.3.1</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
</dependency>
</dependencies>

<build>
Expand Down
9 changes: 5 additions & 4 deletions src/main/java/edu/pitt/dbmi/ccd/web/CcdWebApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@
*/
package edu.pitt.dbmi.ccd.web;

import edu.pitt.dbmi.ccd.db.CCDDatabaseApplication;
import edu.pitt.dbmi.ccd.mail.CCDMailApplication;
import edu.pitt.dbmi.ccd.queue.CCDJobQueueApplication;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.PropertySource;
import org.springframework.scheduling.annotation.EnableAsync;

import edu.pitt.dbmi.ccd.db.CCDDatabaseApplication;
import edu.pitt.dbmi.ccd.mail.CcdMailApplication;
import edu.pitt.dbmi.ccd.queue.CCDJobQueueApplication;

/**
*
* Aug 5, 2015 1:27:02 PM
Expand All @@ -35,7 +36,7 @@
*/
@SpringBootApplication
@EnableAsync
@Import({CCDDatabaseApplication.class, CCDJobQueueApplication.class, CCDMailApplication.class})
@Import({CCDDatabaseApplication.class, CCDJobQueueApplication.class, CcdMailApplication.class})
@PropertySource("classpath:ccd.properties")
public class CcdWebApplication {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
*/
package edu.pitt.dbmi.ccd.web.conf;

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer;
import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;
import org.springframework.boot.context.embedded.ErrorPage;
import org.springframework.boot.web.servlet.ErrorPageRegistrar;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpStatus;
Expand All @@ -37,14 +35,14 @@
public class ApplicationConfigurer extends WebMvcConfigurerAdapter {

@Bean
public EmbeddedServletContainerCustomizer webappEmbeddedServletContainerCustomizer() {
return (ConfigurableEmbeddedServletContainer container) -> {
ErrorPage[] errorPages = {
new ErrorPage(HttpStatus.NOT_FOUND, "/404"),
new ErrorPage(HttpStatus.UNAUTHORIZED, "/401"),
new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/500")
};
container.addErrorPages(errorPages);
public ErrorPageRegistrar errorPageRegistrar() {
return registry -> {
registry.addErrorPages(
new org.springframework.boot.web.servlet.ErrorPage(HttpStatus.BAD_REQUEST, "/400"),
new org.springframework.boot.web.servlet.ErrorPage(HttpStatus.NOT_FOUND, "/404"),
new org.springframework.boot.web.servlet.ErrorPage(HttpStatus.UNAUTHORIZED, "/401"),
new org.springframework.boot.web.servlet.ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/500")
);
};
}

Expand Down
53 changes: 53 additions & 0 deletions src/main/java/edu/pitt/dbmi/ccd/web/conf/Auth0Configurer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* Copyright (C) 2016 University of Pittsburgh.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA
*/
package edu.pitt.dbmi.ccd.web.conf;

import com.auth0.web.Auth0Config;
import com.auth0.web.Auth0Filter;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

/**
*
* Oct 6, 2016 3:47:55 PM
*
* @author Kevin V. Bui ([email protected])
*/
@Profile("auth0")
@Configuration
@ComponentScan(basePackages = {"com.auth0.web"})
@EnableAutoConfiguration
public class Auth0Configurer {

@Bean
public FilterRegistrationBean filterRegistration(Auth0Config auth0Config) {
final FilterRegistrationBean registration = new FilterRegistrationBean();
registration.setFilter(new Auth0Filter(auth0Config));
registration.addUrlPatterns(auth0Config.getSecuredRoute());
registration.addInitParameter("redirectOnAuthError", auth0Config.getLoginRedirectOnFail());
registration.setName("Auth0Filter");

return registration;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
public class ShiroConfigurer {

private static final String AUTHC = "authc";
private static final String ANON = "anon";

@Bean(name = "passwordService")
public DefaultPasswordService passwordService() {
Expand Down
Loading

0 comments on commit 2d3ed2d

Please sign in to comment.