OpenRIMS-RPM - Installation Part 2: Difference between revisions

From OpenRIMS Wiki
Jump to navigation Jump to search
No edit summary
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Configuring Google Authentication ==
OpenRIMS uses OATH2[1] to allow authenticate using Google login. For each deployment, the Google Authentication need to be configured separately.


= Objective =
The Google guide is available here for additional reference and detail:
              This document helps deploy Pharmadex 2 software first time, along with the demo database.


The audience of it is IT persons that are responsible to install and maintain the Pharmadex 2 software. Minimal qualification requirements are:
https://developers.google.com/identity/sign-in/web/sign-in and https://developers.google.com/adwords/api/docs/guides/authentication


·       Ability to install and configure programs and components in the selected Operation System.
Here are the steps to perform:


·       The MySQL knowledge.
# Use a Google account to access the Google Cloud Console
 
# Create a Project unless you already have one
== Pre-conditions ==
# Access APIs & Services for that Project
              Regardless of deployment configuration selected, the following pre-conditions should be fulfilled:
# Navigate to Credentials
 
# Create Oauth Client ID
·       At least 2 GB of free RAM
# Choose Web Application
 
# Add Authorized Redirection URI e.g. <code>https://openrims.msh.org/login/oauth2/code/google</code>
·       At least 10GB of free SDD/HDD
# After clicking Create a Client Secret and a Client ID will be created. You need both for the below configuration of OpenRIMS.
 
·       Operation Systems:
 
o  Windows Server 2016 and above
 
o  Windows 10
 
o  Linux, released after 2018. Tested on Ubuntu 18.04.4 LTS and above
 
·       MySQL R 5.7
 
o  Server
 
o  Workbench
 
·       Oracle Java JDK 1.8. OpenJDK 1.8 has been tested on Linux Ubuntu, but not Windows
 
·       Internet connection. Properties of it should suit minimal requirements for Google Mail
 
·       Binary Pharmadex 2 distribution (see below)
 
·       Pharmadex 2 demo database (<nowiki>https://github.com/MSH/Pharmadex2/tree/main/database</nowiki>[1])
 
·       The own, private Google Mail account
 
== Pharmadex 2 binary distribution ==
The possibility to build the Pharmadex 2 software directly from the source codes is possible, however is not covered by this document. However, this manual describes deployment from the binary distribution. For current, the MSH staff may get this distribution from the corporative GitHub, address is
 
              The descriptions of binary components may be found in the respective file README.md
 
= Steps to deploy =
 
== Prepare to install ==
1.      Install using the vendor’s deployment manual:
 
1.1.   MySQL
 
1.2.   Java JDK 1.8
 
2.      Restore the demo database to MySQL using MySQL Workbench or the command line
 
3.      Copy the binary application pharmadex2-0.0.1.jar  and application.properties to the dedicated folder, e.g. applications/pharmadex2
 
== Configure ==
 
== Local TCP/IP port ==
In the application.properties file edit the values marked bold (if it will be necessary):
 
=== Database ===
              In the application.properties file edit the values marked bold:
 
spring.datasource.url = jdbc:mysql://localhost/pdx2?useSSL=false&useUnicode=yes&characterEncoding=UTF-8&characterSetResults=UTF-8&'''serverTimezone=Europe/Kiev'''
 
spring.datasource.username = '''username'''
 
spring.datasource.password = '''password'''
 
=== Logs ===
              In the application.properties file edit the values marked bold:
 
logging.file.path=/'''home/alexk/pharmadex/log'''
 
the good choice is:
 
'''logging.file.path= ./log/'''




After configuration it will be necessary to copy Client ID and Client secret to the application.properties
After configuration it will be necessary to copy Client ID and Client secret to the application.properties


<nowiki>##</nowiki> OATH2
<code>## OATH2</code>
 
spring.security.oauth2.client.registration.google.client-id=client_id
 
spring.security.oauth2.client.registration.google.client-secret=client_secret
 
== Install as a service ==
              For Linux the official guide is here <nowiki>https://docs.spring.io/spring-boot/docs/current/reference/html/deployment.html#deployment.installing.nix-services.system-d</nowiki>
 
              For Windows the official guide is here <nowiki>https://docs.spring.io/spring-boot/docs/current/reference/html/deployment.html#deployment.installing.windows-services</nowiki>
 
              Examples of the configurations are in the binary distributive. The folders are “windows” and “Linux”.
 
== Provide access from the Internet ==
              To provide access from the Internet it will be a good idea to establish a proxy gateway like Nginx or Apache2. The example of virtual server configuration for Apache 2 is in the binary distributive, folder “Linux”.
 
 
Configuring Google Authentication
 
LINK: See '''Configuring Google Authentication for Pharmadex 2'''


== Special Configuration ==
<code>spring.security.oauth2.client.registration.google.client-id=client_id</code>
LINK: See '''IIS as a gateway for Spring Boot application'''


<code>spring.security.oauth2.client.registration.google.client-secret=client_secret</code>


----[1] For current, available only to MSH staff
{|
!Go Back to Part 1: [[OpenRIMS - Installation Part 1]]
!
!
!Move Forward to Part 3: [[OpenRIMS - Installation Part 3]]
|}

Latest revision as of 20:04, 14 August 2023

Configuring Google Authentication

OpenRIMS uses OATH2[1] to allow authenticate using Google login. For each deployment, the Google Authentication need to be configured separately.

The Google guide is available here for additional reference and detail:

https://developers.google.com/identity/sign-in/web/sign-in and https://developers.google.com/adwords/api/docs/guides/authentication

Here are the steps to perform:

  1. Use a Google account to access the Google Cloud Console
  2. Create a Project unless you already have one
  3. Access APIs & Services for that Project
  4. Navigate to Credentials
  5. Create Oauth Client ID
  6. Choose Web Application
  7. Add Authorized Redirection URI e.g. https://openrims.msh.org/login/oauth2/code/google
  8. After clicking Create a Client Secret and a Client ID will be created. You need both for the below configuration of OpenRIMS.


After configuration it will be necessary to copy Client ID and Client secret to the application.properties

## OATH2

spring.security.oauth2.client.registration.google.client-id=client_id

spring.security.oauth2.client.registration.google.client-secret=client_secret

Go Back to Part 1: OpenRIMS - Installation Part 1 Move Forward to Part 3: OpenRIMS - Installation Part 3