From 0fc6bfa7cefc866d39f464a9efb080c4eff5669b Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Wed, 17 May 2023 11:35:32 +0200 Subject: [PATCH] :whale: Fix encryption length check script The encryption length can also be of length 80 if encoded with base64 Closes #516 --- apps/docs/docs/self-hosting/docker.mdx | 8 ++------ docker-compose.yml | 5 +++-- scripts/builder-entrypoint.sh | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/apps/docs/docs/self-hosting/docker.mdx b/apps/docs/docs/self-hosting/docker.mdx index c020e5e1f..eec46162f 100644 --- a/apps/docs/docs/self-hosting/docker.mdx +++ b/apps/docs/docs/self-hosting/docker.mdx @@ -261,8 +261,6 @@ services: restart: always depends_on: - typebot-db - ports: - - '8080:3000' extra_hosts: - 'host.docker.internal:host-gateway' # See https://docs.typebot.io/self-hosting/configuration for more configuration options @@ -270,7 +268,7 @@ services: - DATABASE_URL=postgresql://postgres:typebot@typebot-db:5432/typebot - NEXTAUTH_URL=https://typebot.domain.com - NEXT_PUBLIC_VIEWER_URL=https://bot.domain.com - - ENCRYPTION_SECRET=Tz9sL3FBc+XnO86KS9ScPuYj79Y4rII/Ie+FkaNNUrk= + - ENCRYPTION_SECRET=K+Bar660Ofaec7v1jHC25tAn3l2b7c81 - ADMIN_EMAIL=baptiste.arnaud95@gmail.com - SMTP_HOST=mail - NEXT_PUBLIC_SMTP_FROM=notifications@typebot.domain.com @@ -285,13 +283,11 @@ services: virtual.tls-email: 'admin@example.com' # change to your email image: baptistearno/typebot-viewer:latest restart: always - ports: - - '8081:3000' # See https://docs.typebot.io/self-hosting/configuration for more configuration options environment: - DATABASE_URL=postgresql://postgres:typebot@typebot-db:5432/typebot - NEXT_PUBLIC_VIEWER_URL=https://bot.domain.com - - ENCRYPTION_SECRET=Tz9sL3FBc+XnO86KS9ScPuYj79Y4rII/Ie+FkaNNUrk= + - ENCRYPTION_SECRET=K+Bar660Ofaec7v1jHC25tAn3l2b7c81 - SMTP_HOST=mail - NEXT_PUBLIC_SMTP_FROM=notifications@typebot.domain.com - S3_ACCESS_KEY=minio diff --git a/docker-compose.yml b/docker-compose.yml index d6b130644..796b36bd9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,7 +17,7 @@ services: - '8080:3000' extra_hosts: - 'host.docker.internal:host-gateway' - # See https://docs.typebot.io/self-hosting/configuration for more configuration options + # See https://docs.typebot.io/self-hosting/configuration/builder for more configuration options environment: - DATABASE_URL=postgresql://postgres:typebot@typebot-db:5432/typebot - NEXTAUTH_URL= @@ -29,10 +29,11 @@ services: restart: always ports: - '8081:3000' - # See https://docs.typebot.io/self-hosting/configuration for more configuration options + # See https://docs.typebot.io/self-hosting/configuration/viewer for more configuration options environment: - DATABASE_URL=postgresql://postgres:typebot@typebot-db:5432/typebot - NEXT_PUBLIC_VIEWER_URL= - ENCRYPTION_SECRET= + - NEXTAUTH_URL= volumes: db_data: diff --git a/scripts/builder-entrypoint.sh b/scripts/builder-entrypoint.sh index 1e807265f..cd43b2884 100644 --- a/scripts/builder-entrypoint.sh +++ b/scripts/builder-entrypoint.sh @@ -9,7 +9,7 @@ if [ -z "$DATABASE_URL" ]; then exit 1 fi -if [ ${#ENCRYPTION_SECRET} -ne 32 ]; then +if [ ${#ENCRYPTION_SECRET} -ne 32 ] && [ ${#ENCRYPTION_SECRET} -ne 80 ]; then echo "ENCRYPTION_SECRET is not 32 characters long. Exiting... (To generate a valid secret: https://docs.typebot.io/self-hosting/docker#2-add-the-required-configuration)" exit 1 fi