diff --git a/config.yml.template b/config.yml.template index a55782d3..edf3d05b 100644 --- a/config.yml.template +++ b/config.yml.template @@ -50,4 +50,6 @@ test: - mrteacher stop_forum_spam_api_key: testkey 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 diff --git a/config.yml.travis b/config.yml.travis index ae274f3a..99a43d7f 100644 --- a/config.yml.travis +++ b/config.yml.travis @@ -20,4 +20,6 @@ education_tag_whitelist: - mrteacher stop_forum_spam_api_key: testkey 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 diff --git a/models/stat.rb b/models/stat.rb index 7f8ef87f..c50f3aea 100644 --- a/models/stat.rb +++ b/models/stat.rb @@ -19,7 +19,7 @@ class Stat < Sequel::Model def parse_logfiles(path) total_site_stats = {} - cache_control_ip = $config['cache_control_ip'] + cache_control_ips = $config['cache_control_ips'] Dir["#{path}/*.log"].each do |log_path| site_logs = {} @@ -34,7 +34,7 @@ class Stat < Sequel::Model 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