diff --git a/.env b/.env index 4daa478..94c0cf9 100644 --- a/.env +++ b/.env @@ -1,3 +1,13 @@ +# Java options +POWERAUTH_JAVA_OPTS=-XX:+UseG1GC -XX:+UseStringDeduplication + +# Memory settings +POWERAUTH_SERVER_MEMORY_LIMIT=800m +PUSH_SERVER_MEMORY_LIMIT=750m +NEXTSTEP_MEMORY_LIMIT=700m +WEBFLOW_MEMORY_LIMIT=800m +DATA_ADAPTER_MEMORY_LIMIT=700m + # Configuration for MySQL database related to PowerAuth Server POWERAUTH_MYSQL_PATH=/var/lib/powerauth/mysql POWERAUTH_MYSQL_PASSWORD=root @@ -55,6 +65,7 @@ POWERAUTH_ADMIN_LOGGING= # Configuration for Push Server PUSH_SERVER_POWERAUTH_SERVICE_URL=http://powerauth-server:8080/powerauth-java-server/soap +PUSH_SERVER_PUSH_SERVICE_URL=http://powerauth-push-server:8080/powerauth-push-server PUSH_SERVER_SECURITY_CLIENT_TOKEN= PUSH_SERVER_SECURITY_CLIENT_SECRET= PUSH_SERVER_ACCEPT_INVALID_SSL_CERTIFICATE=false @@ -81,6 +92,7 @@ PUSH_SERVER_FCM_PROXY_PASSWORD= PUSH_SERVER_FCM_DATA_NOTIFICATION_ONLY=false PUSH_SERVER_DATASOURCE_JNDI_NAME=false PUSH_SERVER_CAMPAIGN_BATCH_SIZE=100000 +PUSH_SERVER_MESSAGE_STORAGE_ENABLED=false PUSH_SERVER_SPRING_BATCH_JOB_ENABLED=false PUSH_SERVER_SPRING_JMX_ENABLED=false PUSH_SERVER_FCM_CONNECT_TIMEOUT=5000 diff --git a/deploy/conf/default/powerauth-push-server.xml b/deploy/conf/default/powerauth-push-server.xml index 1555b9a..8e094e3 100644 --- a/deploy/conf/default/powerauth-push-server.xml +++ b/deploy/conf/default/powerauth-push-server.xml @@ -4,6 +4,9 @@ + + + @@ -46,6 +49,9 @@ + + + diff --git a/deploy/data/mysql/powerauth-push-server.sql b/deploy/data/mysql/powerauth-push-server.sql index e0d6b0d..4c7be8e 100644 --- a/deploy/data/mysql/powerauth-push-server.sql +++ b/deploy/data/mysql/powerauth-push-server.sql @@ -15,11 +15,10 @@ CREATE TABLE `push_app_credentials` ( `ios_team_id` varchar(255) DEFAULT NULL, `ios_key_id` varchar(255) DEFAULT NULL, `ios_bundle` varchar(255) DEFAULT NULL, - `android_server_key` text DEFAULT NULL, - `android_bundle` varchar(255) DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `app_id_index` (`app_id`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; + `android_private_key` blob DEFAULT NULL, + `android_project_id` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; CREATE TABLE `push_device_registration` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -30,13 +29,8 @@ CREATE TABLE `push_device_registration` ( `push_token` varchar(255) NOT NULL, `timestamp_last_registered` DATETIME NOT NULL, `is_active` int(1) DEFAULT 0, - `encryption_key` text DEFAULT NULL, - `encryption_key_index` text DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `activation_id_index` (`activation_id`), - KEY `user_id_index` (`user_id`), - KEY `app_id_index` (`app_id`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; CREATE TABLE `push_message` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -45,15 +39,13 @@ CREATE TABLE `push_message` ( `activation_id` varchar(37) DEFAULT NULL, `is_silent` int(1) DEFAULT 0, `is_personal` int(1) DEFAULT 0, - `is_encrypted` int(1) DEFAULT 0, `message_body` text NOT NULL, `timestamp_created` DATETIME NOT NULL, `status` int(1) NOT NULL, - PRIMARY KEY (`id`), - KEY `user_id_index` (`user_id`,`activation_id`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; -CREATE TABLE push_campaign ( +CREATE TABLE `push_campaign` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `app_id` bigint(20) NOT NULL, `message` text NOT NULL, @@ -62,12 +54,29 @@ CREATE TABLE push_campaign ( `timestamp_sent` DATETIME DEFAULT NULL, `timestamp_completed` DATETIME DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=1 CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; -CREATE TABLE push_campaign_user ( +CREATE TABLE `push_campaign_user` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `campaign_id` bigint(20) NOT NULL, `user_id` varchar(255) NOT NULL, `timestamp_created` DATETIME NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=1 CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- +-- Indexes for better performance. +-- + +CREATE UNIQUE INDEX `push_app_cred_app` ON `push_app_credentials`(`app_id`); + +CREATE INDEX `push_device_app_token` ON `push_device_registration`(`app_id`, `push_token`); +CREATE INDEX `push_device_user_app` ON `push_device_registration`(`user_id`, `app_id`); +CREATE INDEX `push_device_activation` ON `push_device_registration`(`activation_id`); + +CREATE INDEX `push_message_status` ON `push_message`(`status`); + +CREATE INDEX `push_campaign_sent` ON `push_campaign`(`is_sent`); + +CREATE INDEX `push_campaign_user_campaign` ON `push_campaign_user`(`campaign_id`, `user_id`); +CREATE INDEX `push_campaign_user_detail` ON `push_campaign_user`(`user_id`); diff --git a/deploy/data/mysql/powerauth-server.sql b/deploy/data/mysql/powerauth-server.sql index 07dd783..7d649b8 100644 --- a/deploy/data/mysql/powerauth-server.sql +++ b/deploy/data/mysql/powerauth-server.sql @@ -16,7 +16,7 @@ CREATE TABLE `pa_application` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=1 CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; CREATE TABLE `pa_application_version` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -26,10 +26,8 @@ CREATE TABLE `pa_application_version` ( `application_secret` varchar(255) DEFAULT NULL, `supported` int(11) DEFAULT NULL, PRIMARY KEY (`id`), - KEY `KEY_APPLICATION_ID` (`application_id`), - KEY `KEY_APPLICATION_KEY` (`application_key`), CONSTRAINT `FK_APPLICATION_VERSION` FOREIGN KEY (`application_id`) REFERENCES `pa_application` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=1 CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; -- -- Create table for application related master keypair @@ -43,9 +41,8 @@ CREATE TABLE `pa_master_keypair` ( `master_key_public_base64` varchar(255) NOT NULL, `timestamp_created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), - KEY `FK_APPLICATION_KEYPAIR_idx` (`application_id`), CONSTRAINT `FK_APPLICATION_KEYPAIR` FOREIGN KEY (`application_id`) REFERENCES `pa_application` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=1 CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; -- -- Create table for activation records @@ -53,8 +50,7 @@ CREATE TABLE `pa_master_keypair` ( CREATE TABLE `pa_activation` ( `activation_id` varchar(37) NOT NULL, - `activation_id_short` varchar(255) NOT NULL, - `activation_otp` varchar(255) NOT NULL, + `activation_code` varchar(255), `activation_status` int(11) NOT NULL, `blocked_reason` varchar(255) DEFAULT NULL, `activation_name` varchar(255) DEFAULT NULL, @@ -62,6 +58,7 @@ CREATE TABLE `pa_activation` ( `user_id` varchar(255) NOT NULL, `extras` text, `counter` bigint(20) NOT NULL, + `ctr_data` varchar(255), `device_public_key_base64` text, `failed_attempts` bigint(20) DEFAULT NULL, `max_failed_attempts` bigint(20) NOT NULL DEFAULT 5, @@ -72,10 +69,12 @@ CREATE TABLE `pa_activation` ( `timestamp_created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `timestamp_activation_expire` datetime NOT NULL, `timestamp_last_used` datetime NOT NULL, + `timestamp_last_change` datetime, + `version` int(2) DEFAULT 2, PRIMARY KEY (`activation_id`), - KEY `FK_ACTIVATION_APPLICATION_idx` (`application_id`), - CONSTRAINT `FK_ACTIVATION_APPLICATION` FOREIGN KEY (`application_id`) REFERENCES `pa_application` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION -) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CONSTRAINT `FK_ACTIVATION_APPLICATION` FOREIGN KEY (`application_id`) REFERENCES `pa_application` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT `FK_ACTIVATION_KEYPAIR` FOREIGN KEY (`master_keypair_id`) REFERENCES `pa_master_keypair` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION +) ENGINE=InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; -- -- Create a table for signature audits @@ -85,6 +84,7 @@ CREATE TABLE `pa_signature_audit` ( `id` int(11) NOT NULL AUTO_INCREMENT, `activation_id` varchar(37) NOT NULL, `activation_counter` bigint(20) NOT NULL, + `activation_ctr_data` varchar(255), `activation_status` int(11) NOT NULL, `additional_info` varchar(255) DEFAULT NULL, `data_base64` text, @@ -93,10 +93,10 @@ CREATE TABLE `pa_signature_audit` ( `valid` int(11) NOT NULL DEFAULT 0, `note` text NOT NULL, `timestamp_created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + `version` int(2) DEFAULT 2, PRIMARY KEY (`id`), - KEY `K_ACTIVATION_ID` (`activation_id`), CONSTRAINT `FK_ACTIVATION_ID` FOREIGN KEY (`activation_id`) REFERENCES `pa_activation` (`activation_id`) ON DELETE CASCADE ON UPDATE NO ACTION -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=1 CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; -- -- Create a table for integration credentials @@ -108,7 +108,7 @@ CREATE TABLE `pa_integration` ( `client_token` varchar(37) DEFAULT NULL, `client_secret` varchar(37) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; -- -- Create a table for callback URLs @@ -119,23 +119,23 @@ CREATE TABLE `pa_application_callback` ( `application_id` bigint(20) NOT NULL, `name` varchar(255) DEFAULT NULL, `callback_url` text NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; + PRIMARY KEY (`id`), + CONSTRAINT `FK_APPLICATION_CALLBACK` FOREIGN KEY (`application_id`) REFERENCES `pa_application` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION +) ENGINE=InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; -- -- Create a table for tokens -- CREATE TABLE pa_token ( - `token_id` VARCHAR(37) NOT NULL, - `token_secret` VARCHAR(255) NOT NULL, - `activation_id` VARCHAR(37) NOT NULL, - `signature_type` VARCHAR(255) NOT NULL, - `timestamp_created` DATETIME NOT NULL, + `token_id` VARCHAR(37) NOT NULL, + `token_secret` VARCHAR(255) NOT NULL, + `activation_id` VARCHAR(37) NOT NULL, + `signature_type` VARCHAR(255) NOT NULL, + `timestamp_created` DATETIME NOT NULL, PRIMARY KEY (`token_id`), - KEY `K_TOKEN_ACTIVATION_ID` (`activation_id`), CONSTRAINT `FK_TOKEN_ACTIVATION_ID` FOREIGN KEY (`activation_id`) REFERENCES `pa_activation` (`activation_id`) ON DELETE CASCADE ON UPDATE NO ACTION -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; -- -- Create table for activation changes @@ -147,6 +147,23 @@ CREATE TABLE `pa_activation_history` ( `activation_status` int(11) NOT NULL, `timestamp_created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), - KEY `K_HISTORY_ACTIVATION_ID` (`activation_id`), CONSTRAINT `FK_HISTORY_ACTIVATION_ID` FOREIGN KEY (`activation_id`) REFERENCES `pa_activation` (`activation_id`) ON DELETE CASCADE ON UPDATE NO ACTION -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=1 CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- +-- Indexes for better performance. InnoDB engine creates indexes on foreign keys automatically, so they are not included. +-- + +CREATE INDEX `pa_activation_code` ON `pa_activation`(`activation_code`); + +CREATE INDEX `pa_activation_user_id` ON `pa_activation`(`user_id`); + +CREATE INDEX `pa_activation_history_created` ON `pa_activation_history`(`timestamp_created`); + +CREATE UNIQUE INDEX `pa_app_version_app_key` ON `pa_application_version`(`application_key`); + +CREATE INDEX `pa_app_callback_app` ON `pa_application_callback`(`application_id`); + +CREATE UNIQUE INDEX `pa_integration_token` ON `pa_integration`(`client_token`); + +CREATE INDEX `pa_signature_audit_created` ON `pa_signature_audit`(`timestamp_created`); diff --git a/docker-compose-pa-all.yml b/docker-compose-pa-all.yml index c85b1df..3a7c520 100644 --- a/docker-compose-pa-all.yml +++ b/docker-compose-pa-all.yml @@ -55,6 +55,7 @@ services: container_name: powerauth-server ports: - "20010:8080" + mem_limit: ${POWERAUTH_SERVER_MEMORY_LIMIT} healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8080/powerauth-java-server"] interval: 10s @@ -100,6 +101,7 @@ services: - POWERAUTH_ADMIN_APPLICATION_DISPLAY_NAME=${POWERAUTH_ADMIN_APPLICATION_DISPLAY_NAME} - POWERAUTH_ADMIN_APPLICATION_ENVIRONMENT=${POWERAUTH_ADMIN_APPLICATION_ENVIRONMENT} - POWERAUTH_ADMIN_LOGGING=${POWERAUTH_ADMIN_LOGGING} + - JAVA_OPTS=${POWERAUTH_JAVA_OPTS} depends_on: powerauth-mysql: condition: service_healthy @@ -110,6 +112,7 @@ services: container_name: powerauth-push-server ports: - "20030:8080" + mem_limit: ${PUSH_SERVER_MEMORY_LIMIT} healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8080/powerauth-push-server"] interval: 10s @@ -117,6 +120,7 @@ services: retries: 30 environment: - PUSH_SERVER_POWERAUTH_SERVICE_URL=${PUSH_SERVER_POWERAUTH_SERVICE_URL} + - PUSH_SERVER_PUSH_SERVICE_URL=${PUSH_SERVER_PUSH_SERVICE_URL} - PUSH_SERVER_SECURITY_CLIENT_TOKEN=${PUSH_SERVER_SECURITY_CLIENT_TOKEN} - PUSH_SERVER_SECURITY_CLIENT_SECRET=${PUSH_SERVER_SECURITY_CLIENT_SECRET} - PUSH_SERVER_ACCEPT_INVALID_SSL_CERTIFICATE=${PUSH_SERVER_ACCEPT_INVALID_SSL_CERTIFICATE} @@ -143,6 +147,7 @@ services: - PUSH_SERVER_FCM_DATA_NOTIFICATION_ONLY=${PUSH_SERVER_FCM_DATA_NOTIFICATION_ONLY} - PUSH_SERVER_DATASOURCE_JNDI_NAME=${PUSH_SERVER_DATASOURCE_JNDI_NAME} - PUSH_SERVER_CAMPAIGN_BATCH_SIZE=${PUSH_SERVER_CAMPAIGN_BATCH_SIZE} + - PUSH_SERVER_MESSAGE_STORAGE_ENABLED=${PUSH_SERVER_MESSAGE_STORAGE_ENABLED} - PUSH_SERVER_SPRING_BATCH_JOB_ENABLED=${PUSH_SERVER_SPRING_BATCH_JOB_ENABLED} - PUSH_SERVER_SPRING_JMX_ENABLED=${PUSH_SERVER_SPRING_JMX_ENABLED} - PUSH_SERVER_FCM_CONNECT_TIMEOUT=${PUSH_SERVER_FCM_CONNECT_TIMEOUT} @@ -151,6 +156,7 @@ services: - PUSH_SERVER_APPLICATION_DISPLAY_NAME=${PUSH_SERVER_APPLICATION_DISPLAY_NAME} - PUSH_SERVER_APPLICATION_ENVIRONMENT=${PUSH_SERVER_APPLICATION_ENVIRONMENT} - PUSH_SERVER_LOGGING=${PUSH_SERVER_LOGGING} + - JAVA_OPTS=${POWERAUTH_JAVA_OPTS} depends_on: powerauth-push-mysql: condition: service_healthy @@ -163,6 +169,7 @@ services: container_name: powerauth-nextstep ports: - "13010:8080" + mem_limit: ${NEXTSTEP_MEMORY_LIMIT} healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8080/powerauth-nextstep"] interval: 10s @@ -185,6 +192,7 @@ services: - NEXTSTEP_APPLICATION_DISPLAY_NAME=${NEXTSTEP_APPLICATION_DISPLAY_NAME} - NEXTSTEP_APPLICATION_ENVIRONMENT=${NEXTSTEP_APPLICATION_ENVIRONMENT} - NEXTSTEP_LOGGING=${NEXTSTEP_LOGGING} + - JAVA_OPTS=${POWERAUTH_JAVA_OPTS} depends_on: powerauth-webflow-mysql: condition: service_healthy @@ -195,6 +203,7 @@ services: container_name: powerauth-data-adapter ports: - "13050:8080" + mem_limit: ${DATA_ADAPTER_MEMORY_LIMIT} healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8080/powerauth-data-adapter"] interval: 10s @@ -218,6 +227,7 @@ services: - DATA_ADAPTER_APPLICATION_DISPLAY_NAME=${DATA_ADAPTER_APPLICATION_DISPLAY_NAME} - DATA_ADAPTER_APPLICATION_ENVIRONMENT=${DATA_ADAPTER_APPLICATION_ENVIRONMENT} - DATA_ADAPTER_LOGGING=${DATA_ADAPTER_LOGGING} + - JAVA_OPTS=${POWERAUTH_JAVA_OPTS} depends_on: powerauth-webflow-mysql: condition: service_healthy @@ -228,6 +238,7 @@ services: container_name: powerauth-webflow ports: - "13030:8080" + mem_limit: ${WEBFLOW_MEMORY_LIMIT} healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8080/powerauth-webflow"] interval: 10s @@ -260,6 +271,7 @@ services: - WEBFLOW_APPLICATION_DISPLAY_NAME=${WEBFLOW_APPLICATION_DISPLAY_NAME} - WEBFLOW_APPLICATION_ENVIRONMENT=${WEBFLOW_APPLICATION_ENVIRONMENT} - WEBFLOW_LOGGING=${WEBFLOW_LOGGING} + - JAVA_OPTS=${POWERAUTH_JAVA_OPTS} depends_on: powerauth-webflow-mysql: condition: service_healthy diff --git a/docker-compose.yml b/docker-compose.yml index 2a80f9a..2a5facd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -39,6 +39,7 @@ services: container_name: powerauth-server ports: - "20010:8080" + mem_limit: ${POWERAUTH_SERVER_MEMORY_LIMIT} healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8080/powerauth-java-server"] interval: 10s @@ -84,6 +85,7 @@ services: - POWERAUTH_ADMIN_APPLICATION_DISPLAY_NAME=${POWERAUTH_ADMIN_APPLICATION_DISPLAY_NAME} - POWERAUTH_ADMIN_APPLICATION_ENVIRONMENT=${POWERAUTH_ADMIN_APPLICATION_ENVIRONMENT} - POWERAUTH_ADMIN_LOGGING=${POWERAUTH_ADMIN_LOGGING} + - JAVA_OPTS=${POWERAUTH_JAVA_OPTS} depends_on: powerauth-mysql: condition: service_healthy @@ -94,6 +96,7 @@ services: container_name: powerauth-push-server ports: - "20030:8080" + mem_limit: ${PUSH_SERVER_MEMORY_LIMIT} healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8080/powerauth-push-server"] interval: 10s @@ -101,6 +104,7 @@ services: retries: 30 environment: - PUSH_SERVER_POWERAUTH_SERVICE_URL=${PUSH_SERVER_POWERAUTH_SERVICE_URL} + - PUSH_SERVER_PUSH_SERVICE_URL=${PUSH_SERVER_PUSH_SERVICE_URL} - PUSH_SERVER_SECURITY_CLIENT_TOKEN=${PUSH_SERVER_SECURITY_CLIENT_TOKEN} - PUSH_SERVER_SECURITY_CLIENT_SECRET=${PUSH_SERVER_SECURITY_CLIENT_SECRET} - PUSH_SERVER_ACCEPT_INVALID_SSL_CERTIFICATE=${PUSH_SERVER_ACCEPT_INVALID_SSL_CERTIFICATE} @@ -127,6 +131,7 @@ services: - PUSH_SERVER_FCM_DATA_NOTIFICATION_ONLY=${PUSH_SERVER_FCM_DATA_NOTIFICATION_ONLY} - PUSH_SERVER_DATASOURCE_JNDI_NAME=${PUSH_SERVER_DATASOURCE_JNDI_NAME} - PUSH_SERVER_CAMPAIGN_BATCH_SIZE=${PUSH_SERVER_CAMPAIGN_BATCH_SIZE} + - PUSH_SERVER_MESSAGE_STORAGE_ENABLED=${PUSH_SERVER_MESSAGE_STORAGE_ENABLED} - PUSH_SERVER_SPRING_BATCH_JOB_ENABLED=${PUSH_SERVER_SPRING_BATCH_JOB_ENABLED} - PUSH_SERVER_SPRING_JMX_ENABLED=${PUSH_SERVER_SPRING_JMX_ENABLED} - PUSH_SERVER_FCM_CONNECT_TIMEOUT=${PUSH_SERVER_FCM_CONNECT_TIMEOUT} @@ -135,6 +140,7 @@ services: - PUSH_SERVER_APPLICATION_DISPLAY_NAME=${PUSH_SERVER_APPLICATION_DISPLAY_NAME} - PUSH_SERVER_APPLICATION_ENVIRONMENT=${PUSH_SERVER_APPLICATION_ENVIRONMENT} - PUSH_SERVER_LOGGING=${PUSH_SERVER_LOGGING} + - JAVA_OPTS=${POWERAUTH_JAVA_OPTS} depends_on: powerauth-push-mysql: condition: service_healthy diff --git a/docs/Getting-Started.md b/docs/Getting-Started.md index 8181488..7e37c3c 100644 --- a/docs/Getting-Started.md +++ b/docs/Getting-Started.md @@ -57,7 +57,7 @@ docker pull powerauth/push-mysql ### 3. Configure Docker Images -If you don't do anything with the configuration, everything will just work on your local machine. However, if you need to change the Docker images (which is recommended for the production deployment), see: [Building Docker Images](./Building-Docker-Images). +If you don't do anything with the configuration, everything will just work on your local machine. However, if you need to change the Docker images (which is recommended for the production deployment), see: [Building Docker Images](./Building-Docker-Images.md). ### 4. Run @@ -94,7 +94,7 @@ After you start the Docker images, the following databases and applications are |--------------------------|------------------------------------------|----------|----------| | PowerAuth Server DB | `jdbc:mysql://localhost:23316/powerauth` | `root` | `root` | | PowerAuth Push Server DB | `jdbc:mysql://localhost:23336/powerauth` | `root` | `root` | -| PowerAuth Web Flow DB | `jdbc:mysql://localhost:23376/powerauth` | `root` | `root | +| PowerAuth Web Flow DB | `jdbc:mysql://localhost:23376/powerauth` | `root` | `root` | _Note: All databases are already created with the correct structure and contain necessary configuration._ @@ -102,11 +102,13 @@ _Note: All databases are already created with the correct structure and contain | Application | Important Paths | URL | |------------------------|-----------------------------|----------------------------------------------------------------------| -| PowerAuth Server | SOAP endpoint | http://localhost:20010/powerauth-server/soap | -| | WSDL path | http://localhost:20010/powerauth-server/soap/service.wsdl | +| PowerAuth Server | SOAP endpoint | http://localhost:20010/powerauth-java-server/soap | +| | WSDL path (v3) | http://localhost:20010/powerauth-java-server/soap/service-v3.wsdl | +| | WSDL path (v2) | http://localhost:20010/powerauth-java-server/soap/service-v2.wsdl | | PowerAuth Admin | Web GUI | http://localhost:20010/powerauth-admin | +| | Status URL | http://localhost:20010/powerauth-admin/api/service/status | | PowerAuth Push Server | Web GUI | http://localhost:20030/powerauth-push-server | -| | Status URL | http://192.168.5.107:20030/powerauth-push-server/push/service/status | +| | Status URL | http://localhost:20030/powerauth-push-server/push/service/status | | | Swagger Documentation | http://localhost:20030/powerauth-push-server/swagger-ui.html | | PowerAuth Web Flow | Base URL | http://localhost:13030/powerauth-webflow | | | Status URL | http://localhost:13030/powerauth-webflow/api/service/status | @@ -121,6 +123,36 @@ _Note: All databases are already created with the correct structure and contain | | Swagger Documentation | http://localhost:13050/powerauth-data-adapter/swagger-ui.html | | | Status URL | http://localhost:13050/powerauth-data-adapter/api/service/status | +You can verify status of PowerAuth server using POST method: + +URL: http://localhost:20010/powerauth-java-server/rest/v3/status + +Request: +```json +{} +``` + +HTTP header: +``` +Content-Type: application/json +``` + +Response: +```json +{ + "responseObject": { + "status": "OK", + "applicationName": "powerauth-server", + "applicationDisplayName": "PowerAuth Server", + "applicationEnvironment": "", + "version": "0.21.0", + "buildTime": "2019-02-05T15:50:19.948+0000", + "timestamp": "2019-02-20T13:31:32.953+0000" + }, + "status": "OK" +} +``` + ### 5. Configure System For Testing #### 5.1 Create Mobile App Credentials @@ -156,10 +188,10 @@ In order to configure APNs and FCM messages, you need to follow these steps: - Bundle ID _(note: used as the "topic")_ - APNs private key file _(note: a file with `*.p8` extension)_ - For Android, you need to obtain the following information from the [Firebase Console](): - - Package Name (as an identifier of the Android application) - - Server key _(note: the current Push Server version uses FCM legacy API - this will change in upcoming version)_ - -To test the push notifications later, you can call the following comand - don't forget to replace the `appId` and your `userId`: + - Project ID (visible in *Project Settings*) + - Private key for FCM HTTP API v1 (see [FCM documentation](https://firebase.google.com/docs/cloud-messaging/auth-server)) + +To test the push notifications later, you can call the following command - don't forget to replace the `appId` and your `userId`: ```sh curl --request POST \ @@ -168,8 +200,8 @@ curl --request POST \ --data '{ "requestObject": { "appId": 1, - "userId": "user123456", "message": { + "userId": "user123456", "attributes": { "personal": false, "silent": false