Skip to content

Commit

Permalink
Merged in pre-release1 (pull request #215)
Browse files Browse the repository at this point in the history
prerelease1
  • Loading branch information
Jonathan Johnson committed Oct 12, 2018
2 parents 97a87f4 + 62fe80d commit 61aec76
Show file tree
Hide file tree
Showing 8 changed files with 124 additions and 11 deletions.
6 changes: 3 additions & 3 deletions backend/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ bootWar {
// into '/'
into '/public'
}
archiveName = "${baseName}.war"
archiveName = "${baseName}-${version}.war"
}

bootJar.dependsOn ':ui:npm_run_buildProd'
Expand All @@ -61,7 +61,7 @@ bootJar {
// into '/'
into '/public'
}
archiveName = "${baseName}.jar"
archiveName = "${baseName}-${version}.jar"
}

springBoot {
Expand Down Expand Up @@ -241,5 +241,5 @@ docker {
noCache true
files tasks.bootJar.outputs
files 'src/main/docker-files/loader.properties'
buildArgs(['JAR_FILE': 'shibui.jar'])
buildArgs(['JAR_FILE': "shibui-${version}.jar"])
}
2 changes: 1 addition & 1 deletion backend/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spring.liquibase.enabled=false

# Hibernate properties
# for production never ever use create, create-drop. It's BEST to use validate
spring.jpa.hibernate.ddl-auto=create
spring.jpa.hibernate.ddl-auto=update
spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl
spring.jpa.show-sql=false
spring.jpa.properties.hibernate.format_sql=false
Expand Down
12 changes: 11 additions & 1 deletion docs/CUSTOMIZATIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,14 @@ If deploying a WAR, one would use the standard packaging for providing items to

It is highly recommended that a WAR overlay be used to prevent changing the version fingerprint. Overlay
methods exist for both Maven ([https://maven.apache.org/plugins/maven-war-plugin/overlays.html]) and
Gradle ([https://github.com/scalding/gradle-waroverlay-plugin]) projects.
Gradle ([https://github.com/scalding/gradle-waroverlay-plugin]) projects.

## Sample Customization

For an example of a customization, refer to the `pac4j-module` in the project source. This module overrides the delivered
authentication method to provide a simple SAML authentication method. Along with code changes required, it also shows
how one would tie it together using a Docker image.

## Use Cases and Strategies

TBD
45 changes: 45 additions & 0 deletions docs/DATABASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Database configuration

The Shibboleth UI application uses Spring Boot and Spring JPA for database configuration. Out of the box, it ships with
JDBC drivers for H2, MariaDB and Postgres.

By default, it will use an in-memory H2 database. To change which database is used, one should make changes to the
`applications.properties` or `application.yml` file as appropriate. For further information, refer to the appropriate
JDBC driver documentation.

```properties
# Database Credentials
spring.datasource.username=shibui
spring.datasource.password=shibui

# Database Configuration H2
spring.datasource.url=jdbc:h2:mem:shibui;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
spring.datasource.platform=h2
spring.datasource.driverClassName=org.h2.Driver
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
spring.h2.console.enabled=true


# Database Configuration PostgreSQL
#spring.datasource.url=jdbc:postgresql://localhost:5432/shibui
#spring.datasource.driverClassName=org.postgresql.Driver
#spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect

#Maria/MySQL DB
#spring.datasource.url=jdbc:mariadb://localhost:3306/shibui
#spring.datasource.driverClassName=org.mariadb.jdbc.Driver
#spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MariaDBDialect

# Liquibase properties
spring.liquibase.enabled=false
#spring.liquibase.change-log=classpath:edu/internet2/tier/shibboleth/admin/ui/database/masterchangelog.xml

# Hibernate properties
# for production never ever use create, create-drop. It's BEST to use validate
spring.jpa.hibernate.ddl-auto=update
spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl
spring.jpa.show-sql=false
spring.jpa.properties.hibernate.format_sql=false

spring.jpa.hibernate.use-new-id-generator-mappings=true
```
55 changes: 55 additions & 0 deletions docs/GETTINGSTARTED.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Getting Started

## Requirements

* Java 8 (note that ONLY Java 8 is supported at this time)

## Running

There are currently 2 ways to run the application:

1. As an executable
1. deployed in a Java Servlet 3.0 container

Note that some features require encoded slashes in the URL. In tomcat (which is embedded in the war), this can be
allowed with:

```
-Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true
```

In Apache HTTPD, you'll need something like:

```
<VirtualHost *:80>
AllowEncodedSlashes NoDecode
ServerName shibui.unicon.net
ProxyPass / http://localhost:8080/ nocanon
ProxyPassReverse / http://localhost:8080/
</VirtualHost>
```

Note the `AllowEncodedSlashes NoDecode`.

### Running as an executable

`java -jar shibui.war`

For complete information on overriding default configuration, see [https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html].

### Deploying as a WAR

The application can be deployed as a WAR file in a Java Servlet 3.0 container. Currently, the application must be run in the root context.

To override default configuration, see [https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html].
The easiest way to do this in a servlet container is through the use of system properties

## Authentication

Currently, the application is wired with very simple authentication. A password for the user `user`
can be set with the `shibui.default-password` property. If none is set, a default password
will be generated and logged:

```
Using default security password: a3d9ab96-9c63-414f-b199-26fcf59e1ffa
```
6 changes: 6 additions & 0 deletions docs/HOME.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Shibboleth UI

* [DATABASE]
* [CUSTOMIZATIONS]
* [INTERNATIONALIZATION]
* [DATABASE]
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name=shibui
group=edu.internet2.tier.shibboleth.admin.ui
version=1.0.1-SNAPSHOT
version=1.0.4-SNAPSHOT

shibboleth.version=3.4.0
opensaml.version=3.4.0
Expand Down
7 changes: 2 additions & 5 deletions pac4j-module/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ sourceCompatibility = 1.8
targetCompatibility = 1.8

repositories {
maven () {
url 'https://oss.sonatype.org/content/groups/public'
}
jcenter()
maven {
url 'https://build.shibboleth.net/nexus/content/groups/public'
Expand All @@ -36,8 +33,8 @@ dependencies {
compileOnly project(':backend')

compile "org.pac4j:spring-security-pac4j:4.0.0"
compile "org.pac4j:pac4j-core:3.3.0-SNAPSHOT"
compile "org.pac4j:pac4j-saml:3.3.0-SNAPSHOT", {
compile "org.pac4j:pac4j-core:3.3.0"
compile "org.pac4j:pac4j-saml:3.3.0", {
// opensaml libraries are provided
exclude group: 'org.opensaml'
}
Expand Down

0 comments on commit 61aec76

Please sign in to comment.