diff --git a/apps/web/app/health/error.tsx b/apps/web/app/health/error.tsx deleted file mode 100644 index 700ad6f3c8..0000000000 --- a/apps/web/app/health/error.tsx +++ /dev/null @@ -1,17 +0,0 @@ -"use client"; - -import { useTranslate } from "@tolgee/react"; -import { XCircleIcon } from "lucide-react"; - -const Error = ({ error }: { error: Error & { digest?: string } }) => { - const { t } = useTranslate(); - return ( -
- -

{t("health.degraded")}

-

{error.message}

-
- ); -}; - -export default Error; diff --git a/apps/web/app/health/page.tsx b/apps/web/app/health/page.tsx deleted file mode 100644 index dcdcd205b9..0000000000 --- a/apps/web/app/health/page.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import { getTranslate } from "@/tolgee/server"; -import { BadgeCheckIcon } from "lucide-react"; -import { Metadata } from "next"; -import { prisma } from "@formbricks/database"; - -export const dynamic = "force-dynamic"; // no caching - -export const metadata: Metadata = { - robots: { - index: false, - follow: false, - googleBot: { - index: false, - follow: false, - }, - }, -}; - -const checkDatabaseConnection = async () => { - try { - await prisma.$queryRaw`SELECT 1`; - } catch (e) { - console.error("Database connection error:", e); - throw new Error("Database could not be reached"); - } -}; - -/* const checkS3Connection = async () => { - if (!IS_S3_CONFIGURED) { - // dont try connecting if not in use - return; - } - try { - await testS3BucketAccess(); - } catch (e) { - throw new Error("S3 Bucket cannot be accessed"); - } -}; */ - -const Page = async () => { - const t = await getTranslate(); - await checkDatabaseConnection(); - // Skipping S3 check for now until it's fixed - // await checkS3Connection(); - - return ( -
- -

{t("health.healthy")}

-
- ); -}; - -export default Page; diff --git a/apps/web/app/health/route.ts b/apps/web/app/health/route.ts new file mode 100644 index 0000000000..e0e63aab9c --- /dev/null +++ b/apps/web/app/health/route.ts @@ -0,0 +1,3 @@ +export async function GET() { + return Response.json({ status: "ok" }); +} diff --git a/helm-chart/Chart.yaml b/helm-chart/Chart.yaml index 1f8ebbd8b7..959ebb3f8d 100644 --- a/helm-chart/Chart.yaml +++ b/helm-chart/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: formbricks description: A Helm chart for Formbricks with PostgreSQL, Redis, Traefik, and cert-manager type: application -version: 0.1.1 +version: 0.1.2 appVersion: "1.0.0" dependencies: - name: postgresql diff --git a/helm-chart/README.md b/helm-chart/README.md index 99d3ecac06..ddb58973ce 100644 --- a/helm-chart/README.md +++ b/helm-chart/README.md @@ -78,20 +78,49 @@ This Helm chart deploys the following components: To quickly deploy Formbricks with default settings: -1. Add the Formbricks Helm repository: +1. clone the formbricks repository and navigate to the helm-chart directory: ```bash - helm repo add formbricks https://charts.formbricks.com - helm repo update + git clone https://github.com/formbricks/formbricks.git + cd formbricks/helm-chart ``` -2. Install the chart: +2. Deploy Formbricks + ```bash - helm install my-formbricks formbricks/formbricks --namespace formbricks --create-namespace --set postgresql.enabled=true + helm install my-formbricks ./ \ + --namespace formbricks \ + --create-namespace \ + --set replicaCount=2 ``` This will deploy Formbricks with default settings, including a new PostgreSQL instance, Redis and Traefik disabled. +### Verify and Access Formbricks + +After deploying Formbricks, you can verify the installation and access the application: + +1. Check the Running Services: + + ```bash + kubectl get pods -n formbricks + kubectl get svc -n formbricks + kubectl get ingress -n formbricks + ``` + + > **Note:** The Formbricks application pod may take some time to reach a stable state as it runs database migrations during startup. + +2. Access Formbricks: + - If running locally with **Minikube**: + ```bash + minikube service my-formbricks -n formbricks + ``` + - If deployed on a **cloud cluster**, visit: + ``` + https://formbricks.example.com + ``` + (Replace with your configured hostname) + ### Usage Examples Here are various examples of how to install and configure the Formbricks Helm chart: @@ -110,41 +139,43 @@ Here are various examples of how to install and configure the Formbricks Helm ch --set hostname=forms.example.com ``` - This command enables Traefik and sets a custom hostname. Replace `forms.example.com` with your actual domain name. +```` + +This command enables Traefik and sets a custom hostname. Replace `forms.example.com` with your actual domain name.
Option 2: Installation with SSL (Recommended for production) - 1. First, download the values file: +1. First, download the values file: - ```bash - helm show values formbricks/formbricks > values.yaml - ``` +```bash +helm show values formbricks/formbricks > values.yaml +``` - 2. Open the `values.yaml` file in a text editor and make the following changes: +2. Open the `values.yaml` file in a text editor and make the following changes: - ```yaml - traefik: - enabled: true - additionalArguments: - - "--certificatesresolvers.letsencrypt.acme.email=your-email@example.com" - ``` +```yaml +traefik: + enabled: true + additionalArguments: + - "--certificatesresolvers.letsencrypt.acme.email=your-email@example.com" +``` - Replace `your-email@example.com` with a valid email address where you want to receive Let's Encrypt notifications. +Replace `your-email@example.com` with a valid email address where you want to receive Let's Encrypt notifications. - 3. Install Formbricks with the updated values file: +3. Install Formbricks with the updated values file: - ```bash - helm install my-formbricks formbricks/formbricks \ - -f values.yaml \ - --namespace formbricks \ - --create-namespace \ - --set hostname=forms.example.com - ``` +```bash +helm install my-formbricks formbricks/formbricks \ + -f values.yaml \ + --namespace formbricks \ + --create-namespace \ + --set hostname=forms.example.com +``` - This command enables Traefik, sets a custom hostname, and uses the configured email address for Let's Encrypt. Remember to replace `forms.example.com` with your actual domain name. +This command enables Traefik, sets a custom hostname, and uses the configured email address for Let's Encrypt. Remember to replace `forms.example.com` with your actual domain name.
@@ -671,3 +702,5 @@ Please check out [our contribution guide](https://formbricks.com/docs/developer- For more detailed information on MicroK8s, including advanced configuration and usage, please refer to the [official MicroK8s documentation](https://microk8s.io/docs). For Formbricks Helm chart configuration options, see the [Configuration](#configuration) and [Full Values Documentation](#full-values-documentation) sections of this document. +``` +```` diff --git a/helm-chart/values.yaml b/helm-chart/values.yaml index 6b143dc03b..1e3b44f0ec 100644 --- a/helm-chart/values.yaml +++ b/helm-chart/values.yaml @@ -1,7 +1,7 @@ image: repository: ghcr.io/formbricks/formbricks pullPolicy: IfNotPresent - tag: v2.6.0 + tag: v3.2.0 service: type: ClusterIP @@ -44,6 +44,16 @@ autoscaling: replicaCount: 1 +livenessProbe: + httpGet: + path: /health + port: 3000 + initialDelaySeconds: 30 + periodSeconds: 10 + timeoutSeconds: 5 + failureThreshold: 3 + successThreshold: 1 + formbricksConfig: nextAuthSecret: "" encryptionKey: "" @@ -125,7 +135,9 @@ redis: postgresql: enabled: true - externalUrl: "" + image: + repository: pgvector/pgvector + tag: 0.8.0-pg17 auth: username: formbricks password: formbrickspassword @@ -133,4 +145,12 @@ postgresql: primary: persistence: enabled: true - size: 10Gi \ No newline at end of file + size: 10Gi + podSecurityContext: + enabled: true + fsGroup: 1001 + runAsUser: 1001 + containerSecurityContext: + enabled: true + runAsUser: 1001 + readOnlyRootFilesystem: false