From 4c4141fe864d7c4a852ccfaf06c5dbfd5445c495 Mon Sep 17 00:00:00 2001 From: x-rodubou <romuald.dubourg@kereval.com> Date: Wed, 8 Nov 2023 11:56:36 +0100 Subject: [PATCH] [Update] Assertions manager update replace jenkins with manual install --- Assertion-Manager/installation.md | 174 +++++++++++------------------- 1 file changed, 60 insertions(+), 114 deletions(-) diff --git a/Assertion-Manager/installation.md b/Assertion-Manager/installation.md index 6e862a2..e0cff39 100755 --- a/Assertion-Manager/installation.md +++ b/Assertion-Manager/installation.md @@ -6,13 +6,13 @@ function: Engineer date: 17/01/2023 toolversion: 4.2.x version: 1.02 -status: Approved document +status: draft reference: KER1-MAN-IHE-ASSERTION\_MANAGER\_INSTALLATION-1\_02 customer: IHE-EUROPE --- # Purpose -Here is a guide to help you installing Assertion Manager. +Here is a guide to help you to install Assertion Manager. # Minimal Requirements @@ -24,21 +24,28 @@ Here is a guide to help you installing Assertion Manager. To install those requirements you can refer to the documentation of installation of JBoss : [*General Requirements JBOSS 7*](https://gazelle.ihe.net/gazelle-documentation/General/jboss7.html) -# Quick start +## Sources & binaries -Assertion manager has to be installed as a gazelle user on your server: +Assertions Manager is an open-source project under Apache License Version 2.0 ([https://gazelle.ihe.net/content/license](https://gazelle.ihe.net/content/license)). Sources are available via Gitlab at [https://gitlab.inria.fr/gazelle/applications/test-design/AssertionManager](https://gitlab.inria.fr/gazelle/applications/test-design/AssertionManager). + +The latest public packaged release can be downloaded from our Nexus repository [https://gazelle.ihe.net/nexus/#nexus-search;quick~%20AssertionManagerGui.ear](https://gazelle.ihe.net/nexus/#nexus-search;quick~%20AssertionManagerGui.ear). + + +### Database creation + +Your database must have a user **gazelle** : + +1. Connect to your database ```bash -wget https://gitlab.inria.fr/gazelle/applications/test-design/AssertionManager/blob/master/install_assertion_manager_gui.sh -chmod +x install_assertion_manager_gui.sh -sudo install_assertion_manager_gui.sh +psql -U gazelle ``` -It will: +1. Execute the SQL statement to create the database. -* Backup the previous EAR -* Get the latest released version of Assertion Manager and deploy it in your JBoss server. -* Create the database if it doesn't exist. +```sql +CREATE DATABASE "assertion-manager-gui" OWNER gazelle ENCODING 'UTF8' ; +``` ## Deployment To deploy Assertion Manager: @@ -50,9 +57,24 @@ For more informations about how to manage that externalization, please refer to Datasource name : AssertionManagerBaseDS -Database name : assertion-manager +Database name : assertion-manager-gui + +### Application configuration + +1. Download the SQL scripts archive from our Nexus repository [https://gazelle.ihe.net/nexus/#nexus-search;quick~%20AssertionManagerGui.ear](https://gazelle.ihe.net/nexus/#nexus-search;quick~%20AssertionManagerGui.ear) (search for **AssertionManagerGui-ear-X.X.X-sql.zip**) + +1. Unzip the archive + +1. Edit the application_url value in init.sql. You might also want to edit application_works_without_cas. -## Insert configuration values +1. From the bash, update the application configuration by running : + +```bash +psql -U gazelle assertion-manager-gui < schema-X.X.X.sql + +psql -U gazelle assertion-manager-gui < init-X.X.X.sql +``` +Or Configuration can be done through the Administration interface or with an sql script. @@ -67,100 +89,32 @@ To restart the application, there are 2 options: Here is the list of configuration variables that must be defined: -| Variable| Default value| Description| -|---------|--------------|------------| -| application_url |http://server_domain:8080/AssertionManager| URL to reach the tool| -| application_works_without_cas | true | Indicates authentication mechanism to use| -| ip_login | true | Indicates authentication mechanism to use| -| ip_login_admin | .\* | Pattern to grant users as admin based on their IP address| -| cas_url | Not defined| URL of the CAS service| -| upload_max_size | 100000000| Used to limit uploaded files size| -| assertion_manager_rest_path_to_assertion | /testAssertion/assertion| do not change| -| assertion_manager_rest_url | https://server_domain:8080/AssertionManagerGui/rest|  update server_domain:8080 to fit your needs.| -| security-policies | true |  Enable security features| -| X-Frame-Options | SAMEORIGIN|  https://developer.mozilla.org/en-US/docs/Web/HTTP/X-Frame-Options| -| Cache-Control | private, no-cache, no-store, must-revalidate, max-age=0|  https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers#Cache-control| -| Strict-Transport-Security | max-age=31536000 ; includeSubDomains|  https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers#Cache-control| -| X-Content-Security-Policy | | https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers#Cache-control| -| X-WebKit-CSP | Use X-Content-Security-Policy values | | -| X-WebKit-CSP-Report-Only | Use X-Content-Security-Policy-Report-Only values | | +| Variable| Default value | Description| +|---------|----------------------------------------------------------------------------------------------------------------|------------| +| application_url | http://server_domain:8080/AssertionManagerGui | URL to reach the tool| +| application_works_without_cas | true | Indicates authentication mechanism to use| +| ip_login | true | Indicates authentication mechanism to use| +| ip_login_admin | .\* | Pattern to grant users as admin based on their IP address| +| cas_url | Not defined | URL of the CAS service| +| upload_max_size | 100000000 | Used to limit uploaded files size| +| assertion_manager_rest_path_to_assertion | /testAssertion/assertion | do not change| +| assertion_manager_rest_url | https://server_domain:8080/AssertionManagerGui/rest |  update server_domain:8080 to fit your needs.| +| security-policies | true |  Enable security features| +| X-Frame-Options | SAMEORIGIN |  https://developer.mozilla.org/en-US/docs/Web/HTTP/X-Frame-Options| +| Cache-Control | private, no-cache, no-store, must-revalidate, max-age=0 |  https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers#Cache-control| +| Strict-Transport-Security | max-age=31536000 ; includeSubDomains |  https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers#Cache-control| +| X-Content-Security-Policy | | https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers#Cache-control| +| X-WebKit-CSP | Use X-Content-Security-Policy values | | +| X-WebKit-CSP-Report-Only | Use X-Content-Security-Policy-Report-Only values | | | X-Content-Security-Policy-Report-Only | default-src self \*.ihe-europe.net; script-src self unsafe-eval unsafe-inline ; style-src self unsafe-inline ; |  https://developer.mozilla.org/en-US/docs/Web/Security/CSP/Using_Content_Security_Policy | -| sql_injection_filter_switch | true |  Enable sql injection filtering| -| gazelle_test-management-url | https://server_domain:8080/gazelle/rest/ | points to gazelle test management rest interface| -| application_documentation | https://gazelle.ihe.net/content/assertion-manager| | -| documentation_url | https://gazelle.ihe.net/content/assertion-manager| | -| application_release_notes_url | https://gazelle.ihe.net/jira/browse/AS#selectedTab=com.atlassian.jira.plugin.system.project%3Achangelog-panel | | -| application_issue_tracker_url | https://gazelle.ihe.net/browse/EVSCLT| URL of the project in the issue tracking system | - -To insert values with an sql script, connect to the database : -```bash -su postgres -psql assertion-manager-gui -``` +| sql_injection_filter_switch | true |  Enable sql injection filtering| +| gazelle_test-management-url | https://server_domain:8080/gazelle/rest/ | points to gazelle test management rest interface| +| application_documentation | https://gazelle.ihe.net/content/assertion-manager | | +| documentation_url | https://gazelle.ihe.net/content/assertion-manager | | +| application_release_notes_url | https://gazelle.ihe.net/jira/browse/AS#selectedTab=com.atlassian.jira.plugin.system.project%3Achangelog-panel | | +| application_issue_tracker_url | https://gazelle.ihe.net/browse/EVSCLT | URL of the project in the issue tracking system | + -Then copy paste the following script: -```sql -SET statement\_timeout = 0; -SET lock\_timeout = 0; -SET client\_encoding = 'UTF8'; -SET standard\_conforming\_strings = on; -SET check\_function\_bodies = false; -SET client\_min\_messages = warning; -SET search\_path = public, pg\_catalog; -SET default\_tablespace = ''; -SET default\_with\_oids = false; --- --- Name: app\_configuration; Type: TABLE; Schema: public; Owner: gazelle; Tablespace: --- - -CREATE TABLE app\_configuration ( -  id integer NOT NULL, -  value character varying(255), -  variable character varying(255) -); - -ALTER TABLE public.app\_configuration OWNER TO gazelle; - --- --- Name: app\_configuration\_pkey; Type: CONSTRAINT; Schema: public; Owner: gazelle; Tablespace: --- - -ALTER TABLE ONLY app\_configuration -ADD CONSTRAINT app\_configuration\_pkey PRIMARY KEY (id); - --- --- Name: variable\_unique; Type: CONSTRAINT; Schema: public; Owner: gazelle; Tablespace: --- - -ALTER TABLE ONLY app\_configuration -ADD CONSTRAINT variable\_unique UNIQUE (variable); - --- --- Data for Name: app\_configuration; Type: TABLE DATA; Schema: public; Owner: gazelle --- - -INSERT INTO app\_configuration VALUES (1, 'false', 'ip\_login'); -INSERT INTO app\_configuration VALUES (2, '.\*', 'ip\_login\_admin'); -INSERT INTO app\_configuration VALUES (3, '100000000', 'upload\_max\_size'); -INSERT INTO app\_configuration VALUES (4, '/testAssertion/assertion', 'assertion\_manager\_rest\_path\_to\_assertion'); -INSERT INTO app\_configuration VALUES (5, 'https://server_domain:8080/AssertionManagerGui/rest', 'assertion\_manager\_rest\_url'); --update with your server domain example: https://gazelle.ihe.net/AssertionManagerGui/rest -INSERT INTO app\_configuration VALUES (6, 'true', 'security-policies'); -INSERT INTO app\_configuration VALUES (7, 'SAMEORIGIN', 'X-Frame-Options'); -INSERT INTO app\_configuration VALUES (8, 'private, no-cache, no-store, must-revalidate, max-age=0', 'Cache-Control'); -INSERT INTO app\_configuration VALUES (9, 'max-age=31536000 ; includeSubDomains', 'Strict-Transport-Security'); -INSERT INTO app\_configuration VALUES (10, '', 'X-Content-Security-Policy'); -INSERT INTO app\_configuration VALUES (11, 'Use X-Content-Security-Policy values', 'X-WebKit-CSP'); -INSERT INTO app\_configuration VALUES (12, 'Use X-Content-Security-Policy-Report-Only values', 'X-WebKit-CSP-Report-Only'); -INSERT INTO app\_configuration VALUES (13, 'default-src self \*.ihe-europe.net; script-src self unsafe-eval unsafe-inline ; style-src self unsafe-inline ;', 'X-Content-Security-Policy-Report-Only'); -INSERT INTO app\_configuration VALUES (14, 'true', 'sql\_injection\_filter\_switch'); -INSERT INTO app\_configuration VALUES (15, 'https://server_domain:8080/AssertionManagerGui', 'application\_url'); --update with your server domain -INSERT INTO app\_configuration VALUES (16, 'false', 'application\_works\_without\_cas'); -INSERT INTO app\_configuration VALUES (17, 'https://server_domain:8080/cas', 'cas\_url'); --update with your server domain -INSERT INTO app\_configuration VALUES (18, 'https://server_domain:8080/gazelle/rest/', 'gazelle\_test-managment-url'); --update with your server domain -INSERT INTO app\_configuration VALUES (19, 'https://gazelle.ihe.net/content/assertion-manager', 'application\_documentation'); -INSERT INTO app\_configuration VALUES (20, 'https://gazelle.ihe.net/content/assertion-manager', 'documentation\_url'); -INSERT INTO app\_configuration VALUES (21, 'https://gazelle.ihe.net/jira/browse/AS\#selectedTab=com.atlassian.jira.plugin.system.project%3Achangelog-panel', 'application\_release\_notes\_url'); -``` # Compile from sources @@ -172,10 +126,7 @@ Assertion Manager is an open source project under Apache2 licence. The sources a ```bash sudo apt-get install maven2 git git clone https://gitlab.inria.fr/gazelle/applications/test-design/AssertionManager.git assertion-manager-gui -git clone https://gitlab.inria.fr/gazelle/applications/test-design/AssertionManager.git assertion-manager -cd assertion-manager -mvn clean install -cd ../assertion-manager-gui +cd assertion-manager-gui mvn clean package -U -Pproduction ``` @@ -189,7 +140,6 @@ su postgres psql postgres=\# CREATE USER gazelle; postgres=\# ALTER USER gazelle WITH ENCRYPTED PASSWORD 'password'; -postgres=\# CREATE DATABASE "assertion-manager" OWNER gazelle ENCODING UTF-8; postgres=\# CREATE DATABASE "assertion-manager-gui" OWNER gazelle ENCODING UTF-8; postgres=\# \\q exit @@ -200,14 +150,10 @@ exit Before compiling, go into gazelle-tm's directory and edit the file pom.xml. Open this file and adapt the properties of prod profile to your needs : * jdbc.connection.url : jdbc:postgresql:assertion-manager-gui -* jdbc.connection.url2 : jdbc:postgresql:assertion-manager * jdbc.connection.user / jdbc.connection.password : credentials for database access Then, create the EAR archive with the command line: ```bash -cd assertion-manager -mvn install -cd .. cd assertion-manager-gui mvn clean package -Pproduction ``` -- GitLab