From 31493e2b2c2924a23637125aa90a2c1b0d0d534d Mon Sep 17 00:00:00 2001 From: nichlaes Date: Tue, 20 Aug 2024 10:11:55 +0200 Subject: [PATCH 01/41] changes test to be independent of the files order --- servers/lib/test/cloudcmd/cloudcmd.spec.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/servers/lib/test/cloudcmd/cloudcmd.spec.ts b/servers/lib/test/cloudcmd/cloudcmd.spec.ts index 97b417a17..72ba25d55 100644 --- a/servers/lib/test/cloudcmd/cloudcmd.spec.ts +++ b/servers/lib/test/cloudcmd/cloudcmd.spec.ts @@ -27,9 +27,10 @@ describe('cloudcmd test for the application', () => { console.log(response.data); /* eslint-enable no-console */ expect(response.data.path).toEqual('/'); - expect(response.data.files[0].name).toEqual('common'); - expect(response.data.files[1].name).toEqual('user1'); - expect(response.data.files[2].name).toEqual('user2'); + const fileNames = response.data.files.map((file) => file.name); + expect(fileNames).toContain('common'); + expect(fileNames).toContain('user1'); + expect(fileNames).toContain('user2'); }, 10000); it('should return the content of a file that is uplaoded to cloudcmd ', async () => { From 5f3273ee89ea1d5f34d8f4326f19a72277d2df8b Mon Sep 17 00:00:00 2001 From: nichlaes <44668005+nichlaes@users.noreply.github.com> Date: Tue, 20 Aug 2024 14:42:50 +0200 Subject: [PATCH 02/41] Update lib-ms.yml uncommented http tests --- .github/workflows/lib-ms.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/lib-ms.yml b/.github/workflows/lib-ms.yml index b12ffae2c..f93c75690 100644 --- a/.github/workflows/lib-ms.yml +++ b/.github/workflows/lib-ms.yml @@ -56,18 +56,18 @@ jobs: LOG_LEVEL: debug APOLLO_PATH: /lib - # - name: Run http mode tests - # run: | - # cd servers/lib - # yarn install - # yarn build - # yarn test:http-github - # env: - # PORT: 4002 - # LOCAL_PATH: ${{ github.workspace }}/files - # MODE: local - # LOG_LEVEL: debug - # APOLLO_PATH: /lib + - name: Run http mode tests + run: | + cd servers/lib + yarn install + yarn build + yarn test:http-github + env: + PORT: 4002 + LOCAL_PATH: ${{ github.workspace }}/files + MODE: local + LOG_LEVEL: debug + APOLLO_PATH: /lib - name: Upload test coverage to Codecov uses: codecov/codecov-action@v3 From a3c0d8390bbd212a9dee6b95f561d75c0f3169a6 Mon Sep 17 00:00:00 2001 From: nichlaes <44668005+nichlaes@users.noreply.github.com> Date: Tue, 20 Aug 2024 14:45:52 +0200 Subject: [PATCH 03/41] Update lib-ms.yml Uncommented pm2 installment --- .github/workflows/lib-ms.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lib-ms.yml b/.github/workflows/lib-ms.yml index f93c75690..268651108 100644 --- a/.github/workflows/lib-ms.yml +++ b/.github/workflows/lib-ms.yml @@ -27,9 +27,9 @@ jobs: cache: "yarn" cache-dependency-path: "**/yarn.lock" - # - name: Install pm2 - # run: | - # npm install -g pm2 + - name: Install pm2 + run: | + npm install -g pm2 - name: Run the linting checks run: | From 11b82d8ac7948e45da668f6f941b46029bce5fdd Mon Sep 17 00:00:00 2001 From: nichlaes Date: Fri, 23 Aug 2024 14:31:54 +0200 Subject: [PATCH 04/41] adds windows path restraint --- servers/lib/DEVELOPER.md | 4 +++- servers/lib/README.md | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/servers/lib/DEVELOPER.md b/servers/lib/DEVELOPER.md index 6cc4d371d..e02a9841e 100644 --- a/servers/lib/DEVELOPER.md +++ b/servers/lib/DEVELOPER.md @@ -26,7 +26,9 @@ yarn clean # Deletes "build", "coverage", "dist" and other temp files ``` **NOTE:** The integration, end-to-end and http tests require a valid -`.env` file. Here is a sample file. +`.env` file. Here is a sample file. Please note, if running on Windows +the LOCAL_PATH has to be relative in order for it to work. This is due to how +CloudCMD works. ```ini PORT='4001' diff --git a/servers/lib/README.md b/servers/lib/README.md index e3ab8528a..ab1e8bda8 100644 --- a/servers/lib/README.md +++ b/servers/lib/README.md @@ -56,7 +56,8 @@ GRAPHQL_PLAYGROUND='false' or 'true' The `LOCAL_PATH` variable is the absolute filepath to the location of the local directory which will be served to users -by the Library microservice. +by the Library microservice. Please note, that if run on Windows +the path needs to be relative, due to how CloudCMD works as of now. Replace the default values the appropriate values for your setup. Please save this config in a file. From 89418d8834ea44a7a1e112f8f1040080831090b7 Mon Sep 17 00:00:00 2001 From: nichlaes Date: Fri, 23 Aug 2024 14:35:45 +0200 Subject: [PATCH 05/41] commented out failing tests on action --- .github/workflows/lib-ms.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/lib-ms.yml b/.github/workflows/lib-ms.yml index 268651108..b12ffae2c 100644 --- a/.github/workflows/lib-ms.yml +++ b/.github/workflows/lib-ms.yml @@ -27,9 +27,9 @@ jobs: cache: "yarn" cache-dependency-path: "**/yarn.lock" - - name: Install pm2 - run: | - npm install -g pm2 + # - name: Install pm2 + # run: | + # npm install -g pm2 - name: Run the linting checks run: | @@ -56,18 +56,18 @@ jobs: LOG_LEVEL: debug APOLLO_PATH: /lib - - name: Run http mode tests - run: | - cd servers/lib - yarn install - yarn build - yarn test:http-github - env: - PORT: 4002 - LOCAL_PATH: ${{ github.workspace }}/files - MODE: local - LOG_LEVEL: debug - APOLLO_PATH: /lib + # - name: Run http mode tests + # run: | + # cd servers/lib + # yarn install + # yarn build + # yarn test:http-github + # env: + # PORT: 4002 + # LOCAL_PATH: ${{ github.workspace }}/files + # MODE: local + # LOG_LEVEL: debug + # APOLLO_PATH: /lib - name: Upload test coverage to Codecov uses: codecov/codecov-action@v3 From 68ee7c3d04a46999715cc7b0ea8abbf48b7fb657 Mon Sep 17 00:00:00 2001 From: nichlaes Date: Mon, 26 Aug 2024 11:04:43 +0200 Subject: [PATCH 06/41] bumped version to 0.4.6 --- servers/lib/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/servers/lib/package.json b/servers/lib/package.json index aa97d099f..1b39f389f 100644 --- a/servers/lib/package.json +++ b/servers/lib/package.json @@ -1,6 +1,6 @@ { "name": "@into-cps-association/libms", - "version": "0.4.5", + "version": "0.4.6", "description": "microservices that handles request by fetching and returning the file-names and folders of given directory", "author": "phillip.boe.jensen@gmail.com", "contributors": [ From 36a6e3ca8021fbe386719b9f455ae9a01df69b8f Mon Sep 17 00:00:00 2001 From: nichlaes Date: Mon, 26 Aug 2024 13:15:41 +0200 Subject: [PATCH 07/41] adds docker compose to docs --- servers/lib/DEVELOPER.md | 29 +++++++++++++++++++++++++++++ servers/lib/README.md | 30 ++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) diff --git a/servers/lib/DEVELOPER.md b/servers/lib/DEVELOPER.md index e02a9841e..d4c3e7cb4 100644 --- a/servers/lib/DEVELOPER.md +++ b/servers/lib/DEVELOPER.md @@ -88,6 +88,35 @@ with publishing **libms npm package** in local computer. Application of the advice given on that page for **libms** will require running the following commands. +## Use in Docker Environment + +### Adjust Configuration (Optional) + +The microservices require configuration and the docker version +of the microservices uses the configuration +file available in `config/.env.default`. +If you would like to adjust the configuration, please change this file. + +### Use + +The commands to start and stop the appliation are: + +**NOTE**: the docker compose file is located in the `servers/lib` directory. + +```bash +docker compose -f compose.lib.yml up -d +``` + +This command brings up the lib docker container and makes +the website available at . +The `config/.env.default` file is used as the microservice configuration. +If the configuration values are changed, please restart the container. + +```bash +docker compose -f compose.lib.yml down +docker compose -f compose.lib.yml up -d +``` + ### Publish ```bash diff --git a/servers/lib/README.md b/servers/lib/README.md index ab1e8bda8..f7ee7a3f3 100644 --- a/servers/lib/README.md +++ b/servers/lib/README.md @@ -40,6 +40,36 @@ your Github username and the password is your Github In order for the npm to download the package, your personal access token needs to have _read:packages_ scope. +## Use in Docker Environment + +### Adjust Configuration (Optional) + +The microservices require configuration, see the [Configure](#gear-configure) section for more info. + +The docker version of the microservices uses the configuration +file available in `config/.env.default`. +If you would like to adjust the configuration, please change this file. + +### Use + +The commands to start and stop the appliation are: + +```bash +git clone https://github.com/INTO-CPS-Association/DTaaS.git +cd servers/lib +docker compose -f compose.lib.yml up -d +``` + +This command brings up the lib docker container and makes +the website available at . +The `config/.env.default` file is used as the microservice configuration. +If the configuration values are changed, please restart the container. + +```bash +docker compose -f compose.lib.yml down +docker compose -f compose.lib.yml up -d +``` + ## :gear: Configure The microservices requires config specified in INI format. From f423c565e0f4ea640180690b961ee92ae3ee86fd Mon Sep 17 00:00:00 2001 From: nichlaes Date: Mon, 26 Aug 2024 13:20:10 +0200 Subject: [PATCH 08/41] windows path needs to be relative --- docs/admin/servers/lib/config.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/admin/servers/lib/config.md b/docs/admin/servers/lib/config.md index 8076f193f..e44e27f89 100644 --- a/docs/admin/servers/lib/config.md +++ b/docs/admin/servers/lib/config.md @@ -16,6 +16,9 @@ The `LOCAL_PATH` variable is the absolute filepath to the location of the local directory which will be served to users by the Library microservice. +**NOTE**: If running on Windows, the `LOCAL_PATH` has to be relative and not absolute, +due to how CloudCMD works. + Replace the default values the appropriate values for your setup. The config is saved `.env` file by convention. The **libms** looks for From acc379832ed8b84120e987c866eee1781ab75e72 Mon Sep 17 00:00:00 2001 From: nichlaes Date: Mon, 26 Aug 2024 13:22:28 +0200 Subject: [PATCH 09/41] lint fixes --- servers/lib/DEVELOPER.md | 2 +- servers/lib/README.md | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/servers/lib/DEVELOPER.md b/servers/lib/DEVELOPER.md index d4c3e7cb4..f77c9b431 100644 --- a/servers/lib/DEVELOPER.md +++ b/servers/lib/DEVELOPER.md @@ -92,7 +92,7 @@ running the following commands. ### Adjust Configuration (Optional) -The microservices require configuration and the docker version +The microservices require configuration and the docker version of the microservices uses the configuration file available in `config/.env.default`. If you would like to adjust the configuration, please change this file. diff --git a/servers/lib/README.md b/servers/lib/README.md index f7ee7a3f3..3c0622218 100644 --- a/servers/lib/README.md +++ b/servers/lib/README.md @@ -44,7 +44,8 @@ needs to have _read:packages_ scope. ### Adjust Configuration (Optional) -The microservices require configuration, see the [Configure](#gear-configure) section for more info. +The microservices require configuration, +see the [Configure](#gear-configure) section for more info. The docker version of the microservices uses the configuration file available in `config/.env.default`. From fb7ded8dab32b4618548f86ec92ae5fbab2fbae2 Mon Sep 17 00:00:00 2001 From: nichlaes Date: Mon, 2 Sep 2024 14:23:31 +0200 Subject: [PATCH 10/41] Revert "windows path needs to be relative" This reverts commit f423c565e0f4ea640180690b961ee92ae3ee86fd. --- docs/admin/servers/lib/config.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/docs/admin/servers/lib/config.md b/docs/admin/servers/lib/config.md index e44e27f89..8076f193f 100644 --- a/docs/admin/servers/lib/config.md +++ b/docs/admin/servers/lib/config.md @@ -16,9 +16,6 @@ The `LOCAL_PATH` variable is the absolute filepath to the location of the local directory which will be served to users by the Library microservice. -**NOTE**: If running on Windows, the `LOCAL_PATH` has to be relative and not absolute, -due to how CloudCMD works. - Replace the default values the appropriate values for your setup. The config is saved `.env` file by convention. The **libms** looks for From 1e3dba1592d89f2cbb3ed13b003c4f27cd518cdf Mon Sep 17 00:00:00 2001 From: nichlaes Date: Mon, 2 Sep 2024 14:23:49 +0200 Subject: [PATCH 11/41] Revert "adds windows path restraint" This reverts commit 11b82d8ac7948e45da668f6f941b46029bce5fdd. --- servers/lib/DEVELOPER.md | 4 +--- servers/lib/README.md | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/servers/lib/DEVELOPER.md b/servers/lib/DEVELOPER.md index f77c9b431..274bd2528 100644 --- a/servers/lib/DEVELOPER.md +++ b/servers/lib/DEVELOPER.md @@ -26,9 +26,7 @@ yarn clean # Deletes "build", "coverage", "dist" and other temp files ``` **NOTE:** The integration, end-to-end and http tests require a valid -`.env` file. Here is a sample file. Please note, if running on Windows -the LOCAL_PATH has to be relative in order for it to work. This is due to how -CloudCMD works. +`.env` file. Here is a sample file. ```ini PORT='4001' diff --git a/servers/lib/README.md b/servers/lib/README.md index 3c0622218..9117a0676 100644 --- a/servers/lib/README.md +++ b/servers/lib/README.md @@ -87,8 +87,7 @@ GRAPHQL_PLAYGROUND='false' or 'true' The `LOCAL_PATH` variable is the absolute filepath to the location of the local directory which will be served to users -by the Library microservice. Please note, that if run on Windows -the path needs to be relative, due to how CloudCMD works as of now. +by the Library microservice. Replace the default values the appropriate values for your setup. Please save this config in a file. From 5b95d9ca71ff58031a01613c24dcfff340fff78a Mon Sep 17 00:00:00 2001 From: nichlaes Date: Tue, 3 Sep 2024 12:28:19 +0200 Subject: [PATCH 12/41] adds absolute path support for windows --- servers/lib/src/cloudcmd/cloudcmd.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/servers/lib/src/cloudcmd/cloudcmd.ts b/servers/lib/src/cloudcmd/cloudcmd.ts index 73addd31e..564ee9d49 100644 --- a/servers/lib/src/cloudcmd/cloudcmd.ts +++ b/servers/lib/src/cloudcmd/cloudcmd.ts @@ -1,7 +1,11 @@ import { INestApplication } from '@nestjs/common'; import { Server } from 'socket.io'; import * as cloudcmd from 'cloudcmd'; -import { join } from 'path'; +import { join, relative } from 'path'; + +const isWindowsAbsolutePath = (filesPath: string) => { + return filesPath.includes(':'); +}; const runCloudCMD = ( app: INestApplication, @@ -13,7 +17,13 @@ const runCloudCMD = ( configPath: join(process.cwd(), optionsPath), }); - configManager('root', filesPath); + if (isWindowsAbsolutePath(filesPath)) { + const workDir = process.cwd(); + const relativePath = relative(workDir, filesPath); + configManager('root', relativePath); + } else { + configManager('root', filesPath); + } const server = app.getHttpServer(); From 587d14d112bb06b78a11f1222582269c3143965d Mon Sep 17 00:00:00 2001 From: nichlaes Date: Wed, 4 Sep 2024 09:58:01 +0200 Subject: [PATCH 13/41] updated packages --- servers/lib/package.json | 8 +- servers/lib/yarn.lock | 161 ++++++++++++++++++++++++++++++--------- 2 files changed, 129 insertions(+), 40 deletions(-) diff --git a/servers/lib/package.json b/servers/lib/package.json index 1b39f389f..1554a07a6 100644 --- a/servers/lib/package.json +++ b/servers/lib/package.json @@ -11,14 +11,14 @@ "private": false, "license": "SEE LICENSE IN ", "scripts": { - "build": "npx tsc", + "build": "tsc", "clean": "npx rimraf build node_modules coverage dist src.svg test.svg", "format": "prettier --ignore-path ../.gitignore --write \"**/*.{ts,tsx,css,scss}\"", "graph": "npx madge --image src.svg src && npx madge --image test.svg test", "start": "node dist/src/main.js", "start:pm2": "pm2 start pm2.config.js", "stop:pm2": "pm2 delete libms", - "syntax": "npx eslint . --fix", + "syntax": "eslint . --fix", "pretest": "npx shx cp test/data/user2/tools/README.md ../../files/user2/tools/README.md", "posttest": "npx rimraf ../../files/user2/tools/README.md", "test:all": "npx cross-env LOCAL_PATH=test/data jest --testPathIgnorePatterns=cloudcmd --coverage", @@ -59,8 +59,8 @@ "@types/jest": "^29.5.12", "@types/node": "20.12.5", "@types/supertest": "^6.0.2", - "@typescript-eslint/eslint-plugin": "^6.19.0", - "@typescript-eslint/parser": "^6.19.0", + "@typescript-eslint/eslint-plugin": "^8.4.0", + "@typescript-eslint/parser": "^8.4.0", "cross-fetch": "^4.0.0", "eslint": "^8.56.0", "eslint-config-airbnb-base": "^15.0.0", diff --git a/servers/lib/yarn.lock b/servers/lib/yarn.lock index 310816636..bbc3d9cd8 100644 --- a/servers/lib/yarn.lock +++ b/servers/lib/yarn.lock @@ -649,7 +649,12 @@ dependencies: eslint-visitor-keys "^3.3.0" -"@eslint-community/regexpp@^4.5.1", "@eslint-community/regexpp@^4.6.1": +"@eslint-community/regexpp@^4.10.0": + version "4.11.0" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.11.0.tgz#b0ffd0312b4a3fd2d6f77237e7248a5ad3a680ae" + integrity sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A== + +"@eslint-community/regexpp@^4.6.1": version "4.10.0" resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.10.0.tgz#548f6de556857c8bb73bbee70c35dc82a2e74d63" integrity sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA== @@ -2625,32 +2630,30 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^6.19.0": - version "6.21.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.21.0.tgz#30830c1ca81fd5f3c2714e524c4303e0194f9cd3" - integrity sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA== +"@typescript-eslint/eslint-plugin@^8.4.0": + version "8.4.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.4.0.tgz#188c65610ef875a086404b5bfe105df936b035da" + integrity sha512-rg8LGdv7ri3oAlenMACk9e+AR4wUV0yrrG+XKsGKOK0EVgeEDqurkXMPILG2836fW4ibokTB5v4b6Z9+GYQDEw== dependencies: - "@eslint-community/regexpp" "^4.5.1" - "@typescript-eslint/scope-manager" "6.21.0" - "@typescript-eslint/type-utils" "6.21.0" - "@typescript-eslint/utils" "6.21.0" - "@typescript-eslint/visitor-keys" "6.21.0" - debug "^4.3.4" + "@eslint-community/regexpp" "^4.10.0" + "@typescript-eslint/scope-manager" "8.4.0" + "@typescript-eslint/type-utils" "8.4.0" + "@typescript-eslint/utils" "8.4.0" + "@typescript-eslint/visitor-keys" "8.4.0" graphemer "^1.4.0" - ignore "^5.2.4" + ignore "^5.3.1" natural-compare "^1.4.0" - semver "^7.5.4" - ts-api-utils "^1.0.1" + ts-api-utils "^1.3.0" -"@typescript-eslint/parser@^6.19.0": - version "6.21.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.21.0.tgz#af8fcf66feee2edc86bc5d1cf45e33b0630bf35b" - integrity sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ== +"@typescript-eslint/parser@^8.4.0": + version "8.4.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.4.0.tgz#36b7cd7643a1c190d49dc0278192b2450f615a6f" + integrity sha512-NHgWmKSgJk5K9N16GIhQ4jSobBoJwrmURaLErad0qlLjrpP5bECYg+wxVTGlGZmJbU03jj/dfnb6V9bw+5icsA== dependencies: - "@typescript-eslint/scope-manager" "6.21.0" - "@typescript-eslint/types" "6.21.0" - "@typescript-eslint/typescript-estree" "6.21.0" - "@typescript-eslint/visitor-keys" "6.21.0" + "@typescript-eslint/scope-manager" "8.4.0" + "@typescript-eslint/types" "8.4.0" + "@typescript-eslint/typescript-estree" "8.4.0" + "@typescript-eslint/visitor-keys" "8.4.0" debug "^4.3.4" "@typescript-eslint/scope-manager@6.21.0": @@ -2661,21 +2664,34 @@ "@typescript-eslint/types" "6.21.0" "@typescript-eslint/visitor-keys" "6.21.0" -"@typescript-eslint/type-utils@6.21.0": - version "6.21.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.21.0.tgz#6473281cfed4dacabe8004e8521cee0bd9d4c01e" - integrity sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag== +"@typescript-eslint/scope-manager@8.4.0": + version "8.4.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.4.0.tgz#8a13d3c0044513d7960348db6f4789d2a06fa4b4" + integrity sha512-n2jFxLeY0JmKfUqy3P70rs6vdoPjHK8P/w+zJcV3fk0b0BwRXC/zxRTEnAsgYT7MwdQDt/ZEbtdzdVC+hcpF0A== dependencies: - "@typescript-eslint/typescript-estree" "6.21.0" - "@typescript-eslint/utils" "6.21.0" + "@typescript-eslint/types" "8.4.0" + "@typescript-eslint/visitor-keys" "8.4.0" + +"@typescript-eslint/type-utils@8.4.0": + version "8.4.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-8.4.0.tgz#4a91b5789f41946adb56d73e2fb4639fdcf37af7" + integrity sha512-pu2PAmNrl9KX6TtirVOrbLPLwDmASpZhK/XU7WvoKoCUkdtq9zF7qQ7gna0GBZFN0hci0vHaSusiL2WpsQk37A== + dependencies: + "@typescript-eslint/typescript-estree" "8.4.0" + "@typescript-eslint/utils" "8.4.0" debug "^4.3.4" - ts-api-utils "^1.0.1" + ts-api-utils "^1.3.0" "@typescript-eslint/types@6.21.0": version "6.21.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.21.0.tgz#205724c5123a8fef7ecd195075fa6e85bac3436d" integrity sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg== +"@typescript-eslint/types@8.4.0": + version "8.4.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.4.0.tgz#b44d6a90a317a6d97a3e5fabda5196089eec6171" + integrity sha512-T1RB3KQdskh9t3v/qv7niK6P8yvn7ja1mS7QK7XfRVL6wtZ8/mFs/FHf4fKvTA0rKnqnYxl/uHFNbnEt0phgbw== + "@typescript-eslint/typescript-estree@6.21.0": version "6.21.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz#c47ae7901db3b8bddc3ecd73daff2d0895688c46" @@ -2690,7 +2706,31 @@ semver "^7.5.4" ts-api-utils "^1.0.1" -"@typescript-eslint/utils@6.21.0", "@typescript-eslint/utils@^6.0.0": +"@typescript-eslint/typescript-estree@8.4.0": + version "8.4.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.4.0.tgz#00ed79ae049e124db37315cde1531a900a048482" + integrity sha512-kJ2OIP4dQw5gdI4uXsaxUZHRwWAGpREJ9Zq6D5L0BweyOrWsL6Sz0YcAZGWhvKnH7fm1J5YFE1JrQL0c9dd53A== + dependencies: + "@typescript-eslint/types" "8.4.0" + "@typescript-eslint/visitor-keys" "8.4.0" + debug "^4.3.4" + fast-glob "^3.3.2" + is-glob "^4.0.3" + minimatch "^9.0.4" + semver "^7.6.0" + ts-api-utils "^1.3.0" + +"@typescript-eslint/utils@8.4.0": + version "8.4.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.4.0.tgz#35c552a404858c853a1f62ba6df2214f1988afc3" + integrity sha512-swULW8n1IKLjRAgciCkTCafyTHHfwVQFt8DovmaF69sKbOxTSFMmIZaSHjqO9i/RV0wIblaawhzvtva8Nmm7lQ== + dependencies: + "@eslint-community/eslint-utils" "^4.4.0" + "@typescript-eslint/scope-manager" "8.4.0" + "@typescript-eslint/types" "8.4.0" + "@typescript-eslint/typescript-estree" "8.4.0" + +"@typescript-eslint/utils@^6.0.0": version "6.21.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.21.0.tgz#4714e7a6b39e773c1c8e97ec587f520840cd8134" integrity sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ== @@ -2711,6 +2751,14 @@ "@typescript-eslint/types" "6.21.0" eslint-visitor-keys "^3.4.1" +"@typescript-eslint/visitor-keys@8.4.0": + version "8.4.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.4.0.tgz#1e8a8b8fd3647db1e42361fdd8de3e1679dec9d2" + integrity sha512-zTQD6WLNTre1hj5wp09nBIDiOc2U5r/qmzo7wxPn4ZgAjHql09EofqhF9WF+fZHzL5aCyaIpPcT2hyxl73kr9A== + dependencies: + "@typescript-eslint/types" "8.4.0" + eslint-visitor-keys "^3.4.3" + "@ungap/structured-clone@^1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406" @@ -5002,7 +5050,7 @@ fast-diff@^1.1.2: resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.3.0.tgz#ece407fa550a64d638536cd727e129c61616e0f0" integrity sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw== -fast-glob@3.3.2, fast-glob@^3.2.2, fast-glob@^3.2.9, fast-glob@^3.3.1: +fast-glob@3.3.2, fast-glob@^3.2.2, fast-glob@^3.2.9, fast-glob@^3.3.1, fast-glob@^3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129" integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow== @@ -5763,6 +5811,11 @@ ignore@^5.0.4, ignore@^5.2.0, ignore@^5.2.4: resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.1.tgz#5073e554cd42c5b33b394375f538b8593e34d4ef" integrity sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw== +ignore@^5.3.1: + version "5.3.2" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.2.tgz#3cd40e729f3643fd87cb04e50bf0eb722bc596f5" + integrity sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g== + import-fresh@^3.2.1, import-fresh@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" @@ -7671,6 +7724,13 @@ minimatch@^9.0.1: dependencies: brace-expansion "^2.0.1" +minimatch@^9.0.4: + version "9.0.5" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.5.tgz#d74f9dd6b57d83d8e98cfb82133b03978bc929e5" + integrity sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow== + dependencies: + brace-expansion "^2.0.1" + minimist-options@4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/minimist-options/-/minimist-options-4.1.0.tgz#c0655713c53a8a2ebd77ffa247d342c40f010619" @@ -9479,6 +9539,11 @@ semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.3.8, semver@^7.5.3, semve dependencies: lru-cache "^6.0.0" +semver@^7.6.0: + version "7.6.3" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" + integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== + send@0.18.0: version "0.18.0" resolved "https://registry.yarnpkg.com/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be" @@ -9830,7 +9895,16 @@ string-to-stream@^3.0.1: dependencies: readable-stream "^3.4.0" -"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0": + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -9890,7 +9964,14 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -10361,7 +10442,7 @@ tryrequire@^3.0.0: dependencies: try-catch "^3.0.0" -ts-api-utils@^1.0.1: +ts-api-utils@^1.0.1, ts-api-utils@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.3.0.tgz#4b490e27129f1e8e686b45cc4ab63714dc60eea1" integrity sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ== @@ -11009,8 +11090,7 @@ win32@^7.0.0, win32@^7.2.0: redzip "^3.0.0" through2 "^4.0.2" -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: - name wrap-ansi-cjs +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -11028,6 +11108,15 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" From d0e0e7127c17b6d24ce74e2a94f834282108f8ad Mon Sep 17 00:00:00 2001 From: nichlaes Date: Wed, 4 Sep 2024 09:58:52 +0200 Subject: [PATCH 14/41] fixed lint errors --- servers/lib/src/cloudcmd/cloudcmd.ts | 4 +--- servers/lib/src/files/services/local-files.service.ts | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/servers/lib/src/cloudcmd/cloudcmd.ts b/servers/lib/src/cloudcmd/cloudcmd.ts index 564ee9d49..d24f9e4b3 100644 --- a/servers/lib/src/cloudcmd/cloudcmd.ts +++ b/servers/lib/src/cloudcmd/cloudcmd.ts @@ -3,9 +3,7 @@ import { Server } from 'socket.io'; import * as cloudcmd from 'cloudcmd'; import { join, relative } from 'path'; -const isWindowsAbsolutePath = (filesPath: string) => { - return filesPath.includes(':'); -}; +const isWindowsAbsolutePath = (filesPath: string) => filesPath.includes(':'); const runCloudCMD = ( app: INestApplication, diff --git a/servers/lib/src/files/services/local-files.service.ts b/servers/lib/src/files/services/local-files.service.ts index 49804a04e..f94aba572 100644 --- a/servers/lib/src/files/services/local-files.service.ts +++ b/servers/lib/src/files/services/local-files.service.ts @@ -45,7 +45,7 @@ export default class LocalFilesService implements IFilesService { return LocalFilesService.formatResponse(name, content); } catch (error) { - throw new InternalServerErrorException('Error reading file'); + throw new InternalServerErrorException('Error reading file', error); } } From e38342075e6dfcad6fa088b2897ce92e65c4345c Mon Sep 17 00:00:00 2001 From: nichlaes Date: Mon, 9 Sep 2024 10:48:25 +0200 Subject: [PATCH 15/41] adds cases for cloudCMD and pm2 --- servers/lib/DEVELOPER.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/servers/lib/DEVELOPER.md b/servers/lib/DEVELOPER.md index 274bd2528..c4938c521 100644 --- a/servers/lib/DEVELOPER.md +++ b/servers/lib/DEVELOPER.md @@ -43,6 +43,25 @@ The URL endpoint for this microservice is located at: `localhost:PORT/lib` The [API](./API.md) page shows sample queries and responses. +## Manual testing + +As of now, some features require manual testing or attention. + +### CloudCMD + +Due to how CloudCMD works, +it is required to manually test with `LOCAL_PATH` as an absolute path +e.g. `C:\DTaaS\files` and as a relative path e.g. `..\..\files`. +Use the paths relavant to your OS. + +### PM2 + +the pm2 might not close spawned processes correctly, +therefore please use the following command to kill a process. +`pm2 del `. + +**NOTE:** to see the processes spawned by pm2 use `pm2 list` + ## :package: :ship: Packages ### Docker images From b49264fb6c3690bb881d43cee194147d6bc655a0 Mon Sep 17 00:00:00 2001 From: nichlaes Date: Mon, 9 Sep 2024 11:03:11 +0200 Subject: [PATCH 16/41] fixed linting --- servers/lib/DEVELOPER.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/servers/lib/DEVELOPER.md b/servers/lib/DEVELOPER.md index c4938c521..9efa67e32 100644 --- a/servers/lib/DEVELOPER.md +++ b/servers/lib/DEVELOPER.md @@ -56,7 +56,7 @@ Use the paths relavant to your OS. ### PM2 -the pm2 might not close spawned processes correctly, +the pm2 might not close spawned processes correctly, therefore please use the following command to kill a process. `pm2 del `. From 32360de535dcf09f21559cac09027e0db64b490a Mon Sep 17 00:00:00 2001 From: nichlaes Date: Mon, 9 Sep 2024 11:14:10 +0200 Subject: [PATCH 17/41] Revert "commented out failing tests on action" This reverts commit 89418d8834ea44a7a1e112f8f1040080831090b7. --- .github/workflows/lib-ms.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/lib-ms.yml b/.github/workflows/lib-ms.yml index b12ffae2c..268651108 100644 --- a/.github/workflows/lib-ms.yml +++ b/.github/workflows/lib-ms.yml @@ -27,9 +27,9 @@ jobs: cache: "yarn" cache-dependency-path: "**/yarn.lock" - # - name: Install pm2 - # run: | - # npm install -g pm2 + - name: Install pm2 + run: | + npm install -g pm2 - name: Run the linting checks run: | @@ -56,18 +56,18 @@ jobs: LOG_LEVEL: debug APOLLO_PATH: /lib - # - name: Run http mode tests - # run: | - # cd servers/lib - # yarn install - # yarn build - # yarn test:http-github - # env: - # PORT: 4002 - # LOCAL_PATH: ${{ github.workspace }}/files - # MODE: local - # LOG_LEVEL: debug - # APOLLO_PATH: /lib + - name: Run http mode tests + run: | + cd servers/lib + yarn install + yarn build + yarn test:http-github + env: + PORT: 4002 + LOCAL_PATH: ${{ github.workspace }}/files + MODE: local + LOG_LEVEL: debug + APOLLO_PATH: /lib - name: Upload test coverage to Codecov uses: codecov/codecov-action@v3 From 3e33a08a4f869a858fac7d5ba19f67b4a60505e7 Mon Sep 17 00:00:00 2001 From: nichlaes Date: Wed, 11 Sep 2024 13:18:00 +0200 Subject: [PATCH 18/41] adds delay for server to get ready when running on github --- servers/lib/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/servers/lib/package.json b/servers/lib/package.json index 1554a07a6..997111c0f 100644 --- a/servers/lib/package.json +++ b/servers/lib/package.json @@ -25,7 +25,7 @@ "test:e2e": "npx cross-env LOCAL_PATH=test/data jest --config ./test/jest-e2e.json --coverage", "test:http": "yarn build && pm2 start -f --name libms-test dist/src/main.js -- -c .env -H ./config/http.json && jest test/cloudcmd --coverage --coverageThreshold=\"{}\" && pm2 delete libms-test", "test:http-nocov": "yarn build && pm2 start -f --name libms-test dist/src/main.js -- -c .env -H ./config/http.json && jest test/cloudcmd --coverage=false && pm2 delete libms-test", - "test:http-github": "yarn build && yarn start:pm2 && jest test/cloudcmd --coverage --coverageThreshold=\"{}\" && pm2 delete libms", + "test:http-github": "yarn build && yarn start:pm2 && sleep 5s && jest test/cloudcmd --coverage --coverageThreshold=\"{}\" && pm2 delete libms", "test:int": "npx cross-env LOCAL_PATH=test/data jest ../test/integration --coverage", "test:nocov": "yarn test:http-nocov && npx cross-env LOCAL_PATH=test/data jest --testPathIgnorePatterns=cloudcmd --coverage=false", "test:unit": "npx cross-env LOCAL_PATH=test/data jest ../test/unit --coverage" From 229a403f1b8d63b1499468bbfc56b771a940b6aa Mon Sep 17 00:00:00 2001 From: nichlaes Date: Wed, 11 Sep 2024 14:29:08 +0200 Subject: [PATCH 19/41] increased sleep --- servers/lib/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/servers/lib/package.json b/servers/lib/package.json index 997111c0f..3a0e51141 100644 --- a/servers/lib/package.json +++ b/servers/lib/package.json @@ -25,7 +25,7 @@ "test:e2e": "npx cross-env LOCAL_PATH=test/data jest --config ./test/jest-e2e.json --coverage", "test:http": "yarn build && pm2 start -f --name libms-test dist/src/main.js -- -c .env -H ./config/http.json && jest test/cloudcmd --coverage --coverageThreshold=\"{}\" && pm2 delete libms-test", "test:http-nocov": "yarn build && pm2 start -f --name libms-test dist/src/main.js -- -c .env -H ./config/http.json && jest test/cloudcmd --coverage=false && pm2 delete libms-test", - "test:http-github": "yarn build && yarn start:pm2 && sleep 5s && jest test/cloudcmd --coverage --coverageThreshold=\"{}\" && pm2 delete libms", + "test:http-github": "yarn build && yarn start:pm2 && sleep 10s && jest test/cloudcmd --coverage --coverageThreshold=\"{}\" && pm2 delete libms", "test:int": "npx cross-env LOCAL_PATH=test/data jest ../test/integration --coverage", "test:nocov": "yarn test:http-nocov && npx cross-env LOCAL_PATH=test/data jest --testPathIgnorePatterns=cloudcmd --coverage=false", "test:unit": "npx cross-env LOCAL_PATH=test/data jest ../test/unit --coverage" From f4fe9dc3bb86cd7460d9b0db1f16f3076f0ac759 Mon Sep 17 00:00:00 2001 From: nichlaes Date: Wed, 11 Sep 2024 14:46:12 +0200 Subject: [PATCH 20/41] removed paths error --- .github/workflows/lib-ms.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/lib-ms.yml b/.github/workflows/lib-ms.yml index 268651108..d741a0cf9 100644 --- a/.github/workflows/lib-ms.yml +++ b/.github/workflows/lib-ms.yml @@ -8,8 +8,6 @@ on: paths: - 'servers/lib/**' workflow_dispatch: - paths: - - 'servers/lib/**' jobs: test-lib-ms: From fe1da463840a38d570618077df68c8fc914f5a27 Mon Sep 17 00:00:00 2001 From: nichlaes Date: Wed, 11 Sep 2024 14:50:23 +0200 Subject: [PATCH 21/41] debug error actions --- .github/workflows/lib-ms.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/lib-ms.yml b/.github/workflows/lib-ms.yml index d741a0cf9..761e62289 100644 --- a/.github/workflows/lib-ms.yml +++ b/.github/workflows/lib-ms.yml @@ -35,6 +35,23 @@ jobs: yarn install yarn syntax + # FOR TESTING + - name: Build the lib microservice + env: + PORT: 4001 + LOCAL_PATH: ${{ github.workspace }}/files + MODE: local + LOG_LEVEL: debug + APOLLO_PATH: /lib + run: | + cd servers/lib + yarn install + yarn build + yarn start -H ./config/http.json & + sleep 5 + curl -f -LI http://localhost:4001/lib/files || exit "error localhost" + curl -f -LI http://host.docker.internal:4001/lib/files || echo "error host.docker.internal" + - name: Build the lib microservice run: | cd servers/lib From 3bf3a4997e665b97bed825b38678cd6e5f584226 Mon Sep 17 00:00:00 2001 From: nichlaes Date: Wed, 11 Sep 2024 15:42:11 +0200 Subject: [PATCH 22/41] error only if env are not set --- .github/workflows/lib-ms.yml | 3 +-- servers/lib/src/bootstrap.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lib-ms.yml b/.github/workflows/lib-ms.yml index 761e62289..dbac1cb02 100644 --- a/.github/workflows/lib-ms.yml +++ b/.github/workflows/lib-ms.yml @@ -49,8 +49,7 @@ jobs: yarn build yarn start -H ./config/http.json & sleep 5 - curl -f -LI http://localhost:4001/lib/files || exit "error localhost" - curl -f -LI http://host.docker.internal:4001/lib/files || echo "error host.docker.internal" + curl -f -LI http://host.docker.internal/lib/files || echo "Failed to start the server" - name: Build the lib microservice run: | diff --git a/servers/lib/src/bootstrap.ts b/servers/lib/src/bootstrap.ts index 9e9132b3d..1f56673bc 100644 --- a/servers/lib/src/bootstrap.ts +++ b/servers/lib/src/bootstrap.ts @@ -15,7 +15,7 @@ export default async function bootstrap(options?: BootstrapOptions) { path: options?.config ?? '.env', override: true, }); - if (configFile.error) { + if (configFile.error && process.env.LOCAL_PATH === undefined) { // eslint-disable-next-line no-console console.error(configFile.error); if (options.runHelp) { From c25dfc392c558770a0e0ef10761b1d719f5565c9 Mon Sep 17 00:00:00 2001 From: nichlaes Date: Wed, 11 Sep 2024 15:45:14 +0200 Subject: [PATCH 23/41] changed test url --- .github/workflows/lib-ms.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lib-ms.yml b/.github/workflows/lib-ms.yml index dbac1cb02..242327c55 100644 --- a/.github/workflows/lib-ms.yml +++ b/.github/workflows/lib-ms.yml @@ -49,7 +49,8 @@ jobs: yarn build yarn start -H ./config/http.json & sleep 5 - curl -f -LI http://host.docker.internal/lib/files || echo "Failed to start the server" + curl -f -LI http://localhost:4001/lib/files || echo "Failed to start the server" + curl -f -LI http://127.0.0.1:4001/lib/files || echo "Failed to start the server" - name: Build the lib microservice run: | From 632cf1d836815ec26b561ce673309d228e16cd3e Mon Sep 17 00:00:00 2001 From: nichlaes Date: Wed, 11 Sep 2024 15:48:17 +0200 Subject: [PATCH 24/41] verify url works --- .github/workflows/lib-ms.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lib-ms.yml b/.github/workflows/lib-ms.yml index 242327c55..1bed314ec 100644 --- a/.github/workflows/lib-ms.yml +++ b/.github/workflows/lib-ms.yml @@ -50,7 +50,7 @@ jobs: yarn start -H ./config/http.json & sleep 5 curl -f -LI http://localhost:4001/lib/files || echo "Failed to start the server" - curl -f -LI http://127.0.0.1:4001/lib/files || echo "Failed to start the server" + curl -f -LI http://localhost:4001 || echo "Should fail" - name: Build the lib microservice run: | From 69e97c89e551acb8f616239ff548089e020ec71c Mon Sep 17 00:00:00 2001 From: nichlaes Date: Wed, 11 Sep 2024 15:57:18 +0200 Subject: [PATCH 25/41] testing tests --- .github/workflows/lib-ms.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lib-ms.yml b/.github/workflows/lib-ms.yml index 1bed314ec..c050dc238 100644 --- a/.github/workflows/lib-ms.yml +++ b/.github/workflows/lib-ms.yml @@ -38,7 +38,7 @@ jobs: # FOR TESTING - name: Build the lib microservice env: - PORT: 4001 + PORT: 4002 LOCAL_PATH: ${{ github.workspace }}/files MODE: local LOG_LEVEL: debug @@ -49,8 +49,8 @@ jobs: yarn build yarn start -H ./config/http.json & sleep 5 - curl -f -LI http://localhost:4001/lib/files || echo "Failed to start the server" - curl -f -LI http://localhost:4001 || echo "Should fail" + curl -f -LI http://localhost:4002/lib/files || echo "Failed to start the server" + jest test/cloudcmd - name: Build the lib microservice run: | From a6dde579966949fed5308461dbfb2c7a23f205cb Mon Sep 17 00:00:00 2001 From: nichlaes Date: Wed, 11 Sep 2024 16:01:12 +0200 Subject: [PATCH 26/41] tests without pm2 --- .github/workflows/lib-ms.yml | 2 +- servers/lib/compose.lib.dev.yml | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 servers/lib/compose.lib.dev.yml diff --git a/.github/workflows/lib-ms.yml b/.github/workflows/lib-ms.yml index c050dc238..a52367c44 100644 --- a/.github/workflows/lib-ms.yml +++ b/.github/workflows/lib-ms.yml @@ -50,7 +50,7 @@ jobs: yarn start -H ./config/http.json & sleep 5 curl -f -LI http://localhost:4002/lib/files || echo "Failed to start the server" - jest test/cloudcmd + yarn test:github - name: Build the lib microservice run: | diff --git a/servers/lib/compose.lib.dev.yml b/servers/lib/compose.lib.dev.yml new file mode 100644 index 000000000..6e737f213 --- /dev/null +++ b/servers/lib/compose.lib.dev.yml @@ -0,0 +1,11 @@ +version: '3' +services: + libms: + build: + context: ../../ + dockerfile: ./docker/libms.dockerfile + restart: unless-stopped + volumes: + - ./files:/dtaas/libms/files + ports: + - "4001:4001" From 0e39a8c91260812ee8cc23374c355d7b3728b3c8 Mon Sep 17 00:00:00 2001 From: nichlaes Date: Wed, 11 Sep 2024 16:03:33 +0200 Subject: [PATCH 27/41] installs jest --- .github/workflows/lib-ms.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lib-ms.yml b/.github/workflows/lib-ms.yml index a52367c44..92843dfee 100644 --- a/.github/workflows/lib-ms.yml +++ b/.github/workflows/lib-ms.yml @@ -25,9 +25,10 @@ jobs: cache: "yarn" cache-dependency-path: "**/yarn.lock" - - name: Install pm2 + - name: Install pm2 and jest run: | npm install -g pm2 + npm install -g jest - name: Run the linting checks run: | From b32923543f6049a6aa264248025b057ac29423ed Mon Sep 17 00:00:00 2001 From: nichlaes Date: Wed, 11 Sep 2024 16:05:59 +0200 Subject: [PATCH 28/41] . --- .github/workflows/lib-ms.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lib-ms.yml b/.github/workflows/lib-ms.yml index 92843dfee..04b6c0322 100644 --- a/.github/workflows/lib-ms.yml +++ b/.github/workflows/lib-ms.yml @@ -51,7 +51,7 @@ jobs: yarn start -H ./config/http.json & sleep 5 curl -f -LI http://localhost:4002/lib/files || echo "Failed to start the server" - yarn test:github + jest test/cloudcmd --coverage --coverageThreshold=\"{}\" - name: Build the lib microservice run: | From ce7ce03f29a9a49b6971e011e884c3e508adf071 Mon Sep 17 00:00:00 2001 From: nichlaes Date: Thu, 12 Sep 2024 11:07:01 +0200 Subject: [PATCH 29/41] changed port and order --- .github/workflows/lib-ms.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/lib-ms.yml b/.github/workflows/lib-ms.yml index 04b6c0322..79b13161a 100644 --- a/.github/workflows/lib-ms.yml +++ b/.github/workflows/lib-ms.yml @@ -37,7 +37,7 @@ jobs: yarn syntax # FOR TESTING - - name: Build the lib microservice + - name: Build and run test for the lib microservice env: PORT: 4002 LOCAL_PATH: ${{ github.workspace }}/files @@ -60,30 +60,30 @@ jobs: yarn build - name: Run all tests - run: | - cd servers/lib - yarn install - yarn build - yarn test:all env: PORT: 4001 LOCAL_PATH: ${{ github.workspace }}/files MODE: local LOG_LEVEL: debug APOLLO_PATH: /lib - - - name: Run http mode tests run: | cd servers/lib yarn install yarn build - yarn test:http-github + yarn test:all + + - name: Run http mode tests env: - PORT: 4002 + PORT: 4003 LOCAL_PATH: ${{ github.workspace }}/files MODE: local LOG_LEVEL: debug APOLLO_PATH: /lib + run: | + cd servers/lib + yarn install + yarn build + yarn test:http-github - name: Upload test coverage to Codecov uses: codecov/codecov-action@v3 From e858e5fe61b401479867ce1036546331209f408b Mon Sep 17 00:00:00 2001 From: nichlaes Date: Thu, 12 Sep 2024 11:11:13 +0200 Subject: [PATCH 30/41] changed order --- .github/workflows/lib-ms.yml | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/lib-ms.yml b/.github/workflows/lib-ms.yml index 79b13161a..15a6690a8 100644 --- a/.github/workflows/lib-ms.yml +++ b/.github/workflows/lib-ms.yml @@ -36,23 +36,6 @@ jobs: yarn install yarn syntax - # FOR TESTING - - name: Build and run test for the lib microservice - env: - PORT: 4002 - LOCAL_PATH: ${{ github.workspace }}/files - MODE: local - LOG_LEVEL: debug - APOLLO_PATH: /lib - run: | - cd servers/lib - yarn install - yarn build - yarn start -H ./config/http.json & - sleep 5 - curl -f -LI http://localhost:4002/lib/files || echo "Failed to start the server" - jest test/cloudcmd --coverage --coverageThreshold=\"{}\" - - name: Build the lib microservice run: | cd servers/lib @@ -85,6 +68,23 @@ jobs: yarn build yarn test:http-github + # FOR TESTING + - name: Build and run test for the lib microservice + env: + PORT: 4002 + LOCAL_PATH: ${{ github.workspace }}/files + MODE: local + LOG_LEVEL: debug + APOLLO_PATH: /lib + run: | + cd servers/lib + yarn install + yarn build + yarn start -H ./config/http.json & + sleep 5 + curl -f -LI http://localhost:4002/lib/files || echo "Failed to start the server" + jest test/cloudcmd --coverage --coverageThreshold=\"{}\" + - name: Upload test coverage to Codecov uses: codecov/codecov-action@v3 with: From d98549a287d21123982f48fd7f4d4d77bbdee274 Mon Sep 17 00:00:00 2001 From: nichlaes Date: Thu, 12 Sep 2024 15:05:17 +0200 Subject: [PATCH 31/41] ignores bootstrap.ts --- servers/lib/test/unit/files-service.factory.unit.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/servers/lib/test/unit/files-service.factory.unit.spec.ts b/servers/lib/test/unit/files-service.factory.unit.spec.ts index 743aadd9c..5305f61f1 100644 --- a/servers/lib/test/unit/files-service.factory.unit.spec.ts +++ b/servers/lib/test/unit/files-service.factory.unit.spec.ts @@ -32,6 +32,6 @@ describe('FilesServiceFactory', () => { it('should throw an error when MODE is invalid', () => { jest.spyOn(configService, 'get').mockReturnValue('invalid'); - expect(() => serviceFactory.create()).toThrowError(`Invalid MODE: invalid`); + expect(() => serviceFactory.create()).toThrow(`Invalid MODE: invalid`); }); }); From ea69a016bf24dd75a8f6cd81ad1e5b226b0079a4 Mon Sep 17 00:00:00 2001 From: nichlaes Date: Thu, 12 Sep 2024 15:06:48 +0200 Subject: [PATCH 32/41] fixed deprecated func --- servers/lib/jest.config.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/servers/lib/jest.config.json b/servers/lib/jest.config.json index 86c1a7059..991f79e8b 100644 --- a/servers/lib/jest.config.json +++ b/servers/lib/jest.config.json @@ -12,7 +12,8 @@ "node_modules", "./dist", "../src/app.module.ts", - "../src/main.ts" + "../src/main.ts", + "../src/bootstrap.ts" ], "modulePathIgnorePatterns": ["config"], "coverageDirectory": "/coverage/", From 15d37455e7662e6d51400c6001392d3a013e8118 Mon Sep 17 00:00:00 2001 From: nichlaes Date: Thu, 12 Sep 2024 15:10:30 +0200 Subject: [PATCH 33/41] removes temp tests --- .github/workflows/lib-ms.yml | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/.github/workflows/lib-ms.yml b/.github/workflows/lib-ms.yml index 15a6690a8..7f9597d34 100644 --- a/.github/workflows/lib-ms.yml +++ b/.github/workflows/lib-ms.yml @@ -68,23 +68,6 @@ jobs: yarn build yarn test:http-github - # FOR TESTING - - name: Build and run test for the lib microservice - env: - PORT: 4002 - LOCAL_PATH: ${{ github.workspace }}/files - MODE: local - LOG_LEVEL: debug - APOLLO_PATH: /lib - run: | - cd servers/lib - yarn install - yarn build - yarn start -H ./config/http.json & - sleep 5 - curl -f -LI http://localhost:4002/lib/files || echo "Failed to start the server" - jest test/cloudcmd --coverage --coverageThreshold=\"{}\" - - name: Upload test coverage to Codecov uses: codecov/codecov-action@v3 with: From d359c6d54618f157139877215c6351e4570b6bf7 Mon Sep 17 00:00:00 2001 From: nichlaes Date: Fri, 13 Sep 2024 13:50:52 +0200 Subject: [PATCH 34/41] adds check for server running --- .github/workflows/lib-ms.yml | 27 ++++++++++++++++++++++++++- servers/lib/package.json | 2 +- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lib-ms.yml b/.github/workflows/lib-ms.yml index 7f9597d34..09bb776a6 100644 --- a/.github/workflows/lib-ms.yml +++ b/.github/workflows/lib-ms.yml @@ -55,7 +55,7 @@ jobs: yarn build yarn test:all - - name: Run http mode tests + - name: Start http mode env: PORT: 4003 LOCAL_PATH: ${{ github.workspace }}/files @@ -66,8 +66,33 @@ jobs: cd servers/lib yarn install yarn build + yarn start:pm2 + + - name: Check server is running + env: + PORT: 4003 + uses: nick-fields/retry@v3 + with: + timeout_seconds: 10 + max_attempts: 4 + command: "curl -f -LI http://localhost:${{ env.PORT }}/lib/files" + + - name: Run http test + env: + PORT: 4003 + LOCAL_PATH: ${{ github.workspace }}/files + MODE: local + LOG_LEVEL: debug + APOLLO_PATH: /lib + run: | + cd servers/lib yarn test:http-github + - name: Stop http mode + run: | + cd servers/lib + yarn stop:pm2 + - name: Upload test coverage to Codecov uses: codecov/codecov-action@v3 with: diff --git a/servers/lib/package.json b/servers/lib/package.json index 3a0e51141..10e14c87e 100644 --- a/servers/lib/package.json +++ b/servers/lib/package.json @@ -25,7 +25,7 @@ "test:e2e": "npx cross-env LOCAL_PATH=test/data jest --config ./test/jest-e2e.json --coverage", "test:http": "yarn build && pm2 start -f --name libms-test dist/src/main.js -- -c .env -H ./config/http.json && jest test/cloudcmd --coverage --coverageThreshold=\"{}\" && pm2 delete libms-test", "test:http-nocov": "yarn build && pm2 start -f --name libms-test dist/src/main.js -- -c .env -H ./config/http.json && jest test/cloudcmd --coverage=false && pm2 delete libms-test", - "test:http-github": "yarn build && yarn start:pm2 && sleep 10s && jest test/cloudcmd --coverage --coverageThreshold=\"{}\" && pm2 delete libms", + "test:http-github": "jest test/cloudcmd --coverage --coverageThreshold=\"{}\"", "test:int": "npx cross-env LOCAL_PATH=test/data jest ../test/integration --coverage", "test:nocov": "yarn test:http-nocov && npx cross-env LOCAL_PATH=test/data jest --testPathIgnorePatterns=cloudcmd --coverage=false", "test:unit": "npx cross-env LOCAL_PATH=test/data jest ../test/unit --coverage" From 18326eef564e3944fd898b46e088ee850e9c6fb2 Mon Sep 17 00:00:00 2001 From: nichlaes Date: Mon, 16 Sep 2024 10:15:40 +0200 Subject: [PATCH 35/41] set working directory --- .github/workflows/lib-ms.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/lib-ms.yml b/.github/workflows/lib-ms.yml index 09bb776a6..59ab02959 100644 --- a/.github/workflows/lib-ms.yml +++ b/.github/workflows/lib-ms.yml @@ -13,6 +13,9 @@ jobs: test-lib-ms: name: Test library microservice runs-on: ubuntu-latest + defaults: + run: + working-directory: servers/lib steps: - name: Checkout @@ -32,13 +35,11 @@ jobs: - name: Run the linting checks run: | - cd servers/lib yarn install yarn syntax - name: Build the lib microservice run: | - cd servers/lib yarn install yarn build @@ -50,7 +51,6 @@ jobs: LOG_LEVEL: debug APOLLO_PATH: /lib run: | - cd servers/lib yarn install yarn build yarn test:all @@ -63,7 +63,6 @@ jobs: LOG_LEVEL: debug APOLLO_PATH: /lib run: | - cd servers/lib yarn install yarn build yarn start:pm2 @@ -85,12 +84,10 @@ jobs: LOG_LEVEL: debug APOLLO_PATH: /lib run: | - cd servers/lib yarn test:http-github - name: Stop http mode run: | - cd servers/lib yarn stop:pm2 - name: Upload test coverage to Codecov From 7a9a2aa0a9a75930702c8ccdfde0a8cdaa5ffdfd Mon Sep 17 00:00:00 2001 From: nichlaes Date: Mon, 16 Sep 2024 12:49:13 +0200 Subject: [PATCH 36/41] updated docs --- servers/lib/DEVELOPER.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/servers/lib/DEVELOPER.md b/servers/lib/DEVELOPER.md index 9efa67e32..20ca238c0 100644 --- a/servers/lib/DEVELOPER.md +++ b/servers/lib/DEVELOPER.md @@ -47,12 +47,15 @@ The [API](./API.md) page shows sample queries and responses. As of now, some features require manual testing or attention. -### CloudCMD +### CloudCMD (a npm package dependency) Due to how CloudCMD works, -it is required to manually test with `LOCAL_PATH` as an absolute path -e.g. `C:\DTaaS\files` and as a relative path e.g. `..\..\files`. -Use the paths relavant to your OS. +it is required to manually test with `LOCAL_PATH` both as an absolute path and local path. + +| OS | Absolute Path | Relative Path | +| ------- | ----------------------------- | ------------- | +| Windows | C:\DTaaS\files | ..\\..\files | +| Linux | /Users//DTaaS/files | ../../files | ### PM2 @@ -121,7 +124,7 @@ The commands to start and stop the appliation are: **NOTE**: the docker compose file is located in the `servers/lib` directory. ```bash -docker compose -f compose.lib.yml up -d +docker compose -f compose.lib.dev.yml up -d ``` This command brings up the lib docker container and makes From 182e8cb21d70a7f491c2bcbb133c11a1232759d1 Mon Sep 17 00:00:00 2001 From: nichlaes Date: Mon, 16 Sep 2024 12:59:41 +0200 Subject: [PATCH 37/41] code climate fix --- servers/lib/DEVELOPER.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/servers/lib/DEVELOPER.md b/servers/lib/DEVELOPER.md index 20ca238c0..ccaa111df 100644 --- a/servers/lib/DEVELOPER.md +++ b/servers/lib/DEVELOPER.md @@ -50,7 +50,8 @@ As of now, some features require manual testing or attention. ### CloudCMD (a npm package dependency) Due to how CloudCMD works, -it is required to manually test with `LOCAL_PATH` both as an absolute path and local path. +it is required to manually test with `LOCAL_PATH` both as an +absolute path and local path. | OS | Absolute Path | Relative Path | | ------- | ----------------------------- | ------------- | From f33f25738503543b2da92ff7e89095c6b5fc2515 Mon Sep 17 00:00:00 2001 From: nichlaes Date: Mon, 16 Sep 2024 13:42:54 +0200 Subject: [PATCH 38/41] removes console log --- servers/lib/test/cloudcmd/cloudcmd.spec.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/servers/lib/test/cloudcmd/cloudcmd.spec.ts b/servers/lib/test/cloudcmd/cloudcmd.spec.ts index 72ba25d55..2620d5dd3 100644 --- a/servers/lib/test/cloudcmd/cloudcmd.spec.ts +++ b/servers/lib/test/cloudcmd/cloudcmd.spec.ts @@ -23,9 +23,6 @@ describe('cloudcmd test for the application', () => { responseType: 'json', }, ); - /* eslint-disable no-console */ - console.log(response.data); - /* eslint-enable no-console */ expect(response.data.path).toEqual('/'); const fileNames = response.data.files.map((file) => file.name); expect(fileNames).toContain('common'); From 5f8368f755c619ebb9e22a7dfc849dc764890224 Mon Sep 17 00:00:00 2001 From: nichlaes Date: Mon, 16 Sep 2024 13:55:58 +0200 Subject: [PATCH 39/41] adds local compose file --- servers/lib/DEVELOPER.md | 17 +++++++++++++---- servers/lib/compose.lib.dev.yml | 6 ++---- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/servers/lib/DEVELOPER.md b/servers/lib/DEVELOPER.md index ccaa111df..84f7d2002 100644 --- a/servers/lib/DEVELOPER.md +++ b/servers/lib/DEVELOPER.md @@ -50,7 +50,7 @@ As of now, some features require manual testing or attention. ### CloudCMD (a npm package dependency) Due to how CloudCMD works, -it is required to manually test with `LOCAL_PATH` both as an +it is required to manually test with `LOCAL_PATH` both as an absolute path and local path. | OS | Absolute Path | Relative Path | @@ -116,7 +116,16 @@ running the following commands. The microservices require configuration and the docker version of the microservices uses the configuration file available in `config/.env.default`. -If you would like to adjust the configuration, please change this file. + +Please add a `.env` file with the environment variables for +the docker compose file to use. +e.g. + +``` +PORT='4001' +MODE='local' +LOCAL_PATH='..\..\files' +``` ### Use @@ -134,8 +143,8 @@ The `config/.env.default` file is used as the microservice configuration. If the configuration values are changed, please restart the container. ```bash -docker compose -f compose.lib.yml down -docker compose -f compose.lib.yml up -d +docker compose -f compose.lib.dev.yml down +docker compose -f compose.lib.dev.yml up -d ``` ### Publish diff --git a/servers/lib/compose.lib.dev.yml b/servers/lib/compose.lib.dev.yml index 6e737f213..f1e4a8ba0 100644 --- a/servers/lib/compose.lib.dev.yml +++ b/servers/lib/compose.lib.dev.yml @@ -1,11 +1,9 @@ -version: '3' services: libms: build: context: ../../ dockerfile: ./docker/libms.dockerfile - restart: unless-stopped volumes: - - ./files:/dtaas/libms/files + - ${LOCAL_PATH}:/dtaas/libms/files ports: - - "4001:4001" + - ${PORT}:4001 From 0b555a3ff626923124794ff6c030ece080575744 Mon Sep 17 00:00:00 2001 From: nichlaes Date: Mon, 16 Sep 2024 13:59:58 +0200 Subject: [PATCH 40/41] specify code block language --- servers/lib/DEVELOPER.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/servers/lib/DEVELOPER.md b/servers/lib/DEVELOPER.md index 84f7d2002..3dc7299ff 100644 --- a/servers/lib/DEVELOPER.md +++ b/servers/lib/DEVELOPER.md @@ -121,7 +121,7 @@ Please add a `.env` file with the environment variables for the docker compose file to use. e.g. -``` +```sh PORT='4001' MODE='local' LOCAL_PATH='..\..\files' From 05d0f018c7d64c97a556924da62ae35a0515abc3 Mon Sep 17 00:00:00 2001 From: prasadtalasila Date: Mon, 16 Sep 2024 15:05:28 +0200 Subject: [PATCH 41/41] Improves DEVELOPER.md --- servers/lib/DEVELOPER.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/servers/lib/DEVELOPER.md b/servers/lib/DEVELOPER.md index 3dc7299ff..497eeee53 100644 --- a/servers/lib/DEVELOPER.md +++ b/servers/lib/DEVELOPER.md @@ -50,12 +50,13 @@ As of now, some features require manual testing or attention. ### CloudCMD (a npm package dependency) Due to how CloudCMD works, -it is required to manually test with `LOCAL_PATH` both as an -absolute path and local path. +it is required to manually run `yarn test:http` with `LOCAL_PATH` both as an +absolute path and local path. For example, the manual tests +need to be done with the following `LOCAL_PATH` values. | OS | Absolute Path | Relative Path | | ------- | ----------------------------- | ------------- | -| Windows | C:\DTaaS\files | ..\\..\files | +| Windows | C:\DTaaS\files | ..\..\files | | Linux | /Users//DTaaS/files | ../../files | ### PM2