From 1f9788bf2f5483b5fdef9a3d3401802a6e5a75bb Mon Sep 17 00:00:00 2001 From: Aakash Singh Date: Fri, 27 Sep 2024 21:30:19 +0530 Subject: [PATCH 1/2] update care jwks url (#144) --- src/lib/jose.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/jose.ts b/src/lib/jose.ts index 1fc91ae..0727ae9 100644 --- a/src/lib/jose.ts +++ b/src/lib/jose.ts @@ -95,7 +95,7 @@ export async function getCareJWKs() { if (!careJWKs) { const controller = new AbortController(); setTimeout(() => controller.abort(), 5000); - const res = await fetch(`${careApi}/.well-known/openid-configuration`, { + const res = await fetch(`${careApi}/.well-known/jwks.json`, { signal: controller.signal, }).then((res) => { if (!res.ok) { From 126bc78845f128886577c6e11da80fe5529dfae5 Mon Sep 17 00:00:00 2001 From: Aakash Singh Date: Thu, 3 Oct 2024 16:58:00 +0530 Subject: [PATCH 2/2] fix docker builds (#145) --- .nvmrc | 2 +- Dockerfile | 8 +++--- package-lock.json | 65 ++++++++++++++++++++++++++++++++--------------- package.json | 9 ++++--- 4 files changed, 56 insertions(+), 28 deletions(-) diff --git a/.nvmrc b/.nvmrc index 85aee5a..9aef5aa 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v20 \ No newline at end of file +v20.17.0 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 060e559..008ffbe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,22 +1,22 @@ -FROM node:20-alpine AS build +FROM node:20.17.0-alpine AS build WORKDIR /app COPY package.*json ./ -RUN npm install +RUN npm --mount=type=cache,target=/root/.npm install COPY . . RUN npm run build -FROM node:20-alpine AS production +FROM node:20.17.0-alpine AS production WORKDIR /app RUN mkdir /app/images COPY package.*json ./ -RUN npm install --omit=dev +RUN npm --mount=type=cache,target=/root/.npm install --omit=dev COPY --from=build /app/prisma ./prisma COPY --from=build /app/dist ./dist diff --git a/package-lock.json b/package-lock.json index 2c79553..90b9d2f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -42,9 +42,12 @@ }, "devDependencies": { "@trivago/prettier-plugin-sort-imports": "^4.3.0", - "@types/connect-flash": "^0.0.39", + "@types/connect-flash": "^0.0.40", "@types/cookie-parser": "^1.4.6", "@types/cors": "^2.8.15", + "@types/dotenv": "^6.1.1", + "@types/express": "^4.17.21", + "@types/express-serve-static-core": "^4.19.2", "@types/express-session": "^1.17.9", "@types/express-ws": "^3.0.1", "@types/lodash.groupby": "^4.6.8", @@ -64,7 +67,7 @@ "typescript": "^5.2.2" }, "engines": { - "node": ">=20.0.0" + "node": "v20.17.0" } }, "node_modules/@apidevtools/json-schema-ref-parser": { @@ -1253,10 +1256,11 @@ } }, "node_modules/@types/connect-flash": { - "version": "0.0.39", - "resolved": "https://registry.npmjs.org/@types/connect-flash/-/connect-flash-0.0.39.tgz", - "integrity": "sha512-m8xTfpcHZGw3eknCttCwYP37x5lS2ZzKM+BVStSqB0vyNpMnl0YLpvVkFjkxk8E7G3MWIgj3bib4QnHquI+/hw==", + "version": "0.0.40", + "resolved": "https://registry.npmjs.org/@types/connect-flash/-/connect-flash-0.0.40.tgz", + "integrity": "sha512-vqGDzZ85Kyu/tKdDwXP6JCz4i2Xp3o4bYHSCXbF7XiL1HohogtGXG5pgbgypVbdO3DYqCOHIiZhp2Gh5fP2dDw==", "dev": true, + "license": "MIT", "dependencies": { "@types/express": "*" } @@ -1279,11 +1283,22 @@ "@types/node": "*" } }, + "node_modules/@types/dotenv": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/@types/dotenv/-/dotenv-6.1.1.tgz", + "integrity": "sha512-ftQl3DtBvqHl9L16tpqqzA4YzCSXZfi7g8cQceTz5rOlYtk/IZbFjAv3mLOQlNIgOaylCQWQoBdDQHPgEBJPHg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/express": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.20.tgz", - "integrity": "sha512-rOaqlkgEvOW495xErXMsmyX3WKBInbhG5eqojXYi3cGUaLoRDlXa5d52fkfWZT963AZ3v2eZ4MbKE6WpDAGVsw==", + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", + "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==", "dev": true, + "license": "MIT", "dependencies": { "@types/body-parser": "*", "@types/express-serve-static-core": "^4.17.33", @@ -1292,10 +1307,11 @@ } }, "node_modules/@types/express-serve-static-core": { - "version": "4.17.39", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.39.tgz", - "integrity": "sha512-BiEUfAiGCOllomsRAZOiMFP7LAnrifHpt56pc4Z7l9K6ACyN06Ns1JLMBxwkfLOjJRlSf06NwWsT7yzfpaVpyQ==", + "version": "4.19.2", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.2.tgz", + "integrity": "sha512-dPSEQElyVJ97BuGduAqQjpBocZWAs0GR94z+ptL7JXQJeJdHw2WBG3EWdFrK36b8Q6j8P4cXOMhgUoi0IIfIsg==", "dev": true, + "license": "MIT", "dependencies": { "@types/node": "*", "@types/qs": "*", @@ -5041,9 +5057,9 @@ } }, "@types/connect-flash": { - "version": "0.0.39", - "resolved": "https://registry.npmjs.org/@types/connect-flash/-/connect-flash-0.0.39.tgz", - "integrity": "sha512-m8xTfpcHZGw3eknCttCwYP37x5lS2ZzKM+BVStSqB0vyNpMnl0YLpvVkFjkxk8E7G3MWIgj3bib4QnHquI+/hw==", + "version": "0.0.40", + "resolved": "https://registry.npmjs.org/@types/connect-flash/-/connect-flash-0.0.40.tgz", + "integrity": "sha512-vqGDzZ85Kyu/tKdDwXP6JCz4i2Xp3o4bYHSCXbF7XiL1HohogtGXG5pgbgypVbdO3DYqCOHIiZhp2Gh5fP2dDw==", "dev": true, "requires": { "@types/express": "*" @@ -5067,10 +5083,19 @@ "@types/node": "*" } }, + "@types/dotenv": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/@types/dotenv/-/dotenv-6.1.1.tgz", + "integrity": "sha512-ftQl3DtBvqHl9L16tpqqzA4YzCSXZfi7g8cQceTz5rOlYtk/IZbFjAv3mLOQlNIgOaylCQWQoBdDQHPgEBJPHg==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "@types/express": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.20.tgz", - "integrity": "sha512-rOaqlkgEvOW495xErXMsmyX3WKBInbhG5eqojXYi3cGUaLoRDlXa5d52fkfWZT963AZ3v2eZ4MbKE6WpDAGVsw==", + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", + "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==", "dev": true, "requires": { "@types/body-parser": "*", @@ -5080,9 +5105,9 @@ } }, "@types/express-serve-static-core": { - "version": "4.17.39", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.39.tgz", - "integrity": "sha512-BiEUfAiGCOllomsRAZOiMFP7LAnrifHpt56pc4Z7l9K6ACyN06Ns1JLMBxwkfLOjJRlSf06NwWsT7yzfpaVpyQ==", + "version": "4.19.2", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.2.tgz", + "integrity": "sha512-dPSEQElyVJ97BuGduAqQjpBocZWAs0GR94z+ptL7JXQJeJdHw2WBG3EWdFrK36b8Q6j8P4cXOMhgUoi0IIfIsg==", "dev": true, "requires": { "@types/node": "*", diff --git a/package.json b/package.json index 5e8523f..f673200 100644 --- a/package.json +++ b/package.json @@ -61,9 +61,12 @@ "homepage": "https://github.com/coronasafe/teleicu_middleware#readme", "devDependencies": { "@trivago/prettier-plugin-sort-imports": "^4.3.0", - "@types/connect-flash": "^0.0.39", + "@types/connect-flash": "^0.0.40", "@types/cookie-parser": "^1.4.6", "@types/cors": "^2.8.15", + "@types/dotenv": "^6.1.1", + "@types/express": "^4.17.21", + "@types/express-serve-static-core": "^4.19.2", "@types/express-session": "^1.17.9", "@types/express-ws": "^3.0.1", "@types/lodash.groupby": "^4.6.8", @@ -83,6 +86,6 @@ "typescript": "^5.2.2" }, "engines": { - "node": ">=20.0.0" + "node": "v20.17.0" } -} \ No newline at end of file +}