-
Notifications
You must be signed in to change notification settings - Fork 0
/
postar.toml
74 lines (69 loc) · 2.62 KB
/
postar.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# All configurations of logger.
# level has some available values: debug, info, warn, error.
# handler has some available values: tape, text, json.
# target is the logging destination for writing logs.
# file_rotate will rotate log files if needs.
# file_max_size is the max size to rotate a new log file and rename the old log file.
# file_max_age is the max time to keep the old log files.
# file_max_backups is the max count to keep the old log files.
# Check `FishGoddess/logit` library in github to get more information.
[logger]
level = "debug"
handler = "tape"
[logger.writer]
target = "./log/postar.log"
file_rotate = true
file_max_size = "128M"
file_max_age = "30d"
file_max_backups = 60
# All configurations of server.
# type has some available values: gateway, grpc.
# grpc_endpoint is the ip:port of the grpc server.
# http_endpoint is the ip:port of the http server when type is gateway.
# use_tls determines if the server uses tls or not.
# cert_file is the certificate file path. Necessary if use_tls = true.
# key_file is the private key file path. Necessary if use_tls = true.
# request_timeout is the timeout of requests.
# close_server_timeout is the timeout of closing server.
[server]
type = "gateway"
grpc_endpoint = ":5897"
http_endpoint = ":6897"
use_tls = false
cert_file = "./cert/localhost.crt"
key_file = "./cert/localhost.key"
request_timeout = "10s"
close_server_timeout = "1m"
# All configurations of database.
# address is the ip:port of the database.
# username is the username of the database.
# password is the password of the database.
# max_open_conns is the max connected connections of the database.
# max_idle_conns is the max idle connections of the database.
# max_conn_idle_time is the max idle time of connections connected to database.
# max_conn_lifetime is the max lifetime of connections connected to database.
# report_stats_time is the duration for reporting the stats of database.
[database]
address = "127.0.0.1:6033"
username = "postar"
password = "123456"
database = "postar"
max_open_conns = 64
max_idle_conns = 16
max_conn_idle_time = "5m"
max_conn_lifetime = "15m"
report_stats_time = "1m"
# All configurations of crypto.
# aes_key is the key of aes which length must be 24.
# aes_iv is the iv of aes which length must be 16.
[crypto]
aes_key = "123456788765432112345678"
aes_iv = "1234567887654321"
# All configurations of cache.
# use_space_cache is whether postar uses cache for spaces or not.
# use_account_cache is whether postar uses cache for accounts or not.
# use_template_cache is whether postar uses cache for templates or not.
[cache]
use_space_cache = true
use_account_cache = true
use_template_cache = true