Installation
Using the provided Docker images, components can be easily deployed in a local environment or on any cloud platform, such as Microsoft Azure or Amazon AWS.
Database Setup
Mobile In-App Protection backend services use a shared PostgreSQL database instance as the primary data store and a Redis instance for data caching and streaming.
PostgreSQL Setup
The Docker images automatically keep the database schema up-to-date using Liquibase. Whenever you install the application or update it to a new version, the container updates the database schema.
Install PostgreSQL
Download and install the current version of PostgreSQL:
Start the database and connect to it using your preferred database tool.
Create User
Start by creating a user in the database and by setting the user a strong password.
Tip: You can generate a strong password locally on your computer using openssl rand -base64 12.
CREATE USER username;
ALTER USER username WITH PASSWORD '$PASSWORD$';
Create Database
Now, let’s create the mlw database to which the data will be stored.
CREATE DATABASE mlw;
GRANT ALL PRIVILEGES ON DATABASE mlw TO username;
You can assign more granular privileges instead of using ALL PRIVILEGES, if required for security reasons.
Redis Setup
Download and install the current version of Redis:
and start the Redis Server.
Pull the Docker Images
To deploy the Docker image, you need to log in to our Artifactory repository and pull the Docker images:
docker login wultra.jfrog.io
docker pull wultra.jfrog.io/wultra-docker/mlw-init:${VERSION}
docker pull wultra.jfrog.io/wultra-docker/mlw-device-api:${VERSION}
docker pull wultra.jfrog.io/wultra-docker/mlw-integration-api:${VERSION}
docker pull wultra.jfrog.io/wultra-docker/mlw-console-api:${VERSION}
docker pull wultra.jfrog.io/wultra-docker/mlw-console-web:${VERSION}
Database Initialization
The mlw-init image is responsible for initializing the database schema using Liquibase. Before running this
container, set the following environment variables:
DATASOURCE_URL=jdbc:postgresql://host.docker.internal:5432/mlw
DATASOURCE_USERNAME=$USERNAME$
DATASOURCE_PASSWORD=$PASSWORD$
Note that the mlw-init container is intended for one-time execution only. It performs database initialization and then exits. It does not need to run continuously.
Running Backend Services
Once the database has been successfully initialized, start the backend services. Each component is configured
via environment variables passed to the container at startup. The backend components mlw-device-api, mlw-console-api
and mlw-integration-api share a common base configuration.
Use the Correct Database URL
Backend components use Reactive Relational Database Connectivity (R2DBC). Provide a connection string with the
r2dbc: prefix. When running locally, note that localhost inside a Docker container refers to the container
itself, not the host machine. Use host.docker.internal to reach services running on the host.
Device API
The Device API requires the following environment variables:
DATASOURCE_URL=r2dbc:postgresql://host.docker.internal:5432/mlw
DATASOURCE_USERNAME=$USERNAME$
DATASOURCE_PASSWORD=$PASSWORD$
REDIS_URL=redis://host.docker.internal:6379
See Configuration Properties for the full list of available configuration properties for the component.
Integration API
The Integration API requires the following environment variables:
DATASOURCE_URL=r2dbc:postgresql://host.docker.internal:5432/mlw
DATASOURCE_USERNAME=$USERNAME$
DATASOURCE_PASSWORD=$PASSWORD$
REDIS_URL=redis://host.docker.internal:6379
MLW_CONSOLE_URL=https://<public-url-of-console-web>
MLW_CONSOLE_URL must point to the publicly accessible URL of the Console Web frontend.
It is used to build the password reset link included in emails sent to users.
The Integration API also handles email delivery for the password reset flow. Email delivery is enabled
by default and requires Gmail API credentials to be configured. Set MLW_EMAIL_ENABLED=false to disable it. See
Configuration Properties for the full list of email properties.
See Configuration Properties for the full list of available configuration properties for the component.
Console API
The Console API requires the following environment variables:
DATASOURCE_URL=r2dbc:postgresql://host.docker.internal:5432/mlw
DATASOURCE_USERNAME=$USERNAME$
DATASOURCE_PASSWORD=$PASSWORD$
REDIS_URL=redis://host.docker.internal:6379
MLW_CONSOLE_URL=https://<public-url-of-console-web>
MLW_CSRFCOOKIEDOMAIN=<your-domain>
MLW_CONSOLE_URL must be set to the publicly accessible URL of the Console Web frontend.
MLW_CSRFCOOKIEDOMAIN sets the Domain attribute of the CSRF cookie. The cookie is always created with the
Secure=true flag. Ensure that the CORS configuration is set accordingly to allow requests from the Console Web.
MLW_ARTIFACTORYURL is optional and defaults to https://wultra.jfrog.io. Override it if SDK artifacts are hosted on a
private Artifactory instance.
See Configuration Properties for the full list of available configuration properties for the component.
Finally, start the mlw-device-api:${VERSION}, mlw-console-api:${VERSION}, mlw-integration-api:${VERSION} images.
Running Web Console
The mlw-console-web container requires the following environment variable:
API_URL=https://<console-api-host>:<port>
API_URL must point to the running mlw-console-api instance.
Start the mlw-console-web container. Once all services are running, continue to the
Configuration guide.