2018-03-24 18:38:41 -07:00
|
|
|
// The JSON comments are somewhat brittle. Don't try anything too fancy.
|
2016-05-27 18:24:54 -07:00
|
|
|
{
|
2020-03-26 20:09:59 +03:00
|
|
|
// HTTP(S) address to listen on for websocket and long polling clients. Either a TCP host:port pair
|
2020-03-18 17:37:31 +03:00
|
|
|
// or a path to Unix socket as "unix:/path/to/socket.sock".
|
2021-03-16 21:36:44 -07:00
|
|
|
// The TCP port is either a numerical value or a canonical name, e.g. ":80" or ":https". May include
|
|
|
|
// the host name, e.g. "localhost:80" or "hostname.example.com:https".
|
2019-07-16 12:19:05 +03:00
|
|
|
// It could be blank: if TLS is not configured it will default to ":80", otherwise to ":443".
|
2018-03-24 18:38:41 -07:00
|
|
|
// Can be overridden from the command line, see option --listen.
|
2016-06-07 18:05:46 -07:00
|
|
|
"listen": ":6060",
|
2018-07-30 08:43:24 +03:00
|
|
|
|
2020-01-13 22:12:45 +03:00
|
|
|
// Base URL path for serving streaming and large file API calls.
|
|
|
|
// Can be overridden from the command line, see option --api_path.
|
|
|
|
"api_path": "/",
|
|
|
|
|
2021-06-25 10:37:12 -07:00
|
|
|
// Cache-Control header for static content in seconds. 39600 is 11 hours.
|
2018-10-31 12:11:13 +03:00
|
|
|
"cache_control": 39600,
|
2019-02-04 11:50:40 +03:00
|
|
|
|
2023-03-29 09:27:39 -07:00
|
|
|
// If true, do not attempt to negotiate websocket per message compression (RFC 7692.4).
|
|
|
|
// It should be disabled (set to true) if you are using MSFT IIS as a reverse proxy.
|
|
|
|
"ws_compression_disabled": false,
|
|
|
|
|
2018-03-24 18:38:41 -07:00
|
|
|
// URL path for mounting the directory with static files.
|
2018-06-27 16:33:33 +03:00
|
|
|
"static_mount": "/",
|
2018-07-30 08:43:24 +03:00
|
|
|
|
2020-03-26 20:09:59 +03:00
|
|
|
// TCP host:port or unix:/path/to/socket to listen for gRPC clients.
|
2020-03-18 17:37:31 +03:00
|
|
|
// Leave blank to disable gRPC support.
|
2018-03-24 18:38:41 -07:00
|
|
|
// Could be overridden from the command line with --grpc_listen.
|
2020-03-28 12:29:58 +03:00
|
|
|
"grpc_listen": ":16060",
|
2018-07-30 08:43:24 +03:00
|
|
|
|
2019-07-26 12:44:12 +03:00
|
|
|
// Enable handling of gRPC keepalives https://github.com/grpc/grpc/blob/master/doc/keepalive.md
|
|
|
|
// This sets server's GRPC_ARG_KEEPALIVE_TIME_MS to 60 seconds instead of the default 2 hours.
|
|
|
|
"grpc_keepalive_enabled": true,
|
|
|
|
|
2021-03-16 21:36:44 -07:00
|
|
|
// Salt for signing API key. 32 random bytes base64-encoded. Use 'keygen' tool (included in this
|
|
|
|
// distro) to generate the API key and the salt.
|
2016-05-27 18:24:54 -07:00
|
|
|
"api_key_salt": "T713/rYYgW7g4m3vG6zGRh7+FM1t0T8j13koXScOAj4=",
|
2018-07-30 08:43:24 +03:00
|
|
|
|
2021-03-16 21:36:44 -07:00
|
|
|
// Maximum message size allowed from the clients in bytes (262144 = 256KB).
|
2021-07-31 11:55:46 -07:00
|
|
|
// Media files with sizes greater than this limit are sent out of band.
|
|
|
|
// Don't change this limit to a much higher value because it would likely cause crashes:
|
|
|
|
// on Android & iOS due to a limit on the SQLite cursor window size;
|
|
|
|
// on the server-side with MySQL adapter due to the limit on the sort buffer size.
|
2017-09-21 21:15:45 -07:00
|
|
|
"max_message_size": 262144,
|
2018-07-30 08:43:24 +03:00
|
|
|
|
2018-03-24 18:38:41 -07:00
|
|
|
// Maximum number of subscribers per group topic.
|
2018-01-23 15:29:03 -08:00
|
|
|
"max_subscriber_count": 128,
|
2018-08-01 08:20:28 +03:00
|
|
|
|
2018-03-24 18:38:41 -07:00
|
|
|
// Maximum number of indexable tags per topic or user.
|
|
|
|
"max_tag_count": 16,
|
|
|
|
|
2023-03-14 17:07:34 -07:00
|
|
|
// If true, ordinary users cannot delete their accounts.
|
|
|
|
"permanent_accounts": false,
|
|
|
|
|
2019-11-15 11:10:43 +03:00
|
|
|
// URL path for exposing runtime stats. Disabled if the path is blank or "-".
|
2019-01-02 14:58:53 +03:00
|
|
|
// Could be overriden from the command line with --expvar.
|
2019-01-02 19:32:21 +03:00
|
|
|
"expvar": "/debug/vars",
|
2019-01-02 14:58:53 +03:00
|
|
|
|
2021-06-23 14:23:22 +03:00
|
|
|
// URL path for internal server status. Disabled if the path is blank or "-".
|
|
|
|
// Could be overriden from the command line with --server_status.
|
2021-06-23 14:56:26 -07:00
|
|
|
"server_status": "/debug/status",
|
2021-06-23 14:23:22 +03:00
|
|
|
|
2021-03-16 21:36:44 -07:00
|
|
|
// Read IP address of the client from the HTTP header 'X-Forwarded-For'.
|
|
|
|
// Useful when Tinode is behind a proxy. If missing, fallback to default RemoteAddr.
|
2020-04-27 19:18:26 +03:00
|
|
|
"use_x_forwarded_for": true,
|
|
|
|
|
2020-06-20 20:17:50 -07:00
|
|
|
// 2-letter country code to assign to sessions by default when the country isn't specified
|
|
|
|
// by the client explicitly and it's impossible to infer it.
|
|
|
|
// If missing, the server will default to "US".
|
|
|
|
"default_country_code": "",
|
|
|
|
|
2021-03-16 21:36:44 -07:00
|
|
|
// Large media/blob handlers: large files/images included in messages.
|
2018-06-18 11:19:28 +03:00
|
|
|
"media": {
|
2021-03-16 21:36:44 -07:00
|
|
|
// The name of the media handler to use.
|
2018-06-18 11:19:28 +03:00
|
|
|
"use_handler": "fs",
|
|
|
|
// Maximum size of uploaded file (8MB here for testing, maybe increase to 100MB = 104857600 in prod)
|
|
|
|
"max_size": 8388608,
|
2021-03-16 21:36:44 -07:00
|
|
|
// Garbage collection periodicity in seconds: unused or abandoned uploads are deleted.
|
2018-06-26 11:00:39 +03:00
|
|
|
"gc_period": 60,
|
2021-03-16 21:36:44 -07:00
|
|
|
// The number of unused/abandoned entries to delete in one pass.
|
2018-06-26 11:00:39 +03:00
|
|
|
"gc_block_size": 100,
|
2021-03-16 21:36:44 -07:00
|
|
|
// Configurations of individual handlers.
|
2018-06-18 11:19:28 +03:00
|
|
|
"handlers": {
|
|
|
|
// File system storage.
|
|
|
|
"fs": {
|
|
|
|
// File system location to store uploaded files. In case of a cluster it
|
2021-02-05 17:38:45 -08:00
|
|
|
// must be accessible by all cluster members, i.e. a network drive like https://www.samba.org/
|
|
|
|
"upload_dir": "uploads",
|
2023-05-27 12:08:32 -07:00
|
|
|
// Cache-Control header to use for uploaded files. 86400 seconds = 24 hours.
|
|
|
|
"cache_control": "max-age=86400",
|
2021-05-04 15:09:04 -07:00
|
|
|
// Origin URLs allowed to download/upload files, e.g. ["https://www.example.com", "http://example.com"].
|
|
|
|
// Not necessary in most cases.
|
2021-02-05 17:38:45 -08:00
|
|
|
// "cors_origins": ["*"]
|
2018-09-06 19:42:26 +08:00
|
|
|
},
|
2018-09-10 09:53:30 +03:00
|
|
|
// Amazon AWS S3 storage.
|
2021-06-26 12:47:26 -07:00
|
|
|
// See detailed explanation at https://pkg.go.dev/github.com/aws/aws-sdk-go/aws#Config
|
2018-09-10 09:53:30 +03:00
|
|
|
"s3":{
|
|
|
|
// Use AWS console to get Access Key ID and Secret Access Key.
|
|
|
|
// https://aws.amazon.com/blogs/security/wheres-my-secret-access-key/
|
|
|
|
"access_key_id": "your_s3_access_key_id",
|
|
|
|
"secret_access_key": "your_s3_secret_access_key",
|
|
|
|
// Region where the bucket is hosted.
|
|
|
|
"region": "s3 region, like us-east-2",
|
|
|
|
// Name of the S3 bucket.
|
2018-09-11 09:51:07 +03:00
|
|
|
"bucket": "your_s3_bucket_name",
|
2021-06-26 12:47:26 -07:00
|
|
|
// Set this to `true` to disable SSL when sending requests. Defaults to `false`.
|
|
|
|
"disable_ssl": false,
|
|
|
|
// Set this to `true` to force the request to use path-style addressing,
|
|
|
|
// i.e., `http://s3.amazonaws.com/BUCKET/KEY`. By default, the S3 client
|
|
|
|
// will use virtual hosted bucket addressing when possible
|
|
|
|
// (`http://BUCKET.s3.amazonaws.com/KEY`).
|
|
|
|
"force_path_style": false,
|
|
|
|
// An optional endpoint URL (hostname only or fully qualified URI)
|
2024-02-20 17:46:41 -08:00
|
|
|
// to override the default generated endpoint, or `""` to use the default generated endpoint.
|
|
|
|
// The endpoint can be of any S3-compatible service, such as "minio-api.x.io".
|
2021-06-26 12:47:26 -07:00
|
|
|
"endpoint": "",
|
2023-05-27 12:08:32 -07:00
|
|
|
// Expiration time for presigned URLs in seconds.
|
|
|
|
"presign_ttl": 3600,
|
|
|
|
// Cache-Control header to use for uploaded files. 86400 seconds = 24 hours.
|
|
|
|
"cache_control": "max-age=86400",
|
2021-05-04 15:09:04 -07:00
|
|
|
// Origin URLs allowed to download files, e.g. ["https://www.example.com", "http://example.com"].
|
|
|
|
// See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin
|
2018-09-11 09:51:07 +03:00
|
|
|
"cors_origins": ["*"]
|
2018-06-18 11:19:28 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2018-07-30 08:43:24 +03:00
|
|
|
|
2018-12-22 17:52:58 +03:00
|
|
|
// TLS (httpS) configuration. Applies to both web and gRPC interfaces.
|
2017-07-02 16:18:43 +03:00
|
|
|
"tls": {
|
2018-03-24 18:38:41 -07:00
|
|
|
// Enable TLS.
|
2017-07-02 16:18:43 +03:00
|
|
|
"enabled": false,
|
2018-07-30 08:43:24 +03:00
|
|
|
|
2018-03-24 18:38:41 -07:00
|
|
|
// Listen for connections on this port and redirect them to HTTPS port.
|
2020-03-18 17:37:31 +03:00
|
|
|
// Cannot be a Unix socket.
|
2017-09-15 17:39:58 -07:00
|
|
|
"http_redirect": ":80",
|
2018-07-30 08:43:24 +03:00
|
|
|
|
2018-03-24 18:38:41 -07:00
|
|
|
// Add Strict-Transport-Security to headers, the value signifies age.
|
|
|
|
// Zero or negative value turns it off.
|
2017-09-20 17:52:29 -07:00
|
|
|
"strict_max_age": 604800,
|
2018-07-30 08:43:24 +03:00
|
|
|
|
2021-03-16 21:36:44 -07:00
|
|
|
// Letsencrypt configuration.
|
2017-07-02 16:18:43 +03:00
|
|
|
"autocert": {
|
2018-03-24 18:38:41 -07:00
|
|
|
// Location of certificates.
|
2017-09-15 17:39:58 -07:00
|
|
|
"cache": "/etc/letsencrypt/live/your.domain.here",
|
2018-07-30 08:43:24 +03:00
|
|
|
|
2019-02-04 11:50:40 +03:00
|
|
|
// Contact address for this installation. LetsEncrypt will send
|
|
|
|
// messages to this address in case of problems. Replace with your
|
|
|
|
// own address or remove this line.
|
2018-03-24 18:38:41 -07:00
|
|
|
"email": "noreply@example.com",
|
2018-07-30 08:43:24 +03:00
|
|
|
|
2018-03-24 18:38:41 -07:00
|
|
|
// Domains served. Replace with your own domain name.
|
|
|
|
"domains": ["whatever.example.com"]
|
2019-01-22 09:37:18 +03:00
|
|
|
},
|
|
|
|
|
2019-02-04 11:50:40 +03:00
|
|
|
// If "autocert" config is not defined, read static certificates from
|
2019-01-22 09:37:18 +03:00
|
|
|
// these locations. Ignored if "autocert" is defined.
|
|
|
|
"cert_file": "/etc/httpd/conf/your.domain.crt",
|
|
|
|
"key_file": "/etc/httpd/conf/your.domain.key"
|
2017-07-02 16:18:43 +03:00
|
|
|
},
|
2018-03-24 18:38:41 -07:00
|
|
|
|
|
|
|
// Authentication configuration.
|
2016-05-27 18:24:54 -07:00
|
|
|
"auth_config": {
|
2018-09-28 14:53:23 +03:00
|
|
|
// Optional mapping of externally-visible authenticator names to internal names.
|
2021-03-16 21:36:44 -07:00
|
|
|
// For example use ["my-auth:basic", "basic:"] to rename "basic" authenticator to
|
2023-08-02 11:26:49 +03:00
|
|
|
// "my-auth" and make "basic" unaccessible by the old name. If you want to use REST-auth, then
|
|
|
|
// the config is ["basic:rest", "rest:"].
|
2018-09-28 14:53:23 +03:00
|
|
|
// Default is identity mapping.
|
2018-09-29 10:40:13 +03:00
|
|
|
"logical_names": [],
|
2018-09-28 14:53:23 +03:00
|
|
|
|
2018-03-24 18:38:41 -07:00
|
|
|
// Basic (login + password) authentication.
|
|
|
|
"basic": {
|
2018-12-28 12:51:52 +03:00
|
|
|
// Add 'auth-name:username' to tags making user discoverable by username.
|
|
|
|
"add_to_tags": true,
|
|
|
|
// The minimum length of a login in unicode runes, i.e. "登录" is length 2, not 6.
|
|
|
|
// The maximum length is 32 and it cannot be changed.
|
|
|
|
"min_login_length": 4,
|
|
|
|
// The minimum length of a password in unicode runes, "пароль" is length 6, not 12.
|
2024-08-18 08:52:21 +03:00
|
|
|
// There is no limit on maximum length, but MySQL & PgSQL adapters have a limit of 32 bytes.
|
2018-12-28 12:51:52 +03:00
|
|
|
"min_password_length": 6
|
2018-03-24 18:38:41 -07:00
|
|
|
},
|
2018-07-30 08:43:24 +03:00
|
|
|
|
2018-03-24 18:38:41 -07:00
|
|
|
// Token authentication
|
2016-05-27 18:24:54 -07:00
|
|
|
"token": {
|
2018-07-30 08:43:24 +03:00
|
|
|
// Lifetime of a security token in seconds. 1209600 = 2 weeks.
|
2017-07-15 12:34:31 +03:00
|
|
|
"expire_in": 1209600,
|
2018-07-30 08:43:24 +03:00
|
|
|
|
2018-03-24 18:38:41 -07:00
|
|
|
// Serial number of the token. Can be used to invalidate all issued tokens at once.
|
2017-07-15 12:34:31 +03:00
|
|
|
"serial_num": 1,
|
2018-07-30 08:43:24 +03:00
|
|
|
|
2018-03-24 18:38:41 -07:00
|
|
|
// Secret key (HMAC salt) for signing the tokens. Generate your own then keep it secret.
|
2019-11-03 10:01:16 +03:00
|
|
|
// Any 32 random bytes base64 encoded.
|
2019-07-16 12:19:05 +03:00
|
|
|
//
|
|
|
|
// === IMPORTANT ===
|
2019-06-08 15:54:02 -07:00
|
|
|
//
|
|
|
|
// CHANGE IT IN PRODUCTION!!! Otherwise anyone will be able to log in
|
2021-03-16 21:36:44 -07:00
|
|
|
// to your server without the password. It's just random base64-encoded bytes, use any suitable
|
|
|
|
// means to get it. For example:
|
|
|
|
// Linux/Mac:
|
|
|
|
// echo $(head -c 32 /dev/urandom | base64 | tr -d '\n')
|
|
|
|
// Windows:
|
|
|
|
// powershell -command "[Convert]::ToBase64String((1..32|%{[byte](Get-Random -Max 256)}))"
|
2016-05-27 18:24:54 -07:00
|
|
|
"key": "wfaY2RgF2S1OQI/ZlK+LSrp1KB2jwAdGAIHQ7JZn+Kc="
|
2023-01-21 12:44:39 -08:00
|
|
|
},
|
|
|
|
|
|
|
|
// Short code authenticator for resetting passwords.
|
2023-01-21 17:21:48 -08:00
|
|
|
"code": {
|
2023-01-23 19:09:00 -08:00
|
|
|
// Lifetime of a security code in seconds. 900 seconds = 15 minutes.
|
2023-01-21 12:44:39 -08:00
|
|
|
"expire_in": 900,
|
|
|
|
|
|
|
|
// Number of times a user can try to enter the code.
|
|
|
|
"max_retries": 3,
|
|
|
|
|
|
|
|
// Length of the secret code.
|
|
|
|
"code_length": 6
|
2016-05-27 18:24:54 -07:00
|
|
|
}
|
|
|
|
},
|
2018-03-24 15:37:27 -07:00
|
|
|
|
2018-03-24 18:38:41 -07:00
|
|
|
// Database configuration
|
2018-07-30 08:43:24 +03:00
|
|
|
"store_config": {
|
2018-04-26 09:50:50 -07:00
|
|
|
// XTEA encryption key for user IDs and topic names. 16 random bytes base64-encoded.
|
2020-03-14 13:44:51 +03:00
|
|
|
// Generate your own and keep it secret. Otherwise your user IDs will be predictable
|
2019-06-08 15:54:02 -07:00
|
|
|
// and it will be easy to spam your users.
|
2016-05-27 18:24:54 -07:00
|
|
|
"uid_key": "la6YsO+bNX/+XIkOqc5Svw==",
|
2018-07-30 08:43:24 +03:00
|
|
|
|
2019-03-20 17:55:15 +03:00
|
|
|
// Maximum number of results fetched in one DB call.
|
|
|
|
"max_results": 1024,
|
|
|
|
|
2020-03-08 22:03:22 -07:00
|
|
|
// DB adapter name to communicate with the DB backend.
|
2020-03-09 00:40:26 -07:00
|
|
|
// Must be one of the adapters from the list below.
|
|
|
|
"use_adapter": "",
|
2020-03-08 22:03:22 -07:00
|
|
|
|
2018-08-01 08:20:28 +03:00
|
|
|
// Configurations of individual adapters.
|
2018-02-20 13:17:47 -08:00
|
|
|
"adapters": {
|
2023-04-05 23:29:27 +03:00
|
|
|
// PostgreSQL configuration. See https://godoc.org/github.com/jackc/pgx#Config
|
|
|
|
// for other possible options.
|
2023-04-05 00:26:38 +03:00
|
|
|
"postgres": {
|
2023-04-05 23:29:27 +03:00
|
|
|
// PostgreSQL connection settings.
|
2023-04-06 13:59:11 -07:00
|
|
|
"User": "postgres",
|
2023-04-05 00:26:38 +03:00
|
|
|
"Passwd": "postgres",
|
|
|
|
"Host": "localhost",
|
|
|
|
"Port": "5432",
|
|
|
|
"DBName": "tinode",
|
2023-04-05 23:29:27 +03:00
|
|
|
|
2023-05-06 17:46:55 -07:00
|
|
|
// DSN: alternative way of specifying database configuration, passed unchanged
|
|
|
|
// to the driver. See https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING
|
|
|
|
// "dsn": "postgresql://postgres:postgres@localhost:5432/tinode?sslmode=disable&connect_timeout=10",
|
|
|
|
|
2023-04-05 23:29:27 +03:00
|
|
|
// PostgreSQL connection pool settings.
|
|
|
|
// Maximum number of open connections to the database. Zero means unlimited.
|
2023-12-08 11:55:23 -08:00
|
|
|
"max_open_conns": 50,
|
2023-04-05 23:29:27 +03:00
|
|
|
// Maximum number of connections in the idle connection pool. Zero means no idle connections are retained.
|
2023-12-08 11:55:23 -08:00
|
|
|
"max_idle_conns": 50,
|
2023-04-05 23:29:27 +03:00
|
|
|
// Maximum amount of time a connection may be reused. Zero means unlimited.
|
2023-04-05 00:26:38 +03:00
|
|
|
"conn_max_lifetime": 60,
|
2023-04-05 23:29:27 +03:00
|
|
|
// Maximum amount of time waiting for a connection from the pool. Zero means no timeout.
|
2023-04-05 00:26:38 +03:00
|
|
|
"sql_timeout": 10
|
|
|
|
},
|
|
|
|
|
|
|
|
|
2019-01-21 16:19:50 +03:00
|
|
|
// MySQL configuration. See https://godoc.org/github.com/go-sql-driver/mysql#Config
|
|
|
|
// for other possible options.
|
2018-02-20 13:17:47 -08:00
|
|
|
"mysql": {
|
2021-03-15 18:24:52 +03:00
|
|
|
// MySQL connection settings.
|
|
|
|
// See https://pkg.go.dev/github.com/go-sql-driver/mysql#Config for more info
|
|
|
|
// and available fields and options.
|
|
|
|
"User": "root",
|
|
|
|
"Net": "tcp",
|
|
|
|
"Addr": "localhost",
|
|
|
|
"DBName": "tinode",
|
2018-11-09 09:55:34 +03:00
|
|
|
// The 'collation=utf8mb4_unicode_ci' is optional but highly recommended for
|
|
|
|
// emoji and certain CJK characters.
|
2021-03-15 18:24:52 +03:00
|
|
|
"Collation": "utf8mb4_unicode_ci",
|
|
|
|
// Parse time values to time.Time. Required.
|
|
|
|
"ParseTime": true,
|
|
|
|
|
2023-05-06 17:46:55 -07:00
|
|
|
// DSN: alternative way of specifying database configuration, passed unchanged
|
|
|
|
// to MySQL driver. See https://github.com/go-sql-driver/mysql#dsn-data-source-name for syntax.
|
|
|
|
// DSN may optionally start with mysql://
|
2021-03-15 18:24:52 +03:00
|
|
|
// "dsn": "root@tcp(localhost)/tinode?parseTime=true&collation=utf8mb4_unicode_ci",
|
|
|
|
|
|
|
|
// MySQL connection pool settings.
|
2021-03-12 17:54:56 +03:00
|
|
|
// Maximum number of open connections to the database. Default: 0 (unlimited).
|
2021-03-15 18:24:52 +03:00
|
|
|
"max_open_conns": 64,
|
2021-03-12 17:54:56 +03:00
|
|
|
// Maximum number of connections in the idle connection pool. If negative or zero,
|
|
|
|
// no idle connections are retained.
|
2021-03-15 18:24:52 +03:00
|
|
|
"max_idle_conns": 64,
|
2021-03-30 19:17:06 +03:00
|
|
|
// Maximum amount of time a connection may be reused (in seconds).
|
|
|
|
"conn_max_lifetime": 60,
|
2021-03-29 18:00:39 +03:00
|
|
|
|
2021-03-30 19:12:00 +03:00
|
|
|
// DB request timeout (in seconds).
|
2021-03-29 18:00:39 +03:00
|
|
|
// If not set (or <= 0), DB queries and transactions will run without a timeout.
|
2021-03-30 19:12:00 +03:00
|
|
|
"sql_timeout": 10
|
2018-02-20 13:17:47 -08:00
|
|
|
},
|
2018-07-30 08:43:24 +03:00
|
|
|
|
2019-12-16 17:02:58 +03:00
|
|
|
// RethinkDB configuration. See
|
|
|
|
// https://godoc.org/github.com/rethinkdb/rethinkdb-go#ConnectOpts for other possible
|
|
|
|
// options.
|
2018-02-20 13:17:47 -08:00
|
|
|
"rethinkdb": {
|
2018-07-30 20:42:15 +03:00
|
|
|
// Address(es) of RethinkDB node(s): either a string or an array of strings.
|
2019-01-21 16:19:50 +03:00
|
|
|
"addresses": "localhost:28015",
|
2018-07-30 08:43:24 +03:00
|
|
|
// Name of the main database.
|
|
|
|
"database": "tinode"
|
2019-10-07 18:23:51 +05:00
|
|
|
},
|
|
|
|
|
|
|
|
// MongoDB configuration.
|
|
|
|
"mongodb": {
|
2022-05-16 12:53:02 -07:00
|
|
|
// Connection string https://www.mongodb.com/docs/manual/reference/connection-string/
|
2023-08-26 15:15:21 +03:00
|
|
|
// Options configured with the 'uri' connection string override all other options
|
|
|
|
// (only 'uri' is sent to the server, all other options are ignored).
|
2023-08-18 10:51:52 +03:00
|
|
|
// If you are using Atlas, then you MUST use 'uri' to connect. See here:
|
|
|
|
// https://www.mongodb.com/docs/manual/reference/connection-string/#std-label-connections-dns-seedlist
|
|
|
|
// Something like
|
|
|
|
// "uri": "mongodb+srv://CREDENTIALS@PROJECT.gmuaq.mongodb.net/DATABASE?retryWrites=true&w=majority",
|
2022-05-16 12:53:02 -07:00
|
|
|
"uri": "",
|
|
|
|
// The only supported server API version is "1". May or maynot be needed depending on server version.
|
|
|
|
"api_version": "",
|
|
|
|
|
2019-10-07 18:23:51 +05:00
|
|
|
// Address(es) of MongoDB node(s): either a string or an array of strings.
|
|
|
|
"addresses": "localhost:27017",
|
|
|
|
// Name of the main database.
|
2019-10-29 17:27:04 +05:00
|
|
|
"database": "tinode",
|
2019-12-16 17:02:58 +03:00
|
|
|
// Name of replica set of mongodb instance. Remove this line to use a standalone instance.
|
|
|
|
// If replica_set is disabled, transactions will be disabled as well.
|
2019-11-25 17:01:14 +05:00
|
|
|
"replica_set": "rs0",
|
2019-11-08 10:13:11 +05:00
|
|
|
|
2019-12-16 17:02:58 +03:00
|
|
|
// Authentication options. Uncomment if auth is configured on your MongoDB.
|
2020-08-30 10:35:04 -07:00
|
|
|
|
2022-05-15 11:11:36 -07:00
|
|
|
// Authentication mechanism. See https://www.mongodb.com/docs/manual/core/authentication/
|
2020-08-30 10:35:04 -07:00
|
|
|
// Default "SCRAM-SHA-256"
|
|
|
|
// "auth_mechanism": "SCRAM-SHA-256",
|
|
|
|
|
|
|
|
// The name of database that has the collection with the user credentials. Default "admin".
|
2019-11-25 09:52:08 +05:00
|
|
|
// "auth_source": "admin",
|
2019-11-08 10:13:11 +05:00
|
|
|
|
|
|
|
// Username:
|
2019-11-25 09:52:08 +05:00
|
|
|
// "username": "tinode",
|
2019-11-08 10:13:11 +05:00
|
|
|
|
|
|
|
// Password:
|
2020-05-25 14:23:12 +05:00
|
|
|
// "password": "tinode",
|
|
|
|
|
|
|
|
// Driver's TLS configuration. Uncomment to enable TLS.
|
2020-08-30 10:35:04 -07:00
|
|
|
// "tls": true,
|
2020-05-25 14:23:12 +05:00
|
|
|
|
|
|
|
// Path to the client certificate. Optional.
|
2020-08-30 10:35:04 -07:00
|
|
|
// "tls_cert_file": "/path/to/cert_file",
|
2020-05-25 14:23:12 +05:00
|
|
|
|
|
|
|
// Path to private key. Optional.
|
2020-08-30 10:35:04 -07:00
|
|
|
// "tls_private_key": "/path/to/private_key",
|
2020-05-25 14:23:12 +05:00
|
|
|
|
|
|
|
// Specifies whether or not certificates and hostnames received from the server should be validated.
|
|
|
|
// Not recommended to enable in production. Default is false.
|
2020-08-30 10:35:04 -07:00
|
|
|
// "tls_skip_verify": false
|
2018-02-20 13:17:47 -08:00
|
|
|
}
|
2016-05-27 18:24:54 -07:00
|
|
|
}
|
2016-08-11 14:28:35 -07:00
|
|
|
},
|
2018-03-24 15:37:27 -07:00
|
|
|
|
2021-03-16 21:36:44 -07:00
|
|
|
// Account validators (email or SMS or captcha).
|
2018-03-23 17:06:29 -07:00
|
|
|
"acc_validation": {
|
2018-07-30 08:43:24 +03:00
|
|
|
|
2018-03-24 18:38:41 -07:00
|
|
|
// Email validator config.
|
2018-03-23 17:06:29 -07:00
|
|
|
"email": {
|
2021-03-16 21:36:44 -07:00
|
|
|
// Restrict use of "email" namespace: make users searchable by their emails,
|
|
|
|
// disable manual creation of email: tags.
|
2018-03-23 17:06:29 -07:00
|
|
|
"add_to_tags": true,
|
2018-07-30 08:43:24 +03:00
|
|
|
|
2018-03-24 18:38:41 -07:00
|
|
|
// List of authentication levels which require this validation method.
|
2019-03-17 09:21:03 +03:00
|
|
|
// Remove this line to disable email validation.
|
2018-03-23 17:06:29 -07:00
|
|
|
"required": ["auth"],
|
2018-07-30 08:43:24 +03:00
|
|
|
|
2018-03-24 18:38:41 -07:00
|
|
|
// Configuration passed to the validator unchanged.
|
2018-03-23 17:06:29 -07:00
|
|
|
"config": {
|
2018-12-25 11:47:03 +03:00
|
|
|
// Address of the host where the Tinode server is running. This will be used
|
|
|
|
// in URLs in the email.
|
2018-09-21 16:34:07 +03:00
|
|
|
"host_url": "http://localhost:6060/",
|
2019-02-04 11:50:40 +03:00
|
|
|
|
2018-03-24 18:38:41 -07:00
|
|
|
// Address of the SMPT server to use.
|
2018-03-23 17:06:29 -07:00
|
|
|
"smtp_server": "smtp.example.com",
|
2018-07-30 08:43:24 +03:00
|
|
|
|
2018-07-30 20:42:15 +03:00
|
|
|
// SMTP port to use. "25" for basic email RFC 5321 (2821, 821), "587" for RFC 3207 (TLS).
|
2018-03-23 17:06:29 -07:00
|
|
|
"smtp_port": "25",
|
2018-07-30 08:43:24 +03:00
|
|
|
|
2020-11-26 14:13:32 -08:00
|
|
|
// RFC 5322 email address to show in the From: field.
|
2019-10-13 11:09:32 +03:00
|
|
|
"sender": "\"Tinode\" <noreply@example.com>",
|
2018-07-30 08:43:24 +03:00
|
|
|
|
2020-11-26 14:13:32 -08:00
|
|
|
// Optional login to use for authentication; if missing, the connection is not authenticated.
|
2019-10-13 11:09:32 +03:00
|
|
|
"login": "john.doe@example.com",
|
|
|
|
|
2020-11-26 14:13:32 -08:00
|
|
|
// Password to use when authenticating the sender; used only if "login" is provided.
|
2018-03-24 18:38:41 -07:00
|
|
|
"sender_password": "your-password-here",
|
2021-03-16 21:36:44 -07:00
|
|
|
|
2021-09-09 16:20:17 -07:00
|
|
|
// Authentication mechanism to use, optional. One of "login", "cram-md5", "plain" (default).
|
2021-09-08 10:58:18 -06:00
|
|
|
"auth_mechanism": "login",
|
2021-09-07 23:24:57 -06:00
|
|
|
|
2020-11-26 14:13:32 -08:00
|
|
|
// FQDN to use in SMTP HELO/EHLO command; if missing, the hostname from "host_url" is used.
|
2020-11-27 04:23:13 +09:00
|
|
|
"smtp_helo_host": "example.com",
|
2021-03-16 21:36:44 -07:00
|
|
|
|
|
|
|
// Skip verification of the server's certificate chain and host name.
|
2024-05-30 16:55:53 -07:00
|
|
|
// In this mode, TLS is susceptible to man-in-the-middle attacks.
|
2020-11-27 05:39:51 +09:00
|
|
|
"insecure_skip_verify": false,
|
2018-07-30 08:43:24 +03:00
|
|
|
|
2020-02-21 22:54:11 +03:00
|
|
|
// Optional list of human languages to try to load templates for. If you don't care about i18n,
|
|
|
|
// leave it blank or remove. The first language in the list is the default language.
|
2022-03-24 13:49:55 -07:00
|
|
|
"languages": ["en", "es", "fr", "ru", "vi", "zh"],
|
2018-07-30 08:43:24 +03:00
|
|
|
|
2020-02-21 22:54:11 +03:00
|
|
|
// Message template for credential validation.
|
|
|
|
// The file path itself is treated as a template. It's resolved by using the
|
|
|
|
// "languages" field above. One template per language.
|
|
|
|
// See the template file for the explanation of the expected structure.
|
|
|
|
"validation_templ": "./templ/email-validation-{{.Language}}.templ",
|
2018-10-02 10:47:24 +03:00
|
|
|
|
2020-02-23 10:05:08 +03:00
|
|
|
// Message template for resetting authentication secret.
|
|
|
|
// One template per language. See email-validation-en template for the explanation
|
2020-02-21 22:54:11 +03:00
|
|
|
// of the expected structure.
|
2020-02-23 10:05:08 +03:00
|
|
|
"reset_secret_templ": "./templ/email-password-reset-{{.Language}}.templ",
|
2018-07-30 08:43:24 +03:00
|
|
|
|
2018-07-30 20:42:15 +03:00
|
|
|
// Allow this many confirmation attempts before blocking the credential.
|
2021-03-16 21:36:44 -07:00
|
|
|
"max_retries": 3,
|
2018-07-30 08:43:24 +03:00
|
|
|
|
2020-02-21 22:54:11 +03:00
|
|
|
// List of email domains allowed to be used for registration.
|
|
|
|
// Missing or empty list means any email domain is accepted.
|
2018-12-12 18:11:39 +03:00
|
|
|
"domains": [],
|
2019-02-04 11:50:40 +03:00
|
|
|
|
2021-03-16 21:36:44 -07:00
|
|
|
// Dummy response to accept.
|
|
|
|
//
|
|
|
|
// === IMPORTANT ===
|
|
|
|
//
|
2023-05-27 12:08:32 -07:00
|
|
|
// REMOVE IN PRODUCTION!!! Otherwise anyone will be able to register
|
2021-03-16 21:36:44 -07:00
|
|
|
// with fake emails.
|
2018-03-23 17:06:29 -07:00
|
|
|
"debug_response": "123456"
|
|
|
|
}
|
|
|
|
},
|
2018-07-30 08:43:24 +03:00
|
|
|
|
2023-01-23 17:03:32 -08:00
|
|
|
// Placeholder validator for SMS and voice validation. Disabled by default.
|
|
|
|
// Use something like twilio.com or sinch.com in production.
|
2018-03-23 17:06:29 -07:00
|
|
|
"tel": {
|
|
|
|
"add_to_tags": true,
|
|
|
|
"config": {
|
2023-01-23 17:03:32 -08:00
|
|
|
// Address of the host where the Tinode server is running. This will be used
|
|
|
|
// in URLs in the SMS.
|
2023-01-23 19:00:29 -08:00
|
|
|
"host_url": "http://localhost:6060/",
|
2023-01-23 17:03:32 -08:00
|
|
|
|
2023-02-02 17:13:06 -08:00
|
|
|
// Optional list of locales to try to load templates for. If you don't care about i18n,
|
2023-01-23 17:03:32 -08:00
|
|
|
// leave it blank or remove. The first language in the list is the default language.
|
|
|
|
"languages": ["en", "es", "fr", "pt", "ru", "vi", "zh"],
|
|
|
|
|
|
|
|
// String to use in the From field of the SMS.
|
|
|
|
"sender": "Tinode",
|
|
|
|
|
|
|
|
// Message template for credential validation and password reset. The file path itself is
|
|
|
|
// treated as a template. It's resolved by using the "languages" field above. One template
|
|
|
|
// per language.
|
|
|
|
"universal_templ": "./templ/sms-universal-{{.Language}}.templ",
|
|
|
|
|
|
|
|
// Allow this many confirmation attempts before blocking the credential.
|
2023-01-23 19:00:29 -08:00
|
|
|
"max_retries": 3,
|
2023-01-23 17:03:32 -08:00
|
|
|
|
2024-10-15 11:57:20 +03:00
|
|
|
// Twilio configuration (optional).
|
|
|
|
//"twilio_conf": {
|
|
|
|
// "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
|
|
|
|
// "auth_token": "f2xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
|
|
|
//},
|
|
|
|
|
2023-01-23 19:00:29 -08:00
|
|
|
// Dummy response to accept.
|
|
|
|
//
|
|
|
|
// === IMPORTANT ===
|
|
|
|
//
|
2023-05-27 12:08:32 -07:00
|
|
|
// REMOVE IN PRODUCTION!!! Otherwise anyone will be able to register
|
2023-01-23 19:00:29 -08:00
|
|
|
// with fake phone numbers.
|
2018-03-23 17:06:29 -07:00
|
|
|
"debug_response": "123456"
|
|
|
|
}
|
2018-07-30 08:43:24 +03:00
|
|
|
}
|
2018-03-23 17:06:29 -07:00
|
|
|
},
|
2018-03-24 15:37:27 -07:00
|
|
|
|
2024-07-01 11:28:41 -07:00
|
|
|
// Configuration for stale account garbage collector: remove
|
|
|
|
// stale unvalidated user accounts which have been last updated at least
|
|
|
|
// 'gc_min_account_age' hours ago.
|
2022-12-05 20:58:10 -08:00
|
|
|
"acc_gc_config": {
|
2023-01-30 17:26:02 -08:00
|
|
|
"enabled": true,
|
2022-12-05 20:58:10 -08:00
|
|
|
// How often to run GC (seconds).
|
2023-01-30 17:26:02 -08:00
|
|
|
"gc_period": 3600,
|
2022-12-05 20:58:10 -08:00
|
|
|
// Number of accounts to delete in one pass.
|
2023-01-30 17:26:02 -08:00
|
|
|
"gc_block_size": 10,
|
2022-12-06 17:56:21 -08:00
|
|
|
// Minimum hours since account was last modified.
|
|
|
|
"gc_min_account_age": 30
|
2022-12-05 20:58:10 -08:00
|
|
|
},
|
|
|
|
|
2018-03-24 18:38:41 -07:00
|
|
|
// Configuration of push notifications.
|
2016-08-11 14:28:35 -07:00
|
|
|
"push": [
|
|
|
|
{
|
2018-03-24 18:38:41 -07:00
|
|
|
// Notificator which writes to STDOUT. Useful for debugging.
|
2016-08-11 14:28:35 -07:00
|
|
|
"name":"stdout",
|
|
|
|
"config": {
|
2018-03-24 18:38:41 -07:00
|
|
|
// Disabled.
|
2018-01-28 17:51:07 -08:00
|
|
|
"enabled": false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
2018-03-24 18:38:41 -07:00
|
|
|
// Google FCM notificator.
|
2018-01-28 17:51:07 -08:00
|
|
|
"name":"fcm",
|
|
|
|
"config": {
|
2018-03-24 18:38:41 -07:00
|
|
|
// Disabled. Won't work without the server key anyway. See below.
|
2018-01-28 17:51:07 -08:00
|
|
|
"enabled": false,
|
2018-07-30 08:43:24 +03:00
|
|
|
|
2018-09-18 09:30:45 +03:00
|
|
|
// Firebase project ID.
|
|
|
|
"project_id": "your-project-id",
|
|
|
|
|
2018-09-18 18:16:41 +03:00
|
|
|
// Service account credentials as json.
|
|
|
|
// See instructions how to download the service account credentials file:
|
|
|
|
// https://cloud.google.com/iam/docs/creating-managing-service-account-keys
|
|
|
|
// Then insert the file contents here. Yes, this is convoluted, but that's Google's fault.
|
|
|
|
"credentials": {
|
|
|
|
"type": "service_account",
|
2019-11-03 10:01:16 +03:00
|
|
|
"project_id": "your-project-id",
|
|
|
|
"private_key_id": "some-random-looking-hex-number",
|
|
|
|
"private_key": "-----BEGIN PRIVATE KEY----- base64-encoded bits of your private key \n-----END PRIVATE KEY-----\n",
|
|
|
|
"client_email": "firebase-adminsdk-abc123@your-project-id.iam.gserviceaccount.com",
|
|
|
|
"client_id": "1234567890123456789",
|
|
|
|
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
|
|
|
|
"token_uri": "https://oauth2.googleapis.com/token",
|
|
|
|
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
|
|
|
|
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-abc123%40your-project-id.iam.gserviceaccount.com"
|
2018-09-18 18:16:41 +03:00
|
|
|
},
|
2018-09-21 14:09:17 +03:00
|
|
|
|
|
|
|
// An alternative way to provide Firebase service account credentials.
|
2018-09-22 19:15:27 +03:00
|
|
|
"credentials_file": "/path/to/service-account-file-with-credentials.json",
|
2018-07-30 08:43:24 +03:00
|
|
|
|
2020-02-03 19:33:07 +03:00
|
|
|
// Time in seconds before notification is discarded (by Google) if undelivered.
|
2018-01-28 17:51:07 -08:00
|
|
|
"time_to_live": 3600,
|
2018-07-30 08:43:24 +03:00
|
|
|
|
2020-02-03 19:33:07 +03:00
|
|
|
// Payload of AndroidNotification. If enabled, this will take precedence over data payload.
|
|
|
|
"android": {
|
|
|
|
// Set to false to push a data-only message.
|
|
|
|
"enabled": false,
|
|
|
|
|
|
|
|
// Android drawable resource ID to use as a notification icon.
|
|
|
|
"icon": "ic_logo_push",
|
|
|
|
|
|
|
|
// Notification color.
|
2020-05-02 11:06:54 +03:00
|
|
|
"color": "#3949AB",
|
2020-02-03 19:33:07 +03:00
|
|
|
|
|
|
|
// Name of intent filter which will catch this notification.
|
|
|
|
"click_action": ".MessageActivity",
|
|
|
|
|
2020-05-02 11:06:54 +03:00
|
|
|
// Notification of a new message. You can include custom "icon", "color", "click_action"
|
2020-02-03 19:33:07 +03:00
|
|
|
// into this section and it will override the value above.
|
|
|
|
"msg": {
|
|
|
|
// Literal title string. Not recommended because it's not localized.
|
|
|
|
"title": "",
|
2020-02-05 16:18:20 +03:00
|
|
|
|
2020-02-03 19:33:07 +03:00
|
|
|
// Literal message body. Not recommended because it's not localized.
|
2020-02-05 16:18:20 +03:00
|
|
|
"body": "",
|
|
|
|
|
2020-02-03 19:33:07 +03:00
|
|
|
// Android string resource ID to use as a notification title. Localized.
|
|
|
|
// Takes precedence over "title". "new_message" is "New message" in Tindroid.
|
|
|
|
"title_loc_key": "new_message",
|
|
|
|
|
|
|
|
// Android string resource ID to use as a notification body. Localized.
|
|
|
|
// Takes precedence over "body".
|
|
|
|
"body_loc_key": ""
|
|
|
|
},
|
|
|
|
|
|
|
|
// Notification of a new subscription. Same rules as section "msg" above.
|
|
|
|
"sub": {
|
|
|
|
// Android resource string ID to use as notification title. Localized.
|
|
|
|
// "new_chat" is "New chat" in Tindroid.
|
|
|
|
"title_loc_key": "new_chat",
|
|
|
|
|
|
|
|
// Android resource string ID to use as notification body. Localized.
|
|
|
|
"body_loc_key": ""
|
|
|
|
}
|
|
|
|
}
|
2016-08-11 14:28:35 -07:00
|
|
|
}
|
2020-03-30 15:54:08 +03:00
|
|
|
},
|
|
|
|
{
|
2021-03-16 21:36:44 -07:00
|
|
|
// Tinode Push Gateway, see https://github.com/tinode/chat/tree/master/server/push/tnpg.
|
2020-03-30 15:54:08 +03:00
|
|
|
"name":"tnpg",
|
|
|
|
"config": {
|
|
|
|
// Disabled. Configure first then enable.
|
|
|
|
"enabled": false,
|
2020-10-18 10:28:48 -07:00
|
|
|
// Short name (URL) of the organization you registered at console.tinode.co.
|
2020-03-30 15:54:08 +03:00
|
|
|
"org": "test",
|
|
|
|
// Authentication token obtained from console.tinode.co
|
|
|
|
"token": "jwt-security-token-obtained-from-console.tinode.co",
|
|
|
|
}
|
2016-08-11 14:28:35 -07:00
|
|
|
}
|
2018-03-23 17:06:29 -07:00
|
|
|
],
|
2018-03-24 15:37:27 -07:00
|
|
|
|
2022-06-12 15:33:41 -07:00
|
|
|
// Configuration for voice and video calls.
|
|
|
|
"webrtc": {
|
|
|
|
// Disabled. Won't work without functioning ice_servers (see below).
|
|
|
|
"enabled": false,
|
|
|
|
// Timeout in seconds before a video/voice call is dropped if not answered.
|
|
|
|
"call_establishment_timeout": 30,
|
|
|
|
// Interactive Communication Establishment (ICE) STUN and TURN server configuration for video calls.
|
2022-07-27 09:14:06 -07:00
|
|
|
// You need to configure your own servers or consider https://www.metered.ca/tools/openrelay/.
|
2022-06-12 15:33:41 -07:00
|
|
|
// Video calls will not work if both parties are behind NAT and no ICE servers are configured.
|
|
|
|
"ice_servers": [
|
|
|
|
{
|
|
|
|
"urls": [
|
|
|
|
"stun:stun.example.com"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"username": "user-name-to-use-for-authentication-with-the-server",
|
|
|
|
"credential": "your-password",
|
|
|
|
"urls": [
|
|
|
|
"turn:turn.example.com:80?transport=udp",
|
|
|
|
"turn:turn.example.com:3478?transport=udp",
|
|
|
|
"turn:turn.example.com:80?transport=tcp",
|
|
|
|
"turn:turn.example.com:3478?transport=tcp",
|
|
|
|
"turns:turn.example.com:443?transport=tcp",
|
|
|
|
"turns:turn.example.com:5349?transport=tcp"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
// An alternative way to provide STUN/TURN configuration.
|
2025-01-09 12:27:05 +03:00
|
|
|
"ice_servers_file": "/path/to/ice-servers-config.json"
|
2022-06-12 15:33:41 -07:00
|
|
|
},
|
2022-05-31 13:47:30 -07:00
|
|
|
|
2018-03-24 18:38:41 -07:00
|
|
|
// Cluster-mode configuration.
|
2018-03-24 15:37:27 -07:00
|
|
|
"cluster_config": {
|
2021-03-16 21:36:44 -07:00
|
|
|
// Name of this node. Can be assigned from the command line as --cluster_self.
|
2018-03-24 18:38:41 -07:00
|
|
|
// Empty string disables clustering.
|
|
|
|
"self": "",
|
2018-07-30 08:43:24 +03:00
|
|
|
|
2018-03-24 18:38:41 -07:00
|
|
|
// List of available nodes.
|
2018-03-24 15:37:27 -07:00
|
|
|
"nodes": [
|
2019-04-08 10:15:22 +03:00
|
|
|
// Name and TCP address of every node in the cluster. The ports 12001..12003
|
2021-03-16 21:36:44 -07:00
|
|
|
// are cluster communication ports. They don't need to be exposed to end-users.
|
2018-09-21 14:09:17 +03:00
|
|
|
{"name": "one", "addr":"localhost:12001"},
|
|
|
|
{"name": "two", "addr":"localhost:12002"},
|
2018-03-24 15:37:27 -07:00
|
|
|
{"name": "three", "addr":"localhost:12003"}
|
|
|
|
],
|
2018-07-30 08:43:24 +03:00
|
|
|
|
2021-03-16 21:36:44 -07:00
|
|
|
// Failover config. No need to change unless you are doing something unusual.
|
2018-03-24 15:37:27 -07:00
|
|
|
"failover": {
|
2018-03-24 18:38:41 -07:00
|
|
|
// Failover is enabled.
|
2018-03-24 15:37:27 -07:00
|
|
|
"enabled": true,
|
2018-03-24 18:38:41 -07:00
|
|
|
// Time in milliseconds between heartbeats.
|
2018-03-24 15:37:27 -07:00
|
|
|
"heartbeat": 100,
|
2018-03-24 18:38:41 -07:00
|
|
|
// Initiate leader election when the leader is not available for this many heartbeats.
|
2018-03-24 15:37:27 -07:00
|
|
|
"vote_after": 8,
|
2018-03-24 18:38:41 -07:00
|
|
|
// Consider node failed when it missed this many heartbeats.
|
2018-03-24 15:37:27 -07:00
|
|
|
"node_fail_after": 16
|
|
|
|
}
|
|
|
|
},
|
2018-07-30 08:43:24 +03:00
|
|
|
|
2021-03-16 21:36:44 -07:00
|
|
|
// Configuration of plugins.
|
2018-03-23 17:06:29 -07:00
|
|
|
"plugins": [
|
|
|
|
{
|
2018-03-24 18:38:41 -07:00
|
|
|
// Enable or disable this plugin.
|
2018-03-23 17:06:29 -07:00
|
|
|
"enabled": false,
|
2018-07-30 08:43:24 +03:00
|
|
|
|
2018-03-24 18:38:41 -07:00
|
|
|
// Name of the plugin, must be unique.
|
2018-03-23 17:06:29 -07:00
|
|
|
"name": "python_chat_bot",
|
2018-07-30 08:43:24 +03:00
|
|
|
|
2018-03-24 18:38:41 -07:00
|
|
|
// Timeout in microseconds.
|
2018-03-23 17:06:29 -07:00
|
|
|
"timeout": 20000,
|
2018-07-30 08:43:24 +03:00
|
|
|
|
2018-03-24 18:38:41 -07:00
|
|
|
// Events to send to the plugin.
|
2018-03-23 17:06:29 -07:00
|
|
|
"filters": {
|
2018-03-24 18:38:41 -07:00
|
|
|
// Account creation events.
|
2018-03-23 17:06:29 -07:00
|
|
|
"account": "C"
|
|
|
|
},
|
2018-07-30 08:43:24 +03:00
|
|
|
|
2021-03-16 21:36:44 -07:00
|
|
|
// Error code to use in case plugin has failed; 0 means to ignore the failures.
|
2018-03-23 17:06:29 -07:00
|
|
|
"failure_code": 0,
|
2018-07-30 08:43:24 +03:00
|
|
|
|
2020-03-26 20:09:59 +03:00
|
|
|
// Text of an error message to report in case of plugin failure.
|
2018-03-23 17:06:29 -07:00
|
|
|
"failure_text": null,
|
2018-07-30 08:43:24 +03:00
|
|
|
|
2018-03-24 18:38:41 -07:00
|
|
|
// Address of the plugin.
|
2018-03-23 17:06:29 -07:00
|
|
|
"service_addr": "tcp://localhost:40051"
|
|
|
|
}
|
2016-08-11 14:28:35 -07:00
|
|
|
]
|
2016-05-27 18:24:54 -07:00
|
|
|
}
|