This is an automated email from the ASF dual-hosted git repository. sebb pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push: new d798186a Check against ASF domains d798186a is described below commit d798186a41f36eb3c6805a7897f2bcefb766b0c0 Author: Sebb <s...@apache.org> AuthorDate: Wed Apr 10 11:28:50 2024 +0100 Check against ASF domains --- www/members/page-scanner.cgi | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/www/members/page-scanner.cgi b/www/members/page-scanner.cgi index 7026717b..276d3ec9 100755 --- a/www/members/page-scanner.cgi +++ b/www/members/page-scanner.cgi @@ -4,6 +4,7 @@ PAGETITLE = "ASF Page Asset Checker - ALPHA" # very rudimentary page asset checker - shows references to non-ASF assets require 'open3' +require_relative '../../tools/asf-site-check' # usage: whimsy.apache.org/members/page-scanner?url=http://apache.org/ @@ -14,13 +15,17 @@ qs = ENV['QUERY_STRING'] if qs =~ %r{^url=(https?://.+)} url = $1 print "Checking the page #{url}\n\n" - puts "The following 3rd party references were found." - puts "They have not been checked against the list of allowed references." + puts "The following references were found to hosts other than apache.org and apachecon.com" + puts "The first column shows if the host is recognised as being under ASF control according to" + puts "https://privacy.apache.org/policies/asf-domains" print "=====\n" cmd = ['node', '/srv/whimsy/tools/scan-page.js', url, 'all'] out, err, status = Open3.capture3(*cmd) if status.success? - puts out + out.split("\n").each do |url| + print ASFDOMAIN.asfurl?(url) ? 'OK ' : 'NO ' + puts url + end else puts err.scan(/^Error:.+/).first || err # Show only the Error line if present end