diff --git a/backend/Dockerfile b/backend/Dockerfile index e4d283a77..06db22b62 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,18 +1,27 @@ -FROM node:16-bullseye-slim +# Build stage +FROM node:16-alpine AS build WORKDIR /app -COPY package.json package-lock.json ./ - -# RUN npm ci --only-production --ignore-scripts -# "prepare": "cd .. && npm install" - +COPY package*.json ./ RUN npm ci --only-production COPY . . +RUN npm run build + +# Production stage +FROM node:16-alpine + +WORKDIR /app + +COPY package*.json ./ +RUN npm ci --only-production + +COPY --from=build /app . HEALTHCHECK --interval=10s --timeout=3s --start-period=10s \ CMD node healthcheck.js +EXPOSE 4000 -CMD ["npm", "run", "start"] +CMD ["npm", "run", "start"] \ No newline at end of file diff --git a/backend/package.json b/backend/package.json index 89bd52b07..795fc68ed 100644 --- a/backend/package.json +++ b/backend/package.json @@ -48,7 +48,7 @@ "version": "1.0.0", "main": "src/index.js", "scripts": { - "start": "npm run build && node build/index.js", + "start": "node build/index.js", "dev": "nodemon", "swagger-autogen": "node ./swagger/index.ts", "build": "rimraf ./build && tsc && cp -R ./src/templates ./build", diff --git a/docker-compose.yml b/docker-compose.yml index 6143695f5..f1b8f7d05 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: '3' +version: "3" services: nginx: @@ -22,7 +22,6 @@ services: depends_on: - mongo image: infisical/backend - command: npm run start env_file: .env environment: - NODE_ENV=production diff --git a/docs/cli/overview.mdx b/docs/cli/overview.mdx index 47de44e01..8934d8e07 100644 --- a/docs/cli/overview.mdx +++ b/docs/cli/overview.mdx @@ -45,19 +45,19 @@ The Infisical CLI provides a way to inject environment variables from the platfo Install prerequisite ```bash - sudo apk add --no-cache bash sudo + apk add --no-cache bash sudo ``` Add Infisical repository ```bash curl -1sLf \ 'https://dl.cloudsmith.io/public/infisical/infisical-cli/setup.alpine.sh' \ - | sudo -E bash + | bash ``` Then install CLI ```bash - sudo apk update && sudo apk add infisical + apk update && sudo apk add infisical ``` diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 59a788cb0..021e3e0e5 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -13,7 +13,7 @@ "@fortawesome/free-regular-svg-icons": "^6.1.1", "@fortawesome/free-solid-svg-icons": "^6.1.2", "@fortawesome/react-fontawesome": "^0.1.19", - "@headlessui/react": "^1.6.6", + "@headlessui/react": "^1.7.7", "@hookform/resolvers": "^2.9.10", "@octokit/rest": "^19.0.7", "@radix-ui/react-accordion": "^1.1.0", @@ -30,14 +30,14 @@ "@radix-ui/react-tabs": "^1.0.2", "@radix-ui/react-toast": "^1.1.2", "@reduxjs/toolkit": "^1.8.3", - "@stripe/react-stripe-js": "^1.10.0", + "@stripe/react-stripe-js": "^1.16.3", "@stripe/stripe-js": "^1.46.0", "@tanstack/react-query": "^4.23.0", "@types/argon2-browser": "^1.18.1", "add": "^2.0.6", "argon2-browser": "^1.18.0", "axios": "^0.27.2", - "axios-auth-refresh": "^3.3.3", + "axios-auth-refresh": "^3.3.6", "base64-loader": "^1.0.0", "classnames": "^2.3.1", "cookies": "^0.8.0", @@ -45,13 +45,13 @@ "fs": "^0.0.1-security", "gray-matter": "^4.0.3", "http-proxy": "^1.18.1", - "i18next": "^22.4.6", + "i18next": "^22.4.9", "jspdf": "^2.5.1", "jsrp": "^0.2.4", "markdown-it": "^13.0.1", "next": "^12.3.4", "next-i18next": "^13.0.2", - "posthog-js": "^1.34.0", + "posthog-js": "^1.39.4", "query-string": "^7.1.3", "react": "^17.0.2", "react-beautiful-dnd": "^13.1.1", @@ -2544,9 +2544,12 @@ } }, "node_modules/@headlessui/react": { - "version": "1.6.6", - "resolved": "https://registry.npmjs.org/@headlessui/react/-/react-1.6.6.tgz", - "integrity": "sha512-MFJtmj9Xh/hhBMhLccGbBoSk+sk61BlP6sJe4uQcVMtXZhCgGqd2GyIQzzmsdPdTEWGSF434CBi8mnhR6um46Q==", + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/@headlessui/react/-/react-1.7.7.tgz", + "integrity": "sha512-BqDOd/tB9u2tA0T3Z0fn18ktw+KbVwMnkxxsGPIH2hzssrQhKB5n/6StZOyvLYP/FsYtvuXfi9I0YowKPv2c1w==", + "dependencies": { + "client-only": "^0.0.1" + }, "engines": { "node": ">=10" }, @@ -3935,9 +3938,9 @@ "dev": true }, "node_modules/@sentry/types": { - "version": "7.15.0", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.15.0.tgz", - "integrity": "sha512-MN9haDRh9ZOsTotoDTHu2BT3sT8Vs1F0alhizUpDyjN2YgBCqR6JV+AbAE1XNHwS2+5zbppch1PwJUVeE58URQ==", + "version": "7.22.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.22.0.tgz", + "integrity": "sha512-LhCL+wb1Jch+OesB2CIt6xpfO1Ab6CRvoNYRRzVumWPLns1T3ZJkarYfhbLaOEIb38EIbPgREdxn2AJT560U4Q==", "engines": { "node": ">=8" } @@ -6281,14 +6284,14 @@ } }, "node_modules/@stripe/react-stripe-js": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@stripe/react-stripe-js/-/react-stripe-js-1.10.0.tgz", - "integrity": "sha512-vuIjJUZJ3nyiaGa5z5iyMCzZfGGsgzOOjWjqknbbhkNsewyyginfeky9EZLSz9+iSAsgC9K6MeNOTLKVGcMycQ==", + "version": "1.16.3", + "resolved": "https://registry.npmjs.org/@stripe/react-stripe-js/-/react-stripe-js-1.16.3.tgz", + "integrity": "sha512-gS6UDGEuM92K50pFB3o//EqqPxmaqpC8IrsBda4P4LxeULoO0pBFSHXJ5Ab6uA7G2lyO2bluvSLereh0OH9GrQ==", "dependencies": { "prop-types": "^15.7.2" }, "peerDependencies": { - "@stripe/stripe-js": "^1.34.0", + "@stripe/stripe-js": "^1.44.1", "react": "^16.8.0 || ^17.0.0 || ^18.0.0", "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" } @@ -8157,9 +8160,9 @@ } }, "node_modules/axios-auth-refresh": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/axios-auth-refresh/-/axios-auth-refresh-3.3.3.tgz", - "integrity": "sha512-2IbDhJ/h6ddNBBnnzn1VFK/qx17pE9aVqiafB8rx5LVHsJ1HtFpUGkbXY7PzTG+8P9HJWcyA3fNZl9BikSuilg==", + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/axios-auth-refresh/-/axios-auth-refresh-3.3.6.tgz", + "integrity": "sha512-2CeBUce/SxIfFxow5/n8vApJ97yYF6qoV4gh1UrswT7aEOnlOdBLxxyhOI4IaxGs6BY0l8YujU2jlc4aCmK17Q==", "peerDependencies": { "axios": ">= 0.18 < 0.19.0 || >= 0.19.1" } @@ -9205,6 +9208,11 @@ "@colors/colors": "1.5.0" } }, + "node_modules/client-only": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", + "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==" + }, "node_modules/cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", @@ -13224,9 +13232,9 @@ } }, "node_modules/i18next": { - "version": "22.4.6", - "resolved": "https://registry.npmjs.org/i18next/-/i18next-22.4.6.tgz", - "integrity": "sha512-9Tm1ezxWyzV+306CIDMBbYBitC1jedQyYuuLtIv7oxjp2ohh8eyxP9xytIf+2bbQfhH784IQKPSYp+Zq9+YSbw==", + "version": "22.4.9", + "resolved": "https://registry.npmjs.org/i18next/-/i18next-22.4.9.tgz", + "integrity": "sha512-8gWMmUz460KJDQp/ob3MNUX84cVuDRY9PLFPnV8d+Qezz/6dkjxwOaH70xjrCNDO+JrUL25iXfAIN9wUkInNZw==", "funding": [ { "type": "individual", @@ -17079,11 +17087,11 @@ "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==" }, "node_modules/posthog-js": { - "version": "1.34.0", - "resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.34.0.tgz", - "integrity": "sha512-HkRwwzdz31N5ykQIO3SIkSS8nwhdqqnuDZ/qltitX4FhxrV9/tSRavEXz0YLvioOXeNVmQWtsN3krKajErwkwg==", + "version": "1.39.4", + "resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.39.4.tgz", + "integrity": "sha512-Elpf1gwyuObueXi89iH+9pP+WhpkiivP8Qwej4RzOLwSTa7Floaa4rgAw7rnCnX1PtRoJ3F0kqb6q9T+aZjRiA==", "dependencies": { - "@sentry/types": "^7.2.0", + "@sentry/types": "7.22.0", "fflate": "^0.4.1", "rrweb-snapshot": "^1.1.14" } @@ -23946,10 +23954,12 @@ } }, "@headlessui/react": { - "version": "1.6.6", - "resolved": "https://registry.npmjs.org/@headlessui/react/-/react-1.6.6.tgz", - "integrity": "sha512-MFJtmj9Xh/hhBMhLccGbBoSk+sk61BlP6sJe4uQcVMtXZhCgGqd2GyIQzzmsdPdTEWGSF434CBi8mnhR6um46Q==", - "requires": {} + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/@headlessui/react/-/react-1.7.7.tgz", + "integrity": "sha512-BqDOd/tB9u2tA0T3Z0fn18ktw+KbVwMnkxxsGPIH2hzssrQhKB5n/6StZOyvLYP/FsYtvuXfi9I0YowKPv2c1w==", + "requires": { + "client-only": "^0.0.1" + } }, "@hookform/resolvers": { "version": "2.9.10", @@ -24987,9 +24997,9 @@ "dev": true }, "@sentry/types": { - "version": "7.15.0", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.15.0.tgz", - "integrity": "sha512-MN9haDRh9ZOsTotoDTHu2BT3sT8Vs1F0alhizUpDyjN2YgBCqR6JV+AbAE1XNHwS2+5zbppch1PwJUVeE58URQ==" + "version": "7.22.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.22.0.tgz", + "integrity": "sha512-LhCL+wb1Jch+OesB2CIt6xpfO1Ab6CRvoNYRRzVumWPLns1T3ZJkarYfhbLaOEIb38EIbPgREdxn2AJT560U4Q==" }, "@sinclair/typebox": { "version": "0.24.51", @@ -26659,9 +26669,9 @@ } }, "@stripe/react-stripe-js": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@stripe/react-stripe-js/-/react-stripe-js-1.10.0.tgz", - "integrity": "sha512-vuIjJUZJ3nyiaGa5z5iyMCzZfGGsgzOOjWjqknbbhkNsewyyginfeky9EZLSz9+iSAsgC9K6MeNOTLKVGcMycQ==", + "version": "1.16.3", + "resolved": "https://registry.npmjs.org/@stripe/react-stripe-js/-/react-stripe-js-1.16.3.tgz", + "integrity": "sha512-gS6UDGEuM92K50pFB3o//EqqPxmaqpC8IrsBda4P4LxeULoO0pBFSHXJ5Ab6uA7G2lyO2bluvSLereh0OH9GrQ==", "requires": { "prop-types": "^15.7.2" } @@ -28115,9 +28125,9 @@ } }, "axios-auth-refresh": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/axios-auth-refresh/-/axios-auth-refresh-3.3.3.tgz", - "integrity": "sha512-2IbDhJ/h6ddNBBnnzn1VFK/qx17pE9aVqiafB8rx5LVHsJ1HtFpUGkbXY7PzTG+8P9HJWcyA3fNZl9BikSuilg==", + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/axios-auth-refresh/-/axios-auth-refresh-3.3.6.tgz", + "integrity": "sha512-2CeBUce/SxIfFxow5/n8vApJ97yYF6qoV4gh1UrswT7aEOnlOdBLxxyhOI4IaxGs6BY0l8YujU2jlc4aCmK17Q==", "requires": {} }, "axobject-query": { @@ -28888,6 +28898,11 @@ "string-width": "^4.2.0" } }, + "client-only": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", + "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==" + }, "cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", @@ -31990,9 +32005,9 @@ "dev": true }, "i18next": { - "version": "22.4.6", - "resolved": "https://registry.npmjs.org/i18next/-/i18next-22.4.6.tgz", - "integrity": "sha512-9Tm1ezxWyzV+306CIDMBbYBitC1jedQyYuuLtIv7oxjp2ohh8eyxP9xytIf+2bbQfhH784IQKPSYp+Zq9+YSbw==", + "version": "22.4.9", + "resolved": "https://registry.npmjs.org/i18next/-/i18next-22.4.9.tgz", + "integrity": "sha512-8gWMmUz460KJDQp/ob3MNUX84cVuDRY9PLFPnV8d+Qezz/6dkjxwOaH70xjrCNDO+JrUL25iXfAIN9wUkInNZw==", "requires": { "@babel/runtime": "^7.20.6" } @@ -34690,11 +34705,11 @@ "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==" }, "posthog-js": { - "version": "1.34.0", - "resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.34.0.tgz", - "integrity": "sha512-HkRwwzdz31N5ykQIO3SIkSS8nwhdqqnuDZ/qltitX4FhxrV9/tSRavEXz0YLvioOXeNVmQWtsN3krKajErwkwg==", + "version": "1.39.4", + "resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.39.4.tgz", + "integrity": "sha512-Elpf1gwyuObueXi89iH+9pP+WhpkiivP8Qwej4RzOLwSTa7Floaa4rgAw7rnCnX1PtRoJ3F0kqb6q9T+aZjRiA==", "requires": { - "@sentry/types": "^7.2.0", + "@sentry/types": "7.22.0", "fflate": "^0.4.1", "rrweb-snapshot": "^1.1.14" } diff --git a/frontend/package.json b/frontend/package.json index 824dfdcd5..3a61ed7b0 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -20,7 +20,7 @@ "@fortawesome/free-regular-svg-icons": "^6.1.1", "@fortawesome/free-solid-svg-icons": "^6.1.2", "@fortawesome/react-fontawesome": "^0.1.19", - "@headlessui/react": "^1.6.6", + "@headlessui/react": "^1.7.7", "@hookform/resolvers": "^2.9.10", "@octokit/rest": "^19.0.7", "@radix-ui/react-accordion": "^1.1.0", @@ -37,14 +37,14 @@ "@radix-ui/react-tabs": "^1.0.2", "@radix-ui/react-toast": "^1.1.2", "@reduxjs/toolkit": "^1.8.3", - "@stripe/react-stripe-js": "^1.10.0", + "@stripe/react-stripe-js": "^1.16.3", "@stripe/stripe-js": "^1.46.0", "@types/argon2-browser": "^1.18.1", "@tanstack/react-query": "^4.23.0", "add": "^2.0.6", "argon2-browser": "^1.18.0", "axios": "^0.27.2", - "axios-auth-refresh": "^3.3.3", + "axios-auth-refresh": "^3.3.6", "base64-loader": "^1.0.0", "classnames": "^2.3.1", "cookies": "^0.8.0", @@ -52,13 +52,13 @@ "fs": "^0.0.1-security", "gray-matter": "^4.0.3", "http-proxy": "^1.18.1", - "i18next": "^22.4.6", + "i18next": "^22.4.9", "jspdf": "^2.5.1", "jsrp": "^0.2.4", "markdown-it": "^13.0.1", "next": "^12.3.4", "next-i18next": "^13.0.2", - "posthog-js": "^1.34.0", + "posthog-js": "^1.39.4", "query-string": "^7.1.3", "react": "^17.0.2", "react-beautiful-dnd": "^13.1.1",