Skip to content

Commit

Permalink
改进判定
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghost-chu committed Nov 11, 2024
1 parent 3d4d487 commit f90ea1d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ public class AnalyseService {
private long highRiskIpv6IdentityOffset;
@Value("${analyse.ipv6.prefix-length}")
private int ipv6ConvertToPrefixLength;
@Value("${analyse.highriskips.traffic-from-peer-less-than}")
private long trafficFromPeerLessThan;
@Autowired
private AnalysedRuleRepository analysedRuleRepository;
@PersistenceContext
Expand Down Expand Up @@ -110,18 +112,21 @@ public void cronHighRiskIps() {
list.addAll(banHistoryRepository
.findDistinctByPeerClientNameAndModuleLikeAndInsertTimeBetween("Transmission 2.93", "%ProgressCheatBlocker%", pastTimestamp(highRiskIpsOffset), nowTimestamp())
.stream()
.filter(banHistory -> banHistory.getFromPeerTraffic() != -1 && banHistory.getFromPeerTraffic() < trafficFromPeerLessThan)
.map(ban -> IPUtil.toIPAddress(ban.getPeerIp().getHostAddress()))
.distinct()
.toList());
list.addAll(banHistoryRepository
.findDistinctByPeerClientNameAndModuleLikeAndInsertTimeBetween("Transmission 3.00", "%ProgressCheatBlocker%", pastTimestamp(highRiskIpsOffset), nowTimestamp())
.stream()
.filter(banHistory -> banHistory.getFromPeerTraffic() != -1 && banHistory.getFromPeerTraffic() < trafficFromPeerLessThan)
.map(ban -> IPUtil.toIPAddress(ban.getPeerIp().getHostAddress()))
.distinct()
.toList());
list.addAll(banHistoryRepository
.findDistinctByPeerClientNameAndModuleLikeAndInsertTimeBetween("aria2/%", "%ProgressCheatBlocker%", pastTimestamp(highRiskIpsOffset), nowTimestamp())
.stream()
.filter(banHistory -> banHistory.getFromPeerTraffic() != -1 && banHistory.getFromPeerTraffic() < trafficFromPeerLessThan)
.map(ban -> IPUtil.toIPAddress(ban.getPeerIp().getHostAddress()))
.distinct()
.toList());
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,6 @@ analyse.overdownload.offset=3888000000
analyse.overdownload.threshold=2.5
analyse.highriskips.interval=14400000
analyse.highriskips.offset=3888000000
analyse.highriskips.traffic-from-peer-less-than=50000000
analyse.highriskipv6identity.interval=14400000
analyse.highriskipv6identity.offset=3888000000

0 comments on commit f90ea1d

Please sign in to comment.