From d1c28b79d144684a2ef46b9068a5411d9b808c3f Mon Sep 17 00:00:00 2001 From: Tahsin Kurc Date: Sun, 23 Aug 2020 12:50:01 -0400 Subject: [PATCH 1/8] Mods for deployment on K8 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 0fb903e..01cd149 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ RUN mkdir /root/src COPY . /root/src WORKDIR /root/src RUN npm install -ARG viewer +ARG viewer="v3.7.7" ARG fork RUN git clone https://github.com/${fork:-camicroscope}/camicroscope.git --branch=${viewer:-master} EXPOSE 8010 From 738d4aa3e6c0569f95ce4d68a4904a58d7449280 Mon Sep 17 00:00:00 2001 From: Tahsin Kurc Date: Mon, 24 Aug 2020 09:08:46 -0400 Subject: [PATCH 2/8] non root user. --- Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Dockerfile b/Dockerfile index 01cd149..b676d43 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ FROM node:12-alpine + RUN apk add git RUN mkdir /root/src COPY . /root/src @@ -8,4 +9,8 @@ ARG viewer="v3.7.7" ARG fork RUN git clone https://github.com/${fork:-camicroscope}/camicroscope.git --branch=${viewer:-master} EXPOSE 8010 + +RUN chgrp -R 0 /root && \ + chmod -R g+rwX /root + CMD node caracal.js From e8b8133619480e3d6699b0258b483a0aa3a8884f Mon Sep 17 00:00:00 2001 From: Tahsin Kurc Date: Wed, 26 Aug 2020 09:41:50 -0400 Subject: [PATCH 3/8] Added USER 1001 for non-root user runs. --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index b676d43..31077fb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,4 +13,6 @@ EXPOSE 8010 RUN chgrp -R 0 /root && \ chmod -R g+rwX /root +USER 1001 + CMD node caracal.js From 7c0e156e0135690e28a3ca39e45abd87130ae826 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 13 Dec 2020 05:25:58 +0000 Subject: [PATCH 4/8] Bump ini from 1.3.5 to 1.3.8 Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.8. - [Release notes](https://github.com/isaacs/ini/releases) - [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.8) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 31211fe..df3fba8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1463,9 +1463,9 @@ "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, "ini": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" }, "inkjet": { "version": "2.1.2", From 57d72f76dd8189fa8376552b3a0fa9fbc15d884c Mon Sep 17 00:00:00 2001 From: Jasox NaN Date: Tue, 15 Dec 2020 16:09:27 -0500 Subject: [PATCH 5/8] add collection operations --- routes.json | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/routes.json b/routes.json index 68e1d65..a477ba3 100644 --- a/routes.json +++ b/routes.json @@ -24,7 +24,7 @@ "method":"use", "route": "/loader/", "handlers":[ - {"function":"proxyHandler", "args": ["http://ca-load:4000/"]} + {"function":"proxyHandler", "args": ["http://test-load:4000/"]} ] }, @@ -334,6 +334,26 @@ {"function":"permissionHandler", "args": [["Admin", "Editor"]]}, {"function":"mongoUpdate", "args": ["camic", "configuration"]} ] + },{ + "route":"/data/Collection/find", + "method":"get", + "handler":[ + {"function":"mongoFind", "args": ["camic", "collection"]} + ] + },{ + "route":"/data/Collection/update", + "method":"post", + "handlers":[ + {"function":"permissionHandler", "args": [["Admin", "Editor"]]}, + {"function":"mongoUpdate", "args": ["camic", "collection"]} + ] + },{ + "route":"/data/Collection/delete", + "method":"delete", + "handlers":[ + {"function":"permissionHandler", "args": [["Admin", "Editor"]]}, + {"function":"mongoDelete", "args": ["camic", "collection"]} + ] }, { From fd2379ea8992d26b13769f457358ce8bad830ce3 Mon Sep 17 00:00:00 2001 From: Jasox NaN Date: Tue, 15 Dec 2020 16:46:17 -0500 Subject: [PATCH 6/8] add update collection operation --- routes.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/routes.json b/routes.json index a477ba3..e54c2dd 100644 --- a/routes.json +++ b/routes.json @@ -340,6 +340,13 @@ "handler":[ {"function":"mongoFind", "args": ["camic", "collection"]} ] + },{ + "route":"/data/Collection/post", + "method":"post", + "handlers":[ + {"function":"permissionHandler", "args": [["Admin", "Editor"]]}, + {"function":"mongoAdd", "args": ["camic", "collection"]} + ] },{ "route":"/data/Collection/update", "method":"post", From 1b2d4d543630ad89604fd97dd8cf8527a7c1d135 Mon Sep 17 00:00:00 2001 From: Jasox NaN Date: Wed, 16 Dec 2020 10:13:58 -0500 Subject: [PATCH 7/8] fixed a typo in`routes.json` --- routes.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routes.json b/routes.json index e54c2dd..b5c9e47 100644 --- a/routes.json +++ b/routes.json @@ -24,7 +24,7 @@ "method":"use", "route": "/loader/", "handlers":[ - {"function":"proxyHandler", "args": ["http://test-load:4000/"]} + {"function":"proxyHandler", "args": ["http://ca-load:4000/"]} ] }, @@ -337,7 +337,7 @@ },{ "route":"/data/Collection/find", "method":"get", - "handler":[ + "handlers":[ {"function":"mongoFind", "args": ["camic", "collection"]} ] },{ From 5117935759b8c5d06aa697cdeef079db57592862 Mon Sep 17 00:00:00 2001 From: Ryan Birmingham Date: Wed, 6 Jan 2021 11:45:28 -0500 Subject: [PATCH 8/8] axios version fix --- package-lock.json | 160 ++++++++++++++++++++++++++++++---------------- package.json | 2 +- 2 files changed, 107 insertions(+), 55 deletions(-) diff --git a/package-lock.json b/package-lock.json index df3fba8..cc20217 100644 --- a/package-lock.json +++ b/package-lock.json @@ -162,6 +162,11 @@ "tar": "^4.4.6" } }, + "@tootallnate/once": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==" + }, "@types/body-parser": { "version": "1.19.0", "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.0.tgz", @@ -184,9 +189,9 @@ "dev": true }, "@types/connect": { - "version": "3.4.33", - "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.33.tgz", - "integrity": "sha512-2+FrkXY4zllzTNfJth7jOqEHC+enpLeGslEhpnTAkg21GkRrWV4SsAtqchtT4YS9/nODBU2/ZfsBY2X4J/dX7A==", + "version": "3.4.34", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.34.tgz", + "integrity": "sha512-ePPA/JuI+X0vb+gSWlPKOY0NdNAie/rPUqX2GUPpbZwiKTkSPhjXWuee47E4MtE54QVzGCQMQkAL6JhV2E1+cQ==", "requires": { "@types/node": "*" } @@ -198,9 +203,9 @@ "dev": true }, "@types/express": { - "version": "4.17.8", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.8.tgz", - "integrity": "sha512-wLhcKh3PMlyA2cNAB9sjM1BntnhPMiM0JOBwPBqttjHev2428MLEB4AYVN+d8s2iyCVZac+o41Pflm/ZH5vLXQ==", + "version": "4.17.9", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.9.tgz", + "integrity": "sha512-SDzEIZInC4sivGIFY4Sz1GG6J9UObPwCInYJjko2jzOf/Imx/dlpume6Xxwj1ORL82tBbmN4cPDIDkLbWHk9hw==", "requires": { "@types/body-parser": "*", "@types/express-serve-static-core": "*", @@ -218,9 +223,9 @@ } }, "@types/express-serve-static-core": { - "version": "4.17.12", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.12.tgz", - "integrity": "sha512-EaEdY+Dty1jEU7U6J4CUWwxL+hyEGMkO5jan5gplfegUgCUsIUWqXxqw47uGjimeT4Qgkz/XUfwoau08+fgvKA==", + "version": "4.17.17", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.17.tgz", + "integrity": "sha512-YYlVaCni5dnHc+bLZfY908IG1+x5xuibKZMGv8srKkvtul3wUuanYvpIj9GXXoWkQbaAdR+kgX46IETKUALWNQ==", "requires": { "@types/node": "*", "@types/qs": "*", @@ -272,9 +277,9 @@ "integrity": "sha512-esIJx9bQg+QYF0ra8GnvfianIY8qWB0GBx54PK5Eps6m+xTj86KLavHv6qDhzKcu5UUOgNfJ2pWaIIV7TRUd9Q==" }, "@types/qs": { - "version": "6.9.4", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.4.tgz", - "integrity": "sha512-+wYo+L6ZF6BMoEjtf8zB2esQsqdV6WsjRK/GP9WOgLPrq87PbNWgIxS76dS5uvl/QXtHGakZmwTznIfcPXcKlQ==" + "version": "6.9.5", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.5.tgz", + "integrity": "sha512-/JHkVHtx/REVG0VVToGRGH2+23hsYLHdyG+GrvoUGlGAd0ErauXDyvHtRI/7H7mzLm+tBCKA7pfcpkQ1lf58iQ==" }, "@types/range-parser": { "version": "1.2.3", @@ -287,12 +292,12 @@ "integrity": "sha1-nbVjk33YaRX2kJK8QyWdL0hXjkE=" }, "@types/serve-static": { - "version": "1.13.5", - "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.5.tgz", - "integrity": "sha512-6M64P58N+OXjU432WoLLBQxbA0LRGBCRm7aAGQJ+SMC1IMl0dgRVi9EFfoDcS2a7Xogygk/eGN94CfwU9UF7UQ==", + "version": "1.13.8", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.8.tgz", + "integrity": "sha512-MoJhSQreaVoL+/hurAZzIm8wafFR6ajiTM1m4A0kv6AGeVBl4r4pOV8bGFrjjq1sGxDTnCoF8i22o0/aE5XCyA==", "requires": { - "@types/express-serve-static-core": "*", - "@types/mime": "*" + "@types/mime": "*", + "@types/node": "*" } }, "@types/superagent": { @@ -447,29 +452,11 @@ "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==" }, "axios": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.19.2.tgz", - "integrity": "sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==", + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", + "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", "requires": { - "follow-redirects": "1.5.10" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "requires": { - "ms": "2.0.0" - } - }, - "follow-redirects": { - "version": "1.5.10", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz", - "integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==", - "requires": { - "debug": "=3.1.0" - } - } + "follow-redirects": "^1.10.0" } }, "balanced-match": { @@ -1362,6 +1349,39 @@ "requires-port": "^1.0.0" } }, + "http-proxy-agent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "requires": { + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4" + }, + "dependencies": { + "agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "requires": { + "debug": "4" + } + }, + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } + } + }, "http-proxy-middleware": { "version": "0.20.0", "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.20.0.tgz", @@ -1681,31 +1701,58 @@ } }, "jwks-rsa": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/jwks-rsa/-/jwks-rsa-1.9.0.tgz", - "integrity": "sha512-UPCfQQg0s2kF2Ju6UFJrQH73f7MaVN/hKBnYBYOp+X9KN4y6TLChhLtaXS5nRKbZqshwVdrZ9OY63m/Q9CLqcg==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/jwks-rsa/-/jwks-rsa-1.12.1.tgz", + "integrity": "sha512-N7RsfrzK3+S+SqKEEhWF7Ak87Gzg0KcZq/f8h0VqL2ur3nTB6pi5J12uelGAzB3VfhWQI+zfolHE2XDu/EI7Hg==", "requires": { "@types/express-jwt": "0.0.42", - "axios": "^0.19.2", + "axios": "^0.21.1", "debug": "^4.1.0", + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", "jsonwebtoken": "^8.5.1", "limiter": "^1.1.5", "lru-memoizer": "^2.1.2", - "ms": "^2.1.2" + "ms": "^2.1.2", + "proxy-from-env": "^1.1.0" }, "dependencies": { + "agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "requires": { + "debug": "4" + } + }, "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", "requires": { - "ms": "^2.1.1" + "ms": "2.1.2" + }, + "dependencies": { + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } + } + }, + "https-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", + "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", + "requires": { + "agent-base": "6", + "debug": "4" } }, "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" } } }, @@ -1793,9 +1840,9 @@ } }, "lru-memoizer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/lru-memoizer/-/lru-memoizer-2.1.2.tgz", - "integrity": "sha512-N5L5xlnVcbIinNn/TJ17vHBZwBMt9t7aJDz2n97moWubjNl6VO9Ao2XuAGBBddkYdjrwR9HfzXbT6NfMZXAZ/A==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/lru-memoizer/-/lru-memoizer-2.1.4.tgz", + "integrity": "sha512-IXAq50s4qwrOBrXJklY+KhgZF+5y98PDaNo0gi/v2KQBFLyWr+JyFvijZXkGKjQj/h9c0OwoE+JZbwUXce76hQ==", "requires": { "lodash.clonedeep": "^4.5.0", "lru-cache": "~4.0.0" @@ -2165,6 +2212,11 @@ "ipaddr.js": "1.9.1" } }, + "proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "pseudomap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", diff --git a/package.json b/package.json index 048d9b4..009f01f 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "http-proxy-middleware": "^0.20.0", "inkjet": "^2.1.2", "jsonwebtoken": "^8.5.1", - "jwks-rsa": "^1.6.0", + "jwks-rsa": "^1.12.1", "mongodb": "^3.3.5", "throng": "^4.0.0" },