.config.example.php 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <?php
  2. //基本设置---------------------------------------------------------------------------------------------------------------
  3. $_ENV['key'] = 'ChangeMe'; // Cookie加密密钥,请务必修改此key为随机字符串
  4. $_ENV['pwdMethod'] = 'bcrypt'; // 密码加密 可选 bcrypt, argon2i, argon2id
  5. $_ENV['salt'] = ''; // bcrypt/argon2i/argon2id 会忽略此项
  6. $_ENV['debug'] = false; // debug模式开关,生产环境请保持为false
  7. $_ENV['appName'] = 'SSPanel-UIM'; // 站点名称
  8. $_ENV['baseUrl'] = 'https://example.com'; // 站点地址,必须以https://开头,不要以/结尾
  9. // WebAPI
  10. $_ENV['webAPI'] = true; // 是否开启WebAPI功能
  11. $_ENV['webAPIUrl'] = $_ENV['baseUrl']; // WebAPI地址,如需和站点地址相同,请不要修改
  12. $_ENV['muKey'] = 'ChangeMe'; // WebAPI密钥,用于节点服务端与面板通信,请务必修改此key为随机字符串
  13. $_ENV['checkNodeIp'] = true; // 是否webapi验证节点ip
  14. //数据库设置--------------------------------------------------------------------------------------------------------------
  15. // db_host|db_socket 二选一,若设置 db_socket 则 db_host 会被忽略,不用请留空
  16. // db_host 例: localhost(可解析的主机名), 127.0.0.1(IP 地址)
  17. // db_socket 例:/var/run/mysqld/mysqld.sock(需使用绝对地址)
  18. $_ENV['db_host'] = '';
  19. $_ENV['db_socket'] = '';
  20. $_ENV['db_database'] = 'sspanel'; // 数据库名
  21. $_ENV['db_username'] = 'root'; // 数据库用户名
  22. $_ENV['db_password'] = 'sspanel'; // 用户密码
  23. $_ENV['db_port'] = '3306'; // 端口
  24. #读写分离相关配置
  25. $_ENV['enable_db_rw_split'] = false; // 是否开启读写分离
  26. $_ENV['read_db_hosts'] = ['']; // 从库地址,可配置多个
  27. $_ENV['write_db_host'] = ''; // 主库地址
  28. #高级
  29. $_ENV['db_charset'] = 'utf8mb4';
  30. $_ENV['db_collation'] = 'utf8mb4_unicode_ci';
  31. $_ENV['db_prefix'] = '';
  32. //Redis设置--------------------------------------------------------------------------------------------------------------
  33. $_ENV['redis_host'] = '127.0.0.1'; // Redis地址,使用unix domain socket时填写文件路径
  34. $_ENV['redis_port'] = 6379; // Redis端口,使用unix domain socket时填写-1
  35. $_ENV['redis_db'] = 0; // Redis数据库编号,留空则使用默认的0
  36. $_ENV['redis_connect_timeout'] = 2.0; // Redis连接超时时间,单位秒
  37. $_ENV['redis_read_timeout'] = 8.0; // Redis读取超时时间,单位秒
  38. $_ENV['redis_username'] = ''; // Redis用户名,留空则不使用用户名连接
  39. $_ENV['redis_password'] = ''; // Redis密码,留空则无密码
  40. $_ENV['redis_ssl'] = false; // 是否使用SSL连接Redis,如果使用了SSL,那么Redis端口应为Redis实例的TLS端口
  41. $_ENV['redis_ssl_context'] = []; // 使用SSL时的上下文选项,参考 https://www.php.net/manual/zh/context.ssl.php
  42. //Rate Limit 设置--------------------------------------------------------------------------------------------------------
  43. $_ENV['enable_rate_limit'] = true; // 是否开启请求限制
  44. $_ENV['rate_limit_sub_ip'] = 10; // 每分钟每个IP的订阅链接请求限制
  45. $_ENV['rate_limit_sub'] = 10; // 每分钟每个用户的订阅链接请求限制
  46. $_ENV['rate_limit_webapi_ip'] = 120; // 每分钟每个IP的WebAPI请求限制
  47. $_ENV['rate_limit_webapi'] = 1200; // 每分钟WebAPI全局请求限制
  48. $_ENV['rate_limit_user_api_ip'] = 60; // 每分钟每个IP的用户API请求限制
  49. $_ENV['rate_limit_user_api'] = 60; // 每分钟每个用户的API请求限制
  50. $_ENV['rate_limit_admin_api_ip'] = 60; // 每分钟每个管理员的API请求限制
  51. $_ENV['rate_limit_admin_api'] = 60; // 每分钟每个管理员的API请求限制
  52. $_ENV['rate_limit_node_api_ip'] = 60; // 每分钟每个IP的节点API请求限制
  53. $_ENV['rate_limit_node_api'] = 60; // 每分钟每个节点的API请求限制
  54. //邮件设置----------------------------------------------------------------------------------------------------------------
  55. $_ENV['mail_filter'] = 0; // 0: 关闭; 1: 白名单模式; 2; 黑名单模式;
  56. $_ENV['mail_filter_list'] = [];
  57. //已注册用户设置-----------------------------------------------------------------------------------------------------------
  58. //TODO: move these settings to DB
  59. #高级
  60. $_ENV['class_expire_reset_traffic'] = 0; // 等级到期时重置为的流量值,单位GB,小于0时不重置
  61. $_ENV['enable_kill'] = false; // 是否允许用户注销账户
  62. $_ENV['enable_change_email'] = true; // 是否允许用户更改賬戶郵箱
  63. #用户流量不足提醒
  64. $_ENV['notify_limit_mode'] = false; // false为关闭,per为按照百分比提醒,mb为按照固定剩余流量提醒
  65. $_ENV['notify_limit_value'] = 500; // 当上一项为per时,此处填写百分比;当上一项为mb时,此处填写流量
  66. //订阅设置----------------------------------------------------------------------------------------------------------------
  67. $_ENV['Subscribe'] = true; // 本站是否提供订阅功能
  68. $_ENV['subUrl'] = $_ENV['baseUrl']; // 订阅地址,如需和站点名称相同,请不要修改
  69. $_ENV['sub_token_len'] = 16; // 订阅token长度
  70. //审计自动封禁设置---------------------------------------------------------------------------------------------------------
  71. //TODO: move these settings to DB
  72. $_ENV['auto_detect_ban_allow_admin'] = true; // 管理员不受审计限制
  73. $_ENV['auto_detect_ban_allow_users'] = []; // 审计封禁的例外用户 ID
  74. $_ENV['auto_detect_ban_number'] = 30; // 每次执行封禁所需的触发次数
  75. $_ENV['auto_detect_ban_time'] = 60; // 每次封禁的时长 (分钟)
  76. //节点检测---------------------------------------------------------------------------------------------------------------
  77. //TODO: move these settings to DB
  78. #GFW检测
  79. $_ENV['detect_gfw_port'] = 443; //所有节点服务器都打开的TCP端口
  80. $_ENV['detect_gfw_url'] = 'https://example.com/v1/tcping?ip={ip}&port={port}'; // https://github.com/SSPanel-NeXT/NetStatus-API-Go
  81. #离线检测
  82. $_ENV['enable_detect_offline'] = true;
  83. //高级设置---------------------------------------------------------------------------------------------------------------
  84. $_ENV['enable_login_bind_ip'] = true; //是否将登陆线程和IP绑定
  85. $_ENV['enable_login_bind_device'] = true; //是否将登陆线程和设备绑定
  86. $_ENV['rememberMeDuration'] = 7; //登录时记住账号时长天数
  87. $_ENV['timeZone'] = 'Asia/Shanghai'; //需使用 PHP 兼容的时区格式
  88. $_ENV['theme'] = 'tabler'; //默认主题
  89. $_ENV['locale'] = 'zh-CN'; //默认语言
  90. $_ENV['jump_delay'] = 1000; //跳转延时,单位ms
  91. $_ENV['keep_connect'] = false; // 流量耗尽用户限速至 1Mbps
  92. //Other-----------------------------------------------------------------------------------------------------------------
  93. // cdn.jsdelivr.net / fastly.jsdelivr.net / testingcf.jsdelivr.net
  94. $_ENV['jsdelivr_url'] = 'fastly.jsdelivr.net';
  95. // https://sentry.io for production debugging
  96. $_ENV['sentry_dsn'] = '';
  97. // Maxmind GeoIP2 database
  98. //TODO: move these settings to DB
  99. $_ENV['maxmind_account_id'] = '';
  100. $_ENV['maxmind_license_key'] = '';
  101. $_ENV['geoip_locale'] = 'en';
  102. // ClientDownload 命令解决 API 访问频率高而被限制使用的 Github access token
  103. $_ENV['github_access_token'] = '';
  104. // use Cloudflare R2 for clients download
  105. $_ENV['enable_r2_client_download'] = false;
  106. $_ENV['r2_bucket_name'] = '';
  107. $_ENV['r2_account_id'] = '';
  108. $_ENV['r2_access_key_id'] = '';
  109. $_ENV['r2_access_key_secret'] = '';
  110. $_ENV['r2_client_download_timeout'] = 10;
  111. // Clash Meta TCP Concurrency. Default true, false
  112. $_ENV['tcp_concurrent'] = true;
  113. // Custom DNS, sing-box DNS Server setting(Rule mode)
  114. $_ENV['dns_select'] = 'google'; //Default mine_853, mine_443, google, cloudflare, opendns, alidns
  115. //(direct)mine_853 default type tls, quic
  116. $_ENV['dns_server_853'] = 'dns.google'; //The address of the DNS server. Default domain, ip
  117. $_ENV['dns_server_port_853'] = 853; //The port of the DNS server. Default 853
  118. $_ENV['dns_type_853'] = 'tls'; //The type of the DNS server. Default tls, quic
  119. //(direct)mine_443 default type https, h3
  120. $_ENV['dns_server_443'] = 'dns.google'; //The address of the DNS server. Default domain, ip
  121. $_ENV['dns_server_port_443'] = 443; //The port of the DNS server. Default 443
  122. $_ENV['dns_path_443'] = '/dns-query'; //The path of the DNS server. Default /dns-query
  123. $_ENV['dns_type_443'] = 'https'; //The type of the DNS server. Default https, h3