privchat 0.1.0

High-performance instant messaging server built on msgtrans
# PrivChat Server 配置文件
# 此文件由 privchat-server --generate-config 生成
# 网关:[gateway] 与 gateway.listeners;文件:[file] 含 server_port / server_api_base_url

[gateway]
max_connections = 2000
connection_timeout = 300
heartbeat_interval = 60
use_internal_auth = true
handler_max_inflight = 2000

[[gateway.listeners]]
protocol = "tcp"
host = "0.0.0.0"
port = 9001

[[gateway.listeners]]
protocol = "quic"
host = "0.0.0.0"
port = 9001

[[gateway.listeners]]
protocol = "websocket"
host = "0.0.0.0"
port = 9080
path = "/gate"
compression = true

[cache]
l1_max_memory_mb = 256
l1_ttl_secs = 3600

[cache.redis]
url = "redis://127.0.0.1:6379"
pool_size = 50
min_idle = 10
connection_timeout = 5
command_timeout_ms = 5000
idle_timeout = 300

[cache.online_status]
timeout_seconds = 300
cleanup_interval_seconds = 60

[admin]
port = 9090
# master_key = "your-secret-key"  # 也可通过环境变量 SERVICE_MASTER_KEY 设置

[file]
default_storage_source_id = 0
server_port = 9083
server_api_base_url = "http://localhost:9083/api/app"

[[file.storage_sources]]
id = 0
storage_type = "local"
storage_root = "./storage/files"
base_url = "http://localhost:8080/files"

# 多数据中心示例:再增加 id=1、id=2 等,不同机房设置不同 default_storage_source_id 即可
# [[file.storage_sources]]
# id = 1
# storage_type = "local"
# storage_root = "/data/privchat/files-cn"
# base_url = "https://files-cn.example.com/files"
#
# [[file.storage_sources]]
# id = 2
# storage_type = "local"
# storage_root = "/data/privchat/files-us"
# base_url = "https://files-us.example.com/files"

[push]
enabled = false

[push.apns]
enabled = false
bundle_id = "com.netonstream.privchat"
team_id = ""
key_id = ""
private_key_path = ""
use_sandbox = true

[push.fcm]
enabled = false
project_id = ""
access_token = ""

[push.hms]
enabled = false
app_id = ""
access_token = ""
endpoint = "https://push-api.cloud.huawei.com"

[push.honor]
enabled = false
app_id = ""
access_token = ""
endpoint = "https://push-api.hihonor.com"

[push.xiaomi]
enabled = false
app_id = ""
access_token = ""
endpoint = "https://api.xmpush.xiaomi.com"

[push.oppo]
enabled = false
app_id = ""
access_token = ""
endpoint = "https://api.push.oppomobile.com"

[push.vivo]
enabled = false
app_id = ""
access_token = ""
endpoint = "https://api-push.vivo.com.cn"

[push.lenovo]
enabled = false
app_id = ""
access_token = ""
endpoint = "https://push-api.lenovo.com"

[push.zte]
enabled = false
app_id = ""
access_token = ""
endpoint = "https://push-api.ztedevice.com"

[push.meizu]
enabled = false
app_id = ""
access_token = ""
endpoint = "https://server-api-push.meizu.com"

[logging]
level = "info"
format = "compact"
file = "./logs/server.log"

# ==========================================
# 系统消息配置
# ==========================================
[system_message]
# 是否启用系统消息用户
enabled = true

# 新用户注册时的欢迎消息
welcome_message = """
👋 欢迎使用 Privchat!

这是一个端到端加密的即时通讯系统,您的隐私安全由我们守护。

🔐 主要特性:
• 端到端加密通讯
• 多设备同步
• 离线消息推送
• 文件安全传输

如有任何问题,欢迎随时联系我们!
"""

# 是否在用户注册时自动创建与系统用户的会话
auto_create_channel = true

# 是否在创建会话后自动发送欢迎消息
auto_send_welcome = true