Guide For Deploying New Versions On Decentral Server in Production 2.1
Guide For Deploying New Versions On Decentral Server in Production 2.1
Table of Contents
1. Preparation...........................................................................................................................1
2. Deploying the Backend Application......................................................................................2
3. Deploying the Frontend Application.....................................................................................5
4. Post-Deployment Tasks.......................................................................................................5
5. Back-out Plan.......................................................................................................................6
Description of Standard Spring Boot Properties.......................................................................7
Creating an Admin User...........................................................................................................8
2. New Extract URL Setting: A new configuration has been introduced for the extract URL.
This requires specific instructions to ensure the URL is set correctly, which is crucial for
accurate data retrieval.
These updates make the installation instructions clearer and facilitate a smoother installation
process, aligned with the new functionalities and technologies.
1. Preparation
Backup:
The current backend application (.jar file): Copy the existing .jar file to a secure location.
Communication:
Inform all stakeholders about the planned deployment, including potential downtime.
Example configuration:
# DataSource Configuration
spring.datasource.url=jdbc:postgresql://localhost:5432/dbdecentral
spring.datasource.username=gnetatcivil
spring.datasource.password=xxxxxxxx
spring.jpa.show-sql=false
logging.file.name=/opt/etatcivil/decentral/logs/decentral_server.log
## Hibernate Properties
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.properties.hibernate.format_sql=false
spring.jpa.hibernate.ddl-auto=none
# Logging configuration
logging.level.org.hibernate.type=WARN
logging.level.org.hibernate.SQL=ERROR
# Server configuration
server.port=8090
jasypt.password=dav-asa-dabs-4u
spring.mvc.pathmatch.matching-strategy=ant_path_matcher
# Configuration URL extract central service
gn.gov.etatcivil.services.extracts.server.url=https://test.e-renec.gov.gn:8080/extract/
# SSL configuration
security.require-ssl=true
server.ssl.key-store=/etc/letsencrypt/live/test.e-renec.gov.gn/keystore.p12
server.ssl.key-store-password=xxcxxxxx
server.ssl.keyStoreType=PKCS12
server.ssl.keyAlias=tomcat
4. Post-Deployment Tasks
1. Checking Code Tables:
2. Clearing Local Cache on Workstations: After the installation, clear the local cache
on all workstations to prevent issues with lingering elements from the old version of
the application. This step ensures that all users have access to the latest updates
and that no outdated files cause conflicts or errors.
3. Performing tests:
o Conduct a series of tests to verify that the new versions are functioning
correctly, including functional and regression tests.
4. Monitoring:
o Closely monitor the application for any issues or performance fluctuations.
5. Communicating completion:
o Inform all stakeholders that the deployment has been successfully completed
and provide a brief summary of the changes.
Following these steps and configurations will help ensure a smooth deployment of new
versions without major disruptions. Ensure that all steps are carefully executed and maintain
good communication with all stakeholders.
Overview
To create an admin user in the system, you need to:
Insert a record into the users table, which stores user information.
Insert a corresponding record into the user_roles table, which assigns the user a role (e.g., admin
for a municipality, consulate, or court).
Key Concepts
Decentralized Creation: Admin users are created locally at each municipality, consulate, or
court.
Central Synchronization: When the central system is available, user accounts are
synchronized with the central database during login.
Password Expiration: Passwords are checked against the updated_password_date field to
determine if they have expired, based on the system’s security policy.
The user is created by inserting a new record into the users table. The user_id is generated
from a sequence (user_sequence), ensuring it’s unique. The working_place_code field
identifies the user's place of work (municipality, consulate, or court). The password is stored
as a hashed value.
Below is a sample SQL script for creating an admin user for each type of workplace:
DO $$
DECLARE
new_user_id bigint;
BEGIN
-- Generate a new user_id from the user_sequence
new_user_id := nextval('user_sequence');
Explanation of Columns
Table: users
id: A unique identifier generated by the user_sequence. It is the primary key of the table.
comment: Optional notes or comments about the user (e.g., their role or specific details
about their function).
deleted: Indicates whether the user is deleted. Set to false for active users.
enabled: Indicates if the user is active. Set to true for users who are allowed to log in.
external_id: External reference ID, such as one used by another system.
firstnames: The first names of the user.
lastname: The last name of the user.
updated_password_date: Tracks the last time the password was updated. This is used to
enforce password expiration rules.
password: The hashed password of the user. In this example, NewPass2024!-! is hashed
as T53dw7UOfNbpovKFex9/Ldz8CMUF95gD.
username: The unique login name for the user.
working_place_code: Identifies the user's workplace:
– '00003' for Matoto Municipality.
– 'C1111' for Consulat à Paris.
– 'J016' for TPI de Kindia.
last_update_time: The timestamp of the last update to this user's record.
Password Expiration
The updated_password_date column is used to track when the user last updated their
password. If the system enforces password expiration policies (e.g., a password must be
changed every 90 days), this field is checked during login to determine whether the user
needs to change their password.
When a user logs in, if the central system is online, the user account is synchronized with
the central database. This process ensures that all users are unified and centralized,
allowing for consistent user management across all systems.
Example Scenario
An admin for the Matoto Municipality can be created locally using the SQL script shown
earlier. When this user logs into the central system (if it is available), their information is
synchronized with the central database. This ensures consistent and up-to-date user data
across both local and central systems.
Key Points
Local Admin Creation: Admin users are created locally at each workplace (municipality,
consulate, or court).
Central Synchronization: When the central system is available, users are synced to the
central database upon login.
Password Expiration Enforcement: The system checks the updated_password_date
field to determine if a password change is required based on expiration policies.
This guide provides a step-by-step process for creating admin users at the local level while
ensuring that centralized user management and security policies are enforced when
necessary.