Skip to content

Commit

Permalink
Merge pull request #6 from lime-company/develop
Browse files Browse the repository at this point in the history
Changes for current version of Docker deployment for 2017.11
  • Loading branch information
Petr Dvořák authored Nov 28, 2017
2 parents 8bd3e28 + 5c3ca5f commit e370b74
Show file tree
Hide file tree
Showing 38 changed files with 723 additions and 342 deletions.
4 changes: 4 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ POWERAUTH_MYSQL_PASSWORD=root
# Configuration for MySQL database related to PowerAuth 2.0 Push Server
POWERAUTH_PUSH_MYSQL_PATH=/var/lib/powerauth/mysql-push
POWERAUTH_PUSH_MYSQL_PASSWORD=root

# Configuration for MySQL database related to PowerAuth 2.0 Web Flow Server
POWERAUTH_WEBFLOW_MYSQL_PATH=/var/lib/powerauth/mysql-webflow
POWERAUTH_WEBFLOW_MYSQL_PASSWORD=root
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
**/.DS_Store
**/build
**/deploy/conf/*.xml
**/deploy/images/*.war
**/deploy/lib/*.jar
136 changes: 4 additions & 132 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,140 +2,12 @@

# Docker Images for PowerAuth 2.0

## Prerequisites
You can run the whole PowerAuth software stack in Docker easily. Please follow our [Getting Started Guide](https://github.com/lime-company/powerauth-docker/wiki/Getting-Started).

- **Docker.** (version 17.3.1+) Obviously, you need Docker to use our Docker images. :-) Docker is easy to install, follow the [official documentation](https://docs.docker.com/engine/getstarted/step_one/).
- **Docker Copose.** (version 1.11.2+) Compose is an extension to Docker that simplifies container image deployment and configuration management.
- **Unix-based operating system.** While our software can run in Windows as well, we optimized our scripts for Linux / Unix environment. We proudly build all our packages on Mac OS X.
## Supported Technologies

## Turbo Start

Navigate into a folder where you can have the git repository cloned (or `$ cd /tmp` for testing) and run:

```sh
$ bash <(curl -fsSL https://git.io/vSogp)
```

## Step By Step

To install PowerAuth 2.0 in your Docker instance, perform following steps:

### 1. Clone the Repository

```sh
$ git clone https://github.com/lime-company/lime-security-powerauth-docker.git
```

### 2. Configure Build Properties

_(Optional)_

If you don't not do anything with the configuration, everything will just work on your local machine.

Each application has a `conf` folder, where you can configure properties for your particular instance. See the documentation of the respective applications to learn about the meaning of properties:

- [PowerAuth 2.0 Server](https://github.com/lime-company/lime-security-powerauth/wiki/Deploying-PowerAuth-2.0-Server)
- [PowerAuth 2.0 Admin](https://github.com/lime-company/lime-security-powerauth-admin/wiki/Deploying-PowerAuth-2.0-Admin)

### 3. Build Docker Images

Run `build.sh` command from the root of the repository, wait for the images to be built.

```sh
$ cd lime-security-powerauth-docker
$ sh build.sh
```

### 4. Edit `.env` File

You can change properties of the Docker image execution by editing environment variables. Open `.env` file and edit the values for variables.

### 5. Run Images

Run Docker Compose in the root folder:

```sh
$ docker-compose up -d
```

See `docker-compose.yml` for the default configuration.

## Default Configuration

If you didn't change the default application settings, everything should just work.

### Application Configuration

Following configuration is used by default:

#### MySQL DB for PowerAuth Server

- New MySQL image will be created, with a default PowerAuth 2.0 Server DB schema in place.
- Two users are created: "root"/"root" and "powerauth" with no password.
- Database files are created in `/tmp/mysql-powerauth` folder by default.
- To connect to database from the host:
- URL: `jdbc:mysql://localhost:23316/powerauth`
- Username: `powerauth`
- Password: _no password_
- To connect to database from Docker container:
- URL: `jdbc:mysql://powerauth-mysql:3306/powerauth`
- Username: `powerauth`
- Password: _no password_

#### MySQL DB for Push Server

- New MySQL image will be created, with a default PowerAuth 2.0 Push Server DB schema in place.
- Two users are created: "root"/"root" and "powerauth" with no password.
- Database files are created in `/tmp/mysql-push` folder by default.
- To connect to database from the host:
- URL: `jdbc:mysql://localhost:23336/powerauth`
- Username: `powerauth`
- Password: _no password_
- To connect to database from Docker container:
- URL: `jdbc:mysql://powerauth-push-mysql:3306/powerauth`
- Username: `powerauth`
- Password: _no password_

#### PowerAuth 2.0 Server

- SOAP / REST service are not be secured by any integration credentials.
- Database connectivity points to the MySQL instance in the docker image.
- Default application name "powerauth" and display name "PowerAuth 2.0 Server" will be used.
- Access the SOAP service WSDL from the host here:
- http://localhost:20010/powerauth-java-server/soap/service.wsdl
- No credentials are required by default.
- Access the SOAP service WSDL from Docker container here:
- http://powerauth-java-server:8080/powerauth-java-server/soap/service.wsdl
- No credentials are required by default.

#### PowerAuth 2.0 Admin

- Admin will point to the PowerAuth 2.0 Server Docker instance.
- No security credentials will be configured.
- Admin will be secured using a static LDAP file, with a single "admin"/"admin" user (see `ldap-local.ldiff`).
- Admin will not accept invalid SSL certificates.
- Access the Admin application from host here:
- http://localhost:20020/powerauth-admin
- Use `admin` user with password `admin`

#### PowerAuth 2.0 Push Server

- Push Server will point to the PowerAuth 2.0 Server Docker instance.
- No security credentials will be configured.
- Access the Push Server application from host here:
- http://localhost:20030/powerauth-push-server

### Default Port Mapping

Following mappings are used when mapping container ports to host ports:

| Application Name | Application Image Name | Application Port | Database Image Name | Database Port |
|---------------------------|------------------------|------------------|----------------------|---------------|
| PowerAuth 2.0 Server | powerauth-java-server | 20010:8080 | powerauth-mysql | 23316:3306 |
| PowerAuth 2.0 Admin | powerauth-admin | 20020:8080 | - | - |
| PowerAuth 2.0 Push Server | powerauth-push-server | 20030:8080 | powerauth-push-mysql | 23336:3306 |
| PowerAuth 2.0 RESTful API | powerauth-rest-api | 18080:8080 | - | - |
For the Docker deployment, we currently support only base technologies - Docker and Docker Compose. For advanced deployments and other technologies (such as Kubernetes), do not hesitate to contact us.

## License

All sources are licensed using Apache 2.0 license, you can use them with no restriction. If you are using PowerAuth 2.0, please let us know. We will be happy to share and promote your project.
Sources for Docker images are licensed using Apache 2.0 license, you can use them with no restriction. Please note that some of the PowerAuth components that are part of the installation are licensed under restrictive AGPL license. If you are using PowerAuth 2.0, please let us know. We will be happy to share and promote your project.
68 changes: 9 additions & 59 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,68 +2,18 @@

## Check prerequisites

if ! type "curl" > /dev/null; then
echo "Error: 'curl' command must be installed on the system.";
exit
fi

if ! type "awk" > /dev/null; then
echo "Error: 'awk' command must be installed on the system.";
exit
fi

if ! type "docker" > /dev/null; then
echo "Error: 'docker' command must be installed on the system.";
exit
fi

if ! type "docker-compose" > /dev/null; then
echo "Error: 'docker-compose' command must be installed on the system.";
exit
fi

## Make sure environment variables are correctly set

if [ -z "$PA_VERSION" ]; then
PA_VERSION="0.15.0"
fi

if [ -z "$PA_ADMIN_VERSION" ]; then
PA_ADMIN_VERSION="0.15.0"
fi

if [ -z "$PA_PUSH_VERSION" ]; then
PA_PUSH_VERSION="0.15.0-alpha"
fi

if [ -z "$PA_REST_API_VERSION" ]; then
PA_REST_API_VERSION="0.15.0"
fi

if [ -z "$MYSQL_VERSION" ]; then
MYSQL_VERSION="5.1.41"
fi

if [ -z "$ALPN_BOOT_VERSION" ]; then
ALPN_BOOT_VERSION="8.1.11.v20170118"
fi

export PA_VERSION
export PA_ADMIN_VERSION
export PA_PUSH_VERSION
export PA_REST_API_VERSION
export MYSQL_VERSION
export ALPN_BOOT_VERSION

## Launch build scripts

CURRENT_DIR=`pwd`

cd $CURRENT_DIR/docker-powerauth-mysql ; sh ./build.sh
cd $CURRENT_DIR/docker-powerauth-push-mysql ; sh ./build.sh
cd $CURRENT_DIR/docker-powerauth-java-server ; sh ./build.sh
cd $CURRENT_DIR/docker-powerauth-admin ; sh ./build.sh
cd $CURRENT_DIR/docker-powerauth-push-server ; sh ./build.sh
cd $CURRENT_DIR/docker-powerauth-rest-api ; sh ./build.sh
## Build Database Images
docker build -t powerauth-server-mysql -f docker-powerauth-server-mysql/Dockerfile .
docker build -t powerauth-push-mysql -f docker-powerauth-push-mysql/Dockerfile .
docker build -t powerauth-webflow-mysql -f docker-powerauth-webflow-mysql/Dockerfile .

cd $CURRENT_DIR/
## Build Application Images
docker build -t powerauth-server -f docker-powerauth-server/Dockerfile .
docker build -t powerauth-push-server -f docker-powerauth-push-server/Dockerfile .
docker build -t powerauth-nextstep -f docker-powerauth-nextstep/Dockerfile .
docker build -t powerauth-webflow -f docker-powerauth-webflow/Dockerfile .
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Context>

<!-- PowerAuth 2.0 Server Service URL -->
<Parameter name="powerauth.service.url" value="http://powerauth-java-server:8080/powerauth-java-server/soap"/>
<Parameter name="powerauth.service.url" value="http://localhost:8080/powerauth-java-server/soap"/>

<!-- PowerAuth 2.0 Server Service Security Settings -->
<Parameter name="powerauth.service.security.clientToken" value=""/>
Expand Down
18 changes: 18 additions & 0 deletions deploy/conf/default/powerauth-data-adapter.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<Context>

<!-- Database Configuration - JDBC -->
<Parameter name="spring.datasource.url" value="jdbc:mysql://powerauth-webflow-mysql:3306/powerauth"/>
<Parameter name="spring.datasource.username" value="powerauth"/>
<Parameter name="spring.datasource.password" value=""/>
<Parameter name="spring.datasource.driver-class-name" value="com.mysql.jdbc.Driver"/>
<Parameter name="spring.jpa.hibernate.ddl-auto" value="none"/>

<!-- SMS validity parameters -->
<Parameter name="powerauth.authorization.sms-otp.expiration-time-in-seconds" value="300"/>
<Parameter name="powerauth.authorization.sms-otp.max-verify-tries-per-message" value="5"/>

<!-- Database Configuration - JNDI -->
<!--Parameter name="spring.datasource.jndi-name" value=""/-->

</Context>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Context>

<!-- Database Configuration - JDBC -->
<Parameter name="spring.datasource.url" value="jdbc:mysql://powerauth-mysql:3306/powerauth"/>
<Parameter name="spring.datasource.url" value="jdbc:mysql://powerauth-server-mysql:3306/powerauth"/>
<Parameter name="spring.datasource.username" value="powerauth"/>
<Parameter name="spring.datasource.password" value=""/>
<Parameter name="spring.datasource.driver-class-name" value="com.mysql.jdbc.Driver"/>
Expand Down
11 changes: 11 additions & 0 deletions deploy/conf/default/powerauth-nextstep.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<Context>

<!-- Database Configuration - JDBC -->
<Parameter name="spring.datasource.url" value="jdbc:mysql://powerauth-webflow-mysql:3306/powerauth"/>
<Parameter name="spring.datasource.username" value="powerauth"/>
<Parameter name="spring.datasource.password" value=""/>
<Parameter name="spring.datasource.driver-class-name" value="com.mysql.jdbc.Driver"/>
<Parameter name="spring.jpa.hibernate.ddl-auto" value="none"/>

</Context>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Context>

<!-- PowerAuth 2.0 Server Service URL -->
<Parameter name="powerauth.service.url" value="http://powerauth-java-server:8080/powerauth-java-server/soap"/>
<Parameter name="powerauth.service.url" value="http://powerauth-server:8080/powerauth-java-server/soap"/>

<!-- PowerAuth 2.0 Server Service Security Settings -->
<Parameter name="powerauth.service.security.clientToken" value=""/>
Expand All @@ -16,6 +16,8 @@
<Parameter name="spring.datasource.driver-class-name" value="com.mysql.jdbc.Driver"/>
<Parameter name="spring.jpa.hibernate.ddl-auto" value="none"/>

<Parameter name="powerauth.push.service.apns.useDevelopment" value="true"/>

<!-- Database Configuration - JNDI -->
<!--Parameter name="spring.datasource.jndi-name" value=""/-->

Expand Down
37 changes: 37 additions & 0 deletions deploy/conf/default/powerauth-webflow.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<Context>

<!-- PowerAuth 2.0 Credential Service URL -->
<Parameter name="powerauth.credentials.service.url" value="http://powerauth-nextstep:8080/powerauth-data-adapter"/>

<!-- PowerAuth 2.0 Next Step Service URL -->
<Parameter name="powerauth.nextstep.service.url" value="http://powerauth-nextstep:8080/powerauth-nextstep"/>

<!-- PowerAuth 2.0 Server Service URL -->
<Parameter name="powerauth.service.url" value="http://powerauth-server:8080/powerauth-java-server/soap"/>

<!-- PowerAuth 2.0 Server Service Security Settings -->
<Parameter name="powerauth.service.security.clientToken" value=""/>
<Parameter name="powerauth.service.security.clientSecret" value=""/>
<Parameter name="powerauth.service.ssl.acceptInvalidSslCertificate" value="false"/>

<!-- PowerAuth 2.0 Push Server URL -->
<Parameter name="powerauth.push.service.url" value="http://powerauth-push-server:8080/powerauth-push-server"/>
<Parameter name="powerauth.push.service.appId" value="1"/>

<!-- PowerAuth 2.0 WebFlow Page Customization -->
<Parameter name="powerauth.webflow.page.title" value="PowerAuth 2.0 Web Auth"/>
<Parameter name="powerauth.webflow.page.ext-resources.location" value="classpath:/static/resources/"/>
<Parameter name="powerauth.webflow.page.custom-css.url" value=""/>

<!-- Database Configuration - JDBC -->
<Parameter name="spring.datasource.url" value="jdbc:mysql://powerauth-webflow-mysql:3306/powerauth"/>
<Parameter name="spring.datasource.username" value="powerauth"/>
<Parameter name="spring.datasource.password" value=""/>
<Parameter name="spring.datasource.driver-class-name" value="com.mysql.jdbc.Driver"/>
<Parameter name="spring.jpa.hibernate.ddl-auto" value="none"/>

<!-- Database Configuration - JNDI -->
<!--Parameter name="spring.datasource.jndi-name" value=""/-->

</Context>
3 changes: 3 additions & 0 deletions deploy/conf/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Customize application properties by editing context related XML files.

You can use files from the 'default' subfolder to bootstrap.
File renamed without changes.
Loading

0 comments on commit e370b74

Please sign in to comment.