diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3747dd2f36..fc80fc2737 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -407,6 +407,9 @@ jobs: run: node common/scripts/install-run-rush.js docker:build -p 20 env: DOCKER_CLI_HINTS: false + - name: Configure /etc/hosts + run: | + sudo echo "127.0.0.1 host.docker.internal" | sudo tee -a /etc/hosts - name: Prepare server run: | cd ./qms-tests diff --git a/README.md b/README.md index ec34b4f8ce..95da7ff7d6 100644 --- a/README.md +++ b/README.md @@ -127,12 +127,17 @@ Alternatively, you can just execute: sh ./scripts/create-workspace.sh ``` -Accessing the URL http://localhost:8087 will lead you to the app in production mode. +Add the following line to your /etc/hosts file + +``` +127.0.0.1 host.docker.internal +``` + +Accessing the URL http://host.docker.internal:8087 will lead you to the app in development mode. Limitations: - Local installation does not support sending emails, thus disabling functionalities such as password recovery and email notifications. -- Integrations with Telegram, Gmail, and other content sources are exclusively available as Docker containers, sourced from private repositories. However, these integrations are fully functional and can be utilized with the platform. ## Run in development mode diff --git a/dev/branding.json b/dev/branding.json index 9515761f9d..b35a6042a5 100644 --- a/dev/branding.json +++ b/dev/branding.json @@ -13,6 +13,13 @@ "language": "en", "lastNameFirst": "true" }, + "host.docker.internal:8087": { + "key": "huly-docker", + "title": "Huly", + "protocol": "http", + "language": "en", + "lastNameFirst": "true" + }, "localhost:8081": { "key": "tracex-dev", "title": "TraceX", @@ -25,6 +32,13 @@ "protocol": "http", "language": "en" }, + "host.docker.internal:8088": { + "key": "tracex-docker", + "title": "Huly", + "protocol": "http", + "language": "en", + "lastNameFirst": "true" + }, "example.localhost": { "key": "example", "title": "Example", diff --git a/dev/docker-compose.yaml b/dev/docker-compose.yaml index 78ea7ab210..ee0fca0054 100644 --- a/dev/docker-compose.yaml +++ b/dev/docker-compose.yaml @@ -74,14 +74,14 @@ services: - ACCOUNT_PORT=3000 - SERVER_SECRET=secret - MONGO_URL=${MONGO_URL} - - TRANSACTOR_URL=ws://host.docker.internal:3333;ws://localhost:3333 + - TRANSACTOR_URL=ws://host.docker.internal:3333 - SES_URL= - STORAGE_CONFIG=${STORAGE_CONFIG} - FRONT_URL=http://host.docker.internal:8087 - RESERVED_DB_NAMES=telegram,gmail,github - MODEL_ENABLED=* - LAST_NAME_FIRST=true - - ACCOUNTS_URL=http://localhost:3000 + - ACCOUNTS_URL=http://host.docker.internal:3000 - BRANDING_PATH=/var/cfg/branding.json # - INIT_SCRIPT_URL=https://raw.githubusercontent.com/hcengineering/init/main/script.yaml # - INIT_WORKSPACE=onboarding @@ -102,10 +102,10 @@ services: # - WS_OPERATION=create - SERVER_SECRET=secret - MONGO_URL=mongodb://mongodb:27017?compressors=snappy - - TRANSACTOR_URL=ws://transactor:3333;ws://localhost:3333 + - TRANSACTOR_URL=ws://transactor:3333;ws://host.docker.internal:3333 - SES_URL= - STORAGE_CONFIG=${STORAGE_CONFIG} - - FRONT_URL=http://localhost:8087 + - FRONT_URL=http://host.docker.internal:8087 - RESERVED_DB_NAMES=telegram,gmail,github - MODEL_ENABLED=* - ACCOUNTS_URL=http://host.docker.internal:3000 @@ -151,22 +151,22 @@ services: - SERVER_SECRET=secret - MONGO_URL=${MONGO_URL} - 'MONGO_OPTIONS={"appName":"front","maxPoolSize":1}' - - ACCOUNTS_URL=http://localhost:3000 + - ACCOUNTS_URL=http://host.docker.internal:3000 - UPLOAD_URL=/files - ELASTIC_URL=http://host.docker.internal:9200 - - GMAIL_URL=http://localhost:8088 - - CALENDAR_URL=http://localhost:8095 - - TELEGRAM_URL=http://localhost:8086 - - REKONI_URL=http://localhost:4004 - - COLLABORATOR_URL=ws://localhost:3078 + - GMAIL_URL=http://host.docker.internal:8088 + - CALENDAR_URL=http://host.docker.internal:8095 + - TELEGRAM_URL=http://host.docker.internal:8086 + - REKONI_URL=http://host.docker.internal:4004 + - COLLABORATOR_URL=ws://host.docker.internal:3078 - STORAGE_CONFIG=${STORAGE_CONFIG} - - GITHUB_URL=http://localhost:3500 - - PRINT_URL=http://localhost:4005 - - SIGN_URL=http://localhost:4006 - - ANALYTICS_COLLECTOR_URL=http://localhost:4017 + - GITHUB_URL=http://host.docker.internal:3500 + - PRINT_URL=http://host.docker.internal:4005 + - SIGN_URL=http://host.docker.internal:4006 + - ANALYTICS_COLLECTOR_URL=http://host.docker.internal:4017 - DESKTOP_UPDATES_URL=https://dist.huly.io - DESKTOP_UPDATES_CHANNEL=dev - - BRANDING_URL=http://localhost:8087/branding.json + - BRANDING_URL=http://host.docker.internal:8087/branding.json restart: unless-stopped transactor: image: hardcoreeng/transactor @@ -197,7 +197,7 @@ services: - METRICS_FILE=metrics.txt - STORAGE_CONFIG=${STORAGE_CONFIG} - REKONI_URL=http://host.docker.internal:4004 - - FRONT_URL=http://localhost:8087 + - FRONT_URL=http://host.docker.internal:8087 # - APM_SERVER_URL=http://apm-server:8200 - SES_URL='' - ACCOUNTS_URL=http://host.docker.internal:3000 diff --git a/qms-tests/.env b/qms-tests/.env index 90fe452486..ac5825fc99 100644 --- a/qms-tests/.env +++ b/qms-tests/.env @@ -1 +1,2 @@ -STORAGE_CONFIG="minio|minio?accessKey=minioadmin&secretKey=minioadmin" \ No newline at end of file +STORAGE_CONFIG="minio|minio?accessKey=minioadmin&secretKey=minioadmin" +MONGO_URL=mongodb://mongodb:27018?compressors=snappy \ No newline at end of file diff --git a/qms-tests/branding-test.json b/qms-tests/branding-test.json index d4c7d4ee17..35865e70f1 100644 --- a/qms-tests/branding-test.json +++ b/qms-tests/branding-test.json @@ -42,6 +42,49 @@ } ] }, + "host.docker.internal:8083": { + "key": "tracex-docker", + "title": "TraceX", + "protocol": "http", + "languages": "en", + "defaultLanguage": "en", + "defaultApplication": "documents", + "defaultSpace": "documents:space:QualityDocuments", + "defaultSpecial": "", + "lastNameFirst": "true", + "initWorkspace": "init-ws-qms", + "links": [ + { + "rel": "shortcut icon", + "type": "image/x-icon", + "href": "/tracex/favicon.ico" + }, + { + "rel": "icon", + "type": "image/svg+xml", + "sizes": "any", + "href": "/tracex/favicon.svg" + }, + { + "rel": "icon", + "type": "image/png", + "sizes": "16x16", + "href": "/tracex/favicon_16.png" + }, + { + "rel": "icon", + "type": "image/png", + "sizes": "32x32", + "href": "/tracex/favicon_32.png" + }, + { + "rel": "icon", + "type": "image/png", + "sizes": "192x192", + "href": "/tracex/favicon_192.png" + } + ] + }, "localhost:8080": { "key": "tracex-dev", "title": "TraceX", diff --git a/qms-tests/docker-compose.yaml b/qms-tests/docker-compose.yaml index d1afc93b35..ddb2bfa59b 100644 --- a/qms-tests/docker-compose.yaml +++ b/qms-tests/docker-compose.yaml @@ -50,7 +50,7 @@ services: - ACCOUNT_PORT=3003 - SERVER_SECRET=secret - MONGO_URL=mongodb://mongodb:27018 - - TRANSACTOR_URL=ws://transactor:3334;ws://localhost:3334 + - TRANSACTOR_URL=ws://transactor:3334;ws://host.docker.internal:3334 - STORAGE_CONFIG=${STORAGE_CONFIG} - MODEL_ENABLED=* - BRANDING_PATH=/var/cfg/branding-test.json @@ -64,7 +64,7 @@ services: environment: - SERVER_SECRET=secret - MONGO_URL=mongodb://mongodb:27018 - - TRANSACTOR_URL=ws://transactor:3334;ws://localhost:3334 + - TRANSACTOR_URL=ws://transactor:3334;ws://host.docker.internal:3334 - STORAGE_CONFIG=${STORAGE_CONFIG} - MODEL_ENABLED=* - ACCOUNTS_URL=http://account:3003 @@ -88,17 +88,19 @@ services: environment: - SERVER_PORT=8083 - SERVER_SECRET=secret - - ACCOUNTS_URL=http://localhost:3003 + - ACCOUNTS_URL=http://host.docker.internal:3003 - MONGO_URL=mongodb://mongodb:27018 - UPLOAD_URL=/files - ELASTIC_URL=http://elastic:9200 - - GMAIL_URL=http://localhost:8088 - - CALENDAR_URL=http://localhost:8095 + - GMAIL_URL=http://host.docker.internal:8088 + - CALENDAR_URL=http://host.docker.internal:8095 - REKONI_URL=http://rekoni:4005 - - TELEGRAM_URL=http://localhost:8086 - - COLLABORATOR_URL=ws://localhost:3079 + - TELEGRAM_URL=http://host.docker.internal:8086 + - COLLABORATOR_URL=ws://host.docker.internal:3079 - STORAGE_CONFIG=${STORAGE_CONFIG} - - BRANDING_URL=http://localhost:8083/branding-test.json + - BRANDING_URL=http://host.docker.internal:8083/branding-test.json + - PRINT_URL=http://host.docker.internal:4005 + - SIGN_URL=http://host.docker.internal:4006 transactor: image: hardcoreeng/transactor pull_policy: never @@ -122,8 +124,8 @@ services: - METRICS_FILE=metrics.txt - STORAGE_CONFIG=${STORAGE_CONFIG} - REKONI_URL=http://rekoni:4005 - - FRONT_URL=http://localhost:8083 - - UPLOAD_URL=http://localhost:8083/files + - FRONT_URL=http://host.docker.internal:8083 + - UPLOAD_URL=http://host.docker.internal:8083/files - ACCOUNTS_URL=http://account:3003 - LAST_NAME_FIRST=true - ELASTIC_INDEX_NAME=local_storage_index @@ -147,11 +149,42 @@ services: rekoni: image: hardcoreeng/rekoni-service restart: on-failure + print: + image: hardcoreeng/print + restart: unless-stopped ports: - - 4005:4004 + - 4005:4005 + environment: + - SECRET=secret + - MONGO_URL=${MONGO_URL} + - MONGO_OPTIONS={"appName":"print","maxPoolSize":1} + - STORAGE_CONFIG=${STORAGE_CONFIG} deploy: resources: limits: - memory: 1024M + memory: 300M + sign: + image: hardcoreeng/sign + restart: unless-stopped + ports: + - 4006:4006 + volumes: + - ../services/sign/pod-sign/debug/certificate.p12:/var/cfg/certificate.p12 + - ../services/sign/pod-sign/debug/branding.json:/var/cfg/branding.json + environment: + - SECRET=secret + - MONGO_URL=${MONGO_URL} + - MONGO_OPTIONS={"appName":"sign","maxPoolSize":1} + - MINIO_ENDPOINT=minio + - MINIO_ACCESS_KEY=minioadmin + - ACCOUNTS_URL=http://host.docker.internal:3000 + - MINIO_SECRET_KEY=minioadmin + - CERTIFICATE_PATH=/var/cfg/certificate.p12 + - SERVICE_ID=sign-service + - BRANDING_PATH=/var/cfg/branding.json + deploy: + resources: + limits: + memory: 300M volumes: files: diff --git a/qms-tests/sanity/.env b/qms-tests/sanity/.env index c35d538294..b6c722905f 100644 --- a/qms-tests/sanity/.env +++ b/qms-tests/sanity/.env @@ -1,5 +1,5 @@ -PLATFORM_URI='http://localhost:8083' -PLATFORM_TRANSACTOR='ws://localhost:3334' +PLATFORM_URI='http://host.docker.internal:8083' +PLATFORM_TRANSACTOR='ws://host.docker.internal:3334' PLATFORM_USER='user1' PLATFORM_USER_SECOND='user2' REGULAR_USER='user3' diff --git a/qms-tests/sanity/package.json b/qms-tests/sanity/package.json index 4bc027fa87..c2dc64ee7f 100644 --- a/qms-tests/sanity/package.json +++ b/qms-tests/sanity/package.json @@ -19,12 +19,12 @@ "format": "format tests", "ci": "playwright install --with-deps chromium", "test": "", - "uitest": "cross-env LOCAL_URL=http://localhost:3003/ DEV_URL= playwright test -c ./tests/playwright.config.ts", + "uitest": "cross-env LOCAL_URL=http://host.docker.internal:3003/ DEV_URL= playwright test -c ./tests/playwright.config.ts", "staging-uitest": "cross-env PLATFORM_URI=https://front.hc.engineering/ playwright test -c ./tests/playwright.config.ts --grep @staging", - "dev-uitest": "cross-env PLATFORM_URI=http://localhost:8080 PLATFORM_TRANSACTOR=ws://localhost:3333 SETTING=storage-dev.json SETTING_SECOND=storageSecond-dev.json DEV_URL=http://localhost:8080/account playwright test -c ./tests/playwright.config.ts", + "dev-uitest": "cross-env PLATFORM_URI=http://localhost:8080 PLATFORM_TRANSACTOR=ws://host.docker.internal:3333 SETTING=storage-dev.json SETTING_SECOND=storageSecond-dev.json DEV_URL=http://localhost:8080/account playwright test -c ./tests/playwright.config.ts", "debug": "playwright test -c ./tests/playwright.config.ts --debug --headed", - "dev-debug": "cross-env PLATFORM_URI=http://localhost:8080 PLATFORM_TRANSACTOR=ws://localhost:3333 SETTING=storage-dev.json SETTING_SECOND=storageSecond-dev.json playwright test -c ./tests/playwright.config.ts --debug --headed", - "codegen": "playwright codegen --load-storage storage.json http://localhost:8083/workbench/sanity-ws/", + "dev-debug": "cross-env PLATFORM_URI=http://localhost:8080 PLATFORM_TRANSACTOR=ws://host.docker.internal:3333 SETTING=storage-dev.json SETTING_SECOND=storageSecond-dev.json playwright test -c ./tests/playwright.config.ts --debug --headed", + "codegen": "playwright codegen --load-storage storage.json http://host.docker.internal:8083/workbench/sanity-ws/", "dev-codegen": "cross-env playwright codegen --load-storage storage-dev.json http://localhost:8080/workbench/sanity-ws/", "allure:generate": "allure generate allure-results -o allure-report --clean" }, diff --git a/qms-tests/sanity/storage.json b/qms-tests/sanity/storage.json index 38fcfc911b..d2cd2f9ce6 100644 --- a/qms-tests/sanity/storage.json +++ b/qms-tests/sanity/storage.json @@ -2,7 +2,7 @@ "cookies": [], "origins": [ { - "origin": "http://localhost:8083", + "origin": "http://host.docker.internal:8083", "localStorage": [ { "name": "login:metadata:LoginEmail", @@ -14,7 +14,7 @@ }, { "name": "login:metadata:LoginEndpoint", - "value": "ws://localhost:3334" + "value": "ws://host.docker.internal:3334" }, { "name": "#platform.notification.logging", diff --git a/qms-tests/sanity/storageQaraManager.json b/qms-tests/sanity/storageQaraManager.json index 9ce6e5658d..eef84ef90b 100644 --- a/qms-tests/sanity/storageQaraManager.json +++ b/qms-tests/sanity/storageQaraManager.json @@ -2,7 +2,7 @@ "cookies": [], "origins": [ { - "origin": "http://localhost:8083", + "origin": "http://host.docker.internal:8083", "localStorage": [ { "name": "login:metadata:LoginEmail", @@ -14,7 +14,7 @@ }, { "name": "login:metadata:LoginEndpoint", - "value": "ws://localhost:3334" + "value": "ws://host.docker.internal:3334" }, { "name": "#platform.notification.logging", diff --git a/qms-tests/sanity/storageSecond.json b/qms-tests/sanity/storageSecond.json index f979338302..e697bf48ac 100644 --- a/qms-tests/sanity/storageSecond.json +++ b/qms-tests/sanity/storageSecond.json @@ -2,7 +2,7 @@ "cookies": [], "origins": [ { - "origin": "http://localhost:8083", + "origin": "http://host.docker.internal:8083", "localStorage": [ { "name": "login:metadata:LoginEmail", @@ -14,7 +14,7 @@ }, { "name": "login:metadata:LoginEndpoint", - "value": "ws://localhost:3334" + "value": "ws://host.docker.internal:3334" }, { "name": "#platform.notification.logging", diff --git a/qms-tests/sanity/storageThird.json b/qms-tests/sanity/storageThird.json index ef4af3ee2c..3b79ea4d03 100644 --- a/qms-tests/sanity/storageThird.json +++ b/qms-tests/sanity/storageThird.json @@ -2,7 +2,7 @@ "cookies": [], "origins": [ { - "origin": "http://localhost:8083", + "origin": "http://host.docker.internal:8083", "localStorage": [ { "name": "login:metadata:LoginEmail", @@ -14,7 +14,7 @@ }, { "name": "login:metadata:LoginEndpoint", - "value": "ws://localhost:3334" + "value": "ws://host.docker.internal:3334" }, { "name": "#platform.notification.logging", diff --git a/services/print/pod-print/src/print.ts b/services/print/pod-print/src/print.ts index 98eda58919..93913c69b8 100644 --- a/services/print/pod-print/src/print.ts +++ b/services/print/pod-print/src/print.ts @@ -23,6 +23,8 @@ export async function print (url: string, options?: PrintOptions): Promise { + console.log(message) + }) + .on('requestfailed', (request) => { + console.log(`${request.failure()?.errorText} ${request.url()}`) + }) + await page.setViewport(viewport) // NOTE: Issues opened with a guest link worked fine only with networkidle0 here and diff --git a/services/sign/pod-sign/Dockerfile b/services/sign/pod-sign/Dockerfile index 1cd7ec0f03..12bfc895a9 100644 --- a/services/sign/pod-sign/Dockerfile +++ b/services/sign/pod-sign/Dockerfile @@ -4,6 +4,8 @@ FROM node:20 RUN apt-get update && apt-get install dumb-init WORKDIR /usr/src/app +RUN npm install --ignore-scripts=false --verbose bufferutil utf-8-validate @mongodb-js/zstd snappy --unsafe-perm + COPY bundle/bundle.js ./ CMD [ "dumb-init", "node", "bundle.js" ]