Skip to content

Commit

Permalink
feat: adds tls1.2 and 1.3 support, and HSTS config (formbricks#2897)
Browse files Browse the repository at this point in the history
Co-authored-by: Matthias Nannt <[email protected]>
  • Loading branch information
gupta-piyush19 and mattinannt authored Aug 7, 2024
1 parent fffe71a commit 53fb976
Show file tree
Hide file tree
Showing 2 changed files with 350 additions and 69 deletions.
246 changes: 205 additions & 41 deletions apps/docs/app/self-hosting/one-click/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ The script will prompt you for the following information:
<CodeGroup title="Docker GPG Keys Overwrite Prompt">

```bash
🧱 Welcome to the Formbricks single instance installer
πŸš€ Executing default step of installing Formbricks
🧱 Welcome to the Formbricks Setup Script

πŸ›Έ Fasten your seatbelts! We're setting up your Formbricks environment on your Ubuntu 22.04.2 LTS server.
πŸ›Έ Fasten your seatbelts! We're setting up your Formbricks environment on your Ubuntu 24.04 LTS server.
🧹 Time to sweep away any old Docker installations.
πŸ”„ Updating your package list.
Expand All @@ -64,62 +65,208 @@ File '/etc/apt/keyrings/docker.gpg' exists. Overwrite? (y/N)
</CodeGroup>
</Col>

2. **Email Address**: Provide your email address for SSL certificate registration with Let's Encrypt.
2. **Domain Name**: You will be asked to enter the domain name where you want to host Formbricks. This domain will be used to generate an SSL certificate.

<Col>
<CodeGroup title="Email Prompt">

```bash
🧱 Welcome to the Formbricks single instance installer
πŸ›Έ Fasten your seatbelts! We're setting up your Formbricks environment on your Ubuntu 22.04.2 LTS server.
🧹 Time to sweep away any old Docker installations.
πŸ”„ Updating your package list.
πŸ“¦ Installing the necessary dependencies.
πŸ”‘ Adding Docker's official GPG key and setting up the stable repository.
File '/etc/apt/keyrings/docker.gpg' exists. Overwrite? (y/N) y
πŸ”„ Updating your package list again.
🐳 Installing Docker.
πŸš€ Testing your Docker installation.
πŸŽ‰ Docker is installed!
🐳 Adding your user to the Docker group to avoid using sudo with docker commands.
πŸŽ‰ Hooray! Docker is all set and ready to go. Youre now ready to run your Formbricks instance!
πŸš— Installing Traefik...
πŸ“ Created Formbricks Quickstart directory at ./formbricks.
πŸ’‘ Please enter your email address for the SSL certificate:
πŸš€ Executing default step of installing Formbricks
🧱 Welcome to the Formbricks Setup Script

πŸ›Έ Fasten your seatbelts! We're setting up your Formbricks environment on your Ubuntu 24.04 LTS server.
🧹 Time to sweep away any old Docker installations.
πŸ”„ Updating your package list.
πŸ“¦ Installing the necessary dependencies.
πŸ”‘ Adding Docker's official GPG key and setting up the stable repository.
File '/etc/apt/keyrings/docker.gpg' exists. Overwrite? (y/N) y
πŸ”„ Updating your package list again.
🐳 Installing Docker.
πŸš€ Testing your Docker installation.
πŸŽ‰ Docker is installed!
🐳 Adding your user to the Docker group to avoid using sudo with docker commands.
πŸŽ‰ Hooray! Docker is all set and ready to go. You're now ready to run your Formbricks instance!
πŸ“ Created Formbricks Quickstart directory at ./formbricks.
πŸ”— Please enter your domain name for the SSL certificate (🚨 do NOT enter the protocol (http/https/etc)):
```
</CodeGroup>
</Col>
3. **HTTPS Certificate Prompt**: The script will ask if you want to create an HTTPS certificate for your domain. Enter Y to proceed. This is highly recommended for secure access to your Formbricks instance.
<Col>
<CodeGroup>
```bash
πŸš€ Executing default step of installing Formbricks
🧱 Welcome to the Formbricks Setup Script
πŸ›Έ Fasten your seatbelts! We're setting up your Formbricks environment on your Ubuntu 24.04 LTS server.

🧹 Time to sweep away any old Docker installations.
πŸ”„ Updating your package list.
πŸ“¦ Installing the necessary dependencies.
πŸ”‘ Adding Docker's official GPG key and setting up the stable repository.
File '/etc/apt/keyrings/docker.gpg' exists. Overwrite? (y/N) y
πŸ”„ Updating your package list again.
🐳 Installing Docker.
πŸš€ Testing your Docker installation.
πŸŽ‰ Docker is installed!
🐳 Adding your user to the Docker group to avoid using sudo with docker commands.
πŸŽ‰ Hooray! Docker is all set and ready to go. You're now ready to run your Formbricks instance!
πŸ“ Created Formbricks Quickstart directory at ./formbricks.
πŸ”— Please enter your domain name for the SSL certificate (🚨 do NOT enter the protocol (http/https/etc)):
my.hosted.url.com
πŸ”— Do you want us to set up an HTTPS certificate for you? [Y/n]
```

</CodeGroup>
</Col>

3. **Domain Name**: Enter the domain name that Traefik will use to create the SSL certificate and forward requests to Formbricks. Please make sure that port 80 and 443 are open in your VM's Security Group to allow Traefik to create the SSL certificate.
4. **DNS Setup Prompt**: Ensure that your domain's DNS is correctly configured and ports 80 and 443 are open. Confirm this by entering Y. This step is crucial for proper SSL certificate issuance and secure server access.

<Col>
<CodeGroup>

```bash
πŸš€ Executing default step of installing Formbricks
🧱 Welcome to the Formbricks Setup Script

πŸ›Έ Fasten your seatbelts! We're setting up your Formbricks environment on your Ubuntu 24.04 LTS server.
🧹 Time to sweep away any old Docker installations.
πŸ”„ Updating your package list.
πŸ“¦ Installing the necessary dependencies.
πŸ”‘ Adding Docker's official GPG key and setting up the stable repository.
File '/etc/apt/keyrings/docker.gpg' exists. Overwrite? (y/N) y
πŸ”„ Updating your package list again.
🐳 Installing Docker.
πŸš€ Testing your Docker installation.
πŸŽ‰ Docker is installed!
🐳 Adding your user to the Docker group to avoid using sudo with docker commands.
πŸŽ‰ Hooray! Docker is all set and ready to go. You're now ready to run your Formbricks instance!
πŸ“ Created Formbricks Quickstart directory at ./formbricks.
πŸ”— Please enter your domain name for the SSL certificate (🚨 do NOT enter the protocol (http/https/etc)):
my.hosted.url.com
πŸ”— Do you want us to set up an HTTPS certificate for you? [Y/n]
Y
πŸ”— Please make sure that the domain points to the server's IP address and that ports 80 & 443 are open in your server's firewall. Is everything set up? [Y/n]
```
</CodeGroup>
</Col>
5. **Email Address**: Provide an email address for SSL certificate registration. This email will be used for notifications regarding your SSL certificate from Let's Encrypt.

<Col>
<CodeGroup title="Email Prompt">

```bash
πŸš€ Executing default step of installing Formbricks
🧱 Welcome to the Formbricks Setup Script
πŸ›Έ Fasten your seatbelts! We're setting up your Formbricks environment on your Ubuntu 24.04 LTS server.
🧹 Time to sweep away any old Docker installations.
πŸ”„ Updating your package list.
πŸ“¦ Installing the necessary dependencies.
πŸ”‘ Adding Docker's official GPG key and setting up the stable repository.
File '/etc/apt/keyrings/docker.gpg' exists. Overwrite? (y/N) y
πŸ”„ Updating your package list again.
🐳 Installing Docker.
πŸš€ Testing your Docker installation.
πŸŽ‰ Docker is installed!
🐳 Adding your user to the Docker group to avoid using sudo with docker commands.
πŸŽ‰ Hooray! Docker is all set and ready to go. You're now ready to run your Formbricks instance!
πŸ“ Created Formbricks Quickstart directory at ./formbricks.
πŸ”— Please enter your domain name for the SSL certificate (🚨 do NOT enter the protocol (http/https/etc)):
my.hosted.url.com
πŸ”— Do you want us to set up an HTTPS certificate for you? [Y/n]
Y
πŸ”— Please make sure that the domain points to the server's IP address and that ports 80 & 443 are open in your server's firewall. Is everything set up? [Y/n]
Y
πŸ’‘ Please enter your email address for the SSL certificate:
```
</CodeGroup>
</Col>
6. **Enforce HTTPS (HSTS) Prompt**: Enforcing HTTPS with HSTS is a good security practice, as it ensures all communication with your server is encrypted. Enter Y to enable this setting.
<Col>
<CodeGroup title="Domain Name for SSL certificate Prompt">
```bash
🧱 Welcome to the Formbricks single instance installer
πŸš€ Executing default step of installing Formbricks
🧱 Welcome to the Formbricks Setup Script
πŸ›Έ Fasten your seatbelts! We're setting up your Formbricks environment on your Ubuntu 22.04.2 LTS server.
πŸ›Έ Fasten your seatbelts! We're setting up your Formbricks environment on your Ubuntu 24.04 LTS server.
🧹 Time to sweep away any old Docker installations.
πŸ”„ Updating your package list.
πŸ“¦ Installing the necessary dependencies.
πŸ”‘ Adding Dockers official GPG key and setting up the stable repository.
πŸ”‘ Adding Docker's official GPG key and setting up the stable repository.
File '/etc/apt/keyrings/docker.gpg' exists. Overwrite? (y/N) y
πŸ”„ Updating your package list again.
🐳 Installing Docker.
πŸš€ Testing your Docker installation.
πŸŽ‰ Docker is installed!
🐳 Adding your user to the Docker group to avoid using sudo with docker commands.
πŸŽ‰ Hooray! Docker is all set and ready to go. You're now ready to run your Formbricks instance!
πŸš— Installing Traefik...
πŸ“ Created Formbricks Quickstart directory at ./formbricks.
πŸ”— Please enter your domain name for the SSL certificate (🚨 do NOT enter the protocol (http/https/etc)):
my.hosted.url.com
πŸ”— Do you want us to set up an HTTPS certificate for you? [Y/n]
Y
πŸ”— Please make sure that the domain points to the server's IP address and that ports 80 & 443 are open in your server's firewall. Is everything set up? [Y/n]
Y
πŸ’‘ Please enter your email address for the SSL certificate:
[email protected]
πŸ’‘ Created traefik.yaml file with your provided email address.
πŸ’‘ Created acme.json file with correct permissions.
πŸ”— Do you want to enforce HTTPS (HSTS)? [Y/n]
```

</CodeGroup>
</Col>

7. **Email Service Setup Prompt**: The script will ask if you want to set up the email service. Enter `Y` to proceed.(default is `N`). You can skip this step if you don't want to set up the email service. You will still be able to use Formbricks without setting up the email service.
<Col>
<CodeGroup>
```bash
πŸš€ Executing default step of installing Formbricks
🧱 Welcome to the Formbricks Setup Script
πŸ›Έ Fasten your seatbelts! We're setting up your Formbricks environment on your Ubuntu 24.04 LTS server.

🧹 Time to sweep away any old Docker installations.
πŸ”„ Updating your package list.
πŸ“¦ Installing the necessary dependencies.
πŸ”‘ Adding Docker's official GPG key and setting up the stable repository.
File '/etc/apt/keyrings/docker.gpg' exists. Overwrite? (y/N) y
πŸ”„ Updating your package list again.
🐳 Installing Docker.
πŸš€ Testing your Docker installation.
πŸŽ‰ Docker is installed!
🐳 Adding your user to the Docker group to avoid using sudo with docker commands.
πŸŽ‰ Hooray! Docker is all set and ready to go. You're now ready to run your Formbricks instance!
πŸ“ Created Formbricks Quickstart directory at ./formbricks.
πŸ”— Please enter your domain name for the SSL certificate (🚨 do NOT enter the protocol (http/https/etc)):
my.hosted.url.com
πŸ”— Do you want us to set up an HTTPS certificate for you? [Y/n]
Y
πŸ”— Please make sure that the domain points to the server's IP address and that ports 80 & 443 are open in your server's firewall. Is everything set up? [Y/n]
Y
πŸ’‘ Please enter your email address for the SSL certificate:
[email protected]
πŸ”— Do you want to enforce HTTPS (HSTS)? [Y/n]
Y
πŸš— Configuring Traefik...
πŸ’‘ Created traefik.yaml and traefik-dynamic.yaml file.
πŸ’‘ Created acme.json file with correct permissions.
πŸ“§ Do you want to set up the email service? You will need SMTP credentials for the same! [y/N]
```
</CodeGroup>
Expand All @@ -131,39 +278,56 @@ [email protected]
<CodeGroup title="Successfully setup Formbricks on your Ubuntu machine">
```bash
🧱 Welcome to the Formbricks single instance installer
πŸš€ Executing default step of installing Formbricks
🧱 Welcome to the Formbricks Setup Script
πŸ›Έ Fasten your seatbelts! Were setting up your Formbricks environment on your Ubuntu 22.04.2 LTS server.
πŸ›Έ Fasten your seatbelts! We're setting up your Formbricks environment on your Ubuntu 24.04 LTS server.
🧹 Time to sweep away any old Docker installations.
πŸ”„ Updating your package list.
πŸ“¦ Installing the necessary dependencies.
πŸ”‘ Adding Dockers official GPG key and setting up the stable repository.
πŸ”‘ Adding Docker's official GPG key and setting up the stable repository.
File '/etc/apt/keyrings/docker.gpg' exists. Overwrite? (y/N) y
πŸ”„ Updating your package list again.
🐳 Installing Docker.
πŸš€ Testing your Docker installation.
πŸŽ‰ Docker is installed!
🐳 Adding your user to the Docker group to avoid using sudo with docker commands.
πŸŽ‰ Hooray! Docker is all set and ready to go. Youre now ready to run your Formbricks instance!
πŸš— Installing Traefik...
πŸŽ‰ Hooray! Docker is all set and ready to go. You're now ready to run your Formbricks instance!
πŸ“ Created Formbricks Quickstart directory at ./formbricks.
πŸ”— Please enter your domain name for the SSL certificate (🚨 do NOT enter the protocol (http/https/etc)):
[email protected]
πŸ”— Do you want us to set up an HTTPS certificate for you? [Y/n]
Y
πŸ”— Please make sure that the domain points to the server's IP address and that ports 80 & 443 are open in your server's firewall. Is everything set up? [Y/n]
Y
πŸ’‘ Please enter your email address for the SSL certificate:
[email protected]
πŸ’‘ Created traefik.yaml file with your provided email address.
πŸ”— Do you want to enforce HTTPS (HSTS)? [Y/n]
Y
πŸš— Configuring Traefik...
πŸ’‘ Created traefik.yaml and traefik-dynamic.yaml file.
πŸ’‘ Created acme.json file with correct permissions.
πŸ”— Please enter your domain name for the SSL certificate (🚨 do NOT enter the protocol (http/https/etc)):
my.hosted.url.com
πŸš™ Updating NEXTAUTH_SECRET in the Formbricks container...
πŸ“§ Do you want to set up the email service? You will need SMTP credentials for the same! [y/N] N
πŸ“₯ Downloading docker-compose.yml from Formbricks GitHub repository...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 6632 100 6632 0 0 24280 0 --:--:-- --:--:-- --:--:-- 24382
πŸš™ Updating docker-compose.yml with your custom inputs...
πŸš— NEXTAUTH_SECRET updated successfully!
πŸš— ENCRYPTION_KEY updated successfully!
πŸš— CRON_SECRET updated successfully!
[+] Running 4/4
βœ” Network formbricks_default Created 0.1s
βœ” Container formbricks-postgres-1 Started 0.5s
βœ” Container formbricks-formbricks-1 Started 0.7s
βœ” Container traefik Started 1.1s
βœ” Network formbricks_default Created 0.2s
βœ” Container formbricks-postgres-1 Started 1.0s
βœ” Container formbricks-formbricks-1 Started 1.6s
βœ” Container traefik Started 2.8s
πŸ”— To edit more variables and deeper config, go to the formbricks/docker-compose.yml, edit the file, and restart the container!
🚨 Make sure you have set up the DNS records as well as inbound rules for the domain name and IP address of this instance.
πŸŽ‰ All done! Check the status of Formbricks & Traefik with 'cd formbricks && sudo docker compose ps.'
πŸŽ‰ All done! Please setup your Formbricks instance by visiting your domain at https://tls.piyush.formbricks.com. You can check the status of Formbricks & Traefik with 'cd formbricks && sudo docker compose ps.'
```

</CodeGroup>
Expand Down
Loading

0 comments on commit 53fb976

Please sign in to comment.