Skip to content

Commit

Permalink
Merge pull request #47 from linagora/docker-doc
Browse files Browse the repository at this point in the history
Add Docker doc
  • Loading branch information
guimard authored Jun 9, 2024
2 parents 4a68ece + d119395 commit 85ae731
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 8 deletions.
69 changes: 68 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Twake server repository
# Twake-Chat server repository

This is a multi-packages repository. See [packages](./packages) directory.

Expand Down Expand Up @@ -27,6 +27,73 @@ REST API Endpoints documentation is available on https://linagora.github.io/ToM-
[Matrix specification](https://spec.matrix.org/latest/server-server-api/#server-discovery)
* [@twake/retry-promise](packages/retry-promise): simple module extending javascript Promise with retry strategy

## Twake-Chat docker

This repository provides a docker image. Here are the environment variables:

* Required:
* `BASE_URL`: Public URL
* Database:
* `DATABASE_ENGINE` _(`pg` or `sqlite`)_
* `DATABASE_HOST` _(path for `sqlite`)_
* `DATABASE_NAME`
* `DATABASE_USER`
* `DATABASE_PASSWORD`
* `DATABASE_SSL`
* `OIDC_ISSUER`: URL of SSO server
* LDAP service:
* `LDAP_BASE`
* `LDAP_FILTER`
* `LDAP_USER`
* `LDAP_PASSWORD`
* `LDAP_URI`
* Matrix server:
* `SERVER_NAME` _(same value than in Matrix's homeserver.yaml)_
* `MATRIX_SERVER` _(real Matrix server)_
* `TEMPLATE_DIR` _(default: `node_modules/@twake/server/templates`)_
* Recommended:
* `ADDITIONAL_FEATURES`: set true to have all search features; false for a public instance
* Cron service:
* `CRON_SERVICE` _(default: true)_: enable cron tasks
* `UPDATE_USERS_CRON` _(default: `*/15 * * * *`)_
* `UPDATE_FEDERATED_IDENTITY_HASHES_CRON` _(default: `3 3 * * *`)_
* Logs:
* `LOG_TRANSPORTS`: set to `Console`
* `TRUSTED_PROXIES`: IP list of server allowed to set `X-Frowarded-For` header
* Rate limits _(see [express-rate-limit](https://www.npmjs.com/package/express-rate-limit))_:
* `RATE_LIMITING_WINDOW`
* `RATE_LIMITING_NB_REQUESTS`
* Optional:
* `FEDERATED_IDENTITY_SERVICES`: list of federated identity services
* Use a CrowdSec service:
* `CROWDSEC_URI`
* `CROWDSEC_KEY`
* Add Jitsi into metadata:
* `JITSI_BASE_URL`
* `JITSI_JWT_ALGORITHM`
* `JITSI_JWT_ISSUER`
* `JITSI_SECRET`
* `JITSI_PREFERRED_DOMAIN`
* `JITSI_USE_JWT`
* Matrix database _(for automatic channels)_:
* `MATRIX_DATABASE_ENGINE`
* `MATRIX_DATABASE_HOST`
* `MATRIX_DATABASE_NAME`
* `MATRIX_DATABASE_PASSWORD`
* `MATRIX_DATABASE_SSL`
* `MATRIX_DATABASE_USER`
* Opensearch features:
* `OPENSEARCH_CA_CERT_PATH`
* `OPENSEARCH_HOST`
* `OPENSEARCH_IS_ACTIVATED`
* `OPENSEARCH_MAX_RETRIES`
* `OPENSEARCH_NUMBER_OF_SHARDS`
* `OPENSEARCH_NUMBER_OF_REPLICAS`
* `OPENSEARCH_PASSWORD`
* `OPENSEARCH_SSL`
* `OPENSEARCH_USER`
* `OPENSEARCH_WAIT_FOR_ACTIVE_SHARDS`

## Copyright and license

Copyright (c) 2023-present Linagora <https://linagora.com>
Expand Down
12 changes: 6 additions & 6 deletions packages/logger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ Logger is based on [winston library](https://github.com/winstonjs/winston). This
### Environment variables

Three environment variables are available:
* LOG_TRANSPORTS: selects the "interface" to display logs. It must be equal to "Console" or "File" or event both "Console,File"
* LOG_LEVEL: selects the level of logs that should be displayed (available values from the most restrictive to the less restrictive: "error", "warn", "info", "http", "verbose", "debug", "silly")
* LOG_FILE: enables to specify the path to the file where logs should be written if LOG_TRANSPORTS is equal or contains the value "File"
* `LOG_TRANSPORTS`: selects the "interface" to display logs. It must be equal to "Console" or "File" or event both "Console,File"
* `LOG_LEVEL`: selects the level of logs that should be displayed (available values from the most restrictive to the less restrictive: "error", "warn", "info", "http", "verbose", "debug", "silly")
* `LOG_FILE`: enables to specify the path to the file where logs should be written if `LOG_TRANSPORTS` is equal or contains the value "File"

```
LOG_TRANSPORTS=File
Expand All @@ -23,9 +23,9 @@ LOG_FILE=etc/twake/winston.log

All winston's [core configuration properties](https://github.com/winstonjs/winston#logging) except `format` and `levels` can be set in a JSON configuration file. The property `transports` is set through the field `log_transports` which is detailed in the following part.
There are three more available properties:
* default_meta: javascript object containing metadata that should be displayed in the log message
* exception_handlers: array containing transports which specify where uncaughtException events should be displayed (see [winston documention](https://github.com/winstonjs/winston#exceptions))
* rejection_handlers: array containing transports which specify where uncaughtRejection events should be displayed (see [winston documention](https://github.com/winstonjs/winston#rejections))
* `default_meta`: javascript object containing metadata that should be displayed in the log message
* `exception_handlers`: array containing transports which specify where uncaughtException events should be displayed (see [winston documention](https://github.com/winstonjs/winston#exceptions))
* `rejection_handlers`: array containing transports which specify where uncaughtRejection events should be displayed (see [winston documention](https://github.com/winstonjs/winston#rejections))

These properties should be the value of a `logging` field

Expand Down
2 changes: 1 addition & 1 deletion server.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const appServerConf = {
let conf = {
...appServerConf,
additional_features: process.env.ADDITIONAL_FEATURES || false,
cron_service: process.env.CRON_SERVICE || true,
cron_service: process.env.CRON_SERVICE ?? true,
database_engine: process.env.DATABASE_ENGINE,
database_host: process.env.DATABASE_HOST,
database_name: process.env.DATABASE_NAME,
Expand Down

0 comments on commit 85ae731

Please sign in to comment.