From 765d83a84b0f1c6009efcfa9290fe06924d8dc97 Mon Sep 17 00:00:00 2001 From: "Engelbart Kai Sven (PEA4-Fe)" Date: Mon, 22 Feb 2021 14:18:52 +0100 Subject: [PATCH 1/2] Add Test Mode banner when running in test container --- src/app/app.component.html | 1 + src/app/app.component.ts | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/app/app.component.html b/src/app/app.component.html index 57cb40d..0ff77bd 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -52,6 +52,7 @@ DEVELOPMENT + TESTING DeFinMa diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 386b83c..98054b8 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -6,7 +6,6 @@ import {HelpComponent} from './help/help.component'; import {DataService} from './services/data.service'; - @Component({ selector: 'app-root', templateUrl: './app.component.html', @@ -16,7 +15,8 @@ export class AppComponent implements OnInit{ bugReport = {do: '', work: ''}; // Data from bug report inputs isDocumentation = false; // True if user is on documentation pages - devMode = false; + devMode = false; + testMode = false; constructor( public login: LoginService, @@ -27,6 +27,9 @@ export class AppComponent implements OnInit{ public d: DataService ) { this.devMode = isDevMode(); + + // The site is considered to be in test mode when it is deployed inside the definma-test container + this.testMode = window.location.hostname === 'definma-test.apps.de1.bosch-iot-cloud.com'; this.router.events.subscribe(event => { if (event instanceof NavigationStart) { this.isDocumentation = /\/documentation/.test(event.url); @@ -80,5 +83,3 @@ export class AppComponent implements OnInit{ } } - - From ab45dd6b5b0bb6e8a1c719f7519831902601c6c3 Mon Sep 17 00:00:00 2001 From: "Engelbart Kai Sven (PEA4-Fe)" Date: Mon, 22 Feb 2021 14:19:14 +0100 Subject: [PATCH 2/2] Adjust CSP to support pdfmake --- cf_config/headers.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cf_config/headers.conf b/cf_config/headers.conf index 032aff2..f5c959d 100644 --- a/cf_config/headers.conf +++ b/cf_config/headers.conf @@ -1,4 +1,4 @@ -add_header Content-Security-Policy "default-src 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self'; font-src 'self'; connect-src https://*.apps.de1.bosch-iot-cloud.com; form-action 'none'; frame-ancestors 'none'; base-uri 'self'"; +add_header Content-Security-Policy "default-src 'none'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self'; font-src 'self'; connect-src https://*.apps.de1.bosch-iot-cloud.com; form-action 'none'; frame-ancestors 'none'; base-uri 'self'"; add_header X-Frame-Options DENY; add_header X-DNS-Prefetch-Control off; add_header Strict-Transport-Security "max-age=15552000; includeSubDomains";