mirror of
https://github.com/tinode/chat.git
synced 2025-03-15 09:58:43 +00:00
add more configuration options to docker container
This commit is contained in:
@ -131,8 +131,8 @@ pushd ./py_grpc > /dev/null
|
||||
# Generate version file from git tags
|
||||
python3 version.py
|
||||
|
||||
#Generate tinode-grpc package
|
||||
python3 setup.py sdist bdist_wheel
|
||||
# Generate tinode-grpc package
|
||||
python3 setup.py -q sdist bdist_wheel
|
||||
|
||||
popd > /dev/null
|
||||
|
||||
|
@ -59,3 +59,28 @@ then repeat step 4 adding `--env RESET_DB=true`.
|
||||
### Run the chatbot
|
||||
|
||||
See [instructions](../chatbot/).
|
||||
|
||||
## Supported environment variables
|
||||
|
||||
You can specify the following environment viriables when issuing `docker run` command:
|
||||
|
||||
| Variable | Type | Default | Function |
|
||||
| --- | --- | --- | --- |
|
||||
| API_KEY_SALT | string | `T713/rYYgW7g4m3vG6zGRh7+FM1t0T8j13koXScOAj4=` | base64-encoded 32 random bytes used as API salt. Use [keygen](../keygen) to create the API key. |
|
||||
| AUTH_TOKEN_KEY | string | `wfaY2RgF2S1OQI/ZlK+LSrp1KB2jwAdGAIHQ7JZn+Kc=` | base64-encoded 32 random bytes used as salt for authentication tokens |
|
||||
| DEBUG_EMAIL_VERIFICATION_CODE | string | | Enable dummy email verification code. Disabled by default (empty string). |
|
||||
| MYSQL_DSN | string | `'root@tcp(mysql)/tinode'` | MySQL [DSN](https://github.com/go-sql-driver/mysql#dsn-data-source-name) |
|
||||
| RESET_DB | bool | `false` | Drop and recreate the database. |
|
||||
| SMTP_PASSWORD | string | | Password to use for authentication with the SMTP server |
|
||||
| SMTP_PORT | string | | Port number of the SMTP server to use for sending verification emails, e.g. `"25"` or `"587"`. |
|
||||
| SMTP_SENDER | string | | Email address to use in the `FROM` field of verification emails and for authenticationwith the SMTP server. |
|
||||
| SMTP_SERVER | string | | Name of the SMTP server to use for sending verification emails, e.g. `"smtp.gmail.com"`. If SMTP_SERVER is not defined, email verification will be disabled. |
|
||||
| TLS_CONTACT_ADDRESS | string | | Optional email address to use as contact for Lets Encrypt certificats. |
|
||||
| TLS_DOMAIN_NAME | string | | Domain name of your container for TLS support |
|
||||
| TLS_ENABLED | bool | `false` | Controls if TRL (http**s**) is enabled. If enabled, a valid TLS_DOMAIN_NAME must be provided too. You also have to correctly configure DNS for your container. |
|
||||
| UID_ENCRYPTION_KEY | string | `la6YsO+bNX/+XIkOqc5Svw==` | base64-encoded 16 random bytes used as an encryption key for user IDs. |
|
||||
|
||||
Unix-like systems offer a convenient way to generate a random base64-encoded string of desired length as
|
||||
```
|
||||
$ openssl rand -base64 <desired length>
|
||||
```
|
@ -35,15 +35,16 @@ ENV PLUGIN_PYTHON_CHAT_BOT_ENABLED=false
|
||||
|
||||
# Various encryption and salt keys. Replace with your own in production.
|
||||
|
||||
# Key to initialize UID generator
|
||||
ENV UID_ENCRYPTION_KEY=la6YsO+bNX/+XIkOqc5Svw==
|
||||
|
||||
# Key to sign API app ID.
|
||||
ENV API_KEY_SALT=T713/rYYgW7g4m3vG6zGRh7+FM1t0T8j13koXScOAj4=
|
||||
|
||||
# Key used to sign authentication tokens.
|
||||
ENV AUTH_TOKEN_KEY=wfaY2RgF2S1OQI/ZlK+LSrp1KB2jwAdGAIHQ7JZn+Kc=
|
||||
|
||||
# Key to initialize UID generator
|
||||
ENV UID_ENCRYPTION_KEY=la6YsO+bNX/+XIkOqc5Svw==
|
||||
|
||||
|
||||
# Adding bash and grep as they are used here.
|
||||
RUN apk add --no-cache bash grep
|
||||
|
||||
|
@ -58,17 +58,17 @@
|
||||
"acc_validation": {
|
||||
"email": {
|
||||
"add_to_tags": true,
|
||||
"required": [],
|
||||
"required": ["$EMAIL_VERIFICATION_REQUIRED"],
|
||||
"config": {
|
||||
"smtp_server": "smtp.example.com",
|
||||
"smtp_port": "25",
|
||||
"sender": "noreply@example.com",
|
||||
"sender_password": "your-password-here",
|
||||
"smtp_server": "$SMTP_SERVER",
|
||||
"smtp_port": "$SMTP_PORT",
|
||||
"sender": "$SMTP_SENDER",
|
||||
"sender_password": "$SMTP_PASSWORD",
|
||||
"msg_body_templ": "./templ/email-validation-body.templ",
|
||||
"msg_subject": "Tinode chat: confirm email",
|
||||
"headers": [],
|
||||
"max_retries": 4,
|
||||
"debug_response": "123456"
|
||||
"debug_response": "$DEBUG_EMAIL_VERIFICATION_CODE"
|
||||
}
|
||||
},
|
||||
|
||||
@ -77,7 +77,7 @@
|
||||
"config": {
|
||||
"template": "./templ/sms-validation.templ",
|
||||
"max_retries": 4,
|
||||
"debug_response": "123456"
|
||||
"debug_response": "$DEBUG_TEL_VERIFICATION_CODE"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Reference in New Issue
Block a user