Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Commit

Permalink
Installation (#988)
Browse files Browse the repository at this point in the history
* removing outdated 1.0 migration scripts

* Rename scripts to not imply WF11 support only

* Remove H2 deployments, those are now in docker

* standalone-ha was never supported

* Rename mysql script

* Adding standalone KC file

* Some installation docs
  • Loading branch information
matzew committed Apr 18, 2018
1 parent 9e6e9da commit 0287188
Show file tree
Hide file tree
Showing 15 changed files with 103 additions and 230 deletions.
84 changes: 84 additions & 0 deletions databases/README.md
@@ -0,0 +1,84 @@
# Install the UPS with a RDBMS

This guide explains how to configure a fresh WildFly instance and setup the database

__Perquisite:__ Make sure you have the latest version of [WildFly](http://wildfly.org/downloads/), extracted on your machine.

## Database configuration

The UPS does support two database system:

* Postgres (preferred)
* MySQL

### Postgres

You need a running database, like:

```
docker run \
-p 5432:5432 \
-e POSTGRES_PASSWORD=unifiedpush \
-e POSTGRES_USER=unifiedpush \
-e POSTGRES_DATABASE=unifiedpush \
-d postgres:9.6
```

### MySQL

You need a running database, like:

```
docker run \
-p 6306:3306 \
-e MYSQL_USER=unifiedpush \
-e MYSQL_PASSWORD=unifiedpush \
-e MYSQL_DATABASE=unifiedpush \
-e MYSQL_ROOT_PASSWORD=supersecret \
-d mysql:5.6
```

## Prepare the Wildfly server for UPS deployment

Go to your Wildfly installation and start the server, using the `standalone-full` configuration, like:

```
$WILDFLY_HOME/bin/standalone.sh -c standalone-full.xml -b 0.0.0.0
```

__NOTE:__ make sure you have the installation folder of Wildfly exported to `$WILDFLY_HOME`.

We have two shell scripts for setting up the system:

* `prepare_clean_psql_wildfly.sh`
* `prepare_clean_mysql_wildfly.sh`

Based on your database choice execute one of the scripts, like:

```
./prepare_clean_psql_wildfly.sh
```

## UPS deployment

Now the server is running and you can deploy the `WAR` file from the `servers/plain/target` folder.
This is an unprotected version of the push server.


## UPS and Keycloak

We have a Keycloak protected version of the UPS (located in `servers/keycloak/target`), which requires a separated Keycloak server.

For Keycloak we need to provide two `System Properties`:
* `ups.realm.name` - name of the realm used for UPS
* `ups.auth.server.url` - fullqualified URI of the Keycloak server

Here is how the command looks like:

```
$WILDFLY_HOME/bin/standalone.sh -c standalone-full.xml -Dups.realm.name=aerogear -Dups.auth.server.url=http://my-keycloak:PORT/auth -b 0.0.0.0
```

### Running Keycloak

In the [docker-compose](../docker-compose) folder there is a *Standalone Keycloak* section that explains details on how to run a Keycloak server.
18 changes: 0 additions & 18 deletions databases/h2-database-config-wildfly.cli

This file was deleted.

7 changes: 0 additions & 7 deletions databases/ha_deployment/deploy-managed-domain.cli

This file was deleted.

32 changes: 0 additions & 32 deletions databases/ha_deployment/mysql-database-config-wildfly-full-ha.cli

This file was deleted.

This file was deleted.

29 changes: 0 additions & 29 deletions databases/migration/README.md

This file was deleted.

8 changes: 0 additions & 8 deletions databases/migration/keycloak-migration-mysql.sql

This file was deleted.

6 changes: 0 additions & 6 deletions databases/migration/keycloak-migration-postgresql.sql

This file was deleted.

41 changes: 0 additions & 41 deletions databases/migration/ups-migration-mysql.sql

This file was deleted.

30 changes: 0 additions & 30 deletions databases/migration/ups-migration-postgresql.sql

This file was deleted.

File renamed without changes.
27 changes: 0 additions & 27 deletions databases/unifiedpush-h2-ds.xml

This file was deleted.

8 changes: 8 additions & 0 deletions docker-compose/README.md
Expand Up @@ -43,3 +43,11 @@ docker run -p 8080:8080 -it aerogear/ups:kc
```

This brings up both, Keycloak and the UPS containers. Now, go to `http://localhost:8080/` to login to the UPS!

### Standalone Keycloak

It might be handy to just run Keycloak in a Linux container, like:

```
docker-compose -f keycloak-standalone.yaml up -d
```
11 changes: 11 additions & 0 deletions docker-compose/keycloak-standalone.yaml
@@ -0,0 +1,11 @@
version: '2.1'

services:
keycloakServer:
image: docker.io/jboss/keycloak:3.4.3.Final
command: "-b 0.0.0.0 -Dkeycloak.import=/ups-keycloak-config/ups-realm-sample.json"
volumes:
- ./keycloak-realm:/ups-keycloak-config:z
environment:
KEYCLOAK_USER: ${KEYCLOAK_USER}
KEYCLOAK_PASSWORD: ${KEYCLOAK_PASSWORD}

0 comments on commit 0287188

Please sign in to comment.