This repository has been archived by the owner on Jul 26, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
/
config.toml
35 lines (33 loc) · 1.87 KB
/
config.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
[app]
name = "ginBro"
addr ="{{.AppListen}}" # eg1: www.mojotv.cn eg:localhost:3333 eg1:127.0.0.1:88
secret = "{{.AppSecret}}"
env = "local" # only allows local/dev/test/prod
log_level = "error" # only allows debug info warn error fatal panic
enable_not_found = true # if true and static_path is not empty string, all not found route will serve static/index.html
enable_swagger = true
enable_cors = true # true will case 403 error in swaggerUI may cause api perform decrease
enable_sql_log = true # show gorm sql in terminal
enable_https = false # if addr is a domain enable_https will works
enable_cron = false # is enable buildin schedule job
time_zone = "Asia/Shanghai"
api_prefix = "v1" # api_prefix could be empty string, the api uri will be api/v1/resource
static_path = "./static/" # path must be an absolute path or relative to the go-build-executable file, may cause api perform decrease
mem_expire_min = 60 # memory cache expire in 60 minutes
mem_max_count = 1024000 # memory cache maxium store count
login_try = 100 # after 100 times login failure the IP will be ban for mem_expire_min(default 600min), wrong username costs 5 times, wrong password costs 1 time,
jwt_expire_hour = 24 # jwt expire in 24 hours
[mysql]
addr = "{{.MysqlAddr}}"
user = "{{.MysqlUser}}"
password = "{{.MysqlPassword}}"
database = "{{.MysqlDatabase}}"
charset = "{{.MysqlCharset}}"
[redis]
addr = "" # 127.0.0.1:6379 empty string will not init the redis db in models package
password = ""
db_idx = 0
# the init config has not impelement yet
[init]
user_email= "admin@ginbro.com" # if not exist, create a user with the bcrypt password, if the value is empty will do nothing
user_password = "123123" # print the bcrypted password in console for you to paste into mysql auth_table.password column