diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 37011e6792..cbf130dc8d 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,5 +1,5 @@ # [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 18, 16, 14, 18-bullseye, 16-bullseye, 14-bullseye, 18-buster, 16-buster, 14-buster -ARG VARIANT=18-bullseye +ARG VARIANT=20 FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT} # [Optional] Uncomment this section to install additional OS packages. @@ -13,4 +13,4 @@ FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT} # [Optional] Uncomment if you want to install more global node modules # RUN su node -c "npm install -g " -RUN su node -c "npm install -g pnpm" \ No newline at end of file +RUN su node -c "npm install -g pnpm" diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index a87d72d4e2..eace7d5bd2 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,29 +2,27 @@ // https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/javascript-node-postgres // Update the VARIANT arg in docker-compose.yml to pick a Node.js version { - "name": "Node.js & PostgreSQL", - "dockerComposeFile": "docker-compose.yml", - "service": "app", - "workspaceFolder": "/workspace", + "name": "Node.js & PostgreSQL", + "dockerComposeFile": "docker-compose.yml", + "service": "app", + "workspaceFolder": "/workspace", - // Configure tool-specific properties. - "customizations": { - // Configure properties specific to VS Code. - "vscode": { - // Add the IDs of extensions you want installed when the container is created. - "extensions": [ - "dbaeumer.vscode-eslint" - ] - } - }, + // Configure tool-specific properties. + "customizations": { + // Configure properties specific to VS Code. + "vscode": { + // Add the IDs of extensions you want installed when the container is created. + "extensions": ["dbaeumer.vscode-eslint"] + } + }, - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // This can be used to network with other containers or with the host. - "forwardPorts": [3000, 5432, 8025], + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // This can be used to network with other containers or with the host. + "forwardPorts": [3000, 5432, 8025], - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "pnpm install", + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "cp .env.example .env && sed -i '/^ENCRYPTION_KEY=/c\\ENCRYPTION_KEY='$(openssl rand -hex 32) .env && sed -i '/^NEXTAUTH_SECRET=/c\\NEXTAUTH_SECRET='$(openssl rand -hex 32) .env && pnpm install && pnpm db:migrate:dev", - // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. - "remoteUser": "node" + // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. + "remoteUser": "node" } diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 4c8a4cf2e2..cc35a8d7fb 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -6,10 +6,10 @@ services: context: . dockerfile: Dockerfile args: - # Update 'VARIANT' to pick an LTS version of Node.js: 18, 16, 14. + # Update 'VARIANT' to pick an LTS version of Node.js: 20, 18, 16, 14. # Append -bullseye or -buster to pin to an OS version. # Use -bullseye variants on local arm64/Apple Silicon. - VARIANT: "18" + VARIANT: "20" volumes: - ..:/workspace:cached @@ -33,7 +33,7 @@ services: environment: POSTGRES_PASSWORD: postgres POSTGRES_USER: postgres - POSTGRES_DB: postgres + POSTGRES_DB: formbricks # Add "forwardPorts": ["5432"] to **devcontainer.json** to forward PostgreSQL locally. # (Adding the "ports" property to this file will not forward from a Codespace.) diff --git a/.env.example b/.env.example index a6b25e768a..f109d65eba 100644 --- a/.env.example +++ b/.env.example @@ -64,10 +64,10 @@ SMTP_PASSWORD=smtpPassword ##################### # Email Verification. If you enable Email Verification you have to setup SMTP-Settings, too. -# EMAIL_VERIFICATION_DISABLED=1 +EMAIL_VERIFICATION_DISABLED=1 # Password Reset. If you enable Password Reset functionality you have to setup SMTP-Settings, too. -# PASSWORD_RESET_DISABLED=1 +PASSWORD_RESET_DISABLED=1 # Signup. Disable the ability for new users to create an account. # SIGNUP_DISABLED=1 diff --git a/apps/web/next.config.mjs b/apps/web/next.config.mjs index a63775ea77..5f3c4c0b0e 100644 --- a/apps/web/next.config.mjs +++ b/apps/web/next.config.mjs @@ -1,5 +1,6 @@ import { createId } from "@paralleldrive/cuid2"; import { withSentryConfig } from "@sentry/nextjs"; + import "@formbricks/lib/env.mjs"; /** @type {import('next').NextConfig} */ @@ -13,7 +14,7 @@ const nextConfig = { assetPrefix: process.env.ASSET_PREFIX_URL || undefined, output: "standalone", experimental: { - serverComponentsExternalPackages: ['@aws-sdk'], + serverComponentsExternalPackages: ["@aws-sdk"], }, transpilePackages: ["@formbricks/database", "@formbricks/ee", "@formbricks/ui", "@formbricks/lib"], images: { @@ -109,9 +110,9 @@ const nextConfig = { // set actions allowed origins if (process.env.WEBAPP_URL) { -/* nextConfig.experimental.serverActions = { + nextConfig.experimental.serverActions = { allowedOrigins: [process.env.WEBAPP_URL.replace(/https?:\/\//, "")], - }; */ + }; nextConfig.images.remotePatterns.push({ protocol: "https", hostname: getHostname(process.env.WEBAPP_URL),