diff --git a/doc/deployment.md b/doc/deployment.md index 197d693a7e870abccf489e3ec0c16ae681a3256a..ab57213974a3dd9eaa7f223941343cec603c30e4 100644 --- a/doc/deployment.md +++ b/doc/deployment.md @@ -104,47 +104,51 @@ sudo cp docker-compose.yaml.configure docker-compose.yaml 1. In folder `org.etsi.osl.main/compose/mysql-init` edit the file `01-databases.sql`. 2. In the `org.etsi.osl.main/compose/docker-compose.yaml` edit the credentials of the users that services use to connect to the databases, if you wish. - * portaluser (default is 12345) and - * keycloak (default is password) + * portaluser (default is 12345) and + * keycloak (default is password) ### 3. Configure keycloak container *(optional)* 1. If you made changes to keycloak's mysql credentials: - In folder `org.etsi.osl.main/compose/` edit the file `docker-compose.yaml`. + In folder `org.etsi.osl.main/compose/` edit the file `docker-compose.yaml`. - ```yaml - DB_DATABASE: keycloak - DB_USER: keycloak - DB_PASSWORD: password - ``` + ``` + DB_DATABASE: keycloak + DB_USER: keycloak + DB_PASSWORD: password + ``` 2. If you want to change the keycloak admin password: - In folder `org.etsi.osl.main/compose/` edit the file `docker-compose.yaml` + In folder `org.etsi.osl.main/compose/` edit the file `docker-compose.yaml` - ```yaml - KEYCLOAK_PASSWORD: Pa55w0rd - ``` + + ``` + KEYCLOAK_PASSWORD: Pa55w0rd + ``` ### 4. Configure bugzilla container *(optional)* If you want to utilise the Bugzilla connector: In folder `org.etsi.osl.main/compose/` edit the file `docker-compose.yaml` - ```yaml - SPRING_APPLICATION_JSON: '{ - "spring.activemq.brokerUrl": "tcp://anartemis:61616?jms.watchTopicAdvisories=false", - "spring.activemq.user": "artemis", - "spring.activemq.password": "artemis", - "bugzillaurl":"", - "bugzillakey":"", - "main_operations_product":"" - }' - ``` + +``` +SPRING_APPLICATION_JSON: '{ + "spring.activemq.brokerUrl": "tcp://anartemis:61616?jms.watchTopicAdvisories=false", + "spring.activemq.user": "artemis", + "spring.activemq.password": "artemis", + "bugzillaurl":"", + "bugzillakey":"", + "main_operations_product":"" +}' +``` + And add the provided Bugzilla installation information: -```yaml + +``` "bugzillaurl":"bugzillaurl.xx:443/bugzilla/", "bugzillakey":"exampleKeyeqNNwxBlgxZgMEIne0Oeq0Bz", "main_operations_product":"Main Site Operations" // this is the default product to issue tickets @@ -166,20 +170,21 @@ Change the respective fields: - If you made changes to mysql and keycloak credentials. - If you want to change logging level (TRACE / DEBUG / INFO / WARN / ERROR). -> **If you are using a non-local domain, replace everywhere the http://keycloak:8080 with the respective {{protocol://domain.name}}, as well as "spring.portal.main.domain" property.** +> ***If you are using a non-local domain, replace everywhere the http://keycloak:8080 with the respective {{protocol://domain.name}}, as well as "spring.portal.main.domain" property.*** In folder `org.etsi.osl.main/compose/` edit the file `docker-compose.yaml` - ```yaml - SPRING_APPLICATION_JSON: '{ - "spring.datasource.username":"root", - "spring.datasource.password":"letmein", - "spring-addons.issuers[0].uri": "http://keycloak:8080/auth/realms/openslice", - "spring.security.oauth2.resourceserver.jwt.issuer-uri": "http://keycloak:8080/auth/realms/openslice", - "springdoc.oAuthFlow.authorizationUrl": "http://keycloak:8080/auth/realms/openslice/protocol/openid-connect/auth", - "springdoc.oAuthFlow.tokenUrl": "http://keycloak:8080/auth/realms/openslice/protocol/openid-connect/token", - "spring.portal.main.domain": "http://localhost", - "logging.level.org.springframework" : "INFO" - }' + +``` +SPRING_APPLICATION_JSON: '{ + "spring.datasource.username":"root", + "spring.datasource.password":"letmein", + "spring-addons.issuers[0].uri": "http://keycloak:8080/auth/realms/openslice", + "spring.security.oauth2.resourceserver.jwt.issuer-uri": "http://keycloak:8080/auth/realms/openslice", + "springdoc.oAuthFlow.authorizationUrl": "http://keycloak:8080/auth/realms/openslice/protocol/openid-connect/auth", + "springdoc.oAuthFlow.tokenUrl": "http://keycloak:8080/auth/realms/openslice/protocol/openid-connect/token", + "spring.portal.main.domain": "http://localhost", + "logging.level.org.springframework" : "INFO" +}' ``` ### 6. osscapi container (TMF API service) *(conditional)* @@ -192,16 +197,17 @@ Change the respective fields: > **If you are using a non-local domain, replace everywhere the http://keycloak:8080 with the respective {{protocol://domain.name}}.** In folder `org.etsi.osl.main/compose/` edit the file `docker-compose.yaml` -```yaml - SPRING_APPLICATION_JSON: '{ - "spring.datasource.username":"root", - "spring.datasource.password":"letmein", - "spring-addons.issuers[0].uri": "http://keycloak:8080/auth/realms/openslice", - "spring.security.oauth2.resourceserver.jwt.issuer-uri": "http://keycloak:8080/auth/realms/openslice", - "springdoc.oAuthFlow.authorizationUrl": "http://keycloak:8080/auth/realms/openslice/protocol/openid-connect/auth", - "springdoc.oAuthFlow.tokenUrl": "http://keycloak:8080/auth/realms/openslice/protocol/openid-connect/token", - "logging.level.org.springframework" : "INFO" - }' + +``` +SPRING_APPLICATION_JSON: '{ + "spring.datasource.username":"root", + "spring.datasource.password":"letmein", + "spring-addons.issuers[0].uri": "http://keycloak:8080/auth/realms/openslice", + "spring.security.oauth2.resourceserver.jwt.issuer-uri": "http://keycloak:8080/auth/realms/openslice", + "springdoc.oAuthFlow.authorizationUrl": "http://keycloak:8080/auth/realms/openslice/protocol/openid-connect/auth", + "springdoc.oAuthFlow.tokenUrl": "http://keycloak:8080/auth/realms/openslice/protocol/openid-connect/token", + "logging.level.org.springframework" : "INFO" +}' ``` ## Configure nginx @@ -232,7 +238,7 @@ sudo cp config.js.default config.js Edit the `config.js` file with the information of your domain -```yaml +``` { TITLE: "OpenSlice by ETSI", WIKI: "https://openslice.readthedocs.io/en/stable/", @@ -267,7 +273,7 @@ sudo cp config.theming.default.json config.theming.json ``` E.g. Edit "TITLE" or "WIKI" property with your domain title -```yaml +``` { TITLE: "OpenSlice by ETSI", WIKI: "https://osl.etsi.org/documentation/latest/deployment/", @@ -287,12 +293,7 @@ sudo cp config.theming.default.json config.theming.json ``` > ***IMPORTANT NOTE:*** -If you want to apply changes to the JSON configuration files without the need to rebuild the -application, you have to apply the changes at the `org.etsi.osl.tmf.web/dist/io-openslice-portal-web/assets/config` -directory. Although, it is <u>mandatory</u> to also apply these changes to the `org.etsi.osl.tmf.web/src/assets/config` -for <u>persistancy</u>, as after any future rebuild of OpenSlice the `/dist` directory is being overwritten along with its -contents. The OpenSlice team strongly recommends to always apply your changes to the TMF web UI configuration files -at `org.etsi.osl.tmf.web/src/assets/config` and rebuild the application. +If you want to apply changes to the JSON configuration files without the need to rebuild the application, you have to apply the changes at the `org.etsi.osl.tmf.web/dist/io-openslice-portal-web/assets/config` directory. Although, it is <u>mandatory</u> to also apply these changes to the `org.etsi.osl.tmf.web/src/assets/config` for <u>persistancy</u>, as after any future rebuild of OpenSlice the `/dist` directory is being overwritten along with its contents. The OpenSlice team strongly recommends to always apply your changes to the TMF web UI configuration files at `org.etsi.osl.tmf.web/src/assets/config` and rebuild the application. ## Deploy OpenSlice via Docker Compose @@ -331,8 +332,8 @@ The Keycloack server is managing authentication and running on a container at po - Navigate to Administration Console - Login with the credentials from section [Configure keycloak container](#Configure-keycloak-container). Default values are: - - user: admin and - - password: KEYCLOAK_PASSWORD + - user: admin and + - password: KEYCLOAK_PASSWORD > if you are running in HTTP you will get a message: HTTPS required. @@ -387,24 +388,27 @@ Hosts File Location: 2 - Replace http://localhost/auth/ with http://keycloak:8080/auth/ in your Keycloak config for AngularJS and Angular (see examples below). -Explanation: +> Explanation - Nginx uses the http://keycloak:8080 URL, which is accessible via the internal docker system's network. - The Front-end (TS/Angular) shall also use the http://keycloak:8080. - This way, you will not get the invalid token error, as the API is acquiring the token from http://keycloak:8080 (internally) and the Front-end is getting verified by an issuer at the same URL, as well. +Nginx uses the http://keycloak:8080 URL, which is accessible via the internal docker system's network. +The Front-end (TS/Angular) shall also use the http://keycloak:8080. +This way, you will not get the invalid token error, as the API is acquiring the token from http://keycloak:8080 (internally) and the Front-end is getting verified by an issuer at the same URL, as well. - For the Angular configuration (TMF portal UI), navigate to org.etsi.osl.tmf.web/src/assets/config and edit config.prod.json + ```bash # Starting from the root project directory cd org.etsi.osl.tmf.web/src/assets/config ``` + ```bash nano config.prod.json ``` After editing it should look like the example bellow: + ```yaml { "TITLE": "OpenSlice by ETSI", @@ -444,16 +448,19 @@ Explanation: > If you want the changes to take place immediately without rebuilding the project, then repeat the process for org.etsi.osl.tmf.web/dist/org.etsi.osl.tmf.web/assets/config/config.prod.json - For the AngularJS configuration (NVF portal UI), navigate to org.etsi.osl.portal.web/src/js and edit config.js + ```bash # Starting from the root project directory cd org.etsi.osl.portal.web/src/js ``` + ```bash nano config.js ``` + after editing it should look like the example bellow: - ```js + ``` var appConfig = angular.module('portalwebapp.config',[]);