mirror of
https://github.com/twentyhq/twenty
synced 2026-04-21 21:47:38 +00:00
Created by Github action --------- Co-authored-by: Abdul Rahman <ar5438376@gmail.com> Co-authored-by: Crowdin Bot <support+bot@crowdin.com> Co-authored-by: github-actions <github-actions@twenty.com> Co-authored-by: Charles Bochet <charles@twenty.com>
251 lines
No EOL
9.9 KiB
Text
251 lines
No EOL
9.9 KiB
Text
---
|
|
title: Configuració
|
|
image: /images/user-guide/table-views/table.png
|
|
---
|
|
|
|
<Frame>
|
|
<img src="/images/user-guide/table-views/table.png" alt="Header" />
|
|
</Frame>
|
|
|
|
import OptionTable from '@site/src/theme/OptionTable'
|
|
|
|
# Gestió de configuracions
|
|
|
|
<Warning>
|
|
**First time installing?** Follow the [Docker Compose installation guide](https://docs.twenty.com/l/ca/developers/self-hosting/docker-compose) to get Twenty running, then return here for configuration.
|
|
</Warning>
|
|
|
|
Twenty ofereix **dos modes de configuració** per satisfer diferents necessitats de desplegament:
|
|
|
|
**Accés al panell d'administració:** Només els usuaris amb privilegis d'administració (`canAccessFullAdminPanel: true`) poden accedir a la interfície de configuració.
|
|
|
|
## 1. Configuració del Panell d'Administració (Predeterminat)
|
|
|
|
```bash
|
|
IS_CONFIG_VARIABLES_IN_DB_ENABLED=true # default
|
|
```
|
|
|
|
**La major part de la configuració es fa a través de la IU** després de la instal·lació:
|
|
|
|
1. Accediu a la vostra instància de Twenty (normalment `http://localhost:3000`)
|
|
2. Aneu a **Configuració / Panell d'Administració / Variables de configuració**
|
|
3. Configureu integracions, correu electrònic, emmagatzematge, i més
|
|
4. Els canvis tenen efecte immediatament (en 15 segons per a desplegaments multi-container)
|
|
|
|
<Warning>
|
|
**Desplegaments Multi-Contenidor:** Quan es fa servir la configuració de la base de dades (`IS_CONFIG_VARIABLES_IN_DB_ENABLED=true`), tant el servidor com els contenidors de treball llegeixen de la mateixa base de dades. Admin panel changes affect both automatically, eliminating the need to duplicate environment variables between containers (except for infrastructure variables).
|
|
</Warning>
|
|
|
|
**Què podeu configurar mitjançant el panell d'administració:**
|
|
|
|
- **Autenticació** - Google/Microsoft OAuth, configuració de contrasenyes
|
|
- **Correu electrònic** - Configuracions SMTP, plantilles, verificació
|
|
- **Emmagatzematge** - Configuració d'S3, rutes d'emmagatzematge local
|
|
- **Integracions** - Gmail, Google Calendar, serveis de Microsoft
|
|
- **Workflow & Rate Limiting** - Execution limits, API throttling
|
|
- **I molt més...**
|
|
|
|

|
|
|
|
<Warning>
|
|
Cada variable està documentada amb descripcions al vostre panell d'administració a **Configuració → Panell d'Administració → Variables de Configuració**.
|
|
Algunes configuracions d'infraestructura com les connexions a base de dades (`PG_DATABASE_URL`), URLs del servidor (`SERVER_URL`) i secrets d'aplicació (`APP_SECRET`) només es poden configurar via arxiu `.env`.
|
|
|
|
[Complete technical reference →](https://github.com/twentyhq/twenty/blob/main/packages/twenty-server/src/engine/core-modules/twenty-config/config-variables.ts) </Warning>
|
|
|
|
## 2. Configuració Només d'Entorn
|
|
|
|
```bash
|
|
IS_CONFIG_VARIABLES_IN_DB_ENABLED=false
|
|
```
|
|
|
|
**Tota la configuració es gestiona a través dels arxius `.env`:**
|
|
|
|
1. Establiu `IS_CONFIG_VARIABLES_IN_DB_ENABLED=false` al vostre arxiu `.env`
|
|
2. Afegiu totes les variables de configuració al vostre arxiu `.env`
|
|
3. Reinicieu els contenidors perquè els canvis tinguin efecte
|
|
4. El panell d'administració mostrarà els valors actuals però no podrà modificar-los
|
|
|
|
## Integració de Gmail & Google Calendar
|
|
|
|
### Creeu un Projecte de Google Cloud
|
|
|
|
1. Aneu a [Google Cloud Console](https://console.cloud.google.com/)
|
|
2. Creeu un projecte nou o seleccioneu-ne un d'existent
|
|
3. Habiliteu aquestes APIs:
|
|
|
|
- [API de Gmail](https://console.cloud.google.com/apis/library/gmail.googleapis.com)
|
|
- [API de Google Calendar](https://console.cloud.google.com/apis/library/calendar-json.googleapis.com)
|
|
- [API de People](https://console.cloud.google.com/apis/library/people.googleapis.com)
|
|
|
|
### Configureu l'OAuth
|
|
|
|
1. Aneu a [Credencials](https://console.cloud.google.com/apis/credentials)
|
|
2. Creeu un Client ID OAuth 2.0
|
|
3. Afegiu aquests URI de redirecció:
|
|
- `https://{your-domain}/auth/google/redirect` (for SSO)
|
|
- `https://{your-domain}/auth/google-apis/get-access-token` (for integrations)
|
|
|
|
### Configureu en Twenty
|
|
|
|
1. Aneu a **Configuració → Panell d'Administració → Variables de Configuració**
|
|
2. Cerqueu la secció **Google Auth**
|
|
3. Establiu aquestes variables:
|
|
- `MESSAGING_PROVIDER_GMAIL_ENABLED=true`
|
|
- `CALENDAR_PROVIDER_GOOGLE_ENABLED=true`
|
|
- `AUTH_GOOGLE_CLIENT_ID={client-id}`
|
|
- `AUTH_GOOGLE_CLIENT_SECRET={client-secret}`
|
|
- `AUTH_GOOGLE_CALLBACK_URL=https://{your-domain}/auth/google/redirect`
|
|
- `AUTH_GOOGLE_APIS_CALLBACK_URL=https://{your-domain}/auth/google-apis/get-access-token`
|
|
|
|
<Warning>
|
|
**Environment-only mode:** If you set `IS_CONFIG_VARIABLES_IN_DB_ENABLED=false`, add these variables to your `.env` file instead.
|
|
</Warning>
|
|
|
|
**Required scopes** (automatically configured):
|
|
[See relevant source code](https://github.com/twentyhq/twenty/blob/main/packages/twenty-server/src/engine/core-modules/auth/utils/get-google-apis-oauth-scopes.ts#L4-L10)
|
|
|
|
- `https://www.googleapis.com/auth/calendar.events`
|
|
- `https://www.googleapis.com/auth/gmail.readonly`
|
|
- `https://www.googleapis.com/auth/profile.emails.read`
|
|
|
|
### Si la vostra aplicació està en mode de proves
|
|
|
|
Si la vostra aplicació està en mode de proves, necessitareu afegir usuaris de prova al vostre projecte.
|
|
|
|
En el [panell de consentiment OAuth](https://console.cloud.google.com/apis/credentials/consent), afegiu els vostres usuaris de prova a la secció "Usuaris de prova".
|
|
|
|
## Integració amb Microsoft 365
|
|
|
|
<Warning>
|
|
Els usuaris han de tenir una [Llicència de Microsoft 365](https://admin.microsoft.com/Adminportal/Home) per poder utilitzar l'API de Calendari i Missatgeria. No podran sincronitzar el seu compte a Twenty sense una.
|
|
</Warning>
|
|
|
|
### Creeu un projecte al Microsoft Azure
|
|
|
|
Necessitareu crear un projecte a [Microsoft Azure](https://portal.azure.com/#view/Microsoft_AAD_IAM/AppGalleryBladeV2) i obtenir les credencials.
|
|
|
|
### Habilitar APIs
|
|
|
|
A la consola de Microsoft Azure, habiliteu les següents APIs a "Permisions":
|
|
|
|
- Microsoft Graph: Mail.ReadWrite
|
|
- Microsoft Graph: Mail.Send
|
|
- Microsoft Graph: Calendars.Read
|
|
- Microsoft Graph: User.Read
|
|
- Microsoft Graph: openid
|
|
- Microsoft Graph: email
|
|
- Microsoft Graph: profile
|
|
- Microsoft Graph: offline_access
|
|
|
|
Note: "Mail.ReadWrite" and "Mail.Send" are only mandatory if you want to send emails using our workflow actions. Podeu utilitzar "Mail.Read" en cas de només voler rebre correus electrònics.
|
|
|
|
### URI de redirecció autoritzats
|
|
|
|
Heu d'afegir els següents URI de redirecció al vostre projecte:
|
|
|
|
- `https://{your-domain}/auth/microsoft/redirect` if you want to use Microsoft SSO
|
|
- `https://{your-domain}/auth/microsoft-apis/get-access-token`
|
|
|
|
### Configureu en Twenty
|
|
|
|
1. Aneu a **Configuració → Panell d'Administració → Variables de Configuració**
|
|
2. Cerqueu la secció **Microsoft Auth**
|
|
3. Establiu aquestes variables:
|
|
- `MESSAGING_PROVIDER_MICROSOFT_ENABLED=true`
|
|
- `CALENDAR_PROVIDER_MICROSOFT_ENABLED=true`
|
|
- `AUTH_MICROSOFT_ENABLED=true`
|
|
- `AUTH_MICROSOFT_CLIENT_ID={client-id}`
|
|
- `AUTH_MICROSOFT_CLIENT_SECRET={client-secret}`
|
|
- `AUTH_MICROSOFT_CALLBACK_URL=https://{your-domain}/auth/microsoft/redirect`
|
|
- `AUTH_MICROSOFT_APIS_CALLBACK_URL=https://{your-domain}/auth/microsoft-apis/get-access-token`
|
|
|
|
<Warning>
|
|
**Environment-only mode:** If you set `IS_CONFIG_VARIABLES_IN_DB_ENABLED=false`, add these variables to your `.env` file instead.
|
|
</Warning>
|
|
|
|
### Configure scopes
|
|
|
|
[Vegeu el codi font rellevant](https://github.com/twentyhq/twenty/blob/main/packages/twenty-server/src/engine/core-modules/auth/utils/get-microsoft-apis-oauth-scopes.ts#L2-L9)
|
|
|
|
- 'openid'
|
|
- 'correu electrònic'
|
|
- 'perfil'
|
|
- 'offline_access'
|
|
- 'Mail.ReadWrite'
|
|
- 'Mail.Send'
|
|
- 'Calendars.Read'
|
|
|
|
### Si la vostra aplicació està en mode de proves
|
|
|
|
Si la vostra aplicació està en mode de proves, necessitareu afegir usuaris de prova al vostre projecte.
|
|
|
|
Afegiu els vostres usuaris de prova a la secció "Usuaris i grups".
|
|
|
|
## Treballs en segon pla per al Calendari i Missatgeria
|
|
|
|
Després de configurar les integracions de Gmail, Google Calendar o Microsoft 365, necessiteu iniciar els treballs en segon pla que sincronitzen les dades.
|
|
|
|
Registreu els següents treballs recurrents en el vostre contenidor de treballador:
|
|
|
|
```bash
|
|
# from your worker container
|
|
yarn command:prod cron:messaging:messages-import
|
|
yarn command:prod cron:messaging:message-list-fetch
|
|
yarn command:prod cron:calendar:calendar-event-list-fetch
|
|
yarn command:prod cron:calendar:calendar-events-import
|
|
yarn command:prod cron:messaging:ongoing-stale
|
|
yarn command:prod cron:calendar:ongoing-stale
|
|
yarn command:prod cron:workflow:automated-cron-trigger
|
|
```
|
|
|
|
## Configuració del Correu Electrònic
|
|
|
|
1. Aneu a **Configuració → Panell d'Administració → Variables de Configuració**
|
|
2. Cerqueu la secció **Correu Electrònic**
|
|
3. Configureu les vostres opcions d'SMTP:
|
|
|
|
<ArticleTabs label1="Gmail" label2="Office365" label3="Smtp4dev">
|
|
|
|
<ArticleTab>
|
|
|
|
Haureu de proporcionar una [Contrasenya d'Aplicació](https://support.google.com/accounts/answer/185833).
|
|
|
|
- EMAIL_DRIVER=smtp
|
|
- EMAIL_SMTP_HOST=smtp.gmail.com
|
|
- EMAIL_SMTP_PORT=465
|
|
- EMAIL_SMTP_USER=gmail_email_address
|
|
- EMAIL_SMTP_PASSWORD='gmail_app_password'
|
|
|
|
</ArticleTab>
|
|
|
|
<ArticleTab>
|
|
|
|
**smtp4dev** és un servidor SMTP fals per al desenvolupament i proves.
|
|
|
|
- EMAIL_DRIVER=smtp
|
|
- EMAIL_SMTP_HOST=smtp.office365.com
|
|
- EMAIL_SMTP_PORT=587
|
|
- EMAIL_SMTP_USER=office365_email_address
|
|
- EMAIL_SMTP_PASSWORD='office365_password'
|
|
|
|
</ArticleTab>
|
|
|
|
<ArticleTab>
|
|
|
|
**smtp4dev** és un servidor SMTP fals per al desenvolupament i proves.
|
|
|
|
- Executeu la imatge smtp4dev: `docker run --rm -it -p 8090:80 -p 2525:25 rnwood/smtp4dev`
|
|
- Accediu a la interfície smtp4dev aquí: [http://localhost:8090](http://localhost:8090)
|
|
- Establiu les següents variables:
|
|
- EMAIL_DRIVER=smtp
|
|
- EMAIL_SMTP_HOST=localhost
|
|
- EMAIL_SMTP_PORT=2525
|
|
|
|
</ArticleTab>
|
|
|
|
</ArticleTabs>
|
|
|
|
<Warning>
|
|
**Environment-only mode:** If you set `IS_CONFIG_VARIABLES_IN_DB_ENABLED=false`, add these variables to your `.env` file instead.
|
|
</Warning> |