mirror of
https://github.com/lingble/twenty.git
synced 2025-10-30 12:22:29 +00:00
* GH-3245 add passwordResetToken and passwordResetTokenExpiresAt column on user entity * Add password reset token expiry delay env variable * Add generatePasswordResetToken mutation resolver * Update .env.sample file on server * Add password reset token and expiry migration script * Add validate password reset token query and a dummy password update (WIP) resolver * Fix bug in password reset token generate * add update password mutation * Update name and add email password reset link * Add change password UI on settings page * Add reset password route on frontend * Add reset password form UI * sign in user on password reset * format code * make PASSWORD_RESET_TOKEN_EXPIRES_IN optional * add email template for password reset * Improve error message * Rename methods and DTO to improve naming * fix formatting of backend code * Update change password component * Update password reset via token component * update graphql files * spelling fix * Make password-reset route authless on frontend * show token generation wait time * remove constant from .env.example * Add PASSWORD_RESET_TOKEN_EXPIRES_IN in docs * refactor emails module in reset password * update Graphql generated file * update email template of password reset * add space between date and text * update method name * fix lint issues * remove unused code, fix indentation, and email link color * update test file for auth and token service * Fix ci: build twenty-emails when running tests --------- Co-authored-by: martmull <martmull@hotmail.fr>
174 lines
6.6 KiB
Plaintext
174 lines
6.6 KiB
Plaintext
---
|
|
title: Environment Variables
|
|
sidebar_position: 1
|
|
sidebar_custom_props:
|
|
icon: TbVariable
|
|
---
|
|
|
|
import OptionTable from '@site/src/theme/OptionTable'
|
|
import Tabs from '@theme/Tabs';
|
|
import TabItem from '@theme/TabItem';
|
|
|
|
## Frontend
|
|
|
|
<OptionTable options={[
|
|
['REACT_APP_SERVER_BASE_URL', 'http://localhost:3000', 'Url of backend server'],
|
|
['REACT_APP_SERVER_AUTH_URL', 'http://localhost:3000/auth', 'Auth Url of backend server'],
|
|
['REACT_APP_SERVER_FILES_URL', 'http://localhost:3000/files', 'Files Url of backend server'],
|
|
['GENERATE_SOURCEMAP', 'false', 'Generate source maps for debugging'],
|
|
['CHROMATIC_PROJECT_TOKEN', '', 'Chromatic token used for CI'],
|
|
]}></OptionTable>
|
|
|
|
|
|
## Backend
|
|
|
|
### Config
|
|
|
|
<OptionTable options={[
|
|
['PG_DATABASE_URL', 'postgres://user:pw@localhost:5432/default?connection_limit=1', 'Database connection'],
|
|
['REDIS_HOST', '127.0.0.1', 'Redis connection host'],
|
|
['REDIS_PORT', '6379', 'Redis connection port'],
|
|
['FRONT_BASE_URL', 'http://localhost:3001', 'Url to the hosted frontend'],
|
|
['SERVER_URL', 'http://localhost:3000', 'Url to the hosted server'],
|
|
['PORT', '3000', 'Port'],
|
|
]}></OptionTable>
|
|
|
|
### Tokens
|
|
|
|
<OptionTable options={[
|
|
['ACCESS_TOKEN_SECRET', '<random>', 'Secret used for the access tokens'],
|
|
['ACCESS_TOKEN_EXPIRES_IN', '30m', 'Access token expiration time'],
|
|
['LOGIN_TOKEN_SECRET', '<random>', 'Secret used for the login tokens'],
|
|
['LOGIN_TOKEN_EXPIRES_IN', '15m', 'Login token expiration time'],
|
|
['REFRESH_TOKEN_SECRET', '<random>', 'Secret used for the refresh tokens'],
|
|
['REFRESH_TOKEN_EXPIRES_IN', '90d', 'Refresh token expiration time'],
|
|
['REFRESH_TOKEN_COOL_DOWN', '1m', 'Refresh token cooldown'],
|
|
['API_TOKEN_EXPIRES_IN', '1000y', 'Api token expiration time'],
|
|
]}></OptionTable>
|
|
|
|
### Auth
|
|
|
|
<OptionTable options={[
|
|
['MESSAGING_PROVIDER_GMAIL_ENABLED', 'false', 'Enable Gmail API connection'],
|
|
['MESSAGING_PROVIDER_GMAIL_CALLBACK_URL', '', 'Gmail auth callback'],
|
|
['AUTH_GOOGLE_ENABLED', 'false', 'Enable Goole SSO login'],
|
|
['AUTH_GOOGLE_CLIENT_ID', '', 'Google client ID'],
|
|
['AUTH_GOOGLE_CLIENT_SECRET', '', 'Google client secret'],
|
|
['AUTH_GOOGLE_CALLBACK_URL', '', 'Google auth callback'],
|
|
['FRONT_AUTH_CALLBACK_URL', 'http://localhost:3001/verify ', 'Callback used for Login page'],
|
|
['IS_SIGN_UP_DISABLED', 'false', 'Disable sign-up'],
|
|
['PASSWORD_RESET_TOKEN_EXPIRES_IN', '5m', 'Password reset token expiration time'],
|
|
]}></OptionTable>
|
|
|
|
### Email
|
|
|
|
<OptionTable options={[
|
|
['EMAIL_FROM_ADDRESS', 'contact@yourdomain.com', 'Global email From: header used to send emails'],
|
|
['EMAIL_FROM_NAME', 'John from YourDomain', 'Global name From: header used to send emails'],
|
|
['EMAIL_SYSTEM_ADDRESS', 'system@yourdomain.com', 'Email address used as a destination to send internal system notification'],
|
|
['EMAIL_DRIVER', 'logger', "Email driver: 'logger' (to log emails in console) or 'smtp'"],
|
|
['EMAIL_SMTP_HOST', '', 'Email Smtp Host'],
|
|
['EMAIL_SMTP_PORT', '', 'Email Smtp Port'],
|
|
['EMAIL_SMTP_USER', '', 'Email Smtp User'],
|
|
['EMAIL_SMTP_PASSWORD', '', 'Email Smtp Password'],
|
|
]}></OptionTable>
|
|
|
|
#### Email SMTP Server configuration examples
|
|
|
|
<Tabs>
|
|
|
|
<TabItem value="Gmail" label="Gmail" default>
|
|
|
|
You will need to provision an [App Password](https://support.google.com/accounts/answer/185833).
|
|
- EMAIL_SMTP_HOST=smtp.gmail.com
|
|
- EMAIL_SERVER_PORT=465
|
|
- EMAIL_SERVER_USER=gmail_email_address
|
|
- EMAIL_SERVER_PASSWORD='gmail_app_password'
|
|
|
|
</TabItem>
|
|
|
|
<TabItem value="Office365" label="Office365">
|
|
|
|
Keep in mind that if you have 2FA enabled, you will need to provision an [App Password](https://support.microsoft.com/en-us/account-billing/manage-app-passwords-for-two-step-verification-d6dc8c6d-4bf7-4851-ad95-6d07799387e9).
|
|
- EMAIL_SMTP_HOST=smtp.office365.com
|
|
- EMAIL_SERVER_PORT=587
|
|
- EMAIL_SERVER_USER=office365_email_address
|
|
- EMAIL_SERVER_PASSWORD='office365_password'
|
|
|
|
</TabItem>
|
|
|
|
<TabItem value="Smtp4dev" label="Smtp4dev">
|
|
|
|
**smtp4dev** is a fake SMTP email server for development and testing.
|
|
- Run the smtp4dev image: `docker run --rm -it -p 8090:80 -p 2525:25 rnwood/smtp4dev`
|
|
- Access the smtp4dev ui here: [http://localhost:8090](http://localhost:8090)
|
|
- Set the following env variables:
|
|
- EMAIL_SERVER_HOST=localhost
|
|
- EMAIL_SERVER_PORT=2525
|
|
|
|
</TabItem>
|
|
|
|
</Tabs>
|
|
|
|
### Storage
|
|
|
|
<OptionTable options={[
|
|
['STORAGE_TYPE', 'local', "Storage driver: 'local' or 's3'"],
|
|
['STORAGE_S3_REGION', '', 'Storage Region'],
|
|
['STORAGE_S3_NAME', '', 'Bucket Name'],
|
|
['STORAGE_S3_ENDPOINT', '', 'Use if a different Endpoint is needed (for example Google)'],
|
|
['STORAGE_LOCAL_PATH', '.local-storage', 'data path (local storage)'],
|
|
]}></OptionTable>
|
|
|
|
### Message Queue
|
|
|
|
<OptionTable options={[
|
|
['MESSAGE_QUEUE_TYPE', 'pg-boss', "Queue driver: 'pg-boss' or 'bull-mq'"],
|
|
]}></OptionTable>
|
|
|
|
### Logging
|
|
|
|
<OptionTable options={[
|
|
['LOGGER_DRIVER', 'console', "The logging driver can be: 'console' or 'sentry'"],
|
|
['LOG_LEVELS', 'error,warn', "The loglevels which are logged to the logging driver. Can include: 'log', 'warn', 'error'"],
|
|
['EXCEPTION_HANDLER_DRIVER', 'sentry', "The exception handler driver can be: 'console' or 'sentry'"],
|
|
['SENTRY_DSN', 'https://xxx@xxx.ingest.sentry.io/xxx', 'The sentry logging endpoint used if sentry logging driver is selected'],
|
|
]}></OptionTable>
|
|
|
|
|
|
### Data enrichment and AI
|
|
|
|
<OptionTable options={[
|
|
['OPENROUTER_API_KEY', '', "The API key for openrouter.ai, an abstraction layer over models from Mistral, OpenAI and more"]
|
|
]}></OptionTable>
|
|
|
|
|
|
### Support Chat
|
|
|
|
<OptionTable options={[
|
|
['SUPPORT_DRIVER', 'front', "Support driver ('front' or 'none')"],
|
|
['SUPPORT_FRONT_HMAC_KEY', '<secret>', 'Suport chat key'],
|
|
['SUPPORT_FRONT_CHAT_ID', '<id>', 'Support chat id'],
|
|
]}></OptionTable>
|
|
|
|
### Telemetry
|
|
|
|
<OptionTable options={[
|
|
['TELEMETRY_ENABLED', 'true', 'Change this if you want to disable telemetry'],
|
|
['TELEMETRY_ANONYMIZATION_ENABLED', 'true', 'Telemetry is anonymized by default, you probably don\'t want to change this'],
|
|
]}></OptionTable>
|
|
|
|
### Debug / Development
|
|
|
|
<OptionTable options={[
|
|
['DEBUG_MODE', 'true', 'Activate debug mode'],
|
|
['SIGN_IN_PREFILLED', 'true', 'Prefill the Signin form for usage in a demo or dev environment'],
|
|
]}></OptionTable>
|
|
|
|
### Workspace Cleaning
|
|
|
|
<OptionTable options={[
|
|
['WORKSPACE_INACTIVE_DAYS_BEFORE_NOTIFICATION', '', 'Number of inactive days before sending workspace deleting warning email'],
|
|
['WORKSPACE_INACTIVE_DAYS_BEFORE_DELETION', '', 'Number of inactive days before deleting workspace'],
|
|
]}></OptionTable>
|