本次提交包含大量代码优化、功能新增与服务端配置更新: 1. 修复分析报告统计数据,调整CMake策略设置 2. 优化APP权限配置、编辑器与聊天界面组件 3. 更新依赖库版本与pubspec配置 4. 新增文件传输服务端、信令服务器相关配置与脚本 5. 完善用户注销功能与数据库迁移脚本 6. 优化多处动画效果、代码风格与日志输出 7. 新增多种调试与部署脚本,修复已知BUG
73 lines
3.0 KiB
PHP
73 lines
3.0 KiB
PHP
<?php
|
|
// ============================================================
|
|
// 闲言APP — 文件传输服务端配置
|
|
// 创建时间: 2026-05-10
|
|
// 更新时间: 2026-05-10
|
|
// 作用: 信令/TURN/配对服务的统一配置
|
|
// 上次更新: 初始版本
|
|
// ============================================================
|
|
|
|
return [
|
|
|
|
// ─── 服务器基础配置 ───────────────────────────────────
|
|
'server' => [
|
|
'host' => '0.0.0.0',
|
|
'port' => 8443,
|
|
'ssl' => false,
|
|
'ssl_cert' => '/etc/nginx/ssl/server.crt',
|
|
'ssl_key' => '/etc/nginx/ssl/server.key',
|
|
],
|
|
|
|
// ─── 信令服务配置 ─────────────────────────────────────
|
|
'signaling' => [
|
|
'port' => 9443,
|
|
'heartbeat_interval' => 30,
|
|
'heartbeat_timeout' => 90,
|
|
'max_connections' => 1000,
|
|
'max_devices_per_ip' => 10,
|
|
],
|
|
|
|
// ─── TURN服务器配置 ───────────────────────────────────
|
|
'turn' => [
|
|
'enabled' => true,
|
|
'host' => '', // coturn服务器地址, 留空则使用STUN only
|
|
'port' => 3478,
|
|
'secret' => 'xianyan-turn-secret-change-me',
|
|
'realm' => 'xianyan.com',
|
|
'credential_ttl' => 86400, // 24小时
|
|
'stun_servers' => [
|
|
'stun:stun.l.google.com:19302',
|
|
'stun:stun1.l.google.com:19302',
|
|
],
|
|
],
|
|
|
|
// ─── 配对服务配置 ─────────────────────────────────────
|
|
'pairing' => [
|
|
'data_file' => __DIR__ . '/data/pairing_records.json',
|
|
'request_ttl' => 300, // 配对请求5分钟过期
|
|
'max_paired_per_user' => 20,
|
|
],
|
|
|
|
// ─── 安全配置 ─────────────────────────────────────────
|
|
'security' => [
|
|
'api_key' => 'xianyan-api-key-change-me',
|
|
'cors_origins' => ['*'],
|
|
'rate_limit' => 60, // 每分钟请求数
|
|
'fingerprint_min_length' => 16,
|
|
],
|
|
|
|
// ─── 日志配置 ─────────────────────────────────────────
|
|
'log' => [
|
|
'enabled' => true,
|
|
'file' => __DIR__ . '/logs/signaling.log',
|
|
'level' => 'info', // debug/info/warn/error
|
|
'max_size' => 10485760, // 10MB
|
|
],
|
|
|
|
// ─── 协议配置 ─────────────────────────────────────────
|
|
'protocol' => [
|
|
'supported' => ['xianyan-v1', 'localsend-v2'],
|
|
'default' => 'xianyan-v1',
|
|
],
|
|
];
|