diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 0c06bf342..87797c5f7 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,12 +1,17 @@ name: Build, Publish and Deploy to Gamma -on: [workflow_dispatch] +on: + push: + tags: + - "infisical/v*.*.*" jobs: backend-image: name: Build backend image runs-on: ubuntu-latest - steps: + - name: Extract version from tag + id: extract_version + run: echo "::set-output name=version::${GITHUB_REF_NAME#infisical/}" - name: ☁️ Checkout source uses: actions/checkout@v3 - name: 📦 Install dependencies to test all dependencies @@ -51,15 +56,19 @@ jobs: token: ${{ secrets.DEPOT_PROJECT_TOKEN }} push: true context: backend - tags: infisical/backend:${{ steps.commit.outputs.short }}, + tags: | + infisical/backend:${{ steps.commit.outputs.short }} infisical/backend:latest + infisical/backend:${{ steps.extract_version.outputs.version }} platforms: linux/amd64,linux/arm64 frontend-image: name: Build frontend image runs-on: ubuntu-latest - steps: + - name: Extract version from tag + id: extract_version + run: echo "::set-output name=version::${GITHUB_REF_NAME#infisical/}" - name: ☁️ Checkout source uses: actions/checkout@v3 - name: Save commit hashes for tag @@ -100,8 +109,10 @@ jobs: push: true token: ${{ secrets.DEPOT_PROJECT_TOKEN }} context: frontend - tags: infisical/frontend:${{ steps.commit.outputs.short }}, + tags: | + infisical/frontend:${{ steps.commit.outputs.short }} infisical/frontend:latest + infisical/frontend:${{ steps.extract_version.outputs.version }} platforms: linux/amd64,linux/arm64 build-args: | POSTHOG_API_KEY=${{ secrets.PUBLIC_POSTHOG_API_KEY }} diff --git a/backend/package-lock.json b/backend/package-lock.json index 6ff3e9795..ba7fc017b 100644 --- a/backend/package-lock.json +++ b/backend/package-lock.json @@ -22,7 +22,7 @@ "axios": "^1.3.5", "axios-retry": "^3.4.0", "bcrypt": "^5.1.0", - "bigint-conversion": "^2.2.2", + "bigint-conversion": "^2.4.0", "builder-pattern": "^2.2.0", "cookie-parser": "^1.4.6", "cors": "^2.8.5", @@ -39,7 +39,7 @@ "jsrp": "^0.2.4", "libsodium-wrappers": "^0.7.10", "lodash": "^4.17.21", - "mongoose": "^6.10.4", + "mongoose": "^6.10.5", "nodemailer": "^6.8.0", "posthog-node": "^2.6.0", "query-string": "^7.1.3", @@ -3171,9 +3171,9 @@ } }, "node_modules/@juanelas/base64": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@juanelas/base64/-/base64-1.0.5.tgz", - "integrity": "sha512-gTIElNo4ohMcYUZzol/Hb6DYJzphxl0b1B4egJJ+JiqxqcOcWx4XLMAB+lhWuMsMX3uR1oc5hwPusU3lgc1FkQ==" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@juanelas/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-mr2pfRQpWap0Uq4tlrCgp3W+Yjx1/Bpq4QJsYeAQUh1mExgyQvXz7xUhmYT2HcLLspuAL5dpnos8P2QhaCSXsQ==" }, "node_modules/@mapbox/node-pre-gyp": { "version": "1.0.10", @@ -4942,11 +4942,11 @@ "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==" }, "node_modules/bigint-conversion": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/bigint-conversion/-/bigint-conversion-2.3.0.tgz", - "integrity": "sha512-U4Yzg8ygZ3m78n9weKP/6NMxN/98Pdsw6YdnDYgQO8fffL7ila31fCZIy5lCMswr4kEcyl8bGHltcHT0QdG/MQ==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/bigint-conversion/-/bigint-conversion-2.4.0.tgz", + "integrity": "sha512-PApDhrpW5qjdK8ecsBgcJ08pNMt8nNsnPxlw9a9PVPeF01tzBaeV66ogu3L9i/tEz5WhD8IvSf9ipQILujThzA==", "dependencies": { - "@juanelas/base64": "^1.0.1" + "@juanelas/base64": "^1.1.0" } }, "node_modules/binary-extensions": { @@ -8325,9 +8325,9 @@ } }, "node_modules/mongoose": { - "version": "6.10.4", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-6.10.4.tgz", - "integrity": "sha512-xCHVVEaOuhZxbthsKYxvHexWafJqWsl03sD7y7uyyt3euLd1sQoDI8DKueeJq9+hrbWkMkAGbGzgFPTIRqenPg==", + "version": "6.10.5", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-6.10.5.tgz", + "integrity": "sha512-y4HL4/9EySec7L0gJ+pCm9heLSF45uIIvRS4fSeAFWDfe4vXW1vRZJwTz7OGkra3ZoSfRnFTo9bNZkuggDVlVA==", "dependencies": { "bson": "^4.7.0", "kareem": "2.5.1", @@ -15685,9 +15685,9 @@ } }, "@juanelas/base64": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@juanelas/base64/-/base64-1.0.5.tgz", - "integrity": "sha512-gTIElNo4ohMcYUZzol/Hb6DYJzphxl0b1B4egJJ+JiqxqcOcWx4XLMAB+lhWuMsMX3uR1oc5hwPusU3lgc1FkQ==" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@juanelas/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-mr2pfRQpWap0Uq4tlrCgp3W+Yjx1/Bpq4QJsYeAQUh1mExgyQvXz7xUhmYT2HcLLspuAL5dpnos8P2QhaCSXsQ==" }, "@mapbox/node-pre-gyp": { "version": "1.0.10", @@ -16992,11 +16992,11 @@ "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==" }, "bigint-conversion": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/bigint-conversion/-/bigint-conversion-2.3.0.tgz", - "integrity": "sha512-U4Yzg8ygZ3m78n9weKP/6NMxN/98Pdsw6YdnDYgQO8fffL7ila31fCZIy5lCMswr4kEcyl8bGHltcHT0QdG/MQ==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/bigint-conversion/-/bigint-conversion-2.4.0.tgz", + "integrity": "sha512-PApDhrpW5qjdK8ecsBgcJ08pNMt8nNsnPxlw9a9PVPeF01tzBaeV66ogu3L9i/tEz5WhD8IvSf9ipQILujThzA==", "requires": { - "@juanelas/base64": "^1.0.1" + "@juanelas/base64": "^1.1.0" } }, "binary-extensions": { @@ -19550,9 +19550,9 @@ } }, "mongoose": { - "version": "6.10.4", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-6.10.4.tgz", - "integrity": "sha512-xCHVVEaOuhZxbthsKYxvHexWafJqWsl03sD7y7uyyt3euLd1sQoDI8DKueeJq9+hrbWkMkAGbGzgFPTIRqenPg==", + "version": "6.10.5", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-6.10.5.tgz", + "integrity": "sha512-y4HL4/9EySec7L0gJ+pCm9heLSF45uIIvRS4fSeAFWDfe4vXW1vRZJwTz7OGkra3ZoSfRnFTo9bNZkuggDVlVA==", "requires": { "bson": "^4.7.0", "kareem": "2.5.1", diff --git a/backend/package.json b/backend/package.json index d2e40dcb6..2c1154adb 100644 --- a/backend/package.json +++ b/backend/package.json @@ -13,7 +13,7 @@ "axios": "^1.3.5", "axios-retry": "^3.4.0", "bcrypt": "^5.1.0", - "bigint-conversion": "^2.2.2", + "bigint-conversion": "^2.4.0", "builder-pattern": "^2.2.0", "cookie-parser": "^1.4.6", "cors": "^2.8.5", @@ -30,7 +30,7 @@ "jsrp": "^0.2.4", "libsodium-wrappers": "^0.7.10", "lodash": "^4.17.21", - "mongoose": "^6.10.4", + "mongoose": "^6.10.5", "nodemailer": "^6.8.0", "posthog-node": "^2.6.0", "query-string": "^7.1.3", diff --git a/backend/src/services/smtp.ts b/backend/src/services/smtp.ts index 6bae626be..e7c55dfff 100644 --- a/backend/src/services/smtp.ts +++ b/backend/src/services/smtp.ts @@ -3,7 +3,8 @@ import { SMTP_HOST_SENDGRID, SMTP_HOST_MAILGUN, SMTP_HOST_SOCKETLABS, - SMTP_HOST_ZOHOMAIL + SMTP_HOST_ZOHOMAIL, + SMTP_HOST_GMAIL } from '../variables'; import SMTPConnection from 'nodemailer/lib/smtp-connection'; import * as Sentry from '@sentry/node'; @@ -46,6 +47,12 @@ export const initSmtp = async () => { } break; case SMTP_HOST_ZOHOMAIL: + mailOpts.requireTLS = true; + mailOpts.tls = { + ciphers: 'TLSv1.2' + } + break; + case SMTP_HOST_GMAIL: mailOpts.requireTLS = true; mailOpts.tls = { ciphers: 'TLSv1.2' diff --git a/backend/src/variables/index.ts b/backend/src/variables/index.ts index 5695bd547..281145a99 100644 --- a/backend/src/variables/index.ts +++ b/backend/src/variables/index.ts @@ -10,4 +10,4 @@ export * from './secret'; export * from './smtp'; export * from './stripe'; export * from './token'; -export * from './user'; \ No newline at end of file +export * from './user'; diff --git a/backend/src/variables/smtp.ts b/backend/src/variables/smtp.ts index 5b4dbd191..f5dd05d0b 100644 --- a/backend/src/variables/smtp.ts +++ b/backend/src/variables/smtp.ts @@ -1,4 +1,5 @@ export const SMTP_HOST_SENDGRID = 'smtp.sendgrid.net'; export const SMTP_HOST_MAILGUN = 'smtp.mailgun.org'; export const SMTP_HOST_SOCKETLABS = 'smtp.socketlabs.com'; -export const SMTP_HOST_ZOHOMAIL = 'smtp.zoho.com'; \ No newline at end of file +export const SMTP_HOST_ZOHOMAIL = 'smtp.zoho.com'; +export const SMTP_HOST_GMAIL = 'smtp.gmail.com'; diff --git a/docs/images/email-gmail-app-access.png b/docs/images/email-gmail-app-access.png new file mode 100644 index 000000000..43f0b63a4 Binary files /dev/null and b/docs/images/email-gmail-app-access.png differ diff --git a/docs/mint.json b/docs/mint.json index fa6b21576..0d395a6a5 100644 --- a/docs/mint.json +++ b/docs/mint.json @@ -114,7 +114,7 @@ ] }, { - "group": "Deploy Infisical", + "group": "Self-host Infisical", "pages": [ "self-hosting/overview", "self-hosting/configuration/envars", diff --git a/docs/self-hosting/configuration/email.mdx b/docs/self-hosting/configuration/email.mdx index a6b13fa0b..ce841db55 100644 --- a/docs/self-hosting/configuration/email.mdx +++ b/docs/self-hosting/configuration/email.mdx @@ -23,7 +23,7 @@ By default, you need to configure the following SMTP [environment variables](htt - `SMTP_FROM_ADDRESS`: Email address to be used for sending emails (e.g. team@infisical.com). - `SMTP_FROM_NAME`: Name label to be used in `From` field (e.g. Team). -Below you will find details on how to configure common email providers (not in any particular order). +Below you will find details on how to configure common email providers: @@ -135,6 +135,34 @@ SMTP_FROM_NAME=Infisical + + +Create an account and enable "less secure app access" in Gmail Account Settings > Security. This will allow +applications like Infisical to authenticate with Gmail via your username and password. + +![Gmail secure app access](../../images/email-gmail-app-access.png) + +With your Gmail username and password, you can set your SMTP environment variables: + +``` +SMTP_HOST=smtp.gmail.com +SMTP_USERNAME=hey@gmail.com # your email +SMTP_PASSWORD=password # your password +SMTP_PORT=587 +SMTP_SECURE=true +SMTP_FROM_ADDRESS=hey@gmail.com +SMTP_FROM_NAME=Infisical +``` + + + As per the [notice](https://support.google.com/accounts/answer/6010255?hl=en) by Google, you should note that using Gmail credentials for SMTP configuration + will only work for Google Workspace or Google Cloud Identity customers as of May 30, 2022. + + Put differently, the SMTP configuration is only possible with business (not personal) Gmail credentials. + + + + 1. Create an account and configure [Zoho Mail](https://www.zoho.com/mail/) to send emails. diff --git a/docs/self-hosting/overview.mdx b/docs/self-hosting/overview.mdx index d2e076505..8866aa8b3 100644 --- a/docs/self-hosting/overview.mdx +++ b/docs/self-hosting/overview.mdx @@ -70,7 +70,7 @@ Self-hosted Infisical allows you to maintain your sensitive information within y **Prerequisites** - You have understanding of [Kubernetes](https://kubernetes.io/) - - You have understanding of [Helm package manager](https://helm.sh/) + - Installed [Helm package manager](https://helm.sh/) version v3.11.3 or greater - You have [kubectl](https://kubernetes.io/docs/reference/kubectl/kubectl/) installed and connected to your kubernetes cluster