From 6b003eff1fc8f45e14eb867c71a19d4a53c2a721 Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Wed, 5 Jul 2023 19:46:50 +0100 Subject: [PATCH] [ACA-4715] upgrade to latest ADF alphas and cleanup env vars (#3312) * use latest ADF alphas * use latest ADF alphas * use ECM provider by default * use BASIC auth by default * defaults for oauth host * remove unused vars --- .github/actions/run-e2e-playwright/action.yml | 3 -- .github/actions/run-e2e/action.yml | 3 -- .github/workflows/pull-request.yml | 3 -- .github/workflows/release.yml | 3 -- Dockerfile | 6 --- README.md | 3 -- app/src/app.config.json.tpl | 6 +-- docker/run.sh | 8 --- package-lock.json | 52 +++++++++---------- package.json | 14 ++--- .../src/api/api-client-factory.ts | 4 +- 11 files changed, 38 insertions(+), 67 deletions(-) diff --git a/.github/actions/run-e2e-playwright/action.yml b/.github/actions/run-e2e-playwright/action.yml index c9482c29f..4706f315e 100644 --- a/.github/actions/run-e2e-playwright/action.yml +++ b/.github/actions/run-e2e-playwright/action.yml @@ -26,9 +26,6 @@ runs: { echo "APP_CONFIG_ECM_HOST={protocol}//{hostname}{:port}" - echo "APP_CONFIG_PROVIDER=ECM" - echo "APP_CONFIG_AUTH_TYPE=BASIC" - echo "APP_CONFIG_OAUTH2_HOST=http://localhost:4200/auth/realms/alfresco" } >> .env npm start > /dev/null &\ diff --git a/.github/actions/run-e2e/action.yml b/.github/actions/run-e2e/action.yml index 1a8a4c86c..91acd6c46 100644 --- a/.github/actions/run-e2e/action.yml +++ b/.github/actions/run-e2e/action.yml @@ -27,9 +27,6 @@ runs: { echo "APP_CONFIG_ECM_HOST={protocol}//{hostname}{:port}" - echo "APP_CONFIG_PROVIDER=ECM" - echo "APP_CONFIG_AUTH_TYPE=BASIC" - echo "APP_CONFIG_OAUTH2_HOST=http://localhost:4200/auth/realms/alfresco" } >> .env npm start > /dev/null &\ diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 7d0999bcb..8e48464de 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -25,9 +25,6 @@ env: SCREENSHOT_PASSWORD: ${{ secrets.SCREENSHOT_PASSWORD}} AWS_REGION: "eu-west-2" CONTENT_CE_DIST_PATH: "./dist/content-ce" - APP_CONFIG_PROVIDER: ECM - APP_CONFIG_AUTH_TYPE: BASIC - APP_CONFIG_OAUTH2_HOST: http://localhost:4200/auth/realms/alfresco PLAYWRIGHT_E2E_HOST: ${{ secrets.PLAYWRIGHT_E2E_HOST }} GH_BUILD_NUMBER: ${{ github.run_id }} MAXINSTANCES: 2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7a37276ac..cf9d39a9e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,9 +19,6 @@ env: ADMIN_PASSWORD: ${{ secrets.PIPELINE_ADMIN_PASSWORD }} AWS_REGION: "eu-west-2" CONTENT_CE_DIST_PATH: "./dist/content-ce" - APP_CONFIG_PROVIDER: ECM - APP_CONFIG_AUTH_TYPE: BASIC - APP_CONFIG_OAUTH2_HOST: http://localhost:4200/auth/realms/alfresco PLAYWRIGHT_E2E_HOST: ${{ secrets.PLAYWRIGHT_E2E_HOST }} NPM_REGISTRY_ADDRESS: ${{ secrets.NPM_REGISTRY_ADDRESS }} diff --git a/Dockerfile b/Dockerfile index 3649571a2..3871207c2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,13 +17,7 @@ RUN apk update && apk upgrade USER 101 ARG PROJECT_NAME -ARG PROVIDER="ECM" -ARG AUTH_TYPE="BASIC" -ENV APP_CONFIG_PROVIDER=$PROVIDER -ENV APP_CONFIG_AUTH_TYPE=$AUTH_TYPE - -ENV APP_CONFIG_OAUTH2_HOST="{protocol}//{hostname}{:port}/auth/realms/alfresco" ENV APP_CONFIG_BPM_HOST="{protocol}//{hostname}{:port}" ENV APP_CONFIG_ECM_HOST="{protocol}//{hostname}{:port}" diff --git a/README.md b/README.md index b97bfb699..36ae04780 100644 --- a/README.md +++ b/README.md @@ -26,9 +26,6 @@ Create an `.env` file in the project root folder with the following content ```yml APP_CONFIG_ECM_HOST="" -APP_CONFIG_PROVIDER=ECM -APP_CONFIG_AUTH_TYPE=BASIC -APP_CONFIG_OAUTH2_HOST=http://localhost:4200/auth/realms/alfresco ``` Where `` is the address of the ACS. diff --git a/app/src/app.config.json.tpl b/app/src/app.config.json.tpl index 19fed403d..8a65d75fc 100644 --- a/app/src/app.config.json.tpl +++ b/app/src/app.config.json.tpl @@ -3,8 +3,8 @@ "ecmHost": "${APP_CONFIG_ECM_HOST}", "aosHost": "${APP_CONFIG_ECM_HOST}/alfresco/aos", "baseShareUrl": "${APP_CONFIG_ECM_HOST}/#/preview/s", - "providers": "${APP_CONFIG_PROVIDER}", - "authType": "${APP_CONFIG_AUTH_TYPE}", + "providers": "ECM", + "authType": "BASIC", "loginRoute": "login", "mobileAppSwitch": { "enabled": true @@ -15,7 +15,7 @@ "folderRules": true }, "oauth2": { - "host": "${APP_CONFIG_OAUTH2_HOST}", + "host": "{protocol}//{hostname}{:port}/auth/realms/alfresco", "clientId": "alfresco", "scope": "openid", "secret": "", diff --git a/docker/run.sh b/docker/run.sh index f8d0d489c..2098ff960 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -5,16 +5,8 @@ set -e eval ALL_ARGUMENTS=("BASE_PATH" "APP_BASE_SHARE_URL" "APP_CONFIG_IDENTITY_HOST" - "APP_CONFIG_OAUTH2_HOST" "APP_CONFIG_BPM_HOST" "APP_CONFIG_ECM_HOST" - "APP_CONFIG_AUTH_TYPE" - "APP_CONFIG_PROVIDER" - "APP_CONFIG_PLUGIN_MICROSOFT_ONLINE" - "APP_CONFIG_MICROSOFT_ONLINE_AUTHORITY" - "APP_CONFIG_MICROSOFT_ONLINE_CLIENTID" - "APP_CONFIG_MICROSOFT_ONLINE_OOI_URL" - "APP_CONFIG_MICROSOFT_ONLINE_REDIRECT" ) ALL_ARGUMENTS_LENGTH=${#ALL_ARGUMENTS[@]} DOCKER_ARGS="" diff --git a/package-lock.json b/package-lock.json index 201cf6a63..1a26ba9a8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,10 +10,10 @@ "hasInstallScript": true, "license": "LGPL-3.0", "dependencies": { - "@alfresco/adf-content-services": "6.2.0", - "@alfresco/adf-core": "6.2.0", - "@alfresco/adf-extensions": "6.2.0", - "@alfresco/eslint-plugin-eslint-angular": "6.2.0", + "@alfresco/adf-content-services": "6.3.0-5466178577", + "@alfresco/adf-core": "6.3.0-5466178577", + "@alfresco/adf-extensions": "6.3.0-5466178577", + "@alfresco/eslint-plugin-eslint-angular": "6.3.0-5466178577", "@alfresco/js-api": "6.2.0", "@angular/animations": "14.1.3", "@angular/cdk": "14.1.3", @@ -45,8 +45,8 @@ "zone.js": "0.11.8" }, "devDependencies": { - "@alfresco/adf-cli": "6.2.0", - "@alfresco/adf-testing": "6.2.0", + "@alfresco/adf-cli": "6.3.0-5466178577", + "@alfresco/adf-testing": "6.3.0-5466178577", "@angular-devkit/build-angular": "14.2.11", "@angular-devkit/core": "14.1.2", "@angular-devkit/schematics": "14.1.2", @@ -121,9 +121,9 @@ "dev": true }, "node_modules/@alfresco/adf-cli": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@alfresco/adf-cli/-/adf-cli-6.2.0.tgz", - "integrity": "sha512-9YN7YUGVqzmroed1MT/e/K+YjDdC+WtUC+ldE9lb3eC27YLN9GP1nzF42bV5yCgyRSS5fAS5xhCaouaL08XNrA==", + "version": "6.3.0-5466178577", + "resolved": "https://registry.npmjs.org/@alfresco/adf-cli/-/adf-cli-6.3.0-5466178577.tgz", + "integrity": "sha512-pCYFC7Fjm80ORddPvtnSZGb/N4VOCFmO9+8O9OpDu9+XuIg5b4+14L6EszzFRbevo/PI5RsK1/XOb2HT64h2ZA==", "dev": true, "dependencies": { "@alfresco/js-api": ">=6.2.0", @@ -141,14 +141,14 @@ } }, "node_modules/@alfresco/adf-content-services": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@alfresco/adf-content-services/-/adf-content-services-6.2.0.tgz", - "integrity": "sha512-v/7GJI6yBBz0iy13PecaoyPPcvqIFRvvTnTJhVVWtKYiQEUcNoYj0BbYHtTw1EIp/Zf6qfSkyJBkwlDJvhwHDA==", + "version": "6.3.0-5466178577", + "resolved": "https://registry.npmjs.org/@alfresco/adf-content-services/-/adf-content-services-6.3.0-5466178577.tgz", + "integrity": "sha512-aaY66EpjRwC4IAyDIBkHdPM+QW/MYSFc7xtkzBPn/KRrA3LmtcxpWVVXTweCLebo8E6zMR5cp2P3Ljk9sFTB0w==", "dependencies": { "tslib": "^2.3.0" }, "peerDependencies": { - "@alfresco/adf-core": ">=6.2.0", + "@alfresco/adf-core": ">=6.3.0-5466178577", "@alfresco/js-api": ">=6.2.0", "@angular/animations": ">=14.1.3", "@angular/cdk": ">=14.1.2", @@ -165,9 +165,9 @@ } }, "node_modules/@alfresco/adf-core": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@alfresco/adf-core/-/adf-core-6.2.0.tgz", - "integrity": "sha512-C6oMB+Yl1XF1TAJpWRVpGDDtOVS4qtLj/UKMMdV4XVHBdGX/B2LEwQdQTfH4M10SNMitUa4qQOI4WoIA93xtMA==", + "version": "6.3.0-5466178577", + "resolved": "https://registry.npmjs.org/@alfresco/adf-core/-/adf-core-6.3.0-5466178577.tgz", + "integrity": "sha512-ke+WnpGjZNo2EdHz8lz7YEiRvy596Bp2Ca+lceMYHRvc0RxiyAsLgcoInobUDOFxouadKzDEpe/Rjo6x7WP9Eg==", "dependencies": { "angular-oauth2-oidc": "^13.0.1", "angular-oauth2-oidc-jwks": "^13.0.1", @@ -175,7 +175,7 @@ "tslib": "^2.3.0" }, "peerDependencies": { - "@alfresco/adf-extensions": ">=6.2.0", + "@alfresco/adf-extensions": ">=6.3.0-5466178577", "@alfresco/js-api": ">=6.2.0", "@angular/animations": ">=14.1.3", "@angular/cdk": ">=14.1.2", @@ -194,9 +194,9 @@ } }, "node_modules/@alfresco/adf-extensions": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@alfresco/adf-extensions/-/adf-extensions-6.2.0.tgz", - "integrity": "sha512-I4oQPH6w+YXdp2MLpKtnZ/6TDb77tl0EDt90JU95k9xwYxKWKqB5cFhmmHArB6LLac6Jy2H5Prdd3RHGnLjmag==", + "version": "6.3.0-5466178577", + "resolved": "https://registry.npmjs.org/@alfresco/adf-extensions/-/adf-extensions-6.3.0-5466178577.tgz", + "integrity": "sha512-6OrkqALNNLnWhoskI4nLKiJ8Lm07KZNPr5146bLlgtSpAYop+ICvK9dE2QEeXBb0GAsTFHb56iPw2ICtjNWqcA==", "dependencies": { "tslib": "^2.3.0" }, @@ -207,9 +207,9 @@ } }, "node_modules/@alfresco/adf-testing": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@alfresco/adf-testing/-/adf-testing-6.2.0.tgz", - "integrity": "sha512-n8SXi0Q/NFW+zEXTC7Zg853IeRIIxaGHPk0yDr50/0Ho6KpaCrQHcU3hGCYzwroW5yXf15A5K4SslaC7I/mP5Q==", + "version": "6.3.0-5466178577", + "resolved": "https://registry.npmjs.org/@alfresco/adf-testing/-/adf-testing-6.3.0-5466178577.tgz", + "integrity": "sha512-Ryyw3WkqMYQREo1wU1JysgvvUxIi6G94xcIXdrdgM17UhLDIhKPPXx1SLKYrvsb1zuBPg5gTjCMtPJtZ05Rs8Q==", "dev": true, "dependencies": { "@alfresco/js-api": ">=6.2.0", @@ -224,9 +224,9 @@ } }, "node_modules/@alfresco/eslint-plugin-eslint-angular": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@alfresco/eslint-plugin-eslint-angular/-/eslint-plugin-eslint-angular-6.2.0.tgz", - "integrity": "sha512-RBbs5bdjgeKD5ZGnIa1CojsWTWP/yfI9A/2ZJ3HC5OTqvQIcyg/HqDRoAHR4muuZP7SZmGdYDY5NBlu5/mQ3mw==" + "version": "6.3.0-5466178577", + "resolved": "https://registry.npmjs.org/@alfresco/eslint-plugin-eslint-angular/-/eslint-plugin-eslint-angular-6.3.0-5466178577.tgz", + "integrity": "sha512-/DyC2JXmv4TXPxbmJNOnlLFJx4ygzpC5AQGQOfC0b+yUpJmnjt/dvE2YZqL0ijlnlIVPunQS9YfCvhIHSizhSw==" }, "node_modules/@alfresco/js-api": { "version": "6.2.0", diff --git a/package.json b/package.json index 92174f306..e01bd5b4b 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "postinstall": "ngcc", "ng": "ng", "validate-app-config": "ajv validate -s ./node_modules/@alfresco/adf-core/app.config.schema.json -d ./app/.tmp/app.config.json --errors=text --verbose", - "assemble-app-config": "envsub --env-file ./.env --env APP_CONFIG_ECM_HOST={protocol}//{hostname}{:port} --env APP_CONFIG_PROVIDER=ECM --env APP_CONFIG_AUTH_TYPE=BASIC --env APP_CONFIG_OAUTH2_HOST=http://localhost:4200/auth/realms/alfresco --all ./app/src/app.config.json.tpl ./app/.tmp/app.config.json", + "assemble-app-config": "envsub --env-file ./.env --env APP_CONFIG_ECM_HOST={protocol}//{hostname}{:port} --all ./app/src/app.config.json.tpl ./app/.tmp/app.config.json", "prestart": "mkdir -p ./app/.tmp && npm run assemble-app-config && npm run validate-app-config", "start": "nx serve content-ce", "start:prod": "npm run validate-app-config && node --max-old-space-size=8192 nx serve content-ce --configuration production", @@ -38,10 +38,10 @@ }, "private": true, "dependencies": { - "@alfresco/adf-content-services": "6.2.0", - "@alfresco/adf-core": "6.2.0", - "@alfresco/adf-extensions": "6.2.0", - "@alfresco/eslint-plugin-eslint-angular": "6.2.0", + "@alfresco/adf-content-services": "6.3.0-5466178577", + "@alfresco/adf-core": "6.3.0-5466178577", + "@alfresco/adf-extensions": "6.3.0-5466178577", + "@alfresco/eslint-plugin-eslint-angular": "6.3.0-5466178577", "@alfresco/js-api": "6.2.0", "@angular/animations": "14.1.3", "@angular/cdk": "14.1.3", @@ -73,8 +73,8 @@ "zone.js": "0.11.8" }, "devDependencies": { - "@alfresco/adf-cli": "6.2.0", - "@alfresco/adf-testing": "6.2.0", + "@alfresco/adf-cli": "6.3.0-5466178577", + "@alfresco/adf-testing": "6.3.0-5466178577", "@angular-devkit/build-angular": "14.2.11", "@angular-devkit/core": "14.1.2", "@angular-devkit/schematics": "14.1.2", diff --git a/projects/aca-playwright-shared/src/api/api-client-factory.ts b/projects/aca-playwright-shared/src/api/api-client-factory.ts index 907635b9d..a848a00eb 100644 --- a/projects/aca-playwright-shared/src/api/api-client-factory.ts +++ b/projects/aca-playwright-shared/src/api/api-client-factory.ts @@ -50,10 +50,10 @@ export interface AcaBackend { } const config = { - authType: process.env.APP_CONFIG_AUTH_TYPE, + authType: 'BASIC', hostBpm: process.env.APP_CONFIG_BPM_HOST, hostEcm: process.env.APP_CONFIG_ECM_HOST, - provider: process.env.APP_CONFIG_PROVIDER, + provider: 'ECM', contextRoot: 'alfresco' };