(whimsy) branch master updated: Make subject of board report reminders not say missing. (#222)

2024-04-10 Thread sebb
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 5fe07cbe Make subject of board report reminders not say missing. (#222)
5fe07cbe is described below

commit 5fe07cbea4b920671847b8932bc472e8d732197d
Author: Dave Fisher 
AuthorDate: Wed Apr 10 15:15:57 2024 -0700

Make subject of board report reminders not say missing. (#222)

By changing the tone of the subject reminders to submit the report are less 
judgmental.
---
 www/board/agenda/views/buttons/email.js.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/www/board/agenda/views/buttons/email.js.rb 
b/www/board/agenda/views/buttons/email.js.rb
index 6b5b407b..c12d503e 100644
--- a/www/board/agenda/views/buttons/email.js.rb
+++ b/www/board/agenda/views/buttons/email.js.rb
@@ -45,7 +45,7 @@ class Email < Vue
 cc = "#{mail_list},#{@@item.cc}"
 
 if @@item.missing
-  subject = "Missing #{@@item.title} Board Report"
+  subject = "[REMINDER] Please submit the #{@@item.title} Board Report"
   if @@item.attach =~ /^\d/
 body = %{
   Dear #{@@item.owner},



(whimsy) branch master updated: Initial parse of marker files

2024-04-10 Thread sebb
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 b5456158 Initial parse of marker files
b5456158 is described below

commit b5456158e779557697d2d33e0b9496ee9ba023c6
Author: Sebb 
AuthorDate: Wed Apr 10 17:09:47 2024 +0100

Initial parse of marker files
---
 lib/whimsy/asf/mlist.rb | 20 
 1 file changed, 20 insertions(+)

diff --git a/lib/whimsy/asf/mlist.rb b/lib/whimsy/asf/mlist.rb
index 064eac3a..91ef0cb1 100644
--- a/lib/whimsy/asf/mlist.rb
+++ b/lib/whimsy/asf/mlist.rb
@@ -277,6 +277,24 @@ module ASF
   end
 end
 
+# Parse the marker files: modpost, modsub, remote
+# Return hash: key="domain list", value=hash containing :modsub, :modpost, 
:remote
+# if the list has the corresponding file
+# BETA: API may change!
+def self.parse_markers
+  hash = Hash.new {|h,k| h[k] = Hash.new}
+  File.open(File.join(LIST_BASE, 'list-modsub')).each do |line|
+hash[line.chomp][:modsub] = 1
+  end
+  File.open(File.join(LIST_BASE, 'list-modpost')).each do |line|
+hash[line.chomp][:modpost] = 1
+  end
+  File.open(File.join(LIST_BASE, 'list-remote')).each do |line|
+hash[line.chomp][:remote] = 1
+  end
+  hash
+end
+
 private
 
 # return the archiver type as array: 
[:MBOX|:PONY|:MINO|:MAIL_ARCH|:MARKMAIL|:WHIMSY, 
'public'|'private'|'alias'|'direct']
@@ -444,6 +462,8 @@ end
 if __FILE__ == $0
   $LOAD_PATH.unshift '/srv/whimsy/lib'
   require 'whimsy/asf'
+  p ASF::MLIST.parse_markers
+  exit
   domain = ARGV.shift || 'whimsical'
   mlist = ASF::Committee.find(domain).mail_list
   p mlist



(whimsy) branch master updated: Check against ASF domains

2024-04-10 Thread sebb
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 
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



(whimsy) branch master updated: return false rather than nil if RE does not match

2024-04-10 Thread sebb
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 a34bcc0a return false rather than nil if RE does not match
a34bcc0a is described below

commit a34bcc0a747c8dec94ce852c9dacb325ecb39587
Author: Sebb 
AuthorDate: Wed Apr 10 11:09:44 2024 +0100

return false rather than nil if RE does not match
---
 tools/asf-site-check.rb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/asf-site-check.rb b/tools/asf-site-check.rb
index 63dd3bb7..590fac39 100644
--- a/tools/asf-site-check.rb
+++ b/tools/asf-site-check.rb
@@ -56,7 +56,8 @@ module ASFDOMAIN
   def self.asfhost?(host)
 return true if ASF_DOMAINS.include? host
 # This assumes all ASF domains are of the form a.b
-return host =~ %r{\.(\w+\.\w+)\z} && ASF_DOMAINS.include?($1)
+# (return false rather than nil if RE does not match)
+return (host =~ %r{\.(\w+\.\w+)\z} && ASF_DOMAINS.include?($1)) || false
   end
   # check if URL is known to be under ASF control
   # extracts hostname and calls asfhost?