From fc846cce0289fe9ee0dadf166de2c77c73fd4c87 Mon Sep 17 00:00:00 2001 From: Dave Fisher Date: Mon, 9 Nov 2026 14:44:34 -0800 Subject: [PATCH 1/2] Delete www/treasurer directory This functionality is not used --- www/treasurer/Gemfile | 8 --- www/treasurer/bill-upload.cgi | 120 ---------------------------------- www/treasurer/file-upload.cgi | 95 --------------------------- 3 files changed, 223 deletions(-) delete mode 100644 www/treasurer/Gemfile delete mode 100755 www/treasurer/bill-upload.cgi delete mode 100755 www/treasurer/file-upload.cgi diff --git a/www/treasurer/Gemfile b/www/treasurer/Gemfile deleted file mode 100644 index 65e73578a9..0000000000 --- a/www/treasurer/Gemfile +++ /dev/null @@ -1,8 +0,0 @@ -source 'https://rubygems.org' - -root = '../../..' -asf_version = File.read(File.expand_path("#{root}/asf.version", __FILE__)).chomp -gem 'whimsy-asf', asf_version, path: File.expand_path(root, __FILE__) - -gem 'escape' -gem 'wunderbar' diff --git a/www/treasurer/bill-upload.cgi b/www/treasurer/bill-upload.cgi deleted file mode 100755 index 2e217a57eb..0000000000 --- a/www/treasurer/bill-upload.cgi +++ /dev/null @@ -1,120 +0,0 @@ -#!/usr/bin/env ruby -PAGETITLE = "Apache Treasurer Bill Upload" # Wvisible:treasurer -$LOAD_PATH.unshift '/srv/whimsy/lib' -require 'wunderbar' -require 'wunderbar/bootstrap' -require 'wunderbar/jquery' -require 'whimsy/asf' -require 'tmpdir' -require 'escape' - - -user = ASF::Person.new($USER) -unless user.asf_chair_or_member? - print "Status: 401 Unauthorized\r\n" - print "WWW-Authenticate: Basic realm=\"ASF Members and Officers\"\r\n\r\n" - exit -end - -_html do - _style :system - _style %{ - pre._stdin, pre._stdout, pre._stderr {border: none; padding: 0} - } - - _body? do - _whimsy_body( - title: PAGETITLE, - subtitle: 'How To Upload Bills', - related: { - 'https://treasurer.apache.org/' => 'ASF Treasurer Process Documentation', - }, - helpblock: -> { - _p %{ - This form allows ASF Members and Officers to upload invoices or - bills to be submitted for payment. - } - _p %{ - Remember: only allowed approvers for a specific bill should - put or move bills into the /approved directory. - } - } - ) do - # GET: display the data input form for upload - _whimsy_panel('Upload A New Bill', style: 'panel-success') do - _form.form_horizontal enctype: 'multipart/form-data', method: 'post' do - _div.form_group do - _label.control_label.col_sm_2 'Select file to upload', for: 'file' - _div.col_sm_10 do - _input.form_control type: 'file', id: 'file', name: 'file', required: true, autofocus: true - end - end - _div.form_group do - _label.control_label.col_sm_2 'Enter commit message', for: 'message' - _div.col_sm_10 do - _textarea.form_control name: 'message', id: 'message', cols: 80, required: true - end - end - _div.form_group do - _label.control_label.col_sm_2 'Funding source (optional)', for: 'source' - _div.col_sm_10 do - _textarea.form_control name: 'source', id: 'source', cols: 80 - end - end - _div.form_group do - _label.control_label.col_sm_2 'Select destination', for: "dest" - _div.col_sm_10 do - _select.form_control name: 'dest', id: 'dest' do - _option 'Bills/received', type: 'radio', name: 'dest', value: 'received', checked: true - _option 'Bills/approved', type: 'radio', name: 'dest', value: 'approved' - end - end - end - _div.form_group do - _div.col_sm_offset_2.col_sm_10 do - _input.btn.btn_default type: "submit", value: "Upload" - end - end - end - end - - # POST: process the upload by checking into svn - if @file - _div.well.well_lg do - # destination directory - bills = ASF::SVN.svnurl('Bills') - - # validate @file, @dest form parameters - name = @file.original_filename.gsub(/[^-.\w]/, '_').sub(/^\.+/, '_') - raise ArgumentError, "Unexpected directory name" unless @dest =~ /^\w+$/ - - if @file.respond_to? :empty? and @file.empty? - _pre 'File is required', class: '_stderr' - elsif not @message or @message.empty? - _pre 'Message is required', class: '_stderr' - elsif not @dest or @dest.empty? - _pre 'Destination is required', class: '_stderr' - else - # append funding source to message, if present - if @source and not @source.empty? - @message += "\n\nFunding source: #{@source}" - end - _p 'Log of your upload/checkin follows:' - - Dir.mktmpdir do |tmpdir| - ASF::SVN.svn_('checkout', [File.join(bills, @dest), tmpdir], _, - {depth: 'empty', user: $USER, password: $PASSWORD}) - - Dir.chdir tmpdir do - IO.binwrite(name, @file.read) - ASF::SVN.svn_('add', name, _) - - ASF::SVN.svn_('commit', name, _, {msg: @message, user: $USER, password: $PASSWORD}) - end - end - end - end - end - end - end -end diff --git a/www/treasurer/file-upload.cgi b/www/treasurer/file-upload.cgi deleted file mode 100755 index cff1cd94b2..0000000000 --- a/www/treasurer/file-upload.cgi +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/env ruby -PAGETITLE = "ASF Treasurer File Upload" # Wvisible:treasurer -$LOAD_PATH.unshift '/srv/whimsy/lib' -require 'wunderbar' -require 'wunderbar/bootstrap' -require 'wunderbar/jquery' -require 'whimsy/asf' -require 'tmpdir' -require 'escape' - -RECORDS = ASF::SVN.svnurl('records') - -user = ASF::Person.new($USER) -unless user.treasurer? or user.secretary? - print "Status: 401 Unauthorized\r\n" - print "WWW-Authenticate: Basic realm=\"ASF Treasurer or Secretary\"\r\n\r\n" - exit -end - -_html do - _style :system - _style %{ - pre._stdin, pre._stdout, pre._stderr {border: none; padding: 0} - } - - _body? do - _whimsy_body( - title: PAGETITLE, - subtitle: 'How To Upload records', - related: { - 'https://treasurer.apache.org/' => 'ASF Treasurer Process Documentation', - }, - helpblock: -> { - _p %{ - This form allows the ASF Treasurer and Secretary to upload financial records, - e.g. 990 annual returns to: - } - _a RECORDS, href: RECORDS - } - ) do - # GET: display the data input form for upload - _whimsy_panel('Upload A New Record', style: 'panel-success') do - _form.form_horizontal enctype: 'multipart/form-data', method: 'post' do - _div.form_group do - _label.control_label.col_sm_2 'Select file to upload', for: 'file' - _div.col_sm_10 do - _input.form_control type: 'file', id: 'file', name: 'file', required: true, autofocus: true - end - end - _div.form_group do - _label.control_label.col_sm_2 'Enter commit message', for: 'message' - _div.col_sm_10 do - _textarea.form_control name: 'message', id: 'message', cols: 80, required: true - end - end - _div.form_group do - _div.col_sm_offset_2.col_sm_10 do - _input.btn.btn_default type: "submit", value: "Upload" - end - end - end - end - - # POST: process the upload by checking into svn - if @file - _div.well.well_lg do - # destination directory - # validate @file and @message form parameters - if not @file or (@file.respond_to? :empty? and @file.empty?) - _pre 'File is required', class: '_stderr' - elsif not @message or @message.empty? - _pre 'Message is required', class: '_stderr' - else - # prefix whimsy tag: - @message = "Whimsy upload: " + @message - _p 'Log of your upload/checkin follows:' - - name = @file.original_filename.gsub(/[^-.\w]/, '_').sub(/^\.+/, '_') - Dir.mktmpdir do |tmpdir| - ASF::SVN.svn_('checkout', [RECORDS, tmpdir], _, - {depth: 'empty', user: $USER, password: $PASSWORD}) - - Dir.chdir tmpdir do - IO.binwrite(name, @file.read) - ASF::SVN.svn_('add', name, _) - - ASF::SVN.svn_('commit', name, _, {msg: @message, user: $USER, password: $PASSWORD}) - end - end - end - end - end - end - end -end From 5c0a254ad0e7c469e97f9bb28a9b3010f42324c1 Mon Sep 17 00:00:00 2001 From: Dave Fisher Date: Mon, 9 Nov 2026 14:46:56 -0800 Subject: [PATCH 2/2] Remove Treasurer's Bill Upload Helper link Removed the Treasurer's Bill Upload Helper link from the index. --- www/officers/index.cgi | 1 - 1 file changed, 1 deletion(-) diff --git a/www/officers/index.cgi b/www/officers/index.cgi index f50b4f0d11..d1f6c685d6 100755 --- a/www/officers/index.cgi +++ b/www/officers/index.cgi @@ -15,7 +15,6 @@ OFFICERS = { '/board/subscriptions' => "PMC Chair board@ Subscription Crosscheck", 'list-traffic.cgi' => "Statistics About The board@ Mailing List", 'board-stats.cgi' => "Statistics About Board Meetings", - '/treasurer/bill-upload' => "Treasurer's Bill Upload Helper", 'http://treasurer.apache.org' => "Treasurer's Office Payment Processing Overview", 'https://www.apache.org/foundation/governance/orgchart' => "Apache Corporate Organization Chart", 'coi.cgi' => "Conflict of Interest Affirmation / Lookup Tool"