Red Hat massages management site.
This guide will be using the default settings. By using environmental variables (see below) you can easily configure the application. To run the application you'll need to download Java, PostgreSQL, Keycloak, Maven and Node.js.
5432
with username and password set to postgres
.9090
(offset 1010
). Also setup a new administrator console account.keycloak.json
file to the react-ui/public
folder.mvn clean package
to build your application.java -jar target/Massages-<VERSION>.jar db migrate config.yml
.java -jar target/Massages-<VERSION>.jar server config.yml
.http://localhost:8080
.Replace <VERSION>
with the version of your build (can be found in pom.xml
).
The application requires Keycloak server to be configured (environmental variables are supported).
In the Keycloak administration console you need to create a new realm called Massages
. In this realm 2 new authorization clients need to be created:
api-client
for server communication that has bearer-only
Access Type.ui-client
for client communication that has public
Access Type with a single Valid Redirect URI set to http://localhost:8080/*
.Then switch to the Roles tab and create 2 new roles: admin
(for administrators) and user
(for normal users).
Afterwards you can create new users with given roles in the Users tab, but before using the authentication server you need to remove SSL verification in realm's Login settings. There you can also enable other features like registration on the login page etc.
After disabling the SSL verification go back to ui-client
setup, select its Installation tab and downlaod the JSON configuration file, which you will need to configure the UI client later.
Example Keycloak realm setup with default values can be found here and should be importable to the administration console. Example client configuration JSON can be found here and should be also fully reusable in a local setup.
The application supports these environmental variables for the database:
VARIABLE | MEANING | DEFAULT VALUE |
---|---|---|
RM_DB_USERNAME | Database username | postgres |
RM_DB_PASSWORD | Database password | postgres |
RM_DB_URL | Database address | jdbc:postgresql://localhost:5432/postgres |
The application supports these environmental variables for server Keycloak configuration:
VARIABLE | MEANING | DEFAULT VALUE |
---|---|---|
KC_REALM | Keycloak realm name | massages |
KC_SERVER | Keycloak server URL | http://localhost:9090/auth |
KC_RESOURCE | Application resource name | api-client |
KC_SECRET | Keycloak secret | b4a1ee69-6441-49a0-b653-e2875234c0ef |
The application supports these environmental variables for the SMTP server:
VARIABLE | MEANING | DEFAULT VALUE |
---|---|---|
SMTP_APP_URL | Client application url | http://localhost:8080 |
SMTP_SERVER | SMTP server name | localhost |
SMTP_PORT | SMTP server port | 587 |
SMTP_USERNAME | SMTP username | – |
SMTP_PASSWORD | SMTP password | – |
SMTP_FROM_EMAIL | SMTP sender email | portal@massages.com |
SMTP_FROM_NAME | SMTP sender name | admin |
The application can be easily started using Docker using its Dockerfile. The container needs to be connected to a database to be usable, however.