diff --git a/.env b/.env new file mode 100644 index 0000000..3919ee7 --- /dev/null +++ b/.env @@ -0,0 +1,15 @@ +IDENTITY_URL="https://identity.keycloak.develop.eoepca.org" +REALM="master" +CLIENT_ID="eoepca-portal" +IDENTITY_API_URL="https://identity.api.develop.eoepca.org" +ADES_URL="https://ades.develop.eoepca.org/ogc-api/processes" +RESOURCE_CATALOGUE_URL="https://resource-catalogue.develop.eoepca.org" +DATA_ACCESS_URL="https://data-access.develop.eoepca.org" +WORKSPACE_URL="https://workspace-api.develop.eoepca.org" +WORKSPACE_DOCS_URL="https://workspace-api.develop.eoepca.org/docs#" +IMAGES_REGISTRY_URL="https://harbor.develop.eoepca.org" +DUMMY_SERVICE_URL="https://identity.dummy-service.develop.eoepca.org" +ACCESS_TOKEN_NAME="auth_user_id" +ACCESS_TOKEN_DOMAIN=".develop.eoepca.org" +REFRESH_TOKEN_NAME="auth_refresh_token" +REFRESH_TOKEN_DOMAIN=".develop.eoepca.org" \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 97921e5..fc2d678 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,10 +8,12 @@ RUN npm i -g @angular/cli RUN npm i COPY . . -ARG CONFIGURATION=develop -RUN ng build --configuration=$CONFIGURATION +RUN ng build ### STAGE 2: Run ### FROM nginx:stable-alpine COPY nginx.conf /etc/nginx/nginx.conf -COPY --from=build /usr/src/app/dist/* /usr/share/nginx/html \ No newline at end of file +COPY --from=build /usr/src/app/dist/* /usr/share/nginx/html +WORKDIR /start +COPY ./start.sh . +CMD [ "sh", "start.sh" ] \ No newline at end of file diff --git a/angular.json b/angular.json index af7be11..c0cc721 100644 --- a/angular.json +++ b/angular.json @@ -15,7 +15,7 @@ "prefix": "app", "architect": { "build": { - "builder": "@angular-devkit/build-angular:browser", + "builder": "@ngx-env/builder:browser", "options": { "outputPath": "dist/eoepca-portal", "index": "src/index.html", @@ -27,12 +27,16 @@ "inlineStyleLanguage": "scss", "assets": [ "src/favicon.ico", - "src/assets" + "src/assets", + "src/config" ], "styles": [ "src/styles.scss" ], - "scripts": [] + "scripts": [], + "ngxEnv": { + "prefix": "EOEPCA_" + } }, "configurations": { "production": { @@ -48,76 +52,7 @@ "maximumError": "4kb" } ], - "outputHashing": "all", - "fileReplacements": [ - { - "replace": "src/environments/environment.ts", - "with": "src/environments/environment.production.ts" - } - ] - }, - "staging": { - "budgets": [ - { - "type": "initial", - "maximumWarning": "500kb", - "maximumError": "1mb" - }, - { - "type": "anyComponentStyle", - "maximumWarning": "2kb", - "maximumError": "4kb" - } - ], - "outputHashing": "all", - "fileReplacements": [ - { - "replace": "src/environments/environment.ts", - "with": "src/environments/environment.staging.ts" - } - ] - }, - "demo": { - "budgets": [ - { - "type": "initial", - "maximumWarning": "500kb", - "maximumError": "1mb" - }, - { - "type": "anyComponentStyle", - "maximumWarning": "2kb", - "maximumError": "4kb" - } - ], - "outputHashing": "all", - "fileReplacements": [ - { - "replace": "src/environments/environment.ts", - "with": "src/environments/environment.demo.ts" - } - ] - }, - "develop": { - "budgets": [ - { - "type": "initial", - "maximumWarning": "500kb", - "maximumError": "1mb" - }, - { - "type": "anyComponentStyle", - "maximumWarning": "2kb", - "maximumError": "4kb" - } - ], - "outputHashing": "all", - "fileReplacements": [ - { - "replace": "src/environments/environment.ts", - "with": "src/environments/environment.develop.ts" - } - ] + "outputHashing": "all" }, "development": { "buildOptimizer": false, @@ -127,35 +62,22 @@ "sourceMap": true, "namedChunks": true } - }, - "defaultConfiguration": "production" + } }, "serve": { - "builder": "@angular-devkit/build-angular:dev-server", + "builder": "@ngx-env/builder:dev-server", "configurations": { - "production": { - "browserTarget": "eoepca-portal:build:production" - }, - "demo": { - "browserTarget": "eoepca-portal:build:demo" - }, - "staging": { - "browserTarget": "eoepca-portal:build:staging" - }, - "develop": { - "browserTarget": "eoepca-portal:build:develop" - } }, "defaultConfiguration": "develop" }, "extract-i18n": { - "builder": "@angular-devkit/build-angular:extract-i18n", + "builder": "@ngx-env/builder:extract-i18n", "options": { "browserTarget": "eoepca-portal:build" } }, "test": { - "builder": "@angular-devkit/build-angular:karma", + "builder": "@ngx-env/builder:karma", "options": { "polyfills": [ "zone.js", @@ -165,7 +87,8 @@ "inlineStyleLanguage": "scss", "assets": [ "src/favicon.ico", - "src/assets" + "src/assets", + "src/config" ], "styles": [ "@angular/material/prebuilt-themes/indigo-pink.css", diff --git a/charts/eoepca-portal/templates/configmap.yaml b/charts/eoepca-portal/templates/configmap.yaml new file mode 100644 index 0000000..2bb3c66 --- /dev/null +++ b/charts/eoepca-portal/templates/configmap.yaml @@ -0,0 +1,23 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "eoepca-portal.name" . }} + labels: + {{- include "eoepca-portal.labels" . | nindent 4 }} +data: + AUTH_SERVER_URL: "{{ .Values.configMap.auth_server_url }}" + IDENTITY_URL: "{{ .Values.configMap.identity_url }}" + REALM: "{{ .Values.configMap.realm }}" + CLIENT_ID: "{{ .Values.configMap.client_id }}" + IDENTITY_API_URL: "{{ .Values.configMap.identity_api_url }}" + ADES_URL: "{{ .Values.configMap.ades_url }}" + RESOURCE_CATALOGUE_URL: "{{ .Values.configMap.resource_catalogue_url }}" + DATA_ACCESS_URL: "{{ .Values.configMap.data_access_url }}" + WORKSPACE_URL: "{{ .Values.configMap.workspace_url }}" + WORKSPACE_DOCS_URL: "{{ .Values.configMap.workspace_docs_url }}" + IMAGES_REGISTRY_URL: "{{ .Values.configMap.images_registry_url }}" + DUMMY_SERVICE_URL: "{{ .Values.configMap.dummy_service_url }}" + ACCESS_TOKEN_NAME: "{{ .Values.configMap.access_token_name }}" + ACCESS_TOKEN_DOMAIN: "{{ .Values.configMap.access_token_domain }}" + REFRESH_TOKEN_NAME: "{{ .Values.configMap.refresh_token_name }}" + REFRESH_TOKEN_DOMAIN: "{{ .Values.configMap.refresh_token_domain }}" \ No newline at end of file diff --git a/charts/eoepca-portal/templates/deployment.yaml b/charts/eoepca-portal/templates/deployment.yaml index 0888cd0..b0c0fcc 100644 --- a/charts/eoepca-portal/templates/deployment.yaml +++ b/charts/eoepca-portal/templates/deployment.yaml @@ -43,6 +43,8 @@ spec: {{- with .Values.deployment.extraEnvFrom }} {{- tpl . $ | nindent 12 }} {{- end }} + - configMapRef: + name: {{ include "eoepca-portal.name" . }} ports: - name: http containerPort: {{ .Values.deployment.containerPort }} diff --git a/charts/eoepca-portal/values.yaml b/charts/eoepca-portal/values.yaml index 7c2d7f7..878e9c9 100644 --- a/charts/eoepca-portal/values.yaml +++ b/charts/eoepca-portal/values.yaml @@ -112,4 +112,22 @@ serviceAccount: annotations: {} # The name of the service account to use. # If not set and create is true, a name is generated using the fullname template - name: "" \ No newline at end of file + name: "" + +configMap: + auth_server_url: "https://identity.keycloak.develop.eoepca.org" + identity_url: "master" + realm: "eoepca-portal" + client_id: "eoepca-portal" + identity_api_url: "https://identity.api.develop.eoepca.org" + ades_url: "https://ades.develop.eoepca.org/ogc-api/processes" + resource_catalogue_url: "https://resource-catalogue.develop.eoepca.org" + data_access_url: "https://data-access.develop.eoepca.org" + workspace_url: "https://workspace-api.develop.eoepca.org" + workspace_docs_url: "https://workspace-api.develop.eoepca.org/docs#" + images_registry_url: "https://harbor.develop.eoepca.org" + dummy_service_url: "https://identity.dummy-service.develop.eoepca.org" + access_token_name: "auth_user_id" + access_token_domain: ".develop.eoepca.org" + refresh_token_name: "auth_refresh_token" + refresh_token_domain: ".develop.eoepca.org" \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml index 6d6f07d..bc55d44 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -3,7 +3,21 @@ services: eoepca-portal: build: . container_name: eoepca-portal - environment: - - CONFIGURATION=develop ports: - - '80:80' \ No newline at end of file + - '80:80' + environment: + - IDENTITY_URL=${IDENTITY_URL} + - REALM=${REALM} + - CLIENT_ID=${CLIENT_ID} + - IDENTITY_API_URL=${IDENTITY_API_URL} + - ADES_URL=${ADES_URL} + - RESOURCE_CATALOGUE_URL=${RESOURCE_CATALOGUE_URL} + - DATA_ACCESS_URL=${DATA_ACCESS_URL} + - WORKSPACE_URL=${WORKSPACE_URL} + - WORKSPACE_DOCS_URL=${WORKSPACE_DOCS_URL} + - IMAGES_REGISTRY_URL=${IMAGES_REGISTRY_URL} + - DUMMY_SERVICE_URL=${DUMMY_SERVICE_URL} + - ACCESS_TOKEN_NAME=${ACCESS_TOKEN_NAME} + - ACCESS_TOKEN_DOMAIN=${ACCESS_TOKEN_DOMAIN} + - REFRESH_TOKEN_NAME=${REFRESH_TOKEN_NAME} + - REFRESH_TOKEN_DOMAIN=${REFRESH_TOKEN_DOMAIN} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 5d2a385..fc01887 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,7 +38,9 @@ "@angular-devkit/build-angular": "^16.1.4", "@angular/cli": "~16.1.4", "@angular/compiler-cli": "^16.1.0", + "@ngx-env/builder": "^17.2.1", "@types/jasmine": "~4.3.0", + "@types/node": "^20.11.19", "jasmine-core": "~4.6.0", "karma": "~6.4.0", "karma-chrome-launcher": "~3.2.0", @@ -2457,6 +2459,173 @@ "node": ">=10.0.0" } }, + "node_modules/@dotenv-run/core": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@dotenv-run/core/-/core-1.3.4.tgz", + "integrity": "sha512-U/jCYwpzaRjKPhuMj5VdIiIFiIBtiX7lqkyqA+WjpG6S1j91N+5c6LOPUYC54b/N6bKr+fmTj9f05CpWRIuPXw==", + "dev": true, + "dependencies": { + "chalk": "^4.1.0", + "dotenv": "^16.1.4", + "dotenv-expand": "^10.0.0", + "find-up": "^5.0.0" + } + }, + "node_modules/@dotenv-run/core/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@dotenv-run/core/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@dotenv-run/core/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@dotenv-run/core/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/@dotenv-run/core/node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@dotenv-run/core/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@dotenv-run/core/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@dotenv-run/core/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@dotenv-run/core/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@dotenv-run/core/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@dotenv-run/core/node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@dotenv-run/webpack": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@dotenv-run/webpack/-/webpack-1.3.4.tgz", + "integrity": "sha512-2QAH9q2iXhYk9l9lV1htAw5Qvwyyjp7Cg26t8j4RsFcO9NRr+TguKsoYUWI+HALvhFiEb/T07cFCUvaxv9APeQ==", + "dev": true, + "dependencies": { + "@dotenv-run/core": "^1.3.4" + }, + "peerDependencies": { + "webpack": "^5.0.0" + } + }, "node_modules/@esbuild/android-arm": { "version": "0.18.17", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.17.tgz", @@ -3091,6 +3260,487 @@ "webpack": "^5.54.0" } }, + "node_modules/@ngx-env/builder": { + "version": "17.2.1", + "resolved": "https://registry.npmjs.org/@ngx-env/builder/-/builder-17.2.1.tgz", + "integrity": "sha512-X/HyXGGO51GAyQRgPn7L70aqX/6W5tyQg+/qRQUqRsN2Arsv42/tFgVGf1+58blZvKWxeNwp45UDnXdDv05GSg==", + "dev": true, + "dependencies": { + "@dotenv-run/esbuild": "^1.3.4", + "@dotenv-run/webpack": "^1.3.4", + "glob": "^10.3.10" + } + }, + "node_modules/@ngx-env/builder/node_modules/@dotenv-run/esbuild": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@dotenv-run/esbuild/-/esbuild-1.3.4.tgz", + "integrity": "sha512-wc7dhnST+PrzliNZilyDCaLFjYbvlvaL8wafSLb311/ylFafJLLv+i8sABUfG+/iEKZerrTMAJj5rw55VxZsNA==", + "dev": true, + "dependencies": { + "@dotenv-run/core": "^1.3.4" + }, + "peerDependencies": { + "esbuild": "0.19.5" + } + }, + "node_modules/@ngx-env/builder/node_modules/@esbuild/android-arm": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.5.tgz", + "integrity": "sha512-bhvbzWFF3CwMs5tbjf3ObfGqbl/17ict2/uwOSfr3wmxDE6VdS2GqY/FuzIPe0q0bdhj65zQsvqfArI9MY6+AA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "peer": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/@ngx-env/builder/node_modules/@esbuild/android-arm64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.5.tgz", + "integrity": "sha512-5d1OkoJxnYQfmC+Zd8NBFjkhyCNYwM4n9ODrycTFY6Jk1IGiZ+tjVJDDSwDt77nK+tfpGP4T50iMtVi4dEGzhQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "peer": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/@ngx-env/builder/node_modules/@esbuild/android-x64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.5.tgz", + "integrity": "sha512-9t+28jHGL7uBdkBjL90QFxe7DVA+KGqWlHCF8ChTKyaKO//VLuoBricQCgwhOjA1/qOczsw843Fy4cbs4H3DVA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "peer": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/@ngx-env/builder/node_modules/@esbuild/darwin-arm64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.5.tgz", + "integrity": "sha512-mvXGcKqqIqyKoxq26qEDPHJuBYUA5KizJncKOAf9eJQez+L9O+KfvNFu6nl7SCZ/gFb2QPaRqqmG0doSWlgkqw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "peer": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/@ngx-env/builder/node_modules/@esbuild/darwin-x64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.5.tgz", + "integrity": "sha512-Ly8cn6fGLNet19s0X4unjcniX24I0RqjPv+kurpXabZYSXGM4Pwpmf85WHJN3lAgB8GSth7s5A0r856S+4DyiA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "peer": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/@ngx-env/builder/node_modules/@esbuild/freebsd-arm64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.5.tgz", + "integrity": "sha512-GGDNnPWTmWE+DMchq1W8Sd0mUkL+APvJg3b11klSGUDvRXh70JqLAO56tubmq1s2cgpVCSKYywEiKBfju8JztQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "peer": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/@ngx-env/builder/node_modules/@esbuild/freebsd-x64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.5.tgz", + "integrity": "sha512-1CCwDHnSSoA0HNwdfoNY0jLfJpd7ygaLAp5EHFos3VWJCRX9DMwWODf96s9TSse39Br7oOTLryRVmBoFwXbuuQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "peer": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/@ngx-env/builder/node_modules/@esbuild/linux-arm": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.5.tgz", + "integrity": "sha512-lrWXLY/vJBzCPC51QN0HM71uWgIEpGSjSZZADQhq7DKhPcI6NH1IdzjfHkDQws2oNpJKpR13kv7/pFHBbDQDwQ==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/@ngx-env/builder/node_modules/@esbuild/linux-arm64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.5.tgz", + "integrity": "sha512-o3vYippBmSrjjQUCEEiTZ2l+4yC0pVJD/Dl57WfPwwlvFkrxoSO7rmBZFii6kQB3Wrn/6GwJUPLU5t52eq2meA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/@ngx-env/builder/node_modules/@esbuild/linux-ia32": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.5.tgz", + "integrity": "sha512-MkjHXS03AXAkNp1KKkhSKPOCYztRtK+KXDNkBa6P78F8Bw0ynknCSClO/ztGszILZtyO/lVKpa7MolbBZ6oJtQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/@ngx-env/builder/node_modules/@esbuild/linux-loong64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.5.tgz", + "integrity": "sha512-42GwZMm5oYOD/JHqHska3Jg0r+XFb/fdZRX+WjADm3nLWLcIsN27YKtqxzQmGNJgu0AyXg4HtcSK9HuOk3v1Dw==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/@ngx-env/builder/node_modules/@esbuild/linux-mips64el": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.5.tgz", + "integrity": "sha512-kcjndCSMitUuPJobWCnwQ9lLjiLZUR3QLQmlgaBfMX23UEa7ZOrtufnRds+6WZtIS9HdTXqND4yH8NLoVVIkcg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/@ngx-env/builder/node_modules/@esbuild/linux-ppc64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.5.tgz", + "integrity": "sha512-yJAxJfHVm0ZbsiljbtFFP1BQKLc8kUF6+17tjQ78QjqjAQDnhULWiTA6u0FCDmYT1oOKS9PzZ2z0aBI+Mcyj7Q==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/@ngx-env/builder/node_modules/@esbuild/linux-riscv64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.5.tgz", + "integrity": "sha512-5u8cIR/t3gaD6ad3wNt1MNRstAZO+aNyBxu2We8X31bA8XUNyamTVQwLDA1SLoPCUehNCymhBhK3Qim1433Zag==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/@ngx-env/builder/node_modules/@esbuild/linux-s390x": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.5.tgz", + "integrity": "sha512-Z6JrMyEw/EmZBD/OFEFpb+gao9xJ59ATsoTNlj39jVBbXqoZm4Xntu6wVmGPB/OATi1uk/DB+yeDPv2E8PqZGw==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/@ngx-env/builder/node_modules/@esbuild/linux-x64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.5.tgz", + "integrity": "sha512-psagl+2RlK1z8zWZOmVdImisMtrUxvwereIdyJTmtmHahJTKb64pAcqoPlx6CewPdvGvUKe2Jw+0Z/0qhSbG1A==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/@ngx-env/builder/node_modules/@esbuild/netbsd-x64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.5.tgz", + "integrity": "sha512-kL2l+xScnAy/E/3119OggX8SrWyBEcqAh8aOY1gr4gPvw76la2GlD4Ymf832UCVbmuWeTf2adkZDK+h0Z/fB4g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "peer": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/@ngx-env/builder/node_modules/@esbuild/openbsd-x64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.5.tgz", + "integrity": "sha512-sPOfhtzFufQfTBgRnE1DIJjzsXukKSvZxloZbkJDG383q0awVAq600pc1nfqBcl0ice/WN9p4qLc39WhBShRTA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "peer": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/@ngx-env/builder/node_modules/@esbuild/sunos-x64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.5.tgz", + "integrity": "sha512-dGZkBXaafuKLpDSjKcB0ax0FL36YXCvJNnztjKV+6CO82tTYVDSH2lifitJ29jxRMoUhgkg9a+VA/B03WK5lcg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "peer": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/@ngx-env/builder/node_modules/@esbuild/win32-arm64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.5.tgz", + "integrity": "sha512-dWVjD9y03ilhdRQ6Xig1NWNgfLtf2o/STKTS+eZuF90fI2BhbwD6WlaiCGKptlqXlURVB5AUOxUj09LuwKGDTg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "peer": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/@ngx-env/builder/node_modules/@esbuild/win32-ia32": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.5.tgz", + "integrity": "sha512-4liggWIA4oDgUxqpZwrDhmEfAH4d0iljanDOK7AnVU89T6CzHon/ony8C5LeOdfgx60x5cnQJFZwEydVlYx4iw==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "peer": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/@ngx-env/builder/node_modules/@esbuild/win32-x64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.5.tgz", + "integrity": "sha512-czTrygUsB/jlM8qEW5MD8bgYU2Xg14lo6kBDXW6HdxKjh8M5PzETGiSHaz9MtbXBYDloHNUAUW2tMiKW4KM9Mw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "peer": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/@ngx-env/builder/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@ngx-env/builder/node_modules/esbuild": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.5.tgz", + "integrity": "sha512-bUxalY7b1g8vNhQKdB24QDmHeY4V4tw/s6Ak5z+jJX9laP5MoQseTOMemAr0gxssjNcH0MCViG8ONI2kksvfFQ==", + "dev": true, + "hasInstallScript": true, + "peer": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/android-arm": "0.19.5", + "@esbuild/android-arm64": "0.19.5", + "@esbuild/android-x64": "0.19.5", + "@esbuild/darwin-arm64": "0.19.5", + "@esbuild/darwin-x64": "0.19.5", + "@esbuild/freebsd-arm64": "0.19.5", + "@esbuild/freebsd-x64": "0.19.5", + "@esbuild/linux-arm": "0.19.5", + "@esbuild/linux-arm64": "0.19.5", + "@esbuild/linux-ia32": "0.19.5", + "@esbuild/linux-loong64": "0.19.5", + "@esbuild/linux-mips64el": "0.19.5", + "@esbuild/linux-ppc64": "0.19.5", + "@esbuild/linux-riscv64": "0.19.5", + "@esbuild/linux-s390x": "0.19.5", + "@esbuild/linux-x64": "0.19.5", + "@esbuild/netbsd-x64": "0.19.5", + "@esbuild/openbsd-x64": "0.19.5", + "@esbuild/sunos-x64": "0.19.5", + "@esbuild/win32-arm64": "0.19.5", + "@esbuild/win32-ia32": "0.19.5", + "@esbuild/win32-x64": "0.19.5" + } + }, + "node_modules/@ngx-env/builder/node_modules/glob": { + "version": "10.3.10", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", + "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", + "dev": true, + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.5", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@ngx-env/builder/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -3559,12 +4209,12 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.8.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.6.tgz", - "integrity": "sha512-eWO4K2Ji70QzKUqRy6oyJWUeB7+g2cRagT3T/nxYibYcT4y2BDL8lqolRXjTHmkZCdJfIPaY73KbJAZmcryxTQ==", + "version": "20.11.19", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.19.tgz", + "integrity": "sha512-7xMnVEcZFu0DikYjWOlRq7NTPETrm7teqUT2WkQjrTIkEgUyyGdWsj/Zg8bEJt5TNklzbPD1X3fqfsHw3SpapQ==", "dev": true, "dependencies": { - "undici-types": "~5.25.1" + "undici-types": "~5.26.4" } }, "node_modules/@types/qs": { @@ -5662,6 +6312,27 @@ "url": "https://github.com/fb55/domutils?sponsor=1" } }, + "node_modules/dotenv": { + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/dotenv-expand": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-10.0.0.tgz", + "integrity": "sha512-GopVGCpVS1UKH75VKHGuQFqS1Gusej0z4FyQkPdwjil2gNIv+LNsqBlboOzpJFZKVT95GkCyWJbBSdFEFUWI2A==", + "dev": true, + "engines": { + "node": ">=12" + } + }, "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", @@ -11899,9 +12570,9 @@ } }, "node_modules/undici-types": { - "version": "5.25.3", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.25.3.tgz", - "integrity": "sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA==", + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", "dev": true }, "node_modules/unicode-canonical-property-names-ecmascript": { diff --git a/package.json b/package.json index 9f7c49f..8f495cf 100644 --- a/package.json +++ b/package.json @@ -5,12 +5,8 @@ "ng": "ng", "start": "ng serve", "build": "ng build", - "watch": "ng build --watch --configuration develop", - "test": "ng test", - "start:production": "ng serve --configuration=production", - "start:staging": "ng serve --configuration=staging", - "start:demo": "ng serve --configuration=demo", - "start:develop": "ng serve --configuration=develop" + "watch": "ng build --watch", + "test": "ng test" }, "private": true, "dependencies": { @@ -44,7 +40,9 @@ "@angular-devkit/build-angular": "^16.1.4", "@angular/cli": "~16.1.4", "@angular/compiler-cli": "^16.1.0", + "@ngx-env/builder": "^17.2.1", "@types/jasmine": "~4.3.0", + "@types/node": "^20.11.19", "jasmine-core": "~4.6.0", "karma": "~6.4.0", "karma-chrome-launcher": "~3.2.0", diff --git a/src/app/@core/configs/keycloak.config.ts b/src/app/@core/configs/keycloak.config.ts index c6ff700..f5e2380 100644 --- a/src/app/@core/configs/keycloak.config.ts +++ b/src/app/@core/configs/keycloak.config.ts @@ -1,6 +1,8 @@ import {KeycloakEvent, KeycloakService} from "keycloak-angular"; -import {environment} from '../../../environments/environment'; import Keycloak from "keycloak-js"; +import {Environment} from "../../environment.interface"; + +declare let config: Environment; export function initializeKeycloak(keycloak: KeycloakService) { keycloak.keycloakEvents$.subscribe({ @@ -8,17 +10,17 @@ export function initializeKeycloak(keycloak: KeycloakService) { keycloak.isLoggedIn().then(loggedIn => { if (!loggedIn) { const expirationDate: Date = new Date(0); - document.cookie = `${environment.cookies.accessToken.name}=; expires=${expirationDate.toUTCString()}; path=/; domain=${environment.cookies.accessToken.domain}; SameSite=Stric`; - document.cookie = `${environment.cookies.refreshToken.name}=; expires=${expirationDate.toUTCString()}; path=/; domain=${environment.cookies.refreshToken.domain}; SameSite=Stric`; + document.cookie = `${config.cookies.accessToken.name}=; expires=${expirationDate.toUTCString()}; path=/; domain=${config.cookies.accessToken.domain}; SameSite=Stric`; + document.cookie = `${config.cookies.refreshToken.name}=; expires=${expirationDate.toUTCString()}; path=/; domain=${config.cookies.refreshToken.domain}; SameSite=Stric`; } else { const keycloakInstance: Keycloak = keycloak.getKeycloakInstance(); const accessToken: string = keycloakInstance?.token; if (accessToken && accessToken !== '') { - document.cookie = `${environment.cookies.accessToken.name}=${accessToken}; expires=Session; path=/; domain=${environment.cookies.accessToken.domain}; SameSite=Strict`; + document.cookie = `${config.cookies.accessToken.name}=${accessToken}; expires=Session; path=/; domain=${config.cookies.accessToken.domain}; SameSite=Strict`; } const refreshToken: string = keycloakInstance?.refreshToken; if (refreshToken && refreshToken !== '') { - document.cookie = `${environment.cookies.refreshToken.name}=${refreshToken}; expires=Session; path=/; domain=${environment.cookies.refreshToken.domain}; SameSite=Strict`; + document.cookie = `${config.cookies.refreshToken.name}=${refreshToken}; expires=Session; path=/; domain=${config.cookies.refreshToken.domain}; SameSite=Strict`; } } }) @@ -27,9 +29,9 @@ export function initializeKeycloak(keycloak: KeycloakService) { return () => keycloak.init({ config: { - url: environment.identity.url, - realm: environment.identity.realm, - clientId: environment.identity.clientId, + url: config.identity.url, + realm: config.identity.realm, + clientId: config.identity.clientId, }, initOptions: { onLoad: 'check-sso', diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 9228522..d0eb5e2 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,4 +1,7 @@ import {Component} from '@angular/core'; +import {Environment} from "./environment.interface"; + +declare let __config: Environment; @Component({ selector: 'app-root', diff --git a/src/app/environment.interface.ts b/src/app/environment.interface.ts new file mode 100644 index 0000000..6c03dab --- /dev/null +++ b/src/app/environment.interface.ts @@ -0,0 +1,27 @@ +export interface Environment { + identity: { + url: string, + realm: string, + clientId: string, + }, + urls: { + identityApi: string, + ades: string, + resourceCatalogue: string, + dataAccess: string, + workspace: string, + workspaceDocs: string, + imagesRegistry: string, + dummyService: string, + }, + cookies: { + accessToken: { + name: string, + domain: string + }, + refreshToken: { + name: string, + domain: string + } + } +} \ No newline at end of file diff --git a/src/app/features/home/home.component.html b/src/app/features/home/home.component.html index 9922759..c0a345b 100644 --- a/src/app/features/home/home.component.html +++ b/src/app/features/home/home.component.html @@ -5,50 +5,50 @@ @@ -75,10 +75,10 @@ (change)="clearRequestUri()" class="appearance-none max-md:mt-3 max-md:w-full bg-primary-black block text-secondary-white border border-gray-200 py-3 px-4 pr-8 rounded leading-tight focus:outline-none focus:bg-primary-black focus:border-gray-500"> - - - - + + + + / (); diff --git a/src/config/config.js b/src/config/config.js new file mode 100644 index 0000000..6fef782 --- /dev/null +++ b/src/config/config.js @@ -0,0 +1,27 @@ +const config = { + identity: { + url: '$IDENTITY_URL', + realm: '$REALM', + clientId: '$CLIENT_ID', + }, + urls: { + identityApi: '$IDENTITY_API_URL', + ades: '$ADES_URL', + resourceCatalogue: '$RESOURCE_CATALOGUE_URL', + dataAccess: '$DATA_ACCESS_URL', + workspace: '$WORKSPACE_URL', + workspaceDocs: '$WORKSPACE_DOCS_URL', + imagesRegistry: '$IMAGES_REGISTRY_URL', + dummyService: '$DUMMY_SERVICE_URL', + }, + cookies: { + accessToken: { + name: '$ACCESS_TOKEN_NAME', + domain: '$ACCESS_TOKEN_DOMAIN' + }, + refreshToken: { + name: '$REFRESH_TOKEN_NAME', + domain: '$ACCESS_TOKEN_DOMAIN' + } + } +} \ No newline at end of file diff --git a/src/env.d.ts b/src/env.d.ts new file mode 100644 index 0000000..cc58c55 --- /dev/null +++ b/src/env.d.ts @@ -0,0 +1,51 @@ +interface ImportMeta { + readonly env: ImportMetaEnv; +} + +interface ImportMetaEnv { + /** + * Built-in environment variable. + * @see Docs https://github.com/chihab/dotenv-run/packages/angular#node_env. + */ + readonly NODE_ENV: string; + // Add your environment variables below + // readonly NG_APP_API_URL: string; + [key: string]: any; +} + +/* + * Remove all the deprecated code below if you're using import.meta.env (recommended) + */ + +/****************************** DEPREACTED **************************/ +/** + * @deprecated process.env usage + * prefer using import.meta.env + * */ +// declare var process: { +// env: { +// NODE_ENV: string; +// [key: string]: any; +// }; +// }; + +// If your project references @types/node directly (in you) or indirectly (as in RxJS < 7.6.0), +// you might need to use the following declaration merging. +// declare namespace NodeJS { +// export interface ProcessEnv { +// readonly NODE_ENV: string; +// // Add your environment variables below +// } +// } + +// If you're using Angular Universal and process.env notation, you'll need to add the following to your tsconfig.server.json: +/* In your tsconfig.server.json */ +// { +// "extends": "./tsconfig.app.json", +// ... +// "exclude": [ +// "src/env.d.ts" +// ] +// } + +/*********************************************************************/ diff --git a/src/environments/environment.demo.ts b/src/environments/environment.demo.ts deleted file mode 100644 index 6014047..0000000 --- a/src/environments/environment.demo.ts +++ /dev/null @@ -1,32 +0,0 @@ -export const environment = { - production: false, - staging: false, - develop: false, - demo: true, - identity: { - url: 'https://identity.keycloak.demo.eoepca.org', - realm: 'master', - clientId: 'eoepca-portal' - }, - api: 'https://identity.api.demo.eoepca.org', - links: { - keycloak: "https://identity.keycloak.demo.eoepca.org/admin/master/console", - identityApi: "https://identity.api.demo.eoepca.org", - ades: "https://ades.demo.eoepca.org/admin/wps3/processes", - systemResourceCatalogue: "https://resource-catalogue.demo.eoepca.org", - systemDataAccess: "https://data-access.demo.eoepca.org", - workspace: "https://workspace-api.demo.eoepca.org", - containerRegistry: "https://harbor.demo.eoepca.org", - dummyService: "https://identity.dummy-service.demo.eoepca.org", - }, - cookies: { - accessToken: { - name: 'auth_user_id', - domain: '.demo.eoepca.org' - }, - refreshToken: { - name: 'auth_refresh_token', - domain: '.demo.eoepca.org' - } - } -}; \ No newline at end of file diff --git a/src/environments/environment.develop.ts b/src/environments/environment.develop.ts deleted file mode 100644 index 2bdfe1c..0000000 --- a/src/environments/environment.develop.ts +++ /dev/null @@ -1,32 +0,0 @@ -export const environment = { - production: false, - staging: false, - develop: true, - demo: false, - identity: { - url: 'https://identity.keycloak.develop.eoepca.org', - realm: 'master', - clientId: 'eoepca-portal' - }, - api: 'https://identity.api.develop.eoepca.org', - links: { - keycloak: "https://identity.keycloak.develop.eoepca.org/admin/master/console", - identityApi: "https://identity.api.develop.eoepca.org", - ades: "https://ades.develop.eoepca.org/admin/wps3/processes", - systemResourceCatalogue: "https://resource-catalogue.develop.eoepca.org", - systemDataAccess: "https://data-access.develop.eoepca.org", - workspace: "https://workspace-api.develop.eoepca.org", - containerRegistry: "https://harbor.develop.eoepca.org", - dummyService: "https://identity.dummy-service.develop.eoepca.org", - }, - cookies: { - accessToken: { - name: 'auth_user_id', - domain: '.develop.eoepca.org' - }, - refreshToken: { - name: 'auth_refresh_token', - domain: '.develop.eoepca.org' - } - } -}; \ No newline at end of file diff --git a/src/environments/environment.production.ts b/src/environments/environment.production.ts deleted file mode 100644 index fe7eea3..0000000 --- a/src/environments/environment.production.ts +++ /dev/null @@ -1,33 +0,0 @@ -// TODO: not defined yet -export const environment = { - production: true, - staging: false, - develop: false, - demo: false, - identity: { - url: 'https://identity.keycloak.eoepca.org', - realm: 'master', - clientId: 'eoepca-portal' - }, - api: 'https://identity.api.eoepca.org', - links: { - keycloak: "https://identity.keycloak.eoepca.org/admin/master/console", - identityApi: "https://identity.api.eoepca.org", - ades: "https://ades.eoepca.org/admin/wps3/processes", - systemResourceCatalogue: "https://resource-catalogue.eoepca.org", - systemDataAccess: "https://data-access.eoepca.org", - workspace: "https://workspace-api.eoepca.org", - containerRegistry: "https://harbor.eoepca.org", - dummyService: "https://identity.dummy-service.eoepca.org", - }, - cookies: { - accessToken: { - name: 'auth_user_id', - domain: '.eoepca.org' - }, - refreshToken: { - name: 'auth_refresh_token', - domain: '.eoepca.org' - } - } -}; \ No newline at end of file diff --git a/src/environments/environment.staging.ts b/src/environments/environment.staging.ts deleted file mode 100644 index a7fbd4d..0000000 --- a/src/environments/environment.staging.ts +++ /dev/null @@ -1,33 +0,0 @@ -// TODO: Not defined yet. -export const environment = { - production: false, - staging: true, - develop: false, - demo: false, - identity: { - url: 'https://identity.keycloak.staging.eoepca.org', - realm: 'master', - clientId: 'eoepca-portal' - }, - api: 'https://identity.api.staging.eoepca.org', - links: { - keycloak: "https://identity.keycloak.staging.eoepca.org/admin/master/console", - identityApi: "https://identity.api.staging.eoepca.org", - ades: "https://ades.staging.eoepca.org/admin/wps3/processes", - systemResourceCatalogue: "https://resource-catalogue.staging.eoepca.org", - systemDataAccess: "https://data-access.staging.eoepca.org", - workspace: "https://workspace-api.staging.eoepca.org", - containerRegistry: "https://harbor.staging.eoepca.org", - dummyService: "https://identity.dummy-service.staging.eoepca.org", - }, - cookies: { - accessToken: { - name: 'auth_user_id', - domain: '.staging.eoepca.org' - }, - refreshToken: { - name: 'auth_refresh_token', - domain: '.staging.eoepca.org' - } - } -}; \ No newline at end of file diff --git a/src/environments/environment.ts b/src/environments/environment.ts deleted file mode 100644 index c8b4661..0000000 --- a/src/environments/environment.ts +++ /dev/null @@ -1,32 +0,0 @@ -export const environment = { - production: false, - staging: false, - develop: false, - demo: false, - identity: { - url: 'https://identity.keycloak.develop.eoepca.org', - realm: 'master', - clientId: 'eoepca-portal' - }, - api: 'http://localhost:5566', - links: { - keycloak: "https://identity.keycloak.develop.eoepca.org/admin/master/console", - identityApi: "https://identity.api.develop.eoepca.org", - ades: "https://ades.develop.eoepca.org/admin/wps3/processes", - systemResourceCatalogue: "https://resource-catalogue.develop.eoepca.org", - systemDataAccess: "https://data-access.develop.eoepca.org", - workspace: "https://workspace-api.develop.eoepca.org", - containerRegistry: "https://harbor.develop.eoepca.org", - dummyService: "https://identity.dummy-service.develop.eoepca.org", - }, - cookies: { - accessToken: { - name: 'auth_user_id', - domain: 'localhost' - }, - refreshToken: { - name: 'auth_refresh_token', - domain: 'localhost' - } - } -}; \ No newline at end of file diff --git a/src/index.html b/src/index.html index 1798822..2580052 100644 --- a/src/index.html +++ b/src/index.html @@ -6,6 +6,7 @@ + diff --git a/start.sh b/start.sh new file mode 100644 index 0000000..79b8ef7 --- /dev/null +++ b/start.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +sed -i \ +-e "s/\$IDENTITY_URL/$(echo "$IDENTITY_URL" | sed 's/\//\\\//g')/g" \ +-e "s/\$REALM/$(echo "$REALM" | sed 's/\//\\\//g')/g" \ +-e "s/\$CLIENT_ID/$(echo "$CLIENT_ID" | sed 's/\//\\\//g')/g" \ +-e "s/\$IDENTITY_API_URL/$(echo "$IDENTITY_API_URL" | sed 's/\//\\\//g')/g" \ +-e "s/\$ADES_URL/$(echo "$ADES_URL" | sed 's/\//\\\//g')/g" \ +-e "s/\$RESOURCE_CATALOGUE_URL/$(echo "$RESOURCE_CATALOGUE_URL" | sed 's/\//\\\//g')/g" \ +-e "s/\$DATA_ACCESS_URL/$(echo "$DATA_ACCESS_URL" | sed 's/\//\\\//g')/g" \ +-e "s/\$WORKSPACE_URL/$(echo "$WORKSPACE_URL" | sed 's/\//\\\//g')/g" \ +-e "s/\$WORKSPACE_DOCS_URL/$(echo "$WORKSPACE_DOCS_URL" | sed 's/\//\\\//g')/g" \ +-e "s/\$IMAGES_REGISTRY_URL/$(echo "$IMAGES_REGISTRY_URL" | sed 's/\//\\\//g')/g" \ +-e "s/\$DUMMY_SERVICE_URL/$(echo "$DUMMY_SERVICE_URL" | sed 's/\//\\\//g')/g" \ +-e "s/\$ACCESS_TOKEN_NAME/$(echo "$ACCESS_TOKEN_NAME" | sed 's/\//\\\//g')/g" \ +-e "s/\$ACCESS_TOKEN_DOMAIN/$(echo "$ACCESS_TOKEN_DOMAIN" | sed 's/\//\\\//g')/g" \ +-e "s/\$REFRESH_TOKEN_NAME/$(echo "$REFRESH_TOKEN_NAME" | sed 's/\//\\\//g')/g" \ +-e "s/\$REFRESH_TOKEN_DOMAIN/$(echo "$REFRESH_TOKEN_DOMAIN" | sed 's/\//\\\//g')/g" \ +/usr/share/nginx/html/config/config.js + +echo "Starting with configuration:" +cat /usr/share/nginx/html/config/config.js + +nginx -g "daemon off;" \ No newline at end of file diff --git a/tsconfig.app.json b/tsconfig.app.json index 374cc9d..b9f1720 100644 --- a/tsconfig.app.json +++ b/tsconfig.app.json @@ -3,7 +3,8 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "./out-tsc/app", - "types": [] + "types": ["node"], + "noPropertyAccessFromIndexSignature": false }, "files": [ "src/main.ts" @@ -11,4 +12,4 @@ "include": [ "src/**/*.d.ts" ] -} +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index d0f7f2c..7c278b7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1250,11 +1250,40 @@ resolved "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz" integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw== +"@dotenv-run/core@^1.3.4": + version "1.3.4" + resolved "https://registry.npmjs.org/@dotenv-run/core/-/core-1.3.4.tgz" + integrity sha512-U/jCYwpzaRjKPhuMj5VdIiIFiIBtiX7lqkyqA+WjpG6S1j91N+5c6LOPUYC54b/N6bKr+fmTj9f05CpWRIuPXw== + dependencies: + chalk "^4.1.0" + dotenv "^16.1.4" + dotenv-expand "^10.0.0" + find-up "^5.0.0" + +"@dotenv-run/esbuild@^1.3.4": + version "1.3.4" + resolved "https://registry.npmjs.org/@dotenv-run/esbuild/-/esbuild-1.3.4.tgz" + integrity sha512-wc7dhnST+PrzliNZilyDCaLFjYbvlvaL8wafSLb311/ylFafJLLv+i8sABUfG+/iEKZerrTMAJj5rw55VxZsNA== + dependencies: + "@dotenv-run/core" "^1.3.4" + +"@dotenv-run/webpack@^1.3.4": + version "1.3.4" + resolved "https://registry.npmjs.org/@dotenv-run/webpack/-/webpack-1.3.4.tgz" + integrity sha512-2QAH9q2iXhYk9l9lV1htAw5Qvwyyjp7Cg26t8j4RsFcO9NRr+TguKsoYUWI+HALvhFiEb/T07cFCUvaxv9APeQ== + dependencies: + "@dotenv-run/core" "^1.3.4" + "@esbuild/win32-x64@0.18.17": version "0.18.17" resolved "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.17.tgz" integrity sha512-fGEb8f2BSA3CW7riJVurug65ACLuQAzKq0SSqkY2b2yHHH0MzDfbLyKIGzHwOI/gkHcxM/leuSW6D5w/LMNitA== +"@esbuild/win32-x64@0.19.5": + version "0.19.5" + resolved "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.5.tgz" + integrity sha512-czTrygUsB/jlM8qEW5MD8bgYU2Xg14lo6kBDXW6HdxKjh8M5PzETGiSHaz9MtbXBYDloHNUAUW2tMiKW4KM9Mw== + "@fortawesome/angular-fontawesome@^0.13.0": version "0.13.0" resolved "https://registry.npmjs.org/@fortawesome/angular-fontawesome/-/angular-fontawesome-0.13.0.tgz" @@ -1380,6 +1409,15 @@ resolved "https://registry.npmjs.org/@ngtools/webpack/-/webpack-16.2.6.tgz" integrity sha512-d8ZlZL6dOtWmHdjG9PTGBkdiJMcsXD2tp6WeFRVvTEuvCI3XvKsUXBvJDE+mZOhzn5pUEYt+1TR5DHjDZbME3w== +"@ngx-env/builder@^17.2.1": + version "17.2.1" + resolved "https://registry.npmjs.org/@ngx-env/builder/-/builder-17.2.1.tgz" + integrity sha512-X/HyXGGO51GAyQRgPn7L70aqX/6W5tyQg+/qRQUqRsN2Arsv42/tFgVGf1+58blZvKWxeNwp45UDnXdDv05GSg== + dependencies: + "@dotenv-run/esbuild" "^1.3.4" + "@dotenv-run/webpack" "^1.3.4" + glob "^10.3.10" + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz" @@ -1634,12 +1672,12 @@ resolved "https://registry.npmjs.org/@types/mime/-/mime-1.3.3.tgz" integrity sha512-Ys+/St+2VF4+xuY6+kDIXGxbNRO0mesVg0bbxEfB97Od1Vjpjx9KD1qxs64Gcb3CWPirk9Xe+PT4YiiHQ9T+eg== -"@types/node@*", "@types/node@>= 14", "@types/node@>=10.0.0": - version "20.8.6" - resolved "https://registry.npmjs.org/@types/node/-/node-20.8.6.tgz" - integrity sha512-eWO4K2Ji70QzKUqRy6oyJWUeB7+g2cRagT3T/nxYibYcT4y2BDL8lqolRXjTHmkZCdJfIPaY73KbJAZmcryxTQ== +"@types/node@*", "@types/node@^20.11.19", "@types/node@>= 14", "@types/node@>=10.0.0": + version "20.11.19" + resolved "https://registry.npmjs.org/@types/node/-/node-20.11.19.tgz" + integrity sha512-7xMnVEcZFu0DikYjWOlRq7NTPETrm7teqUT2WkQjrTIkEgUyyGdWsj/Zg8bEJt5TNklzbPD1X3fqfsHw3SpapQ== dependencies: - undici-types "~5.25.1" + undici-types "~5.26.4" "@types/qs@*": version "6.9.8" @@ -2883,6 +2921,16 @@ domutils@^3.0.1: domelementtype "^2.3.0" domhandler "^5.0.3" +dotenv-expand@^10.0.0: + version "10.0.0" + resolved "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-10.0.0.tgz" + integrity sha512-GopVGCpVS1UKH75VKHGuQFqS1Gusej0z4FyQkPdwjil2gNIv+LNsqBlboOzpJFZKVT95GkCyWJbBSdFEFUWI2A== + +dotenv@^16.1.4: + version "16.4.5" + resolved "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz" + integrity sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg== + eastasianwidth@^0.2.0: version "0.2.0" resolved "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz" @@ -3026,6 +3074,34 @@ esbuild@^0.18.10, esbuild@0.18.17: "@esbuild/win32-ia32" "0.18.17" "@esbuild/win32-x64" "0.18.17" +esbuild@0.19.5: + version "0.19.5" + resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.19.5.tgz" + integrity sha512-bUxalY7b1g8vNhQKdB24QDmHeY4V4tw/s6Ak5z+jJX9laP5MoQseTOMemAr0gxssjNcH0MCViG8ONI2kksvfFQ== + optionalDependencies: + "@esbuild/android-arm" "0.19.5" + "@esbuild/android-arm64" "0.19.5" + "@esbuild/android-x64" "0.19.5" + "@esbuild/darwin-arm64" "0.19.5" + "@esbuild/darwin-x64" "0.19.5" + "@esbuild/freebsd-arm64" "0.19.5" + "@esbuild/freebsd-x64" "0.19.5" + "@esbuild/linux-arm" "0.19.5" + "@esbuild/linux-arm64" "0.19.5" + "@esbuild/linux-ia32" "0.19.5" + "@esbuild/linux-loong64" "0.19.5" + "@esbuild/linux-mips64el" "0.19.5" + "@esbuild/linux-ppc64" "0.19.5" + "@esbuild/linux-riscv64" "0.19.5" + "@esbuild/linux-s390x" "0.19.5" + "@esbuild/linux-x64" "0.19.5" + "@esbuild/netbsd-x64" "0.19.5" + "@esbuild/openbsd-x64" "0.19.5" + "@esbuild/sunos-x64" "0.19.5" + "@esbuild/win32-arm64" "0.19.5" + "@esbuild/win32-ia32" "0.19.5" + "@esbuild/win32-x64" "0.19.5" + escalade@^3.1.1: version "3.1.1" resolved "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz" @@ -3269,6 +3345,14 @@ find-up@^4.1.0: locate-path "^5.0.0" path-exists "^4.0.0" +find-up@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" + find-up@^6.3.0: version "6.3.0" resolved "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz" @@ -3438,6 +3522,17 @@ glob@^10.2.2: minipass "^5.0.0 || ^6.0.2 || ^7.0.0" path-scurry "^1.10.1" +glob@^10.3.10: + version "10.3.10" + resolved "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz" + integrity sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g== + dependencies: + foreground-child "^3.1.0" + jackspeak "^2.3.5" + minimatch "^9.0.1" + minipass "^5.0.0 || ^6.0.2 || ^7.0.0" + path-scurry "^1.10.1" + glob@^7.1.3, glob@^7.1.4, glob@^7.1.7: version "7.2.3" resolved "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz" @@ -4270,6 +4365,13 @@ locate-path@^5.0.0: dependencies: p-locate "^4.1.0" +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" + locate-path@^7.1.0: version "7.2.0" resolved "https://registry.npmjs.org/locate-path/-/locate-path-7.2.0.tgz" @@ -4900,6 +5002,13 @@ p-limit@^2.2.0: dependencies: p-try "^2.0.0" +p-limit@^3.0.2: + version "3.1.0" + resolved "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + p-limit@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz" @@ -4914,6 +5023,13 @@ p-locate@^4.1.0: dependencies: p-limit "^2.2.0" +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" + p-locate@^6.0.0: version "6.0.0" resolved "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz" @@ -6275,10 +6391,10 @@ ua-parser-js@^0.7.30: resolved "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.36.tgz" integrity sha512-CPPLoCts2p7D8VbybttE3P2ylv0OBZEAy7a12DsulIEcAiMtWJy+PBgMXgWDI80D5UwqE8oQPHYnk13tm38M2Q== -undici-types@~5.25.1: - version "5.25.3" - resolved "https://registry.npmjs.org/undici-types/-/undici-types-5.25.3.tgz" - integrity sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA== +undici-types@~5.26.4: + version "5.26.5" + resolved "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz" + integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== unicode-canonical-property-names-ecmascript@^2.0.0: version "2.0.0" @@ -6748,6 +6864,11 @@ yargs@^17.2.1, yargs@17.7.2: y18n "^5.0.5" yargs-parser "^21.1.1" +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== + yocto-queue@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz"