Clean documentation
This commit is contained in:
@@ -1,21 +1,17 @@
|
||||
export default {
|
||||
base: "/Twake/",
|
||||
base: "/TDrive/",
|
||||
title: "Documentation",
|
||||
description: "Public API documentation",
|
||||
themeConfig: {
|
||||
logo: "https://twake.app/images/logo-twake.svg",
|
||||
logo: "https://tdrive.app/images/logo-tdrive.svg",
|
||||
sidebar: [
|
||||
{
|
||||
text: "Getting started",
|
||||
items: [
|
||||
{
|
||||
text: "☀️ Welcome to Twake",
|
||||
text: "☀️ Welcome to TDrive",
|
||||
link: "index",
|
||||
},
|
||||
{
|
||||
text: "⬇️ Desktop and mobile apps",
|
||||
link: "download",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -27,86 +23,7 @@ export default {
|
||||
},
|
||||
{
|
||||
text: "⚙️ Server configuration",
|
||||
link: "/onprem/configuration/README.md",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
text: "How to use Twake",
|
||||
items: [
|
||||
{
|
||||
text: "👋 Welcome to Twake !",
|
||||
link: "/how-to-use-it/welcome",
|
||||
},
|
||||
{
|
||||
text: "🖥 Desktop and mobile app",
|
||||
link: "/how-to-use-it/desktop-and-mobile-app",
|
||||
},
|
||||
{
|
||||
text: "🔒 Privacy and security",
|
||||
link: "/how-to-use-it/privacy-security",
|
||||
},
|
||||
{
|
||||
text: "Console",
|
||||
link: "/how-to-use-it/console/README.md",
|
||||
items: [
|
||||
{
|
||||
text: "Users",
|
||||
link: "/how-to-use-it/console/users",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
text: "Company & workspace",
|
||||
link: "/how-to-use-it/company-and-workspace/README.md",
|
||||
items: [
|
||||
{
|
||||
text: "Invite user",
|
||||
link: "/how-to-use-it/company-and-workspace/invite-user-from-chat",
|
||||
},
|
||||
{
|
||||
text: "Rights",
|
||||
link: "/how-to-use-it/company-and-workspace/rights",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
text: "Chat",
|
||||
link: "/how-to-use-it/applications/how-to-use-chat/README.md",
|
||||
items: [
|
||||
{
|
||||
text: "Channels",
|
||||
link: "/how-to-use-it/applications/how-to-use-chat/channels",
|
||||
},
|
||||
{
|
||||
text: "Message",
|
||||
link: "/how-to-use-it/applications/how-to-use-chat/message",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
text: "Drive",
|
||||
link: "/how-to-use-it/applications/drive/README.md",
|
||||
items: [
|
||||
{
|
||||
text: "File and folder",
|
||||
link: "/how-to-use-it/applications/drive/file-and-folder",
|
||||
},
|
||||
{
|
||||
text: "Share file with public link",
|
||||
link: "/how-to-use-it/applications/drive/share-file-with-public-link",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
text: "Connectors",
|
||||
link: "/how-to-use-it/applications/connectors/README.md",
|
||||
items: [
|
||||
{
|
||||
text: "n8n",
|
||||
link: "/how-to-use-it/applications/connectors/n8n",
|
||||
},
|
||||
],
|
||||
link: "/onprem/configuration/index.md",
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -132,10 +49,6 @@ export default {
|
||||
text: "Applications",
|
||||
link: "/internal-documentation/backend-services/applications/README.md",
|
||||
},
|
||||
{
|
||||
text: "Channels",
|
||||
link: "/internal-documentation/backend-services/channels/README.md",
|
||||
},
|
||||
{
|
||||
text: "Documents",
|
||||
link: "/internal-documentation/backend-services/documents/README.md",
|
||||
@@ -148,14 +61,6 @@ export default {
|
||||
text: "Tags",
|
||||
link: "/internal-documentation/backend-services/tags/README.md",
|
||||
},
|
||||
{
|
||||
text: "Knowledge graph",
|
||||
link: "/internal-documentation/backend-services/knowledge-graph/README.md",
|
||||
},
|
||||
{
|
||||
text: "Notifications",
|
||||
link: "/internal-documentation/backend-services/notifications/README.md",
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
# Table of contents
|
||||
|
||||
- [☀️ Twake](index.md)
|
||||
- [☀️ TDrive](index.md)
|
||||
|
||||
## Getting started <a href="#gettingstarted" id="gettingstarted"></a>
|
||||
|
||||
- [▶ Use Twake on twake.app](gettingstarted/use-twake-on-twake.app.md)
|
||||
- [▶ Use TDrive on tdrive.app](gettingstarted/use-tdrive-on-tdrive.app.md)
|
||||
- [🏗 Install on your server](onprem/installation.md)
|
||||
- [⚙ Configuration](onprem/configuration/index.md)
|
||||
- [🔒 Security](onprem/configuration/security.md)
|
||||
@@ -15,11 +15,11 @@
|
||||
- [🔌 Connectors and plugins](onprem/configuration/connectors-and-plugins.md)
|
||||
- [👨💻 Authentication modes](onprem/configuration/authentication-modes/README.md)
|
||||
- [Using Keycloak (LDAP, OpenID and more)](onprem/configuration/authentication-modes/using-keycloak-ldap-openid-and-more.md)
|
||||
- [Installing Twake with LemonLDAP (LDAP, OpenID and more)](onprem/configuration/authentication-modes/installing-twake-with-lemonldap-ldap-openid-and-more.md)
|
||||
- [Installing TDrive with LemonLDAP (LDAP, OpenID and more)](onprem/configuration/authentication-modes/installing-tdrive-with-lemonldap-ldap-openid-and-more.md)
|
||||
|
||||
## How to use it
|
||||
|
||||
- [👋 Welcome to Twake !](how-to-use-it/welcome.md)
|
||||
- [👋 Welcome to TDrive !](how-to-use-it/welcome.md)
|
||||
- [🧰 Console](how-to-use-it/console/README.md)
|
||||
- [Users](how-to-use-it/console/users.md)
|
||||
- [🏢 Company & workspace](how-to-use-it/company-and-workspace/README.md)
|
||||
@@ -45,7 +45,7 @@
|
||||
- [🥇 Getting started](developers-api/get-started/README.md)
|
||||
- [Create your first application](developers-api/get-started/create-your-first-application.md)
|
||||
- [Authenticate with Postman](developers-api/get-started/authenticate-postman.md)
|
||||
- [Send a message with your application](developers-api/get-started/send-a-message-for-twake.md)
|
||||
- [Send a message with your application](developers-api/get-started/send-a-message-for-tdrive.md)
|
||||
- [Trigger action from command](developers-api/get-started/trigger-action-from-command.md)
|
||||
- [⚙ Application settings](developers-api/application-settings/README.md)
|
||||
- [Api](developers-api/application-settings/api.md)
|
||||
@@ -61,8 +61,8 @@
|
||||
|
||||
## Internal Documentation
|
||||
|
||||
- [🥇 Get started](developers-api/run-twake-as-developer.md)
|
||||
- [🎨 Twake Ecosystem Guidelines](internal-documentation/twake-ecosystem-guidelines.md)
|
||||
- [🥇 Get started](developers-api/run-tdrive-as-developer.md)
|
||||
- [🎨 TDrive Ecosystem Guidelines](internal-documentation/tdrive-ecosystem-guidelines.md)
|
||||
- [📚 Our stack](internal-documentation/our-stack.md)
|
||||
- [🧱 Backend and APIs](internal-documentation/backend-services/README.md)
|
||||
- [👥 Users, workspaces and companies](internal-documentation/backend-services/users/README.md)
|
||||
@@ -78,9 +78,9 @@
|
||||
- [Resumable.js](internal-documentation/backend-services/files/resumablejs.md)
|
||||
- [📲 Notifications](internal-documentation/backend-services/notifications/README.md)
|
||||
- [Database models](internal-documentation/backend-services/notifications/database-models.md)
|
||||
- [🛠 Twake service development](internal-documentation/backend-services/intro/README.md)
|
||||
- [What is a service in Twake ?](internal-documentation/backend-services/intro/start-working-into-a-service.md)
|
||||
- [Create a new service](internal-documentation/backend-services/intro/create-a-new-twake-service.md)
|
||||
- [🛠 TDrive service development](internal-documentation/backend-services/intro/README.md)
|
||||
- [What is a service in TDrive ?](internal-documentation/backend-services/intro/start-working-into-a-service.md)
|
||||
- [Create a new service](internal-documentation/backend-services/intro/create-a-new-tdrive-service.md)
|
||||
- [Platform/Technical services](internal-documentation/backend-services/intro/platform/README.md)
|
||||
- [Database ORM platform service](internal-documentation/backend-services/intro/platform/database-orm-platform-service.md)
|
||||
- [🎭 Translation](internal-documentation/translation.md)
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
description: Discover our wonderful API
|
||||
---
|
||||
|
||||
# 📖 API Reference
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
---
|
||||
description: How to manage authentification on API call
|
||||
---
|
||||
|
||||
# Authentication
|
||||
|
||||
## Authencate your app in Twake
|
||||
|
||||
**All your connections** should respect the Basic access authentication protocol, which must be used via HTTPS, except in development mode. In order to make an API call with this method, you must add an HTTP header:
|
||||
|
||||
```text
|
||||
Authorization: Basic base64(public_id:private_api_key)
|
||||
```
|
||||
|
||||
**You must concatenate** your [public_id and private_api_key](../get-started/README.md#identity-and-api-settings) , **then convert** the whole **to base64**. Your HTTP header will therefore look like:
|
||||
|
||||
```text
|
||||
# For the keys 'public_id' and 'private_key'
|
||||
Authorization: Basic cHVibGljX2lkOnByaXZhdGVfYXBpX2tleQ==
|
||||
```
|
||||
|
||||
## Authencate your app in a company
|
||||
|
||||
**All your requests should have at least a "group_id" key with the company id you**
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
description: How to manage Drive through API
|
||||
---
|
||||
|
||||
# Drive
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
---
|
||||
description: How to manage messages through API
|
||||
---
|
||||
|
||||
# Message
|
||||
|
||||
_While users have the ability to create message complexes using the built-in formatting system, applications can go even further and offer many types of messages such as system messages for notifications or interactive messages for your most popular applications._
|
||||
|
||||
## Group_id and channel_id:
|
||||
|
||||
1. Get the current front id:
|
||||
|
||||
`channel_service.currentChannelFrontId`
|
||||
|
||||
2. With the channel front id, you will be able to get the channel id by doing this:
|
||||
|
||||
`collections.collections.channels.manager.findByFrontId("My-Front-Id")`
|
||||
|
||||
3. Get the current group id:
|
||||
|
||||
`workspaceService.currentGroupId`
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
description: How to use webhook with Twake
|
||||
---
|
||||
|
||||
# Webhook
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
description: Set your application
|
||||
---
|
||||
|
||||
# ⚙ Application settings
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
description: There you will find some important pieces of information
|
||||
---
|
||||
|
||||
# Api
|
||||
|
||||
-152
@@ -1,152 +0,0 @@
|
||||
---
|
||||
description: This is a JSON parameter to define where your app should appear
|
||||
---
|
||||
|
||||
# Display
|
||||
|
||||
#### Latest version
|
||||
|
||||
```typescript
|
||||
{
|
||||
twake: {
|
||||
version: 1;
|
||||
|
||||
files?: {
|
||||
preview?: {
|
||||
url: string; //Url to preview file (full screen or inline)
|
||||
inline?: boolean;
|
||||
main_ext?: string[]; //Main extensions app can read
|
||||
other_ext?: string[]; //Secondary extensions app can read
|
||||
};
|
||||
actions?: //List of action that can apply on a file
|
||||
{
|
||||
name: string;
|
||||
id: string;
|
||||
}[];
|
||||
};
|
||||
|
||||
//Chat plugin
|
||||
chat: {
|
||||
input?:
|
||||
| true
|
||||
| {
|
||||
icon?: string; //If defined replace original icon url of your app
|
||||
type?: "file" | "call"; //To add in existing apps folder / default icon
|
||||
};
|
||||
commands?: {
|
||||
command: string; // my_app mycommand
|
||||
description: string;
|
||||
}[];
|
||||
actions?: //List of action that can apply on a message
|
||||
{
|
||||
name: string;
|
||||
id: string;
|
||||
}[];
|
||||
};
|
||||
|
||||
//Allow app to appear as a bot user in direct chat
|
||||
direct?:
|
||||
| true
|
||||
| {
|
||||
name?: string;
|
||||
icon?: string; //If defined replace original icon url of your app
|
||||
};
|
||||
|
||||
//Display app as a standalone application in a tab
|
||||
tab?: {
|
||||
url: string;
|
||||
};
|
||||
|
||||
//Display app as a standalone application on the left bar
|
||||
standalone?: {
|
||||
url: string;
|
||||
};
|
||||
|
||||
//Define where the app can be configured from
|
||||
configuration: ("global" | "channel")[];
|
||||
};
|
||||
};
|
||||
|
||||
```
|
||||
|
||||
#### Legacy format
|
||||
|
||||
```javascript
|
||||
type ApplicationDisplay = {
|
||||
twake:
|
||||
{
|
||||
"version": 0, //Legacy
|
||||
"tasks_module" : {
|
||||
"can_connect_to_tasks": true
|
||||
},
|
||||
"calendar_module" : {
|
||||
"can_connect_to_calendar": true
|
||||
}
|
||||
"drive_module" : {
|
||||
"can_connect_to_directory": true,
|
||||
"can_open_files": {
|
||||
"url": "", //Une url à appeler pour éditer le fichier (ouvert dans un onglet)
|
||||
"preview_url": "", //Une url à appeler pour prévisualiser un fichier (iframe)
|
||||
"main_ext": ["docx", "xlsx"], //Extensions principales
|
||||
"other_ext": ["txt", "html"] //Extensions secondaires
|
||||
},
|
||||
"can_create_files": [
|
||||
{
|
||||
"url": "https://[...]/empty.docx",
|
||||
"filename": "Untitled.docx",
|
||||
"name": "Word Document"
|
||||
},
|
||||
{
|
||||
"url": "https://[...]/empty.xlsx",
|
||||
"filename": "Untitled.xlsx",
|
||||
"name": "Excel Document"
|
||||
}
|
||||
]
|
||||
},
|
||||
"member_app": true, // Si défini, votre application génèrera un membre
|
||||
// virtuel dans l'espace de travail avec lequel les
|
||||
// utilisateurs pourront discuter.
|
||||
"messages_module": {
|
||||
"in_plus": {
|
||||
"should_wait_for_popup": true
|
||||
},
|
||||
"right_icon": {
|
||||
"icon_url": "", //If defined replace original icon url of your app
|
||||
"should_wait_for_popup": true,
|
||||
"type": "file" //"file" | "call"
|
||||
},
|
||||
"action": {
|
||||
"should_wait_for_popup": true,
|
||||
"description": "fdsqfds" //Description de l'action, sinon remplacé par le nom de l'app
|
||||
},
|
||||
"commands": [
|
||||
{
|
||||
"command": "mycommand", // my_app mycommand
|
||||
"description": "fdsqfds"
|
||||
}
|
||||
]
|
||||
},
|
||||
"channel": {
|
||||
"can_connect_to_channel": ""
|
||||
},
|
||||
"channel_tab": {
|
||||
"iframe": ""
|
||||
},
|
||||
"app": {
|
||||
"iframe": "",
|
||||
"plus_btn": {
|
||||
"should_wait_for_popup": true
|
||||
}
|
||||
},
|
||||
"configuration": {
|
||||
"can_configure_in_workspace": true,
|
||||
"can_configure_in_channel": true,
|
||||
"can_configure_in_calendar": true,
|
||||
"can_configure_in_tasks": true,
|
||||
//"can_configure_in_directory": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
description: How Identity are managed
|
||||
---
|
||||
|
||||
# Identity
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
description: Which privileges you need for your app
|
||||
---
|
||||
|
||||
# Privileges
|
||||
|
||||
@@ -1,160 +0,0 @@
|
||||
# 🧱 Blocks
|
||||
|
||||
## Introduction: <a href="#introduction" id="introduction"></a>
|
||||
|
||||
This guide will introduce you to use blocks to custom Twake messages. Twake allows application to send customs messages. This customs messages offer the possibility for an application to easily format the text your application wants to send and/or display UI components like button, input or iframe. 
|
||||
|
||||
## Write your first block: <a href="#introduction" id="introduction"></a>
|
||||
|
||||
### 1. Take a look at slack block kit documentation 
|
||||
|
||||
* Go to this page: [Slack Block kit](https://api.slack.com/block-kit)
|
||||
* Understand basic layers of block:
|
||||
* Block
|
||||
|
||||
First layer object, defining the use case of the current block (Actions, Context, Header, Files...). It can contain block elements and Composition object. 
|
||||
* Block elements
|
||||
|
||||
Second layer object, defining complex element that will be display in a block (Button, Menus, Input...). It can contain composition object
|
||||
* Composition object 
|
||||
|
||||
Third layer object, formatting the data to display in both block and/or block elements
|
||||
|
||||
### 2. Try your first block 
|
||||
|
||||
* Go to this page: [Block Kit Builder](https://app.slack.com/block-kit-builder)
|
||||
* Try to add/remove block 
|
||||
* Start writing block and check your result
|
||||
|
||||
### 3. Twake block 
|
||||
|
||||
Twake have some blocks that are not implemented in slack block kit (iframes, progress bar and copiable). To use them please follow this: 
|
||||
|
||||
#### iframe  
|
||||
|
||||
An iframe is **Block** allowing you to display an html page in twake.
|
||||
|
||||
How to use it: 
|
||||
|
||||
* Iframe type: 
|
||||
|
||||
```
|
||||
type BlockIframe = {
|
||||
type: "iframe";
|
||||
iframe_url: string;
|
||||
width: number;
|
||||
height: number;
|
||||
};
|
||||
```
|
||||
|
||||
* type: always "iframe"
|
||||
* iframe\_url: the URL of the web page you want to display 
|
||||
* width: the with that you iframe will take
|
||||
* height: the height that you iframe will take
|
||||
|
||||
Example: 
|
||||
|
||||
```
|
||||
{
|
||||
"blocks": [
|
||||
{
|
||||
"type": "iframe",
|
||||
"iframe_url": "
|
||||
https://twake.app
|
||||
",
|
||||
width: "40vh",
|
||||
height: "40vh"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
#### Copiable
|
||||
|
||||
A copiable is **Block element** is a readable only input allowing you to copy string with a button.
|
||||
|
||||
How to use it: 
|
||||
|
||||
* Copiable type: it is a plain text input block element with readonly and copiable set to true
|
||||
|
||||
```
|
||||
type BlockElementPlaintextInput = {
|
||||
type: "plain_text_input";
|
||||
action_id: string;
|
||||
placeholder?: CompositionPlainTextObject;
|
||||
initial_value?: string;
|
||||
multiline?: boolean;
|
||||
min_length?: number;
|
||||
max_length?: number;
|
||||
dispatch_action_config?: DispatchActionConfiguration;
|
||||
readonly?: boolean;
|
||||
copiable?: boolean;
|
||||
};
|
||||
```
|
||||
|
||||
* type: always `"plain_text_input"`
|
||||
* readonly: always `true`
|
||||
* copiable: always `true`
|
||||
|
||||
Example : 
|
||||
|
||||
```
|
||||
{
|
||||
"blocks": [
|
||||
{
|
||||
"type": "input",
|
||||
"element": {
|
||||
"type": "plain_text_input",
|
||||
"action_id": "plain_text_input-action",
|
||||
"initial_value": "https://twake.app"
|
||||
"readonly": true,
|
||||
"copiable": true,
|
||||
},
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
#### Progress bar
|
||||
|
||||
A Progess bar is **Block element** that display a progress bar.
|
||||
|
||||
How to use it: 
|
||||
|
||||
* Progress bar type:
|
||||
|
||||
```
|
||||
export type BlockElementProgressBar = {
|
||||
type: "progress_bar";
|
||||
value: number;
|
||||
title: string;
|
||||
};
|
||||
```
|
||||
|
||||
* type: always `"progress_bar"`
|
||||
* value: the value of your progress between 0 and 100
|
||||
* title: the title associate to your progress bar
|
||||
|
||||
Example : 
|
||||
|
||||
```
|
||||
{
|
||||
"blocks": [
|
||||
{
|
||||
"type": "progress_bar",
|
||||
"value": 50,
|
||||
"title": "Chargement"
|
||||
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
 
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
---
|
||||
description: 'Welcome to the developers API of Twake, let''s begin together'
|
||||
---
|
||||
|
||||
# 🥇 Getting started
|
||||
|
||||
## Introduction:
|
||||
|
||||
_While users have the ability to create message complexes using the built-in formatting system, applications can go even further and offer many types of messages such as system messages for notifications or interactive messages for your most popular applications._
|
||||
|
||||
## Basics:
|
||||
|
||||
* [Create your first application](create-your-first-application.md)
|
||||
* [Authenticate with Postman](authenticate-postman.md)
|
||||
* [Send a message with your application](send-a-message-for-twake.md)
|
||||
* [Trigger action from command](trigger-action-from-command.md)
|
||||
|
||||
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
---
|
||||
description: Postman example
|
||||
---
|
||||
|
||||
# Authenticate with Postman
|
||||
|
||||
## Introduction:
|
||||
|
||||
This guide will introduce you to authenticate with [Postman](https://www.getpostman.com).
|
||||
|
||||
## Prerequisites:
|
||||
|
||||
* _You are a **manager** of the company._
|
||||
* You have already [created a Twake application](create-your-first-application.md).
|
||||
* _You have previously installed_ [_Postman_](https://www.getpostman.com)_._
|
||||
|
||||
## Steps:
|
||||
|
||||
### 1. Log your Application
|
||||
|
||||
* Open Postman 
|
||||
* Find the app's credentials according to [#3.-api-settings](create-your-first-application.md#3.-api-settings "mention")
|
||||
* Send POST request with : 
|
||||
* Url: https://web.twake.app/api/console/v1/login
|
||||
* Headers: `{ "Content-Type": "application/json", }`
|
||||
* Body: `{ id: $APP_`_`ID, secret: $APP_SECRET`_` ``}`
|
||||
* This POST request will return a JWT token, this token will allow your application to send events in Twake
|
||||
|
||||
### 2. Optional: Verify your token
|
||||
|
||||
If you're not sure that the procedure to generate a token goes well : 
|
||||
|
||||
* Send GET request with : 
|
||||
* Url: https://web.twake.app/api/console/v1/me
|
||||
* Headers: `{ "Content-Type": "application/json",` Authorization: "`Bearer " + $APP_TOKEN }`
|
||||
|
||||
|
||||
|
||||
###  
|
||||
@@ -1,78 +0,0 @@
|
||||
---
|
||||
description: >-
|
||||
You want to create an application for Twake? It's easy, just follow the steps
|
||||
in this documentation! 😀
|
||||
---
|
||||
|
||||
# Create your first application
|
||||
|
||||
## Introduction:
|
||||
|
||||
This guide will walk you through creating, setting up and installing a Twake application.
|
||||
|
||||
## Prerequisites:
|
||||
|
||||
- _You are a **manager** of the company._
|
||||
|
||||
## Steps:
|
||||
|
||||
### 1. Create a Twake application
|
||||
|
||||

|
||||
|
||||
1. _Start by opening your `Workspace settings`_
|
||||
2. _Go to `Applications and connectors`, you should see an **Installed applications area** and **Applications developed by the company**,_
|
||||
3. _Click on `Access your applications and connectors` then `Create an application`,_
|
||||
4. _Enter your application name and application group._ 
|
||||
|
||||
**Application group** is used to group your application with other applications of the same type. **Be careful, the application group will not be modifiable later.**
|
||||
|
||||
### **2. Identity of the application (Optional)**
|
||||
|
||||

|
||||
|
||||
Let's add a description and an icon for our application. \
|
||||
it will be much prettier! 😇
|
||||
|
||||
### 3. API settings
|
||||
|
||||
There you will find some important pieces of information:
|
||||
|
||||

|
||||
|
||||
- _Your API private key,_
|
||||
- _Your public application identifier,_
|
||||
- _URL that will be used to receive events for your application,_
|
||||
- _List of IP addresses that have the right to call the Twake API with your credentials. (You can use `*`during the development of your application.)_
|
||||
|
||||
**Private key** and **Public application identifier** relate to **calls to the Twake API**.
|
||||
|
||||
### 4. Display settings (Optional)
|
||||
|
||||

|
||||
|
||||
To configure where your application should display, you need to fill a `JSON` object in `Display Settings` field.
|
||||
|
||||
[Here](../application-settings/application-visibility-example.md) is a quick example, each field is optional and his presence determines the positioning of your application in Twake.
|
||||
|
||||
### 5. Application privileges
|
||||
|
||||

|
||||
|
||||
Your application can access and modify data, only according to your needs you don't need to access all the data present in Twake. \
|
||||
\
|
||||
This is why you must specify the accesses for the proper functioning of your application. These accesses will be public and indicated to the user before the installation of your application.
|
||||
|
||||
In our example, we will only add `message_save` and `message_remove` in `Write privileges`.\
|
||||
\
|
||||
If you want to know more about capabilities and privileges, take a look at the list [here](../application-settings/privileges.md).
|
||||
|
||||
### 6. Install application
|
||||
|
||||
Once you've configured your application, you need to install it on Twake. 
|
||||
|
||||

|
||||
|
||||
Go to `Applications and connectors`, search and display your application then install it.
|
||||
|
||||
Your application is now ready, check the [Authenticate with Postman](authenticate-postman.md) documentation for starting using it !
|
||||
@@ -1,66 +0,0 @@
|
||||
---
|
||||
description: Send a message through API
|
||||
---
|
||||
|
||||
# Send a message with your application
|
||||
|
||||
\
|
||||
Introduction: <a href="#introduction" id="introduction"></a>
|
||||
|
||||
---
|
||||
|
||||
This guide will introduce you to send message with your application in Twake.
|
||||
|
||||
## Prerequisites: <a href="#prerequisites" id="prerequisites"></a>
|
||||
|
||||
- You have already created a Twake application.
|
||||
- _Your application is installed and saved in your company._
|
||||
|
||||
## Steps: <a href="#steps" id="steps"></a>
|
||||
|
||||
### 1. Send message as a new Thread 
|
||||
|
||||
- Find the app's token according to [1. Log your Application](authenticate-postman.md#1.-log-your-application)
|
||||
- Find the identifiers to target a channel:
|
||||
- Company's _id: $COMPANY_ID_
|
||||
- Workspace's \_id: $WOKSPACE\_\_ID
|
||||
- Channel's _id: $CHANNEL_ID_
|
||||
- _Set the message you want to send:_
|
||||
|
||||
- _Minimal:_ 
|
||||
|
||||
_$MESSAGE = { "text": "Hello world !" }_
|
||||
|
||||
- _To take full advantage of the messages capability in Twake see the_ [_MessageObject_](../../internal-documentation/backend-services/messages/database-model.md)\_\_
|
||||
|
||||
- Send POST request with : 
|
||||
- Url: https://web.twake.app/api/messages/v1/companies/$COMPANY\_ID/threads
|
||||
- Headers: `{ "Content-Type": "application/json",` Authorization: "`Bearer " + $APP_TOKEN }`
|
||||
- Body: `{ resource: { participants: [ { type: "channel", id: $CHANNEL_ID, company_id: $COMPANY_ID, workspace_id: $WORKSPACE_ID, }, ], }, options: { $MESSAGE }, }`
|
||||
- This POST request will return a [ThreadObject](../../internal-documentation/backend-services/messages/database-model.md)
|
||||
|
||||
### 2. Send message as a Thread answer
|
||||
|
||||
- Find the app's token according to [1. Log your Application](authenticate-postman.md#1.-log-your-application)
|
||||
- Find the identifiers to target a channel:
|
||||
- Company's _id: $COMPANY_ID_
|
||||
- Workspace's \_id: $WOKSPACE\_\_ID
|
||||
- Channel's _id: $CHANNEL_ID_
|
||||
- _Thread's id: $THREAD_Id_
|
||||
- _Set the message you want to send:_
|
||||
|
||||
- _Minimal:_ 
|
||||
|
||||
_$MESSAGE = { "text": "Hello world !" }_
|
||||
|
||||
- _To take full advantage of the messages capability in Twake see the_ [_MessageObject_](../../internal-documentation/backend-services/messages/database-model.md)\_\_
|
||||
|
||||
- Send POST request with : 
|
||||
- Url: https://web.twake.app/api/messages/v1/companies/$COMPANY_ID/threads/$THREAD\__ID
|
||||
- Headers: `{ "Content-Type": "application/json",` Authorization: "`Bearer " + $APP_TOKEN }`
|
||||
- Body: `{ resource: { $MESSAGE } }`
|
||||
- This POST request will return a [MessageObject](../../internal-documentation/backend-services/messages/database-model.md)
|
||||
|
||||
### 3. Applications can send customized messages 
|
||||
|
||||
The [MessageObject](../../internal-documentation/backend-services/messages/database-model.md) object have a property called "block" that allow your application to send messages which contains more than a simple string. For example in an application message you can display an iFrame, buttons, menu selector, etc... Combining all this options you can create everything you want up to the limit of your imagination. To understand how to create powerful message using the block property see [blocks](../blocks.md).
|
||||
@@ -1,41 +0,0 @@
|
||||
---
|
||||
description: Trigger action from command
|
||||
---
|
||||
|
||||
# Trigger action from command
|
||||
|
||||
## Introduction: <a href="#introduction" id="introduction"></a>
|
||||
|
||||
This guide will introduce you to trigger action from your application using command
|
||||
|
||||
## Prerequisites: <a href="#prerequisites" id="prerequisites"></a>
|
||||
|
||||
* You have already created a Twake application.
|
||||
* Your application is installed and saved in your company.
|
||||
|
||||
## Steps: <a href="#steps" id="steps"></a>
|
||||
|
||||
### 1. Let your application listen to command
|
||||
|
||||
* Go in your app developer's setting: 
|
||||
* Click on your username in the top left corner
|
||||
* Go to workspace settings 
|
||||
* Go to integrations 
|
||||
* Click on the three-dot next to your application
|
||||
* Open developper setting 
|
||||
* Click on display 
|
||||
* You will find and editable object containing a twake object
|
||||
* Add a new property commands in this object like this:
|
||||
|
||||
* `"commands" : [{"command": string, "descritpion": string }]`
|
||||
* The first property of commands is command that let you define a name for your command, by default the command name is the name of your application. 
|
||||
* The second property of command is description that let you describe the way to use the command you want to define.
|
||||
|
||||
|
||||
|
||||
### 2. Use your command in a channel
|
||||
|
||||
* In the message editor write /command 
|
||||
* A popup displaying the description on how to use the command related to your application should open.
|
||||
|
||||
__
|
||||
@@ -1,36 +0,0 @@
|
||||
---
|
||||
description: >-
|
||||
Welcome to the developers API home, here you can create apps, plugins and
|
||||
connectors for Twake.
|
||||
---
|
||||
|
||||
# 🏠 Home
|
||||
|
||||
## Introduction:
|
||||
|
||||
Twake offer the possibility to uses a lot of application to increase the quality of your team workflow. You can now easily send a Gif to add conviviality into your channels, start Jitsi calls in one click, create polls or even get notified in your channels using webhooks or automation as powerful as n8n allows.
|
||||
|
||||
|
||||
|
||||
## Ready to use integration:
|
||||
|
||||
Twake have some integrations ready to use that are just waiting for you to be installed in your workspaces. You can find in the list below these integrations:
|
||||
|
||||
* Jitsi: [https://github.com/linagora/Twake-Plugins-Jitsi](https://github.com/linagora/Twake-Plugins-Jitsi)
|
||||
* Giphy: [https://github.com/linagora/Twake-Plugins-Giphy](https://github.com/linagora/Twake-Plugins-Giphy)
|
||||
* SimplePoll: [https://github.com/linagora/Twake-Plugins-SimplePoll](https://github.com/linagora/Twake-Plugins-SimplePoll)
|
||||
* Webhoocks: [https://github.com/linagora/Twake-Plugins-Webhooks](https://github.com/linagora/Twake-Plugins-Webhooks)
|
||||
* N8n: [https://github.com/linagora/Twake-Plugins-n8n](https://github.com/linagora/Twake-Plugins-n8n)
|
||||
|
||||
## Imagination is your limit 
|
||||
|
||||
By installing webhooks or n8n in your workspace, you can now imagine infinite uses cases to increase the quality of your team workflow. Connect your channels to get notify of new code changes when pushing on github or to get notify in a n8n workflow. 
|
||||
|
||||
If you think that you can't do something with integration, as Twake is open source, feel free to contribute to an existing Twake's integration or even more create the new integration that answer to your need.  
|
||||
|
||||
|
||||
|
||||
> Please do not work on this list of plugins as we already made them (their are just not yet open-sourced)\
|
||||
> Zapier, IFTTT, OnlyOffice, RSS feed, Github, Gitlab and Reminder.
|
||||
|
||||
🤗 We are not yet ready for this documentation, up this issue to have it sooner : [https://github.com/TwakeApp/Twake/issues/116](https://github.com/TwakeApp/Twake/issues/116)
|
||||
@@ -1,70 +0,0 @@
|
||||
---
|
||||
description: >-
|
||||
Welcome to the internal documentation section. This chapter is for developers
|
||||
working in Twake team or wanting to participate in the project.
|
||||
---
|
||||
|
||||
# 🥇 Get started
|
||||
|
||||
> If you are looking for the Developers API of Twake to make plugins, apps or connectors, go here : [Developers API](../developers-api/home.md)
|
||||
|
||||
## Before to start
|
||||
|
||||
- Fork our repo [https://github.com/TwakeApp/Twake](https://github.com/TwakeApp/Twake) and checkout the **develop** branch
|
||||
|
||||
::: info
|
||||
You want to fix a translation issue? We use Weblate: [https://hosted.weblate.org/projects/linagora/twake-chat-web/](https://hosted.weblate.org/projects/linagora/twake-chat-web/)
|
||||
:::
|
||||
|
||||
## Run the backend (+ database)
|
||||
|
||||
1. Go to "twake/"
|
||||
2. `docker-compose -f docker-compose.dev.mongo.yml up -d`
|
||||
3. The backend will be running on port 3000
|
||||
|
||||
## Run the frontend
|
||||
|
||||
1. Go to "twake/frontend"
|
||||
2. Run `yarn install` (better to use **yarn** than **npm**), our developers uses node 14 and 16, it should work with any upper version.
|
||||
3. Prepare the **environment.ts** file like this: `cp environment/environment.ts.dist.dev environment/environment.ts`
|
||||
|
||||
```
|
||||
export default {
|
||||
env_dev: true,
|
||||
front_root_url: 'http://localhost:3001',
|
||||
api_root_url: 'http://localhost:3000',
|
||||
websocket_url: 'ws://localhost:3000'
|
||||
};
|
||||
```
|
||||
|
||||
5\. Run `yarn start`
|
||||
|
||||
6\. It will propose to run on another port, say "yes" to run it on port 3001.
|
||||
|
||||
## Test and start develop
|
||||
|
||||
You should be able to go on localhost port 3001 just click on "create an account" and you'll be able to access Twake after a few steps.
|
||||
|
||||
\-> Logs from backend can be accessed from `docker-compose -f docker-compose.dev.mongo.yml logs -f --tail 100`
|
||||
|
||||
\-> Logs from frontend are visible in the output of `yarn start`
|
||||
|
||||
You can start writing code 🎉 ! It will reload the backend / frontend automatically each time you save.
|
||||
|
||||
::: danger
|
||||
Before to start implementing a new feature or bug fix, please find or create an issue on our repository (here [https://github.com/linagora/Twake/issues](https://github.com/linagora/Twake/issues)) and put a comment to inform that you will work yourself on the issue. To avoid two same people doing the same work ;)
|
||||
:::
|
||||
|
||||
::: info
|
||||
If you have any issue, please come and join us on [https://community.twake.app/](https://community.twake.app)
|
||||
:::
|
||||
|
||||
## Propose an improvement to be merged
|
||||
|
||||
For this you need to create a merge request on Github from your fork to our develop branch. Goes there: [https://github.com/linagora/Twake/compare](https://github.com/linagora/Twake/compare) and click "compare across forks".
|
||||
|
||||
Tests will be ran automatically and should pass before to merge the code.
|
||||
|
||||
::: info
|
||||
We are hiring! Apply now on [https://job.linagora.com/en/join-us/](https://job.linagora.com/en/join-us/)
|
||||
:::
|
||||
@@ -1,15 +0,0 @@
|
||||
---
|
||||
description: How to download Twake
|
||||
---
|
||||
|
||||
# ⬇️ Download desktop and mobile apps
|
||||
|
||||
## Desktop
|
||||
|
||||
You can download Twake for Mac, Windows, Linux here: [https://twake.app/download](https://twake.app/download)
|
||||
|
||||
Click on the version according your OS, and click on "download" to get the desktop application.
|
||||
|
||||
## Mobile
|
||||
|
||||
iOS, Android is also available from Google Play Store and the App Store.
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
description: Discover Twake application
|
||||
---
|
||||
|
||||
# 💠 Applications
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
description: How to use Twake calendar
|
||||
---
|
||||
|
||||
# 📆 Calendar
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
description: How to add connector on Twake
|
||||
---
|
||||
|
||||
# 🔃 Connectors
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
---
|
||||
description: Did you ever dreamed to use Twake and n8n together ?
|
||||
---
|
||||
|
||||
# n8n
|
||||
|
||||
## How to connect Twake with n8n
|
||||
|
||||
n8n is a powerful workflow automation tool wich can be self hosted : [n8n.io](https://n8n.io)
|
||||
|
||||

|
||||
|
||||
### Install n8n in Twake
|
||||
|
||||
Install your n8n application in your workspace and get your key :
|
||||
|
||||

|
||||
|
||||
### Create your credential on n8n
|
||||
|
||||

|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
description: How you can use the drive on Twake
|
||||
---
|
||||
|
||||
# 📂 Drive
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
---
|
||||
description: How you can create file & folder on Twake
|
||||
---
|
||||
|
||||
# File and folder
|
||||
|
||||
##
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
---
|
||||
description: How you can share your files with a public link
|
||||
---
|
||||
|
||||
# Share file with public link
|
||||
|
||||
In Twake, you can share your folders or files to external user. You juste have to create a public link on what you want to share and send the link. Your partner will access to these elements without creating a Twake account.
|
||||
|
||||
### Create a public link
|
||||
|
||||
Click on "public access" of what you want to share and "create an access link".
|
||||
|
||||

|
||||
|
||||
###
|
||||
|
||||
### Remove a public link
|
||||
|
||||
If you want to remove the public link, select folder you want to unlink, then, "Public access" and "Suppress the link"
|
||||
|
||||

|
||||
@@ -1,11 +0,0 @@
|
||||
---
|
||||
description: How Twake chat is working
|
||||
---
|
||||
|
||||
# 💬 Chat
|
||||
|
||||
The discussion application are Twake's entry points. This is where you communicate with your team.
|
||||
|
||||
[channels](channels.md)
|
||||
|
||||
[message](message.md)
|
||||
@@ -1,51 +0,0 @@
|
||||
---
|
||||
description: Discover how channels are used on Twake
|
||||
---
|
||||
|
||||
# Channels
|
||||
|
||||
## Create a channel
|
||||
|
||||
To create a channel, you must have `Administrator` rights for the workspace in question.
|
||||
|
||||
[rights](../../company-and-workspace/rights.md)
|
||||
|
||||
To create your channel, click on the `+` button right to the "Channel" inscription. Fill a name for your channel, select a wonderful emoji and select if it is a public or private channel \(by default, channels are private\).
|
||||
|
||||
## Channel sections
|
||||
|
||||
You can organize your channel by grouping them. If you are `Administrator`, you can drag a channel and drop in the section you want `Add here` or in `New group`.
|
||||
|
||||
To edit section name, you just have to click on it, change the name and press `Enter`
|
||||
|
||||

|
||||
|
||||
## Public channel
|
||||
|
||||
Public channels are visible to all members of the workspace.
|
||||
|
||||
## Private channel
|
||||
|
||||
Private channels are channels accessible only to a limited number of users. Members not present in these channels cannot see them.
|
||||
|
||||
### Modify the members of a private channel
|
||||
|
||||
You can choose the members of a private channel when creating it. To modify the members of a private channel once created, place your mouse on the channel, click on the `...` then on `Edit channel`, in the `Participants` box, you can add or remove the members of the channel.
|
||||
|
||||

|
||||
|
||||
## External member
|
||||
|
||||
You have the possibility to invite external members to your channel. External members are members who are not in the workspace and who are added to one, or more, specific channel\(s\).
|
||||
|
||||
This feature is useful for inviting users who are not in your company. Freelancers, for example, can be added to a specific channel to collaborate on a project. They will only have access to this channel, they will not see public channels.
|
||||
|
||||

|
||||
|
||||
## Mute a channel
|
||||
|
||||
You can mute a channel so that you do not receive notification of it. You will not receive a new notification from that channel unless you are mentioned \(with @username\). To do it, click on `...` and `Mute`a barred bell icon will appear.
|
||||
|
||||
## Star a channel
|
||||
|
||||
If a channel is very important for you, you can star it. Stared channels are gathered at the top of your channel. It is only for your view, not for everyone. To star a channel click on `...` and `Star this channel`. Your channel will be move to the stared channel section \(at the top\).
|
||||
@@ -1,59 +0,0 @@
|
||||
---
|
||||
description: Send message on Twake
|
||||
---
|
||||
|
||||
# Message
|
||||
|
||||
## Send a message
|
||||
|
||||
To send a message, select the channel where you want to post. In the input message, write what you want to send. Press `enter` to send the message.
|
||||
|
||||
If you want to add a new line to your message, press `Shift + Enter`.
|
||||
|
||||

|
||||
|
||||
#### Pin
|
||||
|
||||
If one of the message is important for the team, you can pin it \(or unpin\)
|
||||
|
||||

|
||||
|
||||
#### Reaction
|
||||
|
||||
You can react to a message with emoji. Click on the `Emoji button` in message to show emoji picker.
|
||||
|
||||
### Response to a message
|
||||
|
||||
Someone ask you a question ? You can answer it by clicking `Answer` below the message.
|
||||
|
||||

|
||||
|
||||
### Reorganize your chat
|
||||
|
||||
You can reorganize your chat by dragging and dropping your messages.
|
||||
|
||||

|
||||
|
||||
###
|
||||
|
||||
### See thread message
|
||||
|
||||
You can see a thread in a specific view. Hover over in one, the button `Show on the right` . A side panel opens.
|
||||
|
||||
## Integration
|
||||
|
||||
### Gif
|
||||
|
||||
You can send gif in your channel. Just clic gif icon to open a gif selector.
|
||||
|
||||
.gif>)
|
||||
|
||||
### Call
|
||||
|
||||
If you need to call your team, there is native integration with Jitsi. Just click on the green button with the phone and a menu opens on the left to create a Jitsi call. Once the information is filled in, the call link is sent to your team.
|
||||
|
||||
## Send document
|
||||
|
||||
If you want to send a document through the chat, drag it from your computer and drop it into the chat. It will be uploaded and shared with your teammates.
|
||||
|
||||
You can also send a document from Twake drive: click on the `+` button, to the left of the input. You can select a file from Twake and share it in the chat room.
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
description: How to use Twake task
|
||||
---
|
||||
|
||||
# ✅ Tasks
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
---
|
||||
description: How company and workspace work on Twake
|
||||
---
|
||||
|
||||
# 🏢 Company & workspace
|
||||
|
||||
## Company
|
||||
|
||||
Companies are the largest entities on Twake. They represent your virtual business. You will find all your employees and connectors that you have developed internally. Inside your company is your workspaces.
|
||||
|
||||
You can switch from one company to an other by clicking on the left bottom button :
|
||||
|
||||

|
||||
|
||||
## Workspace
|
||||
|
||||
Workspaces represent the teams or departments in your company. Each workspace has its members, discussions, files, tasks, and calendar. It's your team's sharing space.
|
||||
@@ -1,15 +0,0 @@
|
||||
---
|
||||
description: Invite user from Twake
|
||||
---
|
||||
|
||||
# Invite user from Chat
|
||||
|
||||
You can invite user in your workspace.
|
||||
|
||||
Open the menu, and click on `Collaborators` > `Add colleagues`. Enter emails of your colleagues \(separated with coma\) and validate.
|
||||
|
||||

|
||||
|
||||
You can also invite users from the console :
|
||||
|
||||
[users](../console/users.md)
|
||||
@@ -1,70 +0,0 @@
|
||||
---
|
||||
description: How rights are managed on Twake
|
||||
---
|
||||
|
||||
# Rights
|
||||
|
||||
Twake has several levels of rights. Users belong to one or more workspaces within the company. They can have different statuses inherent to their membership to the company or workspace
|
||||
|
||||
## Owner
|
||||
|
||||
He's the main administrator of the whole company. He can:
|
||||
|
||||
- Allow connectors and applications to be installed in workspaces
|
||||
- Change the corporate identity
|
||||
- Giving/withdrawing the right "Owner of the company" to a member of the company
|
||||
|
||||
The creator of the company is the only owner. You can not change this role. Only the creator can be owner of the company.
|
||||
|
||||
## Admin
|
||||
|
||||
An admin has the same right than the owner. He can:
|
||||
|
||||
- Allow connectors and applications to be installed in workspaces
|
||||
- Change the corporate identity
|
||||
- Giving/withdrawing the right "Owner of the company" to a member of the company
|
||||
|
||||
The creator of the company is the only owner. You can not change this role. Only the creator can be owner of the company.
|
||||
|
||||
To grant the admin right, open the console \([https://console.twake.app](https://console.twake.app)\). Open `Users` section and `Edit` the member you want to set admin. Update the Role with `Admin` and save.
|
||||
|
||||

|
||||
|
||||
## Workspace administrator
|
||||
|
||||
He's the team administrator. He has the same rights as a user. In addition, he can:
|
||||
|
||||
- Add/remove connectors and applications in the workspace
|
||||
- Changing the identity of the workspace
|
||||
- Adding members to the workspace
|
||||
- Delete workspace
|
||||
|
||||
By default, the creator of the workspace is the administrator. This right can be cumulated with that of a company administrator.
|
||||
|
||||
To grant the workspace level, open your workspace collaborators page, and select `Administrator`
|
||||
|
||||

|
||||
|
||||
## User
|
||||
|
||||
The "user" right is the default right of a member in a workspace. It can :
|
||||
|
||||
- Read and send messages to public and private chat channels \(to which he has been invited\)
|
||||
- Create, modify, delete documents from the drive
|
||||
- Create, edit, delete events and calendars
|
||||
- Create, modify, delete tables and tasks Invite users to the workspace
|
||||
- Create a workspace within the company
|
||||
|
||||
It's a default right. If the collaborator is not Company or Workspace administrator and he is not a Guest user, he is a simple User
|
||||
|
||||
## Guest
|
||||
|
||||
This status is intended for external partners working on a specific topic with the team. Guest user can :
|
||||
|
||||
- Talk in the channel where they are invited
|
||||
|
||||
They can not join by themself any channel \(even public\). They need to be invited by a normal user.
|
||||
|
||||
To set the Guest level, open the console \([https://console.twake.app](https://console.twake.app)\) and the users page. Set the user's role to "Guest".
|
||||
|
||||

|
||||
@@ -1,12 +0,0 @@
|
||||
---
|
||||
description: How to use the Twake console
|
||||
---
|
||||
|
||||
# 🧰 Console
|
||||
|
||||
The console is where you can manage your company and all information shared on Twake, LinShare and more.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
---
|
||||
description: How users are managed in the Twake console
|
||||
---
|
||||
|
||||
# Users
|
||||
|
||||
As user admin, you have access to the user management page.
|
||||
|
||||
Open the console : [https://console.twake.app/](https://console.twake.app/) and open the page "Users".
|
||||
|
||||

|
||||
|
||||
## Add a user
|
||||
|
||||
To work with your colleagues in your company, you have 2 choices :
|
||||
|
||||
- Create user account
|
||||
- Invite them by email
|
||||
|
||||
You can also invite users from the chat :
|
||||
|
||||
[invite-user-from-chat](../company-and-workspace/invite-user-from-chat.md)
|
||||
|
||||
### Send email invitation
|
||||
|
||||
To send an invitation, you can click on `Add user` > `Invite users`.Enter emails you want to invite separated with coma. After validation, an email is sent to this address. Your colleagues will have a link to signup and join your company.
|
||||
|
||||

|
||||
|
||||
### Create user account
|
||||
|
||||
You can create directly accounts for your colleagues. For that, click on `Add user` > `Create account`. After giving email, name and Role, you can specify a password \(or generate a random one\). You just have to send credentials to your teammate.
|
||||
|
||||

|
||||
|
||||
## Manage user
|
||||
@@ -1,32 +0,0 @@
|
||||
---
|
||||
description: "Yes, we have desktop and mobile apps !"
|
||||
---
|
||||
|
||||
# 🖥 Desktop and mobile app
|
||||
|
||||
## Desktop
|
||||
|
||||
You can download Twake for Mac, Windows, Linux here: [https://github.com/linagora/Twake-Desktop/tree/master/download](https://github.com/linagora/Twake-Desktop/tree/master/download)
|
||||
|
||||
Click on the version according your OS, and click on "download" to get the desktop application.
|
||||
|
||||
-(1).png>)
|
||||
|
||||
### Switch to on-premise servers
|
||||
|
||||
On the desktop app, you can use the following options to change your server:
|
||||
|
||||
• On MacOS, click on Help > Change Twake Server
|
||||
• On Windows, MacOS and Linux, use the shortcut CTRL+ALT+SHIFT+S or CMD+ALT+SHIFT+S
|
||||
|
||||
## Mobile App
|
||||
|
||||
The mobile app is available on iOS App Store and Android Play Store.
|
||||
|
||||
### Switch to on-premise servers
|
||||
|
||||
On the mobile app, just log out and you should be able to change the server from the bottom left login page link "Change Server".
|
||||
|
||||
#### Push notifications on the on-premise mobile app
|
||||
|
||||
This feature is not yet available, say you want this feature using a "thumbs up" emoji here: [https://github.com/TwakeApp/Twake/issues/130](https://github.com/TwakeApp/Twake/issues/130)
|
||||
@@ -1,102 +0,0 @@
|
||||
# 🔒 Privacy
|
||||
|
||||
You will find everything related to privacy in this document [https://twake.app/en/privacy/](https://twake.app/en/privacy/).
|
||||
|
||||
At Twake we are committed to protecting your privacy. We implemented specific security features to ensure that your data is safe and secure.
|
||||
|
||||
## General presentation of Twake
|
||||
|
||||
Twake is available in two main versions :
|
||||
|
||||
- SaaS : Twake as a service (SaaS available on twake.app)
|
||||
- On-Premise : Twake on-premise (on private servers or on dedicated servers managed by
|
||||
Twake)
|
||||
|
||||
The Twake SaaS version is hosted in France by a French infrastructure provider. All servers are located in Paris (UE).
|
||||
|
||||
The Twake On-Premise version can be deployed on any local server and can work fully disconnected from the Internet or with an unique and unidirectional connection to twake.app for licencing management, mailing and iOS and Android push notifications (that are not available without additional configuration in fully disconnected mode).
|
||||
|
||||
On SaaS version, Twake provide two main tiers softwares :
|
||||
|
||||
- ONLYOFFICE spreadsheet, ONLYOFFICE document and ONLYOFFICE presentation, https://
|
||||
onlyoffice.com
|
||||
- Jitsi video-conferencing, https://jitsi.org/
|
||||
|
||||
On the On-Premise version those softwares are optionals.
|
||||
|
||||
## Quick FAQ about Twake security
|
||||
|
||||
#### Where are your servers ?
|
||||
|
||||
Twake servers are all in France, in Paris.
|
||||
|
||||
#### Are you GRPD compliant ?
|
||||
|
||||
Yes ! As you can see in this document, we do everything we can do to protect your personal and professional data. Concerning your password and personal data specifically, passwords are hashed using PBKDF2, your data is encrypted before to be sent to the database (encryption at rest on the application layer) and we use TLS.0 for communications (encryption on transit). Moreover, we do not require any personal data in order for you to use our software, you can use Twake without disclosing personal information.
|
||||
|
||||
#### What protocol do you use ?
|
||||
|
||||
We use HTTPS for unidirectional traffic encryption and WSS for bidirectional realtime traffic encryption. Passwords are hashed with PBKDF2. Files are encrypted with OpenSSL AES-256-CBC with a key composed of three parts stored in database, in code and in the server configuration. Finally our database data is encrypted with OpenSSL AES-256-CBC. In order to always improve our security, next version of Twake will include full end-to-end encryption for direct and private channels using the Matrix protocol.
|
||||
|
||||
#### How do you manage backups ?
|
||||
|
||||
We backup our encrypted database and your encrypted documents in a replicated Object Storage. We keep a backup of each month and a backup of each of the last seven days.
|
||||
|
||||
#### What if I want to export all my data ?
|
||||
|
||||
We do not provide an export feature on the software itself. But we have the ability to export your data on-demand, please contact us for more information.
|
||||
|
||||
#### Can I delete my account and erase my data ?
|
||||
|
||||
Yes, you can delete your account and erase your data. To proceed, open your account from the "console" and click on "Delete my account". You will be asked to confirm your choice. Once your account is deleted, you will not be able to access it anymore.
|
||||
|
||||
#### How do you manage security with tiers applications and modules ?
|
||||
|
||||
We cannot guarantee the security of the data you send to tiers applications and modules. If you work with an external app like Zapier or Giphy, they will have access to some of your information. You can see the access scope of an application before to add it to your company.
|
||||
|
||||
## High availability
|
||||
|
||||
Twake is built on scalable technologies and allow us to scale to million users but also to be fault tolerant. We define two kind of replication, hardware replication and software replication:
|
||||
|
||||
Hardware replication in case of hard disk crash or network issue is managed by our infrastructure provider, you will find more details on how they manage this following these links:
|
||||
|
||||
- Servers: https://www.ovhcloud.com/en/public-cloud/
|
||||
- Object storage and backups: https://www.ovhcloud.com/en/public-cloud/object-storage/
|
||||
|
||||
Software replication is done by ourself. Each middleware and nodes used by Twake are replicated at least three time. In the rare case of node failure, our system automatically alerts us and start using the remaining available node until we operate and fix the broken one.
|
||||
|
||||
## Application encryption
|
||||
|
||||
Data are stored encrypted in ScyllaDB and searchable entities will be stored in Elastic Search.
|
||||
|
||||
#### ScyllaDB
|
||||
|
||||
Any data (except non-sensible data like identifiers, dates and counters) stored in ScyllaDB is encrypted using OpenSSL AES-256-CBC before being sent to the database.
|
||||
|
||||
#### Indexed search storage
|
||||
|
||||
We provide advanced search features to our product Twake using Elastic Search to index our entities. Entities are not stored in Elastic Search and only indexes will be available if Twake Elastic Search servers are compromised.
|
||||
|
||||
## Other
|
||||
|
||||
#### Random token generation
|
||||
|
||||
For random generation we use the PHP built-in random_bytes function with bin2hex if needed on PHP side and the crypto library with randomBytes from NodeJS and frontend side.
|
||||
|
||||
#### Passwords storage and authentication
|
||||
|
||||
Passwords are not stored in clear, only a hash of it is stored in database. We use the hash_pbkdf2 method with a randomly generated salt for each user.
|
||||
|
||||
#### SQL Injection
|
||||
|
||||
Each database access use Doctrine ORM sanitisation before write or reads, we never use custom access to the database to reduce risks of injection. We developed a middleware to use ScyllaDB databases but this middleware works after Doctrine ORM sanitisation.
|
||||
On NodeJS, we also implemented an ORM for all database access in order to keep this level of security.
|
||||
|
||||
#### XSS
|
||||
|
||||
We use React as front-end framework and we never execute tiers Javascript. External apps are loaded in webviews or iframes and use a bridge designed like a router for data exchange between frames.
|
||||
|
||||
## Continuous security checks
|
||||
|
||||
- We use Snyk to ensure that our dependencies are up to date and secure.
|
||||
- We are active on huntr.dev to ensure that we fix all security issues reported by the community.
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
description: Discover how to use Twake
|
||||
---
|
||||
|
||||
# 👋 Welcome to Twake !
|
||||
|
||||
Twake is an open source collaborative workspace. It can be self-hosted, used is saas and easily integrated into your teams. Twake offers all the features for collaboration : team chat, file storage, team calendar, tasks manager.
|
||||
|
||||
In this chapter, you'll find how to use Twake.
|
||||
|
||||
@@ -1,45 +1,15 @@
|
||||
# ☀️ Welcome to Twake
|
||||
# ☀️ Welcome to TDrive
|
||||
|
||||
Twake is an open source collaborative workspace. It can be self-hosted, used is saas and easily integrated into your teams. Twake offers all the features for collaboration : team chat, file storage, team calendar, tasks manager.
|
||||
TDrive is an open source collaborative drive. It can be self-hosted, used is saas and easily integrated into your teams. TDrive offers all the features for collaboration : team chat, file storage, team calendar, tasks manager.
|
||||
|
||||
This **documentation** assists developers and users in having the best Twake experience as possible. We’ve developed Twake to have a better teamwork.
|
||||
This **documentation** assists developers and users in having the best TDrive experience as possible. We’ve developed TDrive to have a better teamwork.
|
||||
|
||||
---
|
||||
|
||||
# 🌎 Use Twake on twake.app
|
||||
#### Start using TDrive now
|
||||
|
||||
#### Start using Twake now
|
||||
Install it on your own server: [click here](onprem/installation.md)).
|
||||
|
||||
To use Twake online it is simple, just go on [twake.app](https://twake.app) and click "Sign up".
|
||||
#### Add plugins like OnlyOffice
|
||||
|
||||
> Want to install it on your own server ? [It is here](onprem/installation.md)).
|
||||
|
||||
#### Now, you can learn how to become a Twake super-user
|
||||
|
||||
> Learn how to become a power user of Twake: [welcome.md](./how-to-use-it/welcome.md)
|
||||
|
||||
> If you want to see the latest updates you can go here: [https://github.com/linagora/Twake/blob/main/changelog.md](https://github.com/linagora/Twake/blob/canary/changelog.md)
|
||||
|
||||
## Use the canary version to try out new features
|
||||
|
||||
You want to try the latest features from Twake before they come out to production? You can!
|
||||
|
||||
We have a server called Canary that will give you access to new features 1 month before their official releases. This server is compatible with the classic server so it means you can still discuss with your team even if you are the only one using the canary server.
|
||||
|
||||
The goal of the canary server it to do additional testing with a larger set of users, so if you encounter any issue, please notify us to help us fix the version before to ship it on production.
|
||||
|
||||
When using the canary server, the best is to set it up on all your devices like so:
|
||||
|
||||
#### How to use it on my browser
|
||||
|
||||
Just go to [canary.twake.app](https://canary.twake.app) instead of web.twake.app.
|
||||
|
||||
#### How to use it on the desktop app
|
||||
|
||||
Press Shift+Alt+Command or Shift+Ctrl+Alt to open the "Change server url" popup then enters [https://canary.twake.app](https://canary.twake.app) in the input then press OK.
|
||||
|
||||
#### How to use it on the mobile app
|
||||
|
||||
Logout from the mobile app, click on Change server and put [https://canary.twake.app](https://canary.twake.app) then login.
|
||||
|
||||
> If you want to see the latest updates on the **canary** server you can go here: [https://github.com/linagora/Twake/blob/canary/changelog.md](https://github.com/linagora/Twake/blob/canary/changelog.md)
|
||||
[click here](plugins.md)).
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
description: >-
|
||||
This page will document all the services implemented in the new NodeJS
|
||||
backend. For all the PHP services not yet migrated, please ask us directly on
|
||||
https://community.twake.app/
|
||||
https://community.tdrive.app/
|
||||
---
|
||||
|
||||
# 🧱 Backend and APIs
|
||||
|
||||
## Twake Services
|
||||
## TDrive Services
|
||||
|
||||
As a frontend developer / connector developer to read our APIs, or to understand our data models or just for fun, here is all the details over Twake backend services.
|
||||
As a frontend developer / connector developer to read our APIs, or to understand our data models or just for fun, here is all the details over TDrive backend services.
|
||||
|
||||
If document are empty, check out our Notion documentation: [https://www.notion.so/twake/Backend-documentation-e219323593d2401c9887d0e11b2a597b](https://www.notion.so/twake/Backend-documentation-e219323593d2401c9887d0e11b2a597b)
|
||||
If document are empty, check out our Notion documentation: [https://www.notion.so/tdrive/Backend-documentation-e219323593d2401c9887d0e11b2a597b](https://www.notion.so/tdrive/Backend-documentation-e219323593d2401c9887d0e11b2a597b)
|
||||
|
||||
### Services
|
||||
|
||||
@@ -25,12 +25,12 @@ If document are empty, check out our Notion documentation: [https://www.notion.s
|
||||
|
||||
[notifications/](notifications/README.md))
|
||||
|
||||
## Get started to code in Twake
|
||||
## Get started to code in TDrive
|
||||
|
||||
Want to edit Twake code ? Congratulation ! You participate in the development of a great product 😃
|
||||
Want to edit TDrive code ? Congratulation ! You participate in the development of a great product 😃
|
||||
|
||||
[start-working-into-a-service](intro/start-working-into-a-service.md)
|
||||
|
||||
[create-a-new-twake-service](intro/create-a-new-twake-service.md)
|
||||
[create-a-new-tdrive-service](intro/create-a-new-tdrive-service.md)
|
||||
|
||||
[intro/platform/](intro/platform/README.md))
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
---
|
||||
description: How applications are managed in Twake backend
|
||||
description: How applications are managed in TDrive backend
|
||||
---
|
||||
|
||||
# 🍎 Applications
|
||||
|
||||
#### Description
|
||||
|
||||
**Applications** is everything related to connectors in Twake.
|
||||
**Applications** is everything related to connectors in TDrive.
|
||||
|
||||
An application is described by an identity sheet containing this information:
|
||||
|
||||
- **Identity** \(name, description, logo\)
|
||||
- **API** **preferences** \(Twake→Connector events endpoint, API id and secret, and Connector→Twake allowed IPs\)
|
||||
- **API** **preferences** \(TDrive→Connector events endpoint, API id and secret, and Connector→TDrive allowed IPs\)
|
||||
- **Privileges and capabilities** \(List of things the connector can read and can write\)
|
||||
- **Display information** \(Where the connector is visible, button in chat, configuration in application list etc\)
|
||||
|
||||
|
||||
+8
-10
@@ -5,7 +5,7 @@ description: Application models for backend
|
||||
# Database models
|
||||
|
||||
**applications**\
|
||||
****Represent an application in the database
|
||||
\*\*\*\*Represent an application in the database
|
||||
|
||||
```javascript
|
||||
{
|
||||
@@ -27,7 +27,7 @@ type ApplicationIdentity = {
|
||||
description: string;
|
||||
website: string;
|
||||
categories: string[];
|
||||
compatibility: "twake"[];
|
||||
compatibility: "tdrive"[];
|
||||
};
|
||||
|
||||
type ApplicationPublication = {
|
||||
@@ -53,7 +53,7 @@ type ApplicationAccess = {
|
||||
};
|
||||
|
||||
type ApplicationDisplay = {
|
||||
twake: {
|
||||
tdrive: {
|
||||
"version": 1,
|
||||
|
||||
"files" : {
|
||||
@@ -74,7 +74,7 @@ type ApplicationDisplay = {
|
||||
//Chat plugin
|
||||
"chat": {
|
||||
"input": {
|
||||
"icon": "", //If defined replace original icon url of your app
|
||||
"icon": "", //If defined replace original icon url of your app
|
||||
"type": "file" | "call" //To add in existing apps folder / default icon
|
||||
},
|
||||
"commands": [
|
||||
@@ -113,18 +113,16 @@ type ApplicationDisplay = {
|
||||
};
|
||||
```
|
||||
|
||||
|
||||
|
||||
**company\_application**\
|
||||
****Represent an application in a company
|
||||
**company_application**\
|
||||
\*\*\*\*Represent an application in a company
|
||||
|
||||
```javascript
|
||||
{
|
||||
"company_id": uuid;
|
||||
"application_id": uuid;
|
||||
"id": uuid;
|
||||
|
||||
|
||||
"created_at": number;
|
||||
"created_by": string; //Will be the default delegated user when doing actions on Twake
|
||||
"created_by": string; //Will be the default delegated user when doing actions on TDrive
|
||||
}
|
||||
```
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
---
|
||||
description: >-
|
||||
Channels are topics in Twake, users can subscribe to them, can make them
|
||||
private or can create them.
|
||||
---
|
||||
|
||||
# 🎩 Channels and tabs
|
||||
|
||||
### Wording
|
||||
|
||||
**Member:** member in company without the tag "guest"
|
||||
**Guest:** company member with the tag "guest"
|
||||
**Channel member:** member in the channel
|
||||
**Channels types:
|
||||
→ Private:** Relative to a workspace but restricted to a defined group of members
|
||||
**→ Public:** Relative to a workspace anyone can find the channel and join
|
||||
**→ Direct:** Relative to a company, a discussion between a set of members but without defined topic
|
||||
|
||||
**To understand the routing** please read **"**Collections based rest api:" in "Wording and formating"
|
||||
|
||||
TODO [Wording and formatting](https://www.notion.so/Wording-and-formatting-24ef27e094a042aea4899ac6a8039dee)
|
||||
|
||||
### What it does
|
||||
|
||||
Channel component is **not** responsible of the red badge counter \(notification service is\).
|
||||
|
||||
Channel component **is** responsible of keeping track of the message from where the user need to start reading but can be override by notification service if there is a mention to start reading from.
|
||||
|
||||
TODO [Some process details and constant s](https://www.notion.so/Some-process-details-and-constant-s-fb5b2d4974da490aa87bb87082af8454)
|
||||
|
||||
### Models an APIs
|
||||
|
||||
[Database models](database-models.md)
|
||||
|
||||
TODO [REST Api / Websockets Api](https://www.notion.so/REST-Api-Websockets-Api-458b153a6a6e46c2925dfc1db3859d3b)
|
||||
|
||||
TODO [In/Out microservice](https://www.notion.so/In-Out-microservice-e721e72e542244a69ca3a913e0b405ad)
|
||||
|
||||
TODO [Activity models](https://www.notion.so/Activity-models-0fa3acb0a13f41fd98bc98709908eedf)
|
||||
|
||||
-152
@@ -1,152 +0,0 @@
|
||||
---
|
||||
description: Database models of channel
|
||||
---
|
||||
|
||||
# Database models
|
||||
|
||||
## Channels
|
||||
|
||||
#### **channels**
|
||||
|
||||
The main channel table, this table should only be used when changing things on the channel \(not frequently\) so we don't add counters or last\_activity or anything like that.
|
||||
|
||||
```javascript
|
||||
{
|
||||
//Primary key
|
||||
"company_id": "uuid-v4",
|
||||
"workspace_id": "string" // ("uuid-v4" | "direct")
|
||||
"id": "uuid-v4",
|
||||
|
||||
//Content
|
||||
"owner": "uuid-v4", //User-id of the channel owner (invisible but used on some access restriction-
|
||||
"icon": "String",
|
||||
"name": "String",
|
||||
"description": "String",
|
||||
"channel_group": "String",
|
||||
"visibility": "private" | "public" | "direct"
|
||||
"default": true | false, //The new members join by default this channel
|
||||
"archived": false | true,
|
||||
"archivation_date": 0, //Timestamp
|
||||
}
|
||||
```
|
||||
|
||||
#### **channel\_defaults**
|
||||
|
||||
Contain the default channels
|
||||
|
||||
```javascript
|
||||
{
|
||||
//Primary key
|
||||
"company_id": "uuid-v4",
|
||||
"workspace_id": "uuid-v4"
|
||||
|
||||
"id": "uuid-v4" //Channel id
|
||||
}
|
||||
```
|
||||
|
||||
#### **channel\_counters**
|
||||
|
||||
We use a separated table to manage counters for this channel. Currently this is not used to do statistics but can be used to this goal in the future.
|
||||
|
||||
```javascript
|
||||
{
|
||||
//Primary key
|
||||
"company_id": "uuid-v4",
|
||||
"workspace_id": "string", // "uuid-v4" | "direct"
|
||||
"channel_id": "uuid-v4",
|
||||
"type": "members" | "guests" | "messages",
|
||||
|
||||
"value": 0,
|
||||
}
|
||||
```
|
||||
|
||||
#### **channel\_last\_activity**
|
||||
|
||||
Store last channel activity for bold/not bold management
|
||||
|
||||
```javascript
|
||||
{
|
||||
//Primary key
|
||||
"company_id": "uuid-v4",
|
||||
"channel_id": "uuid-v4",
|
||||
|
||||
"last_activity": 0, //Timestamp in seconds
|
||||
}
|
||||
```
|
||||
|
||||
#### **direct\_channel\_identifiers**
|
||||
|
||||
This table is used to find an existing discussion with a group of members. The "identifier" is generated from the group of members.
|
||||
|
||||
```javascript
|
||||
{
|
||||
//Primary key
|
||||
"company_id": "uuid-v4",
|
||||
"identifier": "string", // ordered CSV list of user ids
|
||||
"channel_id": "uuid-v4" //A way to find it in the channel table
|
||||
}
|
||||
```
|
||||
|
||||
## **Channels tabs**
|
||||
|
||||
#### **channel\_tabs**
|
||||
|
||||
Channels can have tabs that are connexion to other apps or different views.
|
||||
|
||||
```javascript
|
||||
{
|
||||
//Primary key
|
||||
"company_id": "uuid-v4",
|
||||
"workspace_id": "string", // "uuid-v4" | "direct"
|
||||
"channel_id": "uuid-v4",
|
||||
"tab_id": "uuid-v4",
|
||||
|
||||
"name": "String",
|
||||
"configuration": JSON,
|
||||
"application_id": "uuid-v4",
|
||||
"owner": "uuid-v4",
|
||||
"order": "string"
|
||||
}
|
||||
```
|
||||
|
||||
## **Channels members**
|
||||
|
||||
#### **channel\_members**
|
||||
|
||||
List of channels for an user
|
||||
|
||||
```javascript
|
||||
{
|
||||
//Primary key
|
||||
"company_id": "uuid-v4", //Partition Key
|
||||
"workspace_id": "string", // "uuid-v4" | "direct", //Clustering key
|
||||
"user_id": "uuid-v4",
|
||||
"channel_id": "uuid-v4",
|
||||
|
||||
"type": "member" | "guest" | "bot",
|
||||
|
||||
"last_access": 0, //Timestamp in seconds
|
||||
"last_increment": 0, //Number
|
||||
"favorite": false | true, //Did the user add this channel to its favorites
|
||||
"notification_level": "all" | "none" | "group_mentions" | "user_mentions",
|
||||
"expiration": false | Timestamp, //Member expiration in channel (only for guests)
|
||||
}
|
||||
```
|
||||
|
||||
#### **channel\_members\_reversed**
|
||||
|
||||
List of users in channel
|
||||
|
||||
**Not implemented:** We need to ensure this replication regularly \(on each user open channel\) ?
|
||||
|
||||
```javascript
|
||||
{
|
||||
//Primary key
|
||||
"company_id": "uuid-v4",
|
||||
"workspace_id": "string", // "uuid-v4" | "direct",
|
||||
"channel_id": "uuid-v4",
|
||||
"type": "guest" | "bot" | "member",
|
||||
"user_id": "uuid-v4",
|
||||
}
|
||||
```
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
---
|
||||
description: Drive on Twake
|
||||
description: Drive on TDrive
|
||||
---
|
||||
|
||||
# 📁 Drive
|
||||
|
||||
## description
|
||||
|
||||
**Drive** or **Documents** is the Nodejs drive implementation for twake, it contains drive items.
|
||||
**Drive** or **Documents** is the Nodejs drive implementation for tdrive, it contains drive items.
|
||||
|
||||
A **Drive item** can be:
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ All the following routes require the usual authentication header. But you can al
|
||||
|
||||
- For the download routes, you can use a token generated by the `/internal/services/documents/v1/companies/:company_id/download/token` route (see bellow).
|
||||
- All the routes can use a query string `?public_token=token` to authenticate the user.
|
||||
- All the routes can use a query string `?twake_tab_token=token` to authenticate the user in the context of a channel tab for instance.
|
||||
- All the routes can use a query string `?tdrive_tab_token=token` to authenticate the user in the context of a channel tab for instance.
|
||||
|
||||
# Navigation and drive capabilities
|
||||
|
||||
@@ -299,9 +299,9 @@ Used to create a zip archive containing the requested drive items ( files and fo
|
||||
|
||||
**Auth required** : Yes
|
||||
|
||||
# Tabs (for Twake)
|
||||
# Tabs (for TDrive)
|
||||
|
||||
If you want to use the Twake tabs, you must store the configuration of the tabs in the database.
|
||||
If you want to use the TDrive tabs, you must store the configuration of the tabs in the database.
|
||||
|
||||
## Get tab configuration
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
---
|
||||
description: File on Twake
|
||||
description: File on TDrive
|
||||
---
|
||||
|
||||
# 📄 Files
|
||||
|
||||
## description
|
||||
|
||||
**Files** is everything related to file upload in Twake after the migration to Node.js. Note that the Twake Drive isn't part of this migration because it will be replaced by Linshare.
|
||||
**Files** is everything related to file upload in TDrive after the migration to Node.js. Note that the TDrive Drive isn't part of this migration because it will be replaced by Linshare.
|
||||
|
||||
Twake Files upload support chunk upload and file encryption.
|
||||
TDrive Files upload support chunk upload and file encryption.
|
||||
|
||||
## Wording
|
||||
|
||||
@@ -18,7 +18,7 @@ Twake Files upload support chunk upload and file encryption.
|
||||
|
||||
## Encryption
|
||||
|
||||
Files and Storage services in Twake feature encryption at rest in **aes-256-cbc**.
|
||||
Files and Storage services in TDrive feature encryption at rest in **aes-256-cbc**.
|
||||
|
||||
Each file is encrypted with two layers:
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
description: How we use resumable on Twake
|
||||
description: How we use resumable on TDrive
|
||||
---
|
||||
|
||||
# Resumable.js
|
||||
@@ -9,7 +9,7 @@ description: How we use resumable on Twake
|
||||
## What is Resumable.js
|
||||
|
||||
::: info
|
||||
Using Resumable is not mandatory to upload a file to Twake. You can do it manually, see REST APIs page.
|
||||
Using Resumable is not mandatory to upload a file to TDrive. You can do it manually, see REST APIs page.
|
||||
:::
|
||||
|
||||
It’s a JavaScript library providing multiple simultaneous, stable and resumable uploads via the HTML5 File API.
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
---
|
||||
description: Get started with Twake service development
|
||||
description: Get started with TDrive service development
|
||||
---
|
||||
|
||||
# 🛠 Twake service development
|
||||
# 🛠 TDrive service development
|
||||
|
||||
[start-working-into-a-service](start-working-into-a-service.md)
|
||||
|
||||
[create-a-new-twake-service](create-a-new-twake-service.md)
|
||||
[create-a-new-tdrive-service](create-a-new-tdrive-service.md)
|
||||
|
||||
[platform/](platform/README.md))
|
||||
|
||||
+15
-15
@@ -1,7 +1,7 @@
|
||||
---
|
||||
description: >-
|
||||
If you are here, you probably have a very great idea for Twake, like adding a
|
||||
brand new feature into Twake, maybe a coffee maker service ? ☕️
|
||||
If you are here, you probably have a very great idea for TDrive, like adding a
|
||||
brand new feature into TDrive, maybe a coffee maker service ? ☕️
|
||||
---
|
||||
|
||||
# Create a new service
|
||||
@@ -19,10 +19,10 @@ In order to illustrate how to create a component, let's create a fake Notificati
|
||||
|
||||
```javascript
|
||||
// File src/services/notification/index.ts
|
||||
import { TwakeService } from "../../core/platform/framework";
|
||||
import { TDriveService } from "../../core/platform/framework";
|
||||
import NotificationServiceAPI from "./api.ts";
|
||||
|
||||
export default class NotificationService extends TwakeService<NotificationServiceAPI> {
|
||||
export default class NotificationService extends TDriveService<NotificationServiceAPI> {
|
||||
version = "1";
|
||||
name = "notification";
|
||||
service: NotificationServiceAPI;
|
||||
@@ -33,15 +33,15 @@ export default class NotificationService extends TwakeService<NotificationServic
|
||||
}
|
||||
```
|
||||
|
||||
1. Our `NotificationService` class extends the generic `TwakeService` class and we defined the `NotificationServiceAPI` as its generic type parameter. It means that in the platform, the other components will be able to retrieve the component from its name and then consume the API defined in the `NotificationServiceAPI` interface and exposed by the `api` method.
|
||||
1. Our `NotificationService` class extends the generic `TDriveService` class and we defined the `NotificationServiceAPI` as its generic type parameter. It means that in the platform, the other components will be able to retrieve the component from its name and then consume the API defined in the `NotificationServiceAPI` interface and exposed by the `api` method.
|
||||
|
||||
We need to create this `NotificationServiceAPI` interface which must extend the `TwakeServiceProvider` from the platform like:
|
||||
We need to create this `NotificationServiceAPI` interface which must extend the `TDriveServiceProvider` from the platform like:
|
||||
|
||||
```javascript
|
||||
// File src/services/notification/api.ts
|
||||
import { TwakeServiceProvider } from "../../core/platform/framework/api";
|
||||
import { TDriveServiceProvider } from "../../core/platform/framework/api";
|
||||
|
||||
export default interface NotificationServiceAPI extends TwakeServiceProvider {
|
||||
export default interface NotificationServiceAPI extends TDriveServiceProvider {
|
||||
|
||||
/**
|
||||
* Send a message to a list of recipients
|
||||
@@ -65,17 +65,17 @@ export class NotificationServiceImpl implements NotificationServiceAPI {
|
||||
}
|
||||
```
|
||||
|
||||
1. `NotificationServiceImpl` now needs to be instanciated from the `NotificationService` class since this is where we choose to keep its reference and expose it. There are several places which can be used to instanciate it, in the constructor itself, or in one of the `TwakeService` lifecycle hooks. The `TwakeService` abstract class has several lifecycle hooks which can be extended by the service implementation for customization pusposes:
|
||||
1. `NotificationServiceImpl` now needs to be instanciated from the `NotificationService` class since this is where we choose to keep its reference and expose it. There are several places which can be used to instanciate it, in the constructor itself, or in one of the `TDriveService` lifecycle hooks. The `TDriveService` abstract class has several lifecycle hooks which can be extended by the service implementation for customization pusposes:
|
||||
2. `public async doInit(): Promise<this>;` Customize the `init` step of the component. This is generally the place where services are instanciated. From this step, you can retrieve services consumed by the current component which have been already initialized by the platform.
|
||||
3. `public async doStart(): Promise<this>;` Customize the `start` step of the component. You have access to all other services which are already started.
|
||||
|
||||
```javascript
|
||||
// File src/services/notification/index.ts
|
||||
import { TwakeService } from "../../core/platform/framework";
|
||||
import { TDriveService } from "../../core/platform/framework";
|
||||
import NotificationServiceAPI from "./api.ts";
|
||||
import NotificationServiceImpl from "./services/api.ts";
|
||||
|
||||
export default class NotificationService extends TwakeService<NotificationServiceAPI> {
|
||||
export default class NotificationService extends TDriveService<NotificationServiceAPI> {
|
||||
version = "1";
|
||||
name = "notification";
|
||||
service: NotificationServiceAPI;
|
||||
@@ -95,12 +95,12 @@ export default class NotificationService extends TwakeService<NotificationServic
|
||||
1. Now that the service is fully created, we can consume it from any other service in the platform. To do this, we rely on Typescript decorators to define the links between components. For example, let's say that the a `MessageService` needs to call the `NotificationServiceAPI`, we can create the link with the help of the `@Consumes` decorator and get a reference to the `NotificationServiceAPI` by calling the `getProvider` on the component context like:
|
||||
|
||||
```javascript
|
||||
import { TwakeService, Consumes } from "../../core/platform/framework";
|
||||
import { TDriveService, Consumes } from "../../core/platform/framework";
|
||||
import MessageServiceAPI from "./providapier";
|
||||
import NotificationServiceAPI from "../notification/api";
|
||||
|
||||
@Consumes(["notification"])
|
||||
export default class MessageService extends TwakeService<MessageServiceAPI> {
|
||||
export default class MessageService extends TDriveService<MessageServiceAPI> {
|
||||
|
||||
public async doInit(): Promise<this> {
|
||||
const notificationService = this.context.getProvider<NotificationServiceAPI>("notification");
|
||||
@@ -143,7 +143,7 @@ Then each service can have its own configuration block which is accessible from
|
||||
On the component class side, the configuration object is directly accessible from the `configuration` property like:
|
||||
|
||||
```javascript
|
||||
export default class WebSocket extends TwakeService<WebSocketAPI> {
|
||||
export default class WebSocket extends TDriveService<WebSocketAPI> {
|
||||
async doInit(): Promise<this> {
|
||||
// get the "path" value, defaults to "/socket" if not defined
|
||||
const path = this.configuration.get < string > ("path", "/socket");
|
||||
@@ -166,7 +166,7 @@ After creating a new service, you can add controllers, business services and ent
|
||||
|
||||
## Create a new technical service
|
||||
|
||||
Now you are bringing things a step further, you are going to add new core services in Twake, like for instance a new database connector or encryption system.
|
||||
Now you are bringing things a step further, you are going to add new core services in TDrive, like for instance a new database connector or encryption system.
|
||||
|
||||
Creating a new core service is as easy as creating a functional service. But it must be in `src/core/platform/services` .
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
description: >-
|
||||
List of core shared components in Twake backend, available in
|
||||
List of core shared components in TDrive backend, available in
|
||||
src/core/platform/services
|
||||
---
|
||||
|
||||
@@ -8,7 +8,7 @@ description: >-
|
||||
|
||||
## **Database Technical Service**
|
||||
|
||||
Twake uses a custom ORM to work with both MongoDB and CassandraDB/ScyllaDB.
|
||||
TDrive uses a custom ORM to work with both MongoDB and CassandraDB/ScyllaDB.
|
||||
|
||||
::: info
|
||||
This paragraph is not ready yet, you can contribute to this documentation on our Github!
|
||||
@@ -108,7 +108,7 @@ Services annotated as described above automatically publish events to WebSockets
|
||||
```javascript
|
||||
const io = require("socket.io-client");
|
||||
|
||||
// Get a JWT token from the Twake API first
|
||||
// Get a JWT token from the TDrive API first
|
||||
const token =
|
||||
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOjEsImlhdCI6MTYwMzE5ODkzMn0.NvQoV9KeWuTNzRvzqbJ5uZCQ8Nmi2rCYQzcKk-WsJJ8";
|
||||
const socket = io.connect("http://localhost:3000", { path: "/socket" });
|
||||
@@ -150,7 +150,7 @@ socket.on("connect", () => {
|
||||
.emit("authenticate", { token })
|
||||
.on("authenticated", () => {
|
||||
// join the /channels room
|
||||
socket.emit("realtime:join", { name: "/channels", token: "twake" });
|
||||
socket.emit("realtime:join", { name: "/channels", token: "tdrive" });
|
||||
socket.on("realtime:join:error", (message) => {
|
||||
// will fire when join does not provide a valid token
|
||||
console.log("Error on join", message);
|
||||
@@ -231,7 +231,7 @@ socket.on("connect", () => {
|
||||
.emit("authenticate", { token })
|
||||
.on("authenticated", () => {
|
||||
// join the "/channels" room
|
||||
socket.emit("realtime:join", { name: "/channels", token: "twake" });
|
||||
socket.emit("realtime:join", { name: "/channels", token: "tdrive" });
|
||||
|
||||
// will only occur when an action occured on a resource
|
||||
// and if and only if the client joined the room
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
description: >-
|
||||
List of core shared components in Twake backend, available in
|
||||
List of core shared components in TDrive backend, available in
|
||||
src/core/platform/services
|
||||
---
|
||||
|
||||
@@ -8,7 +8,7 @@ description: >-
|
||||
|
||||
## **Database Technical Service**
|
||||
|
||||
Twake uses a custom ORM to work with both MongoDB and CassandraDB/ScyllaDB.
|
||||
TDrive uses a custom ORM to work with both MongoDB and CassandraDB/ScyllaDB.
|
||||
|
||||
[database-orm-platform-service](database-orm-platform-service.md)
|
||||
|
||||
@@ -106,7 +106,7 @@ Services annotated as described above automatically publish events to WebSockets
|
||||
```javascript
|
||||
const io = require("socket.io-client");
|
||||
|
||||
// Get a JWT token from the Twake API first
|
||||
// Get a JWT token from the TDrive API first
|
||||
const token =
|
||||
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOjEsImlhdCI6MTYwMzE5ODkzMn0.NvQoV9KeWuTNzRvzqbJ5uZCQ8Nmi2rCYQzcKk-WsJJ8";
|
||||
const socket = io.connect("http://localhost:3000", { path: "/socket" });
|
||||
@@ -148,7 +148,7 @@ socket.on("connect", () => {
|
||||
.emit("authenticate", { token })
|
||||
.on("authenticated", () => {
|
||||
// join the /channels room
|
||||
socket.emit("realtime:join", { name: "/channels", token: "twake" });
|
||||
socket.emit("realtime:join", { name: "/channels", token: "tdrive" });
|
||||
socket.on("realtime:join:error", (message) => {
|
||||
// will fire when join does not provide a valid token
|
||||
console.log("Error on join", message);
|
||||
@@ -229,7 +229,7 @@ socket.on("connect", () => {
|
||||
.emit("authenticate", { token })
|
||||
.on("authenticated", () => {
|
||||
// join the "/channels" room
|
||||
socket.emit("realtime:join", { name: "/channels", token: "twake" });
|
||||
socket.emit("realtime:join", { name: "/channels", token: "tdrive" });
|
||||
|
||||
// will only occur when an action occured on a resource
|
||||
// and if and only if the client joined the room
|
||||
|
||||
+14
-12
@@ -5,7 +5,10 @@
|
||||
A. Create an entity and put it anywhere in the code
|
||||
|
||||
```typescript
|
||||
import { Entity, Column } from "../../../core/platform/services/database/services/orm/decorators";
|
||||
import {
|
||||
Entity,
|
||||
Column,
|
||||
} from "../../../core/platform/services/database/services/orm/decorators";
|
||||
|
||||
@Entity("my_entity", {
|
||||
primaryKey: [["company_id"], "id"], //Primary key, see Cassandra documentation for more details
|
||||
@@ -45,25 +48,24 @@ await repository.remove({company_id: "", id: ""});
|
||||
|
||||
#### I set a column to a type but I get an other type on code. Why for two identical definitions it created fields of different types?
|
||||
|
||||
It depends on what database you use \(mongo or scylladb\) for development. Here is the process for each:
|
||||
It depends on what database you use \(mongo or scylladb\) for development. Here is the process for each:
|
||||
|
||||
Scylla:
|
||||
|
||||
* on startup it creates the tables with the requested types, in this case twake\_boolean => tinyint on scylla side
|
||||
* on save entity it will convert the node type \(boolean\) to the good cql request: "{bool: false}" => "SET bool = 0", it happens in the transformValueToDbString method
|
||||
* on find entity it will convert the database raw value \(a tinyint\) to the nodejs type \(boolean\): 1 => true, 0 => false.
|
||||
- on startup it creates the tables with the requested types, in this case tdrive_boolean => tinyint on scylla side
|
||||
- on save entity it will convert the node type \(boolean\) to the good cql request: "{bool: false}" => "SET bool = 0", it happens in the transformValueToDbString method
|
||||
- on find entity it will convert the database raw value \(a tinyint\) to the nodejs type \(boolean\): 1 => true, 0 => false.
|
||||
|
||||
Mongo:
|
||||
|
||||
* on startup it does nothing \(mongo don't need to initialise columns
|
||||
* on save entity it will create a document, it means in mongo we just store json for each entity, there is no really a column concept.
|
||||
* on find entity we just get back the saved json and map it to the entity in node.
|
||||
- on startup it does nothing \(mongo don't need to initialise columns
|
||||
- on save entity it will create a document, it means in mongo we just store json for each entity, there is no really a column concept.
|
||||
- on find entity we just get back the saved json and map it to the entity in node.
|
||||
|
||||
Even if mongo just store json directly from mongo, we sometime do some changes to the data before to save in mongo, it will also be in the typeTransforms.ts file.
|
||||
|
||||
So what could have happened in you case ?
|
||||
|
||||
* \(1\) if you use mongodb and we did not enforce the type before to save to mongo, then maybe you used a string instead of a boolean at some point in time while working and mongo just saved it as it was \(without checking the requested type on entity\)
|
||||
* \(2\) other possibility is that we incorrectly get the information from the database on the typeTransforms.ts file, from cassandra for instance I think we don't convert tinyint back to clean boolean, so you could get 0 and 1 instead of false and true. And maybe instead of 0 and 1 sometime undefined values can convert to ''.
|
||||
* To fix all this just enforce the types in typeTransforms.ts for the twake\_boolean type.
|
||||
|
||||
- \(1\) if you use mongodb and we did not enforce the type before to save to mongo, then maybe you used a string instead of a boolean at some point in time while working and mongo just saved it as it was \(without checking the requested type on entity\)
|
||||
- \(2\) other possibility is that we incorrectly get the information from the database on the typeTransforms.ts file, from cassandra for instance I think we don't convert tinyint back to clean boolean, so you could get 0 and 1 instead of false and true. And maybe instead of 0 and 1 sometime undefined values can convert to ''.
|
||||
- To fix all this just enforce the types in typeTransforms.ts for the tdrive_boolean type.
|
||||
|
||||
+3
-3
@@ -4,7 +4,7 @@ description: >-
|
||||
to our channel service ? You are in the right place !
|
||||
---
|
||||
|
||||
# What is a service in Twake ?
|
||||
# What is a service in TDrive ?
|
||||
|
||||
The backend is developed using a **software component approach** in order to compose and adapt the platform based on needs and constraints. The current section describes this approach, and how to extend it by creating new components.
|
||||
|
||||
@@ -25,9 +25,9 @@ The platform currently have some limitations:
|
||||
|
||||
## Discover what is in a service
|
||||
|
||||
To unfold the internal ways of services in Twake, we will follow a simple request journey into our framework.
|
||||
To unfold the internal ways of services in TDrive, we will follow a simple request journey into our framework.
|
||||
|
||||
1. The requests starts from Twake Frontend or Postman for instance,
|
||||
1. The requests starts from TDrive Frontend or Postman for instance,
|
||||
2. it then goes to a controller which validate the request parameters and extract them for the services,
|
||||
3. the services uses the given parameters to get/set entities in database and returns a proper reply.
|
||||
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
# Knowledge-graph
|
||||
|
||||
## Twake to Knowledge-graph events
|
||||
|
||||
Twake can send events to the knowledge graph following this documentation:
|
||||
|
||||
[Events from Twake](./pushed-from-twake.md)
|
||||
|
||||
## Knowledge-graph to Twake REST
|
||||
|
||||
The knowledge graph can send us event at the following endpoint:
|
||||
`POST https://api.twake.app/internal/services/knowledge-graph/v1/push`
|
||||
|
||||
Authorized by a Token authorization header:
|
||||
`Authorization: Token {some token defined together}`
|
||||
|
||||
And with the following data in JSON:
|
||||
|
||||
```
|
||||
{
|
||||
events: [KnowledgeGraphCallbackEvent, KnowledgeGraphCallbackEvent, KnowledgeGraphCallbackEvent, ...]
|
||||
}
|
||||
|
||||
type KnowledgeGraphCallbackEvent = {
|
||||
recipients: {
|
||||
type: "user";
|
||||
id: string; // KG user id which is a md5 of the email
|
||||
}[];
|
||||
event: {
|
||||
type: "user_tags"; //More events will be added later
|
||||
data: {
|
||||
//For user_tags event only
|
||||
tags?: {
|
||||
value: string;
|
||||
weight: number;
|
||||
}[];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
```
|
||||
|
||||
The reply will be if everything was alright:
|
||||
|
||||
```
|
||||
{
|
||||
"status": "success"
|
||||
}
|
||||
```
|
||||
-172
@@ -1,172 +0,0 @@
|
||||
# Knowledge-graph
|
||||
|
||||
## Knowledge-graph to Twake events
|
||||
|
||||
[Send events to Twake](./README.md)
|
||||
|
||||
## Events sent by twake to the knowledge graph
|
||||
|
||||
### User created / updated
|
||||
|
||||
```typescript
|
||||
{
|
||||
records: [
|
||||
{
|
||||
key: "null",
|
||||
value: {
|
||||
id: "User",
|
||||
properties: {
|
||||
_kg_user_id: string; //Console wide user id (based on the console id), prefer to use this one
|
||||
_kg_email_id: string; //Console wide user id (based on the email md5)
|
||||
_kg_company_all_id: string[]; //All console wide companies_ids for this user
|
||||
|
||||
user_id: string; //Twake internal user id
|
||||
company_id: string; //Company internal id
|
||||
user_created_at: number;
|
||||
user_last_activity: string;
|
||||
email: string;
|
||||
first_name: string;
|
||||
last_name: string;
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Channel created / updated
|
||||
|
||||
```typescript
|
||||
{
|
||||
records: [
|
||||
{
|
||||
key: "null",
|
||||
value: {
|
||||
id: "Channel",
|
||||
properties: {
|
||||
_kg_user_id: string; //Console wide user id (based on the console id), prefer to use this one
|
||||
_kg_email_id: string; //Console wide user id (based on the email md5)
|
||||
_kg_company_id: string; //Console wide company id
|
||||
channel_id: string;
|
||||
channel_name: string;
|
||||
channel_owner: string;
|
||||
workspace_id: string;
|
||||
company_id: string;
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
```
|
||||
|
||||
### Message created / updated
|
||||
|
||||
```typescript
|
||||
{
|
||||
records: [
|
||||
{
|
||||
key: "null",
|
||||
value: {
|
||||
id: "Message",
|
||||
properties: {
|
||||
_kg_user_id: string; //Console wide user id (based on the console id), prefer to use this one
|
||||
_kg_email_id: string; //Console wide user id (based on the email md5)
|
||||
_kg_company_id: string; //Console wide company id
|
||||
message_thread_id: message.thread_id,
|
||||
message_content: string; //Empty if user requested not to share data to KG
|
||||
message_created_at: number;
|
||||
message_updated_at: number;
|
||||
type_message: string;
|
||||
company_id: string; //Internal to Twake company id
|
||||
workspace_id: string;
|
||||
channel_id: string;
|
||||
user_id: string; //Internal to Twake user id
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
```
|
||||
|
||||
### Company created / updated
|
||||
|
||||
```typescript
|
||||
{
|
||||
records: [
|
||||
{
|
||||
key: "null",
|
||||
value: {
|
||||
id: "Company",
|
||||
properties: {
|
||||
_kg_company_id: string; //Console wide company id
|
||||
company_id: string; //Internal to Twake company id
|
||||
company_name: string;
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
```
|
||||
|
||||
### Workspace created / updated
|
||||
|
||||
```typescript
|
||||
{
|
||||
records: [
|
||||
{
|
||||
key: "null",
|
||||
value: {
|
||||
id: "Workspace",
|
||||
properties: {
|
||||
_kg_company_id: string; //Console wide company id
|
||||
company_id: string; //Internal to Twake company id
|
||||
workspace_id: string; //Internal to Twake workspace id
|
||||
workspace_name: string;
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
```
|
||||
|
||||
## Sending events to Twake from the KG
|
||||
|
||||
Twake listen at at:
|
||||
`POST https://domain/internal/services/knowledge-graph/v1/push`
|
||||
|
||||
Authorised by a Token authorization header:
|
||||
`Authorization: Token {some token defined together}`
|
||||
|
||||
And with the following data in JSON:
|
||||
|
||||
```typescript
|
||||
{
|
||||
events: [KnowledgeGraphCallbackEvent, KnowledgeGraphCallbackEvent, KnowledgeGraphCallbackEvent, ...]
|
||||
}
|
||||
|
||||
type KnowledgeGraphCallbackEvent = {
|
||||
recipients: {
|
||||
type: "user";
|
||||
id: string; // KG user id which is a md5 of the email
|
||||
}[];
|
||||
event: {
|
||||
type: "user_tags"; //More events will be added later
|
||||
data: {
|
||||
//For user_tags event only
|
||||
tags?: {
|
||||
value: string;
|
||||
weight: number;
|
||||
}[];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
```
|
||||
|
||||
The reply will be if everything was alright:
|
||||
|
||||
```typescript
|
||||
{
|
||||
"status": "success"
|
||||
}
|
||||
```
|
||||
@@ -1,8 +0,0 @@
|
||||
---
|
||||
description: Message api
|
||||
---
|
||||
|
||||
# 💬 Messages
|
||||
|
||||
Document still on Notion: [https://www.notion.so/twake/Backend-documentation-e219323593d2401c9887d0e11b2a597b](https://www.notion.so/twake/Backend-documentation-e219323593d2401c9887d0e11b2a597b)
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
description: Message database models
|
||||
---
|
||||
|
||||
# Database models
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
description: Notifications on Twake
|
||||
---
|
||||
|
||||
# 📲 Notifications
|
||||
|
||||
-59
@@ -1,59 +0,0 @@
|
||||
---
|
||||
description: Notification database model
|
||||
---
|
||||
|
||||
# Database models
|
||||
|
||||
#### **channel\_members\_notification\_preferences**
|
||||
|
||||
```javascript
|
||||
{
|
||||
//Primary key
|
||||
"company_id": "uuid-v4",
|
||||
"channel_id": "uuid-v4",
|
||||
"user_id": "uuid-v4",
|
||||
|
||||
"preferences": "all" | "mentions" | "me" | "none",
|
||||
"last_read": 16000000, //Timestamp in seconds
|
||||
}
|
||||
```
|
||||
|
||||
#### **channel\_thread\_users**
|
||||
|
||||
```javascript
|
||||
{
|
||||
//Primary key
|
||||
"company_id": "uuid-v4",
|
||||
"channel_id": "uuid-v4",
|
||||
"thread_id": "uuid-v4",
|
||||
|
||||
"user_id": "uuid-v4"
|
||||
}
|
||||
```
|
||||
|
||||
#### **user\_notifications\_badges \(this is not a counter like scylladb counters here, just classic table\)**
|
||||
|
||||
```javascript
|
||||
{
|
||||
//Primary key
|
||||
"company_id": "uuid-v4", (partition key)
|
||||
"user_id": "uuid-v4", (clustering key)
|
||||
"workspace_id": "uuid-v4", (clustering key)
|
||||
"channel_id": "uuid-v4", (clustering key)
|
||||
"thread_id": "uuid-v4", (clustering key)
|
||||
}
|
||||
```
|
||||
|
||||
#### **user\_notifications\_general\_preferences**
|
||||
|
||||
```javascript
|
||||
{
|
||||
//Primary key
|
||||
"company_id": "uuid-v4",
|
||||
"user_id": "uuid-v4",
|
||||
"workspace_id": "uuid-v4",
|
||||
|
||||
"preferences": PreferencesObject
|
||||
}
|
||||
```
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
---
|
||||
description: Tags on Twake
|
||||
description: Tags on TDrive
|
||||
---
|
||||
|
||||
# 📁 Tags
|
||||
|
||||
## description
|
||||
|
||||
**Tags** is everything related to tafs in Twake after the migration to Node.js.
|
||||
**Tags** is everything related to tafs in TDrive after the migration to Node.js.
|
||||
|
||||
## Models and APIs
|
||||
|
||||
|
||||
@@ -4,5 +4,4 @@ description: How users and workspaces are managed in backend
|
||||
|
||||
# 👥 Users and workspaces
|
||||
|
||||
Document still on notion: [https://www.notion.so/twake/Backend-documentation-e219323593d2401c9887d0e11b2a597b](https://www.notion.so/twake/Backend-documentation-e219323593d2401c9887d0e11b2a597b)
|
||||
|
||||
Document still on notion: [https://www.notion.so/tdrive/Backend-documentation-e219323593d2401c9887d0e11b2a597b](https://www.notion.so/tdrive/Backend-documentation-e219323593d2401c9887d0e11b2a597b)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
---
|
||||
description: Get started with Twake frontend.
|
||||
description: Get started with TDrive frontend.
|
||||
---
|
||||
|
||||
# Storybook
|
||||
|
||||
Twake components are available through our Storybook. You can find it here:
|
||||
TDrive components are available through our Storybook. You can find it here:
|
||||
|
||||
[https://web.twake.app/storybook/index.html](https://web.twake.app/storybook/index.html)
|
||||
[https://web.tdrive.app/storybook/index.html](https://web.tdrive.app/storybook/index.html)
|
||||
|
||||
@@ -4,14 +4,14 @@ description: Here is the list of our middlewares and their usages.
|
||||
|
||||
# 📚 Our stack
|
||||
|
||||
Write an article describing our stack at Twake composed of:
|
||||
Write an article describing our stack at TDrive composed of:
|
||||
|
||||
- In full mode a docker containing: node, react behind nginx, elasticsearch, scylladb, redis, rabbitmq
|
||||
- In simple mode a docker containing: node, react and mongodb for db and search
|
||||
|
||||
### Simple mode
|
||||
|
||||
The simple mode of Twake messaging app is designed for quick setup and development purposes. It is a more straightforward mode that uses a single container to deploy the components. The technical stack of this mode includes the following components:
|
||||
The simple mode of TDrive messaging app is designed for quick setup and development purposes. It is a more straightforward mode that uses a single container to deploy the components. The technical stack of this mode includes the following components:
|
||||
|
||||
- Node: A JavaScript runtime environment used to develop server-side applications.
|
||||
- React: A JavaScript library used to build user interfaces.
|
||||
@@ -21,7 +21,7 @@ The simple mode is great for companies that want a quick and easy setup for thei
|
||||
|
||||
### Full mode
|
||||
|
||||
The full mode of Twake messaging app is designed to handle large-scale production loads with more than 1000 active users. It uses a container-based approach to deploy the components and ensure scalability. The technical stack of this mode includes the following components:
|
||||
The full mode of TDrive messaging app is designed to handle large-scale production loads with more than 1000 active users. It uses a container-based approach to deploy the components and ensure scalability. The technical stack of this mode includes the following components:
|
||||
|
||||
- Node: A JavaScript runtime environment used to develop server-side applications.
|
||||
- React: A JavaScript library used to build user interfaces.
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
---
|
||||
description: Want to translate Twake ?
|
||||
description: Want to translate TDrive ?
|
||||
---
|
||||
|
||||
# 🎭 Translation
|
||||
|
||||
## Translation process
|
||||
|
||||
Twake is built for everyone. That means we support languages that user want. If we do not already support your language, or you find a mistake in the translation, you have a simply way to do that.
|
||||
TDrive is built for everyone. That means we support languages that user want. If we do not already support your language, or you find a mistake in the translation, you have a simply way to do that.
|
||||
|
||||
Send us a mail to this address saying that you want to help us on the translation : [sales@twake.app](mailto:sales@twake.app). After, you'll have to follow the bellow steps.
|
||||
Send us a mail to this address saying that you want to help us on the translation : [sales@tdrive.app](mailto:sales@tdrive.app). After, you'll have to follow the bellow steps.
|
||||
|
||||
## Join weblate server
|
||||
|
||||
At Twake, we use [weblate](https://hosted.weblate.org/), a tool that allow you to translate Twake without working on the code. After you sent an email, we'll invite you to the project. Inside the Twake project you can find [twake-web-frontend](https://hosted.weblate.org/projects/twake/twake-web-frontend/) that contains all translation for the web version.
|
||||
At TDrive, we use [weblate](https://hosted.weblate.org/), a tool that allow you to translate TDrive without working on the code. After you sent an email, we'll invite you to the project. Inside the TDrive project you can find [tdrive-web-frontend](https://hosted.weblate.org/projects/tdrive/tdrive-web-frontend/) that contains all translation for the web version.
|
||||
|
||||
## Start to translate
|
||||
|
||||
@@ -22,4 +22,4 @@ After choosing the language you want to contribute, you can click on categories
|
||||
|
||||
## Thank you!
|
||||
|
||||
Twake is build by and for the community. Your commitment is highly appreciate! In reward, we can offer you a year on our SaaS version. You just have to contact us through this email : [sales@twake.app](mailto:sales@twake.app)
|
||||
TDrive is build by and for the community. Your commitment is highly appreciate! In reward, we can offer you a year on our SaaS version. You just have to contact us through this email : [sales@tdrive.app](mailto:sales@tdrive.app)
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
---
|
||||
description: >-
|
||||
Global guidelines for any new projects around Twake, Frontend and Backend
|
||||
guidelines are discussed here.
|
||||
---
|
||||
|
||||
# 🎨 Twake Ecosystem Guidelines
|
||||
|
||||
## Frontend guidelines
|
||||
|
||||
### Logo, UI and UX guidelines
|
||||
|
||||
#### Logos
|
||||
|
||||
{% file src="../assets/logo\_shape.svg" caption="Logo shape in SVG format" %}
|
||||
|
||||
#### Colors and fonts
|
||||
|
||||
The fonts and colors to use are defined in the document bellow, scroll down for the hexadecimal codes of each color.
|
||||
|
||||

|
||||
|
||||
Colors code extracted from the Twake theme [https://github.com/linagora/Twake/blob/main/twake/frontend/src/app/theme.less](https://github.com/linagora/Twake/blob/main/twake/frontend/src/app/theme.less)
|
||||
|
||||
```css
|
||||
// Circular Std = France
|
||||
// Helvetica Neue = Vietnam
|
||||
// TT Norms = Russia
|
||||
|
||||
// --- Twake fonts --- //
|
||||
@main-font: "Circular Std", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
|
||||
"Apple Color Emoji", Arial, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
|
||||
|
||||
// --- Twake colors --- //
|
||||
@primary: #3840f7;
|
||||
@primary-background: #3842f723;
|
||||
@primary-hover: #3850f7;
|
||||
@secondary: #0d0f38;
|
||||
|
||||
@black: #000000;
|
||||
@black-alpha-50: #18295288;
|
||||
@black-alpha-70: #18295255;
|
||||
@grey-background: #f5f5f7;
|
||||
@grey-light: #eeeeee;
|
||||
@grey-dark: #6a6a6a;
|
||||
|
||||
@error: #ff5154;
|
||||
@success: #04aa11;
|
||||
@warning: #ff8607;
|
||||
@white: #fff;
|
||||
```
|
||||
|
||||
#### Icons and emojis \(⚠️ not validated by UX designer yet\)
|
||||
|
||||
Twake is currently using feather icons [https://feathericons.com/](https://feathericons.com/) and can fallback to Material Icons or FontAwesome.
|
||||
|
||||
Emojis on web must use the Apple emojis set preferably. On device, prefer to use the device emoji set.
|
||||
|
||||
### Frameworks and component system
|
||||
|
||||
#### Languages and frameworks
|
||||
|
||||
We recommend **TypeScript** and **VueJS** for any new projects around Twake. \(But Twake itself currently uses ReactJS with typescript.\)
|
||||
|
||||
#### **Components system**
|
||||
|
||||
We strongly recommend using Antd design system: [https://ant.design/](https://ant.design/) for 3 reasons:
|
||||
|
||||
1. We want to **differ from Material** UI that is too recognisable
|
||||
2. Antd is very customisable, and **we provide a Twake theme here:** [**https://github.com/linagora/Twake/blob/main/twake/frontend/src/app/theme.less**](https://github.com/linagora/Twake/blob/main/twake/frontend/src/app/theme.less)\*\*\*\*
|
||||
3. Antd contain more components than Material UI
|
||||
|
||||
### Libraries for common use cases
|
||||
|
||||
Feel free to add any library in this table.
|
||||
|
||||
| Use case | used by | prefered library |
|
||||
| :-------------- | :----------------- | :------------------------------------------------------- |
|
||||
| Infinite scroll | Twake message feed | [https://virtuoso.dev/](https://virtuoso.dev/) \(React\) |
|
||||
|
||||
## Backend guidelines
|
||||
|
||||
### Programmation languages
|
||||
|
||||
### Databases and middlewares
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
description: Twake let you authenticate using CAS or OpenID.
|
||||
---
|
||||
|
||||
# 👨💻 Authentication modes
|
||||
|
||||
Twake works with OpenID, CAS and in standalone.
|
||||
|
||||
See child pages to configure with [KeyCloak](using-keycloak-ldap-openid-and-more.md) or [LemonLDAP](installing-twake-with-lemonldap-ldap-openid-and-more.md).
|
||||
|
||||
-52
@@ -1,52 +0,0 @@
|
||||
---
|
||||
description: 'Harder than KeyCloak but has other features, see official LemonLDAP site.'
|
||||
---
|
||||
|
||||
# Installing Twake with LemonLDAP \(LDAP, OpenID and more\)
|
||||
|
||||
#### 1. Twake configuration
|
||||
|
||||
Edit Twake PHP config `twake/backend/core/app/Configuration/Parameters.php`, in defaults.auth.openid
|
||||
|
||||
```text
|
||||
"openid" => [
|
||||
"use" => true,
|
||||
"provider_uri" => 'http://auth.open-paas.org.local',
|
||||
"client_id" => 'twake',
|
||||
"client_secret" => 'secret',
|
||||
"ignore_mail_verified" => true,
|
||||
"ignore_id_token_verification" => true,
|
||||
"provider_config" => [
|
||||
"token_endpoint"=> "http://auth.open-paas.org.local/oauth2/token", //token_endpoint
|
||||
"userinfo_endpoint" => "http://auth.open-paas.org.local/oauth2/userinfo",//userinfo_endpoint
|
||||
"end_session_endpoint" => "http://auth.open-paas.org.local/oauth2/logout",//end_session_endpoint
|
||||
"authorization_endpoint" => "http://auth.open-paas.org.local/oauth2/authorize",//authorization_endpoint
|
||||
]
|
||||
|
||||
],
|
||||
```
|
||||
|
||||
Add line to /etc/hosts if needed :
|
||||
|
||||
`sudo docker-compose exec php bash -c "echo '51.210.124.92 manager.open-paas.org.local auth.open-paas.org.local reload.open-paas.org.local' >> /etc/hosts"`
|
||||
|
||||
#### 2. Lemon LDAP configuration
|
||||
|
||||
Dans ClientOpenIDConnect > twake > Options > Basique > Adresse connexion : [http://15.236.209.74/ajax/users/openid](http://15.236.209.74/ajax/users/openid)
|
||||
|
||||
Dans ClientOpenIDConnect > twake > Attributs exportés :
|
||||
|
||||
```text
|
||||
{
|
||||
email_verified: email_verified,
|
||||
picture: picture,
|
||||
name: cn,
|
||||
given_name: givenName,
|
||||
family_name: sn,
|
||||
email: mail,
|
||||
sub: uid
|
||||
}
|
||||
```
|
||||
|
||||
\[Ne marche pas pour le moment\] Dans ClientOpenIDConnect > twake > Options > Déconnexion > Adresse : [http://15.236.209.74/ajax/users/openid/logout\_success](http://15.236.209.74/ajax/users/openid/logout_success)
|
||||
|
||||
-47
@@ -1,47 +0,0 @@
|
||||
---
|
||||
description: Use Keycloak with Twake
|
||||
---
|
||||
|
||||
# Using Keycloak \(LDAP, OpenID and more\)
|
||||
|
||||
#### Run keycloak and persist data
|
||||
|
||||
```text
|
||||
cd twake
|
||||
docker run -p 8080:8080 -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin -v $(pwd)/docker-data/keycloak-db:/opt/jboss/keycloak/standalone/data jboss/keycloak
|
||||
```
|
||||
|
||||
#### Configure keycloak with twake for the first time
|
||||
|
||||
**On Keycloak**
|
||||
|
||||
Go to `http://localhost:8080/auth/`
|
||||
|
||||
Login with admin:admin
|
||||
|
||||
Go to client > account > Credentials tab and save the `Secret`
|
||||
|
||||
Go to Settings tab and add a Valid Redirect uri to `http://localhost:8000/*` and save
|
||||
|
||||
Then create an user in User / Add User
|
||||
|
||||
⚠️ Users must have an email and the email must be marked as verified !
|
||||
|
||||
Then create a password for this user.
|
||||
|
||||
**On Twake**
|
||||
|
||||
Go to your \[docker-compose file location\]/configuration/backend/Parameters.php \(see [Configuration](../)\)
|
||||
|
||||
Change defaults.auth.openid to:
|
||||
|
||||
```text
|
||||
"use" => true,
|
||||
"provider_uri" => 'http://[machine_ip]:8080/auth/realms/master',
|
||||
"client_id" => 'account',
|
||||
"client_secret" => '[keycloak_secret]',
|
||||
"logout_suffix" => "/protocol/openid-connect/logout" //Specific to keycloak
|
||||
```
|
||||
|
||||
ℹ️ \[machine\_ip\] Because Twake is accessing keycloak for inside a docker container, do not use localhost or 127.0.0.1 to access keycloak.
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
---
|
||||
description: To configure your mail serveur with Twake.
|
||||
---
|
||||
|
||||
# 💌 Configure mail server
|
||||
|
||||
Here is the default mail block in the configuration file to edit \(from Parameters.php, see "[Configuration page](./)"\):
|
||||
|
||||
```text
|
||||
"mail" => [
|
||||
"sender" => [
|
||||
"host" => "", //smtp server
|
||||
"port" => "",
|
||||
"username" => "",
|
||||
"password" => "",
|
||||
"auth_mode" => "plain" //plain, login, cram-md5, or null
|
||||
],
|
||||
"from" => "noreply@twakeapp.com",
|
||||
"dkim" => [ //Optional, to avoid lost emails, configure your dns with dkim
|
||||
"private_key" => "",
|
||||
"domain_name" => '',
|
||||
"selector" => ''
|
||||
],
|
||||
"twake_domain_url" => "https://twakeapp.com/",
|
||||
"from_name" => "Twake", //Server owner name
|
||||
"twake_address" => "Twake, 54000 Nancy, France", //Server owner address
|
||||
"template_dir" => "/src/Twake/Core/Resources/views/", //Must not be modified
|
||||
],
|
||||
```
|
||||
|
||||
⚠️ Once edited, don't forget to restart docker.
|
||||
|
||||
You can test the good behaviour of emails going into your account parameters, emails, add a secondary email. Or simply try to invite a user using its email.
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
---
|
||||
description: 'You can connect anything you want on Twake, read this to know how.'
|
||||
---
|
||||
|
||||
# 🔌 Connectors and plugins
|
||||
|
||||
### Install connectors and plugins on SaaS version
|
||||
|
||||
Work in progress.
|
||||
|
||||
Ask us to be faster on [https://community.twake.app](https://community.twake.app) !
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
---
|
||||
description: Use a custom domain with Twake
|
||||
---
|
||||
|
||||
# 🔗 Custom domain + HTTPS
|
||||
|
||||
::: info
|
||||
We do not offer the possibility to edit the nginx configuration present in the docker-compose containers yet. To enable https you first need to install nginx and configure on your machine.
|
||||
|
||||
Your nginx installation will be used to forward the requests from https to the docker-compose http port.
|
||||
|
||||
The last step is to tell Twake that the frontend is accessed from a different domain and protocol to handle the redirections.
|
||||
:::
|
||||
|
||||
#### Use port 80 or 443 over https
|
||||
|
||||
To use 443 create a new nginx install and attach a proxy to port 8000 + certauto.
|
||||
If you use Apache2 go on the [Apache2 configuration page](apache2-configuration.md).
|
||||
|
||||
> Follow this thread if you have issues with websockets and reverse proxy: [https://community.twake.app/t/twake-on-docker-behind-apache-proxy/78](https://community.twake.app/t/twake-on-docker-behind-apache-proxy/78)
|
||||
|
||||
```text
|
||||
# /etc/nginx/site-enabled/default
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:8000;
|
||||
}
|
||||
|
||||
location /socketcluster/ {
|
||||
proxy_pass http://127.0.0.1:8000/socketcluster/;
|
||||
# this magic is needed for WebSocket
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_connect_timeout 7d;
|
||||
proxy_send_timeout 7d;
|
||||
proxy_read_timeout 7d;
|
||||
}
|
||||
```
|
||||
|
||||
#### Configure domain name
|
||||
|
||||
You must edit the configuration in both `configuration/frontend/environment.ts` and `configuration/backend/Parameters.php`
|
||||
|
||||
```text
|
||||
//Exemple of environment.ts
|
||||
export default {
|
||||
env_dev: false,
|
||||
mixpanel_enabled: false,
|
||||
sentry_dsn: false,
|
||||
mixpanel_id: false,
|
||||
front_root_url: 'https://twake.acme.com',
|
||||
api_root_url: 'https://twake.acme.com',
|
||||
websocket_url: 'wss://twake.acme.com'
|
||||
};
|
||||
```
|
||||
|
||||
```text
|
||||
//To change in Parameters.php
|
||||
...
|
||||
"env" => [
|
||||
...
|
||||
"server_name" => "https://twake.acme.com/",
|
||||
],
|
||||
...
|
||||
```
|
||||
|
||||
> Dont forget to restart your docker-compose 😉 and rebuild the frontend:
|
||||
> `docker-compose exec nginx yarn build`
|
||||
-77
@@ -1,77 +0,0 @@
|
||||
---
|
||||
description: "\U0001F64F From Dahpril (community) https://github.com/TwakeApp/Twake/issues/76"
|
||||
---
|
||||
|
||||
# Apache2 configuration
|
||||
|
||||
#### Apache vhost
|
||||
|
||||
You need to create a vhost listening on port 443.
|
||||
|
||||
_For exemple with certbot :_
|
||||
|
||||
_1. Create a vhost listening on port 80 with ServerName equals to your custom domain. Don't define any document root. 2. Then, use certbot to get a certificate and automatically create your vhost listening on port 443_
|
||||
|
||||
```text
|
||||
sudo certbot --apache --email your_email -d your_domain --agree-tos --redirect --noninteractive
|
||||
```
|
||||
|
||||
#### Reverse proxy
|
||||
|
||||
You have now to configure your reverse proxy directive. Head up to your 443 vhost configuration file and paste those directives \(place them after server and ssl directives\) :
|
||||
|
||||
```text
|
||||
RewriteEngine on
|
||||
RewriteCond ${HTTP:Upgrade} websocket [NC]
|
||||
RewriteCond ${HTTP:Connection} upgrade [NC]
|
||||
RewriteRule .* "wss://127.0.0.1:8000/$1" [P,L]
|
||||
|
||||
ProxyRequests off
|
||||
|
||||
<Location />
|
||||
ProxyPass http://127.0.0.1:8000/
|
||||
ProxyPassReverse http://127.0.0.1:8000/
|
||||
ProxyPreserveHost On
|
||||
</Location>
|
||||
<Location /socketcluster>
|
||||
ProxyPass ws://127.0.0.1:8000/socketcluster
|
||||
ProxyPassReverse ws://127.0.0.1:8000/socketcluster
|
||||
ProxyPreserveHost On
|
||||
</Location>
|
||||
|
||||
<Proxy *>
|
||||
AllowOverride All
|
||||
Order allow,deny
|
||||
Allow from All
|
||||
</Proxy>
|
||||
|
||||
RequestHeader set X-Forwarded-port "80"
|
||||
```
|
||||
|
||||
Be careful to NOT type trailing slash for ws location \(it won't work\).
|
||||
|
||||
I'm not sure that all directives are needed, but this configuration works for me.
|
||||
|
||||
#### Configuring remoteip
|
||||
|
||||
You also need to configure remoteip mod from apache with this command :
|
||||
|
||||
```text
|
||||
a2enmod remoteip
|
||||
```
|
||||
|
||||
Then, edit /etc/apache2/conf-available/remoteip.conf to fit with this content :
|
||||
|
||||
```text
|
||||
RemoteIPHeader X-Real-IP
|
||||
RemoteIPTrustedProxy 127.0.0.1 ::1
|
||||
```
|
||||
|
||||
You can now enable the configuration of remoteip and restart Apache :
|
||||
|
||||
```text
|
||||
a2enconf remoteip
|
||||
service apache2 restart
|
||||
```
|
||||
|
||||
Return to the section "Configure domain name" of [Custom domain + HTTPS](./README.md#configure-domain-name) page to continue the configuration.
|
||||
@@ -1,64 +0,0 @@
|
||||
---
|
||||
description: How to make Twake feel better in your company.
|
||||
---
|
||||
|
||||
# 🎨 Customisation
|
||||
|
||||
> Customising Twake on SaaS \(web.twake.app\) is not available yet, contact sales to install an on-premise Twake version.
|
||||
|
||||
### Customise style and logos
|
||||
|
||||
You can customise Twake for your brand using the `configuration/backend/Parameters.php` file.
|
||||
|
||||
```text
|
||||
"defaults" => [
|
||||
"branding" => [
|
||||
"header" => [
|
||||
"logo" => '', //Some logo used on header coloured background
|
||||
"apps" => [ //A list of apps accessible from header
|
||||
[
|
||||
"name"=> '', //App name
|
||||
"url"=> '', //Url to your app
|
||||
"icon"=> '', //App icon as image
|
||||
],
|
||||
],
|
||||
],
|
||||
"style" => [
|
||||
"color" => '#2196F3', //Change default main color
|
||||
"default_border_radius" => '2', //Change default main border-radius
|
||||
],
|
||||
"name" => "", //Brand name
|
||||
"enable_newsletter" => false, //Disable newsletter checkbox on subscribe
|
||||
"link" => "", //Link to your website (showed on login page)
|
||||
"logo" => "" //Coloured logo (white background)
|
||||
]
|
||||
]
|
||||
```
|
||||
|
||||
### Customize apps
|
||||
|
||||
You can disable default apps with this command \(apps will not be installed on future new companies or workspaces\)
|
||||
|
||||
```text
|
||||
"defaults" => [
|
||||
"applications" => [
|
||||
"twake_calendar" => false, //Not available
|
||||
"twake_tasks" => [ "default" => false ], //Available but not by default
|
||||
"twake_drive" => [ "default" => true ], //Available and by default in every new workspaces
|
||||
"connectors" => [
|
||||
"jitsi" => [ "default" => true ],
|
||||
"linshare" => false
|
||||
]
|
||||
]
|
||||
]
|
||||
```
|
||||
|
||||
After editing this configuration, **restart docker-compose** \(to import new configuration\) and type the following command:
|
||||
|
||||
```text
|
||||
#docker-compose restart #To import new configuration
|
||||
docker-compose exec php php bin/console twake:init
|
||||
```
|
||||
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
---
|
||||
description: More details about Twake configuration.
|
||||
description: More details about TDrive configuration.
|
||||
---
|
||||
|
||||
# ⚙️ Server configuration
|
||||
|
||||
### Detach the configuration and start using your own
|
||||
|
||||
Each configuration file is optional, if not given, Twake will fallback to default configuration.
|
||||
Each configuration file is optional, if not given, TDrive will fallback to default configuration.
|
||||
|
||||
#### Backend configuration
|
||||
|
||||
You can find an example of Twake configuration (default configuration) here: [https://github.com/TwakeApp/Twake/blob/main/twake/backend/node/config/default.json](https://github.com/TwakeApp/Twake/blob/main/twake/backend/node/config/default.json)
|
||||
You can find an example of TDrive configuration (default configuration) here: [https://github.com/TDriveApp/TDrive/blob/main/tdrive/backend/node/config/default.json](https://github.com/TDriveApp/TDrive/blob/main/tdrive/backend/node/config/default.json)
|
||||
|
||||
Copy the content of this file and put it in `[docker-compose.yml location]/configuration/backend-node/production.json`
|
||||
|
||||
@@ -18,7 +18,7 @@ Copy the content of this file and put it in `[docker-compose.yml location]/confi
|
||||
|
||||
#### Backend configuration, PHP (only for scalable mode)
|
||||
|
||||
An example is available here: [https://github.com/TwakeApp/Twake/blob/main/twake/backend/core/app/Configuration/Parameters.php.dist](https://github.com/TwakeApp/Twake/blob/main/twake/backend/core/app/Configuration/Parameters.php.dist)
|
||||
An example is available here: [https://github.com/TDriveApp/TDrive/blob/main/tdrive/backend/core/app/Configuration/Parameters.php.dist](https://github.com/TDriveApp/TDrive/blob/main/tdrive/backend/core/app/Configuration/Parameters.php.dist)
|
||||
|
||||
Copy the content of this file and put it in `[docker-compose.yml location]/configuration/backend/Parameters.php`
|
||||
|
||||
@@ -26,7 +26,7 @@ Copy the content of this file and put it in `[docker-compose.yml location]/confi
|
||||
|
||||
#### Frontend configuration (only for scalable mode)
|
||||
|
||||
You can find an example of Twake configuration (default configuration) here: [https://github.com/TwakeApp/Twake/blob/main/twake/frontend/src/app/environment/environment.ts.dist](https://github.com/TwakeApp/Twake/blob/main/twake/frontend/src/app/environment/environment.ts.dist)
|
||||
You can find an example of TDrive configuration (default configuration) here: [https://github.com/TDriveApp/TDrive/blob/main/tdrive/frontend/src/app/environment/environment.ts.dist](https://github.com/TDriveApp/TDrive/blob/main/tdrive/frontend/src/app/environment/environment.ts.dist)
|
||||
|
||||
Copy the content of this file and put it in `[docker-compose.yml location]/configuration/frontend/environment.ts`
|
||||
|
||||
|
||||
@@ -1,18 +1,15 @@
|
||||
---
|
||||
description: You should update this security keys to ship Twake in production.
|
||||
description: You should update this security keys to ship TDrive in production.
|
||||
---
|
||||
|
||||
# 🔒 Security
|
||||
|
||||
> See how to [Detach Configuration](./) first.
|
||||
|
||||
The following keys must be updated to increase Twake security in [docker-compose.yml location]/configuration/backend-node/production.json:
|
||||
The following keys must be updated to increase TDrive security in [docker-compose.yml location]/configuration/backend-node/production.json:
|
||||
|
||||
```json
|
||||
{
|
||||
"phpnode": {
|
||||
"secret": "xxx" // Secret for PHP<->Node communication, deprecated like PHP
|
||||
},
|
||||
"websocket": {
|
||||
"auth": {
|
||||
"jwt": {
|
||||
@@ -34,27 +31,3 @@ The following keys must be updated to increase Twake security in [docker-compose
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The following keys must be updated to increase Twake security in /configuration/backend/Parameters.php:
|
||||
|
||||
```text
|
||||
"env" => [
|
||||
"secret" => "somesecret", //Any string
|
||||
],
|
||||
...
|
||||
"websocket" => [
|
||||
...
|
||||
"pusher_public" //Generate public and private key
|
||||
"pusher_private" //Put private key here
|
||||
],
|
||||
"db" => [
|
||||
...
|
||||
"encryption_key" //Any string
|
||||
]
|
||||
...
|
||||
"storage" => [
|
||||
...
|
||||
"drive_salt" => "SecretPassword", //Any string
|
||||
],
|
||||
...
|
||||
```
|
||||
|
||||
@@ -1,32 +1,32 @@
|
||||
# 🏗 Install on your server
|
||||
|
||||
## Use Twake in SaaS
|
||||
## Use TDrive in SaaS
|
||||
|
||||
You can test or use Twake in our SaaS : [chat.twake.app](https://chat.twake.app)
|
||||
You can test or use TDrive in our SaaS : [chat.tdrive.app](https://chat.tdrive.app)
|
||||
|
||||
## Run Twake in your server
|
||||
## Run TDrive in your server
|
||||
|
||||
1. First you'll need to [install docker and docker-compose](https://docs.docker.com/compose/install/).
|
||||
|
||||
2. Then you can install Twake on your server with this command
|
||||
2. Then you can install TDrive on your server with this command
|
||||
|
||||
```
|
||||
git clone https://github.com/TwakeApp/Twake.git
|
||||
cd Twake/twake
|
||||
git clone https://github.com/TDriveApp/TDrive.git
|
||||
cd TDrive/tdrive
|
||||
docker-compose -f docker-compose.onpremise.mongo.yml up -d
|
||||
```
|
||||
|
||||
Twake will be running on port 3000
|
||||
TDrive will be running on port 3000
|
||||
|
||||
### What's next ?
|
||||
|
||||
If you kept the default configuration, you can simply follow the signup steps, no email verification is required by default so you will get into Twake right after the signup steps.
|
||||
If you kept the default configuration, you can simply follow the signup steps, no email verification is required by default so you will get into TDrive right after the signup steps.
|
||||
|
||||
## Ship Twake in production
|
||||
## Ship TDrive in production
|
||||
|
||||
See how to [manage configuration](./configuration/index.md)). And then how to [update security keys](./configuration/security.md), and finally how to use your [custom domain](./configuration/custom-domain-and-https/README.md)).
|
||||
See how to [manage configuration](./configuration/index.md)). And then how to [update security keys](./configuration/security.md).
|
||||
|
||||
### Update Twake
|
||||
### Update TDrive
|
||||
|
||||
```
|
||||
docker-compose stop
|
||||
@@ -42,21 +42,21 @@ Currently you'll need at least a **2 cpu + 4 gb of ram** machine for **20-50 use
|
||||
|
||||
If you enable ElasticSearch, use two machines, or limit the cpu/ram dedicated to it and use a larger machine (at least 2gb of ram and 1 cpu dedicated to ES for 20-50 users).
|
||||
|
||||
If you need to deploy Twake for more users, you can use only one big machine up to 500 users (Will need something like **12 cpu and 32go of ram**), then you'll need to use multiple nodes.
|
||||
If you need to deploy TDrive for more users, you can use only one big machine up to 500 users (Will need something like **12 cpu and 32go of ram**), then you'll need to use multiple nodes.
|
||||
|
||||
---
|
||||
|
||||
# 🎡 Scale with Twake
|
||||
# 🎡 Scale with TDrive
|
||||
|
||||
> We deployed Twake on production for companies of 10 to 50 users in a single node. We also deployed Twake in a scalable mode and we support currently thousands of concurrent users.
|
||||
> If you deploy Twake in your own company we would love to have your feedback here [https://github.com/TwakeApp/Twake/issues/289](https://github.com/TwakeApp/Twake/issues/289) to improve our requirements documentation.
|
||||
> Now if you want to scale with Twake and support thousand of users, continue reading.
|
||||
> We deployed TDrive on production for companies of 10 to 50 users in a single node. We also deployed TDrive in a scalable mode and we support currently thousands of concurrent users.
|
||||
> If you deploy TDrive in your own company we would love to have your feedback here [https://github.com/TDriveApp/TDrive/issues/289](https://github.com/TDriveApp/TDrive/issues/289) to improve our requirements documentation.
|
||||
> Now if you want to scale with TDrive and support thousand of users, continue reading.
|
||||
|
||||
Scaling with Twake is possible if you install Twake with **RabbitMQ, Redis, ElasticSearch and ScyllaDB**.
|
||||
Scaling with TDrive is possible if you install TDrive with **RabbitMQ, Redis, ElasticSearch and ScyllaDB**.
|
||||
|
||||
```
|
||||
git clone https://github.com/TwakeApp/Twake.git
|
||||
cd Twake/twake
|
||||
git clone https://github.com/TDriveApp/TDrive.git
|
||||
cd TDrive/tdrive
|
||||
|
||||
cp -n docker-compose.yml.dist.onpremise docker-compose.yml
|
||||
cp -nR default-configuration/ configuration/
|
||||
@@ -71,8 +71,8 @@ sleep 10m #Wait php to create tables in scylladb
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
> To run ElasticSearch (optional, but enabled by default in the Twake docker-compose) you must increase the max_map_count of your system: [https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#\_set_vm_max_map_count_to_at_least_262144](https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#_set_vm_max_map_count_to_at_least_262144)
|
||||
> To run ElasticSearch (optional, but enabled by default in the TDrive docker-compose) you must increase the max_map_count of your system: [https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#\_set_vm_max_map_count_to_at_least_262144](https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#_set_vm_max_map_count_to_at_least_262144)
|
||||
>
|
||||
> To fix an other bug with ElasticSearch container, you must also run this command: `chmod 777 ./docker-data/es_twake` (create the folder if it doesn't exists in your docker-compose.yml folder)
|
||||
> To fix an other bug with ElasticSearch container, you must also run this command: `chmod 777 ./docker-data/es_tdrive` (create the folder if it doesn't exists in your docker-compose.yml folder)
|
||||
|
||||
Twake will be running on port 8000 🎉
|
||||
TDrive will be running on port 8000 🎉
|
||||
|
||||
Reference in New Issue
Block a user