diff --git a/angular.json b/angular.json index 7d91245a8..ff5f8185f 100644 --- a/angular.json +++ b/angular.json @@ -74,8 +74,7 @@ "serve": { "builder": "@angular-devkit/build-angular:dev-server", "options": { - "browserTarget": "red-ui:build", - "proxyConfig": "apps/red-ui/proxy.conf.json" + "browserTarget": "red-ui:build" }, "configurations": { "production": { diff --git a/apps/red-ui/proxy.conf.json b/apps/red-ui/proxy.conf.json deleted file mode 100644 index 5dab76d13..000000000 --- a/apps/red-ui/proxy.conf.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "/project": { - "target": "https://timo-redaction-dev.iqser.cloud/", - "secure": false, - "changeOrigin": true, - "logLevel": "debug" - }, - "/reanalyze": { - "target": "https://timo-redaction-dev.iqser.cloud/", - "secure": false, - "changeOrigin": true, - "logLevel": "debug" - }, - "/upload": { - "target": "https://timo-redaction-dev.iqser.cloud/", - "secure": false, - "changeOrigin": true, - "logLevel": "debug" - }, - "/version": { - "target": "https://timo-redaction-dev.iqser.cloud/", - "secure": false, - "changeOrigin": true, - "logLevel": "debug" - }, - "/viewedPages": { - "target": "https://timo-redaction-dev.iqser.cloud/", - "secure": false, - "changeOrigin": true, - "logLevel": "debug" - }, - "/redactionLog": { - "target": "https://timo-redaction-dev.iqser.cloud/", - "secure": false, - "changeOrigin": true, - "logLevel": "debug" - }, - "/user": { - "target": "https://timo-redaction-dev.iqser.cloud/", - "secure": false, - "changeOrigin": true, - "logLevel": "debug" - }, - "/download": { - "target": "https://timo-redaction-dev.iqser.cloud/", - "secure": false, - "changeOrigin": true, - "logLevel": "debug" - }, - "/delete": { - "target": "https://timo-redaction-dev.iqser.cloud/", - "secure": false, - "changeOrigin": true, - "logLevel": "debug" - }, - "/status": { - "target": "https://timo-redaction-dev.iqser.cloud/", - "secure": false, - "changeOrigin": true, - "logLevel": "debug" - }, - "/dictionary": { - "target": "https://timo-redaction-dev.iqser.cloud/", - "secure": false, - "changeOrigin": true, - "logLevel": "debug" - }, - "/manualRedaction": { - "target": "https://timo-redaction-dev.iqser.cloud/", - "secure": false, - "changeOrigin": true, - "logLevel": "debug" - }, - "/color": { - "target": "https://timo-redaction-dev.iqser.cloud/", - "secure": false, - "changeOrigin": true, - "logLevel": "debug" - } -} diff --git a/apps/red-ui/src/app/app-config/app-config.service.ts b/apps/red-ui/src/app/app-config/app-config.service.ts index bf2eafc22..8e529ea31 100644 --- a/apps/red-ui/src/app/app-config/app-config.service.ts +++ b/apps/red-ui/src/app/app-config/app-config.service.ts @@ -23,6 +23,7 @@ export class AppConfigService { loadAppConfig(): Observable { return this._httpClient.get('/assets/config/config.json').pipe( tap((config) => { + console.log('got', config); this._config = config; }) ); diff --git a/apps/red-ui/src/app/auth/auth.module.ts b/apps/red-ui/src/app/auth/auth.module.ts index 5efcf99a5..807c675f4 100644 --- a/apps/red-ui/src/app/auth/auth.module.ts +++ b/apps/red-ui/src/app/auth/auth.module.ts @@ -30,7 +30,6 @@ export function keycloakInitializer(keycloak: KeycloakService, appConfigService: }, enableBearerInterceptor: true }; - console.log(options); return keycloak.init(options); }); }; diff --git a/apps/red-ui/src/app/interceptor/api-path-interceptor.service.ts b/apps/red-ui/src/app/interceptor/api-path-interceptor.service.ts index cfaf336ce..0530add81 100644 --- a/apps/red-ui/src/app/interceptor/api-path-interceptor.service.ts +++ b/apps/red-ui/src/app/interceptor/api-path-interceptor.service.ts @@ -1,13 +1,28 @@ import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; -import { AppConfigService } from '../app-config/app-config.service'; +import { AppConfigKey, AppConfigService } from '../app-config/app-config.service'; @Injectable() export class ApiPathInterceptorService implements HttpInterceptor { constructor(private readonly _appConfigService: AppConfigService) {} intercept(req: HttpRequest, next: HttpHandler): Observable> { - return next.handle(req); + if (!req.url.startsWith('/assets')) { + console.log(this._appConfigService); + const updatedRequest = req.clone({ + url: this._appConfigService.getConfig(AppConfigKey.API_URL) + req.url + }); + return next.handle(updatedRequest); + } else { + // if (!req.url.startsWith('/assets')) { + // const updatedRequest = req.clone({ + // url: this._appConfigService.getConfig(AppConfigKey.API_URL) + req.url + // }) + // return next.handle(updatedRequest); + // } else { + return next.handle(req); + } + // } } } diff --git a/apps/red-ui/src/assets/config/config.json b/apps/red-ui/src/assets/config/config.json index 37870cb0c..a7169b843 100644 --- a/apps/red-ui/src/assets/config/config.json +++ b/apps/red-ui/src/assets/config/config.json @@ -1,6 +1,6 @@ { "OAUTH_URL": "https://redkc-staging.iqser.cloud/auth/realms/redaction", "OAUTH_CLIENT_ID": "redaction", - "API_URL": "", + "API_URL": "https://timo-redaction-dev.iqser.cloud", "PDFTRON_LICENSE": "" } diff --git a/docker/common/nginx/nginx.conf.template b/docker/common/nginx/nginx.conf.template index 5f4c45ec0..0afa340b0 100644 --- a/docker/common/nginx/nginx.conf.template +++ b/docker/common/nginx/nginx.conf.template @@ -1,5 +1,5 @@ server { - upload_progress proxied 1m; + listen 8080; proxy_hide_header WWW-Authenticate; root /usr/share/nginx/html; @@ -15,45 +15,7 @@ server { proxy_hide_header WWW-Authenticate; try_files $uri$args $uri$args/ $uri $uri/ /index.html =404; } - location /project { - proxy_pass $API_URL; - } - location /viewedPages { - proxy_pass $API_URL; - } - location /version { - proxy_pass $API_URL; - } - location /color { - proxy_pass $API_URL; - } - location /user { - proxy_pass $API_URL; - } - location /dictionary { - proxy_pass $API_URL; - } - location /manualRedaction { - proxy_pass $API_URL; - } - location /reanalyze { - proxy_pass $API_URL; - } - location /upload { - proxy_pass $API_URL; - } - location /download { - proxy_pass $API_URL; - } - location /delete { - proxy_pass $API_URL; - } - location /status { - proxy_pass $API_URL; - } - location /redactionLog { - proxy_pass $API_URL; - } + client_max_body_size 0; gzip_min_length 1000; gzip on; diff --git a/libs/red-cache/src/lib/caches/cache-utils.ts b/libs/red-cache/src/lib/caches/cache-utils.ts index b50c07bb8..b07212af3 100644 --- a/libs/red-cache/src/lib/caches/cache-utils.ts +++ b/libs/red-cache/src/lib/caches/cache-utils.ts @@ -2,7 +2,7 @@ export const APP_LEVEL_CACHE = 'app-level-cache'; export const DYNAMIC_CACHES = [ { - urls: ['/assets/'], + urls: ['/assets/icons', '/assets/wv-resources'], name: 'cached-assets', maxAge: 24 * 3600, maxSize: 1000,