Clean documentation

This commit is contained in:
Romaric Mourgues
2023-04-17 17:00:03 +02:00
parent a46c6ca0a8
commit 88bd3b2a32
80 changed files with 138 additions and 2492 deletions
@@ -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).
@@ -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)
@@ -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`
@@ -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
],
...
```
+22 -22
View File
@@ -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 🎉