Technical docs (#553)

* WIP

* Working on configuration

* wip

* Finished docs

* Self hosted comparison + more links
This commit is contained in:
Julien Nahum
2024-09-02 15:33:17 +02:00
committed by GitHub
parent 6d4b5b8ff4
commit 4cd8b3c62e
33 changed files with 1289 additions and 242 deletions

View File

@@ -0,0 +1,30 @@
---
title: AWS S3 Configuration
description: OpnForm & File uploads
---
OpnForm uses [Laravel's filesystem](https://laravel.com/docs/master/filesystem), which provides a powerful abstraction layer for various file storage systems. While AWS S3 is a popular choice, OpnForm supports both local storage and S3-compatible services.
1. Create an S3 bucket in your AWS account (or use an equivalent service).
2. Create an IAM user with access to this bucket. Ensure the user has the necessary permissions to read from and write to the bucket.
3. Configure CORS for the S3 bucket permissions, by adding the following under "Cross-origin resource sharing (CORS)":
```json
[
{
"AllowedHeaders": ["*"],
"AllowedMethods": ["PUT", "POST", "GET", "DELETE"],
"AllowedOrigins": ["*"],
"ExposeHeaders": []
}
]
```
4. Set the following environment variables in your OpnForm installation (`api/.env`):
- `AWS_ACCESS_KEY_ID`: Your IAM user's access key ID
- `AWS_SECRET_ACCESS_KEY`: Your IAM user's secret access key
- `AWS_DEFAULT_REGION`: The AWS region where your S3 bucket is located
- `AWS_BUCKET`: The name of your S3 bucket
These settings will enable OpnForm to use your S3 bucket for file storage.

View File

@@ -0,0 +1,20 @@
---
title: Using your own domain
description: Setting up a custom domain for OpnForm
---
This page explains how to configure a custom domain for your OpnForm instance.
## Custom Domain Setup
To use a custom domain (or subdomain)with OpnForm:
1. Purchase a domain (if needed)
2. Configure DNS records to point to your OpnForm instance
3. Update OpnForm configuration:
- Set `APP_URL` in `.env`
- Set `NUXT_PUBLIC_APP_URL` and `NUXT_PUBLIC_API_BASE` in `client/.env`
4. Secure with SSL certificate
import CloudVersion from "/snippets/cloud-version.mdx";
<CloudVersion/>

View File

@@ -0,0 +1,33 @@
---
title: Email Setup
description: OpnForm & Emails
---
This page explains how to configure email notifications in OpnForm.
By default, with a new Docker deployment, the email driver used is `log`, which simply logs the emails instead of sending them. To enable actual email sending, you need to set up a proper email configuration.
OpnForm uses Laravel's mail system. For more detailed information, you can refer to the [Laravel Mail documentation](https://laravel.com/docs/master/mail).
## Supported Mail Drivers
Laravel supports various mail drivers, including SMTP, Mailgun, Postmark, Amazon SES, and more. In this guide, we'll focus on setting up SMTP, which is widely used.
## Configuring SMTP Settings
To configure SMTP, you need to set the following environment variables in your `.env` file:
| Variable | Description |
|----------|-------------|
| `MAIL_MAILER` | Set this to `smtp` to use the SMTP driver. |
| `MAIL_HOST` | The address of your SMTP server. |
| `MAIL_PORT` | The port used by your SMTP server (common ports are 25, 465, and 587). |
| `MAIL_USERNAME` | The username for your SMTP account. |
| `MAIL_PASSWORD` | The password for your SMTP account. |
| `MAIL_ENCRYPTION` | The encryption method used by your SMTP server (typically `tls` or `ssl`). |
| `MAIL_FROM_ADDRESS` | The email address that emails should be sent from. |
| `MAIL_FROM_NAME` | The name that should appear as the sender of the emails. |
import CloudVersion from "/snippets/cloud-version.mdx";
<CloudVersion/>

View File

@@ -0,0 +1,64 @@
---
title: Environment Variables Configuration
description: Detailed guide on configuring environment variables for OpnForm
---
OpnForm uses two `.env` files for configuration: one for the Laravel backend located in the `api` directory, and one for the Nuxt front-end located in the `client` directory.
## Backend Environment Variables
The following environment variables are used to [configure the Laravel](https://laravel.com/docs/11.x/configuration) application (OpnForm's API).
### Dedicated guides
There are dedicated configuration pages available for more detailed setup instructions on specific topics:
- [File Storage (S3)](../configuration/aws-s3)
- [Email Configuration (SMTP)](../configuration/email-setup)
- [Custom Domain](../configuration/custom-domain)
### Other Environment Variables
### Configuration Environment Variables
| Variable Name | Description |
|------------------------------|--------------------------------------------------|
| `JWT_TTL` | Time to live for JSON Web Tokens (JWT). |
| `JWT_SECRET` | Secret key used to sign JWTs. |
| `H_CAPTCHA_SITE_KEY` | Site key for hCaptcha integration. |
| `H_CAPTCHA_SECRET_KEY` | Secret key for hCaptcha integration. |
| `OPEN_AI_API_KEY` | API key for accessing OpenAI services. |
| `UNSPLASH_ACCESS_KEY` | Access key for Unsplash API. |
| `UNSPLASH_SECRET_KEY` | Secret key for Unsplash API. |
| `GOOGLE_CLIENT_ID` | Client ID for Google OAuth. |
| `GOOGLE_CLIENT_SECRET` | Client secret for Google OAuth. |
| `GOOGLE_REDIRECT_URL` | Redirect URL for Google OAuth. |
| `GOOGLE_AUTH_REDIRECT_URL` | Authentication redirect URL for Google OAuth. |
| `GOOGLE_FONTS_API_KEY` | API key for accessing Google Fonts. |
| `FRONT_URL` | Public facing URL of the front-end. |
| `FRONT_API_SECRET` | Shared secret with the front-end. |
### User Options Environment Variables
| Variable Name | Description |
|------------------------------|--------------------------------------------------|
| `ADMIN_EMAILS` | Comma-separated list of admin email addresses. |
| `TEMPLATE_EDITOR_EMAILS` | Comma-separated list of template editor emails. |
| `EXTRA_PRO_USERS_EMAILS` | Comma-separated list of extra pro user emails. |
| `MODERATOR_EMAILS` | Comma-separated list of moderator email addresses. |
## Front-end Environment Variables
### Front-end Environment Variables
| Variable Name | Description |
|------------------------------|--------------------------------------------------|
| `NUXT_PUBLIC_APP_URL` | Public facing URL of the Nuxt application. |
| `NUXT_PUBLIC_API_BASE` | Base URL for the Laravel API. |
| `NUXT_PUBLIC_H_CAPTCHA_SITE_KEY` | Site key for hCaptcha integration on the front-end. |
| `NUXT_API_SECRET` | Shared secret key between Nuxt and Laravel backend. |
import CloudVersion from "/snippets/cloud-version.mdx";
<CloudVersion/>