mirror of
https://github.com/neocities/neocities.git
synced 2025-07-27 04:48:20 +02:00
support for multiple cache purge ips in stats parsing
This commit is contained in:
parent
b80c4a98a2
commit
5c2f56e0b6
3 changed files with 8 additions and 4 deletions
|
@ -50,4 +50,6 @@ test:
|
||||||
- mrteacher
|
- mrteacher
|
||||||
stop_forum_spam_api_key: testkey
|
stop_forum_spam_api_key: testkey
|
||||||
screenshots_url: http://screenshots:derp@screenshotssite.com
|
screenshots_url: http://screenshots:derp@screenshotssite.com
|
||||||
cache_control_ip: 1.2.3.4
|
cache_control_ips:
|
||||||
|
- 1.2.3.4
|
||||||
|
- 4.5.6.7
|
||||||
|
|
|
@ -20,4 +20,6 @@ education_tag_whitelist:
|
||||||
- mrteacher
|
- mrteacher
|
||||||
stop_forum_spam_api_key: testkey
|
stop_forum_spam_api_key: testkey
|
||||||
screenshots_url: http://screenshots:derp@screenshotssite.com
|
screenshots_url: http://screenshots:derp@screenshotssite.com
|
||||||
cache_control_ip: 1.2.3.4
|
cache_control_ips:
|
||||||
|
- 1.2.3.4
|
||||||
|
- 4.5.6.7
|
||||||
|
|
|
@ -19,7 +19,7 @@ class Stat < Sequel::Model
|
||||||
def parse_logfiles(path)
|
def parse_logfiles(path)
|
||||||
total_site_stats = {}
|
total_site_stats = {}
|
||||||
|
|
||||||
cache_control_ip = $config['cache_control_ip']
|
cache_control_ips = $config['cache_control_ips']
|
||||||
|
|
||||||
Dir["#{path}/*.log"].each do |log_path|
|
Dir["#{path}/*.log"].each do |log_path|
|
||||||
site_logs = {}
|
site_logs = {}
|
||||||
|
@ -34,7 +34,7 @@ class Stat < Sequel::Model
|
||||||
|
|
||||||
time, username, size, path, ip, referrer = hit_array
|
time, username, size, path, ip, referrer = hit_array
|
||||||
|
|
||||||
next if ip == cache_control_ip
|
next if cache_control_ips.include?(ip)
|
||||||
|
|
||||||
log_time = Time.parse time
|
log_time = Time.parse time
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue