88 lines
2.0 KiB
Cheetah
88 lines
2.0 KiB
Cheetah
[server]
|
|
grpc_port = ${BACKEND_GRPC_PORT}
|
|
grpc_web_port = ${BACKEND_GRPC_WEB_PORT}
|
|
read_timeout = 10
|
|
write_timeout = 10
|
|
|
|
[database]
|
|
host = "${POSTGRES_HOST}"
|
|
port = ${POSTGRES_PORT}
|
|
user = "${POSTGRES_USER}"
|
|
password = "${POSTGRES_PASSWORD}"
|
|
name = "${POSTGRES_DB}"
|
|
# max_idle_conns = 10
|
|
# max_open_conns = 100
|
|
# conn_max_lifetime = 3600
|
|
# charset = "utf8mb4"
|
|
|
|
[redis]
|
|
host = "${REDIS_HOST}"
|
|
port = ${REDIS_PORT}
|
|
password = "${REDIS_PASSWORD}"
|
|
db = ${REDIS_DB}
|
|
timeout = 5
|
|
|
|
[consul]
|
|
enabled = true
|
|
address = "${CONSUL_HOST}:${CONSUL_PORT}"
|
|
scheme = "http"
|
|
token = "${CONSUL_ROOT_TOKEN}"
|
|
datacenter = ""
|
|
prefix = "${CONSUL_PREFIX}"
|
|
|
|
[minio]
|
|
endpoint = "${MINIO_HOST}:${MINIO_API_PORT}"
|
|
access_key = "${MINIO_ROOT_USER}"
|
|
secret_key = "${MINIO_ROOT_PASSWORD}"
|
|
bucket = "${MINIO_BUCKET}"
|
|
use_ssl = false
|
|
timeout = 30
|
|
|
|
[elasticsearch]
|
|
enabled = ${ELASTICSEARCH_ENABLED}
|
|
addresses = ["http://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}"]
|
|
username = "${ELASTICSEARCH_USERNAME}"
|
|
password = "${ELASTICSEARCH_PASSWORD}"
|
|
index_prefix = "${ELASTICSEARCH_INDEX_PREFIX}"
|
|
timeout = 5
|
|
|
|
[mq_config]
|
|
|
|
# [backend.mq_config.redis]
|
|
|
|
[mq_config.rabbitmq]
|
|
url = "amqp://${RABBITMQ_DEFAULT_USER}:${RABBITMQ_DEFAULT_PASS}@${RABBITMQ_HOST}:${RABBITMQ_AMQP_PORT}/"
|
|
|
|
[backend]
|
|
system_name = "${SYSTEM_NAME}"
|
|
internal_rpc_key = "${BACKEND_INTERNAL_RPC_KEY}"
|
|
|
|
[backend.jwt]
|
|
secret = "${JWT_SECRET}"
|
|
expire = 86400 # 24 hours
|
|
refresh_expire = 604800 # 7 days
|
|
|
|
[backend.log]
|
|
level = "debug"
|
|
# Optional: silent/error/warn/info. When empty, follows backend.log.level.
|
|
# gorm_log_level = "warn"
|
|
file = "logs/app.log"
|
|
console = true
|
|
file_log = true
|
|
|
|
[backend.document]
|
|
max_size = 10
|
|
allowed_extensions = [".md", ".txt", ".pdf", ".doc", ".docx"]
|
|
storage_path = "uploads"
|
|
|
|
[backend.security]
|
|
password_hash_cost = 12
|
|
max_login_attempts = 5
|
|
login_lock_duration = 30
|
|
[backend.security.cors]
|
|
allowed_origins = ["*"]
|
|
allowed_methods = ["GET", "POST", "PUT", "DELETE", "OPTIONS"]
|
|
allowed_headers = ["Origin", "Content-Type", "Authorization"]
|
|
allow_credentials = true
|
|
max_age = 86400
|