From 45a13d06b5dd603d64758bbe08fd4330d6f01a49 Mon Sep 17 00:00:00 2001 From: Maidul Islam Date: Fri, 18 Aug 2023 21:20:20 -0400 Subject: [PATCH] add redis why docs & update redis notice --- docs/mint.json | 3 +- docs/self-hosting/configuration/redis.mdx | 76 +++++++++++++++++++ .../deployment-options/kubernetes-helm.mdx | 2 +- .../standalone-infisical.mdx | 1 + frontend/src/hooks/api/serverDetails/types.ts | 1 + .../src/pages/org/[id]/overview/index.tsx | 9 ++- 6 files changed, 86 insertions(+), 6 deletions(-) create mode 100644 docs/self-hosting/configuration/redis.mdx diff --git a/docs/mint.json b/docs/mint.json index 4d5af11d0..4892def24 100644 --- a/docs/mint.json +++ b/docs/mint.json @@ -144,13 +144,12 @@ "self-hosting/deployment-options/aws-ec2", "self-hosting/deployment-options/docker-compose", "self-hosting/deployment-options/standalone-infisical", - "self-hosting/deployment-options/fly.io", - "self-hosting/deployment-options/render", "self-hosting/deployment-options/digital-ocean-marketplace" ] }, "self-hosting/configuration/envars", "self-hosting/configuration/email", + "self-hosting/configuration/redis", "self-hosting/faq" ] }, diff --git a/docs/self-hosting/configuration/redis.mdx b/docs/self-hosting/configuration/redis.mdx new file mode 100644 index 000000000..93b7efe34 --- /dev/null +++ b/docs/self-hosting/configuration/redis.mdx @@ -0,0 +1,76 @@ +--- +title: "Configure Redis" +description: "How to add Redis to your self-hosted Infisical." +--- + +## Why Redis? +As the features and use case of Infisical have grown, the need for a fast and reliable in-memory data storage has become clear. +By adding Redis to Infisical, we can now support more complex workflows such as queuing system to run long running asynchronous tasks, cron jobs, and access reliable cache to speed up frequently used resources. + + + Starting with Infisical version v0.XX.X, Redis will be required to fully use Infisical + + +### Adding Redis to your self hosted instance of Infisical +To add Redis to your self hosted instance, follow the instructions for the deployment method you used. + + + + ### In cluster Redis + By default, new versions of the Infisical Helm chart already comes with an in-cluster Redis instance. To deploy a in-cluster Redis instance along with your Infisical instance, update your Infisical chart then redeploy/upgrade your release. + This will spin up a Redis instance and automatically configure it with your Infisical backend. + + 1. Update Infisical Helm chart + ```bash + helm repo update + ``` + + 2. Upgrade Infisical release + ```bash + helm upgrade infisical-helm-charts/infisical --values + ``` + ### External Redis + If you want to use an external Redis instance, please add a Redis connection URL under the backend environments variables and then upgrade/redeploy your Infisical instance. + + 1. Update your helm values file + ```yaml your-values.yaml + backendEnvironmentVariables: + REDIS_URL= + ``` + + 2. Upgrade Infisical release + ```bash + helm upgrade infisical-helm-charts/infisical --values + ``` + + + ### Internal Redis service + By default, new versions of the docker compose file already comes with a Redis service. To use the prefigured Redis service, please update your docker compose file to the latest version. + + 1. Download the new docker compose file + ``` + wget -O docker-compose.yml https://raw.githubusercontent.com/Infisical/infisical/main/docker-compose.yml + ``` + + 2. Restart your docker compose services + + + This standalone version of Infisical does not have an internal Redis service. To configure Redis with your Infisical instance, you must connect to a external Redis service by setting the connection string as an environment variable. + + Example: + + ```bash + docker run -p 80:80 \ + -e ENCRYPTION_KEY=f40c9178624764ad85a6830b37ce239a \ + -e JWT_SIGNUP_SECRET=38ea90fb7998b92176080f457d890392 \ + -e JWT_REFRESH_SECRET=7764c7bbf3928ad501591a3e005eb364 \ + -e JWT_AUTH_SECRET=5239fea3a4720c0e524f814a540e14a2 \ + -e JWT_SERVICE_SECRET=8509fb8b90c9b53e9e61d1e35826dcb5 \ + -e REDIS_URL=<> \ + -e MONGO_URL="<>" \ + infisical/infisical:latest + ``` + + Redis environment variable name: `REDIS_URL` + + \ No newline at end of file diff --git a/docs/self-hosting/deployment-options/kubernetes-helm.mdx b/docs/self-hosting/deployment-options/kubernetes-helm.mdx index e0843c4fa..8bfd5ccd3 100644 --- a/docs/self-hosting/deployment-options/kubernetes-helm.mdx +++ b/docs/self-hosting/deployment-options/kubernetes-helm.mdx @@ -92,7 +92,7 @@ ingress: #### Database Infisical uses a document database as its persistence layer. With this Helm chart, you spin up a MongoDB instance power by Bitnami along side other Infisical services in your cluster. -When persistence is enabled, the data will be stored a Kubernetes Persistence Volume. View all [properties for mongodb](https://github.com/Infisical/infisical/tree/main/helm-charts/infisical). +When persistence is enabled, the data will be stored as Kubernetes Persistence Volume. View all [properties for mongodb](https://github.com/Infisical/infisical/tree/main/helm-charts/infisical). ```yaml simple-values-example.yaml mongodb: diff --git a/docs/self-hosting/deployment-options/standalone-infisical.mdx b/docs/self-hosting/deployment-options/standalone-infisical.mdx index 22b036b85..03f132d69 100644 --- a/docs/self-hosting/deployment-options/standalone-infisical.mdx +++ b/docs/self-hosting/deployment-options/standalone-infisical.mdx @@ -65,6 +65,7 @@ docker run -p 80:80 \ -e JWT_AUTH_SECRET=5239fea3a4720c0e524f814a540e14a2 \ -e JWT_SERVICE_SECRET=8509fb8b90c9b53e9e61d1e35826dcb5 \ -e MONGO_URL="<>" \ +-e REDIS_URL="<>" \ infisical/infisical:latest ``` diff --git a/frontend/src/hooks/api/serverDetails/types.ts b/frontend/src/hooks/api/serverDetails/types.ts index ad9ed24e8..32cc92ae1 100644 --- a/frontend/src/hooks/api/serverDetails/types.ts +++ b/frontend/src/hooks/api/serverDetails/types.ts @@ -4,4 +4,5 @@ export type ServerStatus = { emailConfigured: boolean; inviteOnlySignup: boolean; secretScanningConfigured: boolean + redisConfigured: boolean }; \ No newline at end of file diff --git a/frontend/src/pages/org/[id]/overview/index.tsx b/frontend/src/pages/org/[id]/overview/index.tsx index bbda91a54..2d22dc27c 100644 --- a/frontend/src/pages/org/[id]/overview/index.tsx +++ b/frontend/src/pages/org/[id]/overview/index.tsx @@ -39,6 +39,7 @@ import { import { TabsObject } from "@app/components/v2/Tabs"; import { useSubscription, useUser, useWorkspace } from "@app/context"; import { fetchOrgUsers, useAddUserToWs, useCreateWorkspace, useUploadWsKey } from "@app/hooks/api"; +import { useFetchServerStatus } from "@app/hooks/api/serverDetails"; import { usePopUp } from "@app/hooks/usePopUp"; import { encryptAssymmetric } from "../../../../components/utilities/cryptography/crypto"; @@ -274,6 +275,8 @@ export default function Organization() { const createWs = useCreateWorkspace(); const { user } = useUser(); const uploadWsKey = useUploadWsKey(); + const { data: serverDetails } = useFetchServerStatus(); + const onCreateProject = async ({ name, addMembers }: TAddProjectFormData) => { // type check @@ -345,18 +348,18 @@ export default function Organization() { {t("common.head-title", { title: t("settings.members.title") })} -
+ {!serverDetails?.redisConfigured &&

Announcements

- Note: you do not have Redis configured. Please find the documentation to set it up + Attention: New versions of Infisical require setting up Redis to function properly. Learn how to configure it here .
-
+
}

Projects