feat: add configurable stealth download security policies
This commit is contained in:
@@ -1705,6 +1705,40 @@ function initDefaultSettings() {
|
||||
if (!SettingsDB.get('global_theme')) {
|
||||
SettingsDB.set('global_theme', 'dark');
|
||||
}
|
||||
|
||||
// 下载安全策略默认值(同IP同文件限速:5分钟3次、1小时10次、1天20次)
|
||||
if (!SettingsDB.get('download_security_enabled')) {
|
||||
SettingsDB.set('download_security_enabled', 'true');
|
||||
}
|
||||
if (!SettingsDB.get('download_security_same_file_enabled')) {
|
||||
SettingsDB.set('download_security_same_file_enabled', 'true');
|
||||
}
|
||||
if (!SettingsDB.get('download_security_same_file_limit_5m')) {
|
||||
SettingsDB.set('download_security_same_file_limit_5m', '3');
|
||||
}
|
||||
if (!SettingsDB.get('download_security_same_file_limit_1h')) {
|
||||
SettingsDB.set('download_security_same_file_limit_1h', '10');
|
||||
}
|
||||
if (!SettingsDB.get('download_security_same_file_limit_1d')) {
|
||||
SettingsDB.set('download_security_same_file_limit_1d', '20');
|
||||
}
|
||||
|
||||
// 扩展策略默认关闭(管理员可按需开启)
|
||||
if (!SettingsDB.get('download_security_same_user_enabled')) {
|
||||
SettingsDB.set('download_security_same_user_enabled', 'false');
|
||||
}
|
||||
if (!SettingsDB.get('download_security_same_user_limit_1h')) {
|
||||
SettingsDB.set('download_security_same_user_limit_1h', '80');
|
||||
}
|
||||
if (!SettingsDB.get('download_security_same_user_limit_1d')) {
|
||||
SettingsDB.set('download_security_same_user_limit_1d', '300');
|
||||
}
|
||||
if (!SettingsDB.get('download_security_same_file_min_interval_enabled')) {
|
||||
SettingsDB.set('download_security_same_file_min_interval_enabled', 'false');
|
||||
}
|
||||
if (!SettingsDB.get('download_security_same_file_min_interval_seconds')) {
|
||||
SettingsDB.set('download_security_same_file_min_interval_seconds', '2');
|
||||
}
|
||||
}
|
||||
|
||||
// 数据库迁移 - 主题偏好字段
|
||||
|
||||
Reference in New Issue
Block a user