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 12675c9 Disable agenda and workbench updates for migration
12675c9 is described below
commit 12675c99c21c67795bd37ffdfff970456f362d3d
Author: Sebb <[email protected]>
AuthorDate: Sat Sep 19 23:02:36 2020 +0100
Disable agenda and workbench updates for migration
---
www/board/agenda/routes.rb | 16 ++++++++++++++++
www/secretary/workbench/server.rb | 12 ++++++++++++
2 files changed, 28 insertions(+)
diff --git a/www/board/agenda/routes.rb b/www/board/agenda/routes.rb
index 4b49b0e..4399fe7 100755
--- a/www/board/agenda/routes.rb
+++ b/www/board/agenda/routes.rb
@@ -2,6 +2,10 @@
# Server side Sinatra routes
#
+# disable all update actions
+UNAVAILABLE = 'Service temporarily unavailable due to migration.'
+# set the constant to nil to re-enable
+
# redirect root to latest agenda
get '/' do
agenda = dir('board_agenda_*.txt').sort.last
@@ -183,6 +187,8 @@ get %r{/(\d\d\d\d-\d\d-\d\d)/feedback.json} do |date|
end
post %r{/(\d\d\d\d-\d\d-\d\d)/feedback.json} do |date|
+ return [503, UNAVAILABLE] if UNAVAILABLE
+
@agenda = "board_agenda_#{date.gsub('-', '_')}.txt".untaint
@dryrun = false
_json :'actions/feedback'
@@ -337,6 +343,8 @@ get '/json/posted-reports' do
end
post '/json/posted-reports' do
+ return [503, UNAVAILABLE] if UNAVAILABLE
+
_json :"actions/posted-reports"
end
@@ -352,6 +360,8 @@ end
# posted actions
post '/json/:file' do
+ return [503, UNAVAILABLE] if UNAVAILABLE
+
_json :"actions/#{params[:file]}"
end
@@ -448,10 +458,14 @@ end
# Secretary post-meeting todos
get '/json/secretary-todos/:date' do
+ return [503, UNAVAILABLE] if UNAVAILABLE
+
_json :'actions/todos'
end
post '/json/secretary-todos/:date' do
+ return [503, UNAVAILABLE] if UNAVAILABLE
+
_json :'actions/todos'
end
@@ -562,6 +576,8 @@ end
# post a new agenda
post %r{/(\d\d\d\d-\d\d-\d\d)/} do |date|
+ return [503, UNAVAILABLE] if UNAVAILABLE
+
boardurl = ASF::SVN.svnurl('foundation_board')
agenda = "board_agenda_#{date.gsub('-', '_')}.txt"
diff --git a/www/secretary/workbench/server.rb
b/www/secretary/workbench/server.rb
index 37fab60..e9e8299 100644
--- a/www/secretary/workbench/server.rb
+++ b/www/secretary/workbench/server.rb
@@ -52,6 +52,10 @@ set :show_exceptions, true
disable :logging # suppress log of requests to stderr/error.log
+# disable all update actions
+UNAVAILABLE = 'Service temporarily unavailable due to migration.'
+# set the constant to nil to re-enable
+
# list of messages
get '/' do
redirect to('/') if env['REQUEST_URI'] == env['SCRIPT_NAME']
@@ -106,6 +110,8 @@ end
# task lists
post '/tasklist/:file' do
+ return [503, UNAVAILABLE] if UNAVAILABLE
+
@jsmtime = File.mtime('public/tasklist.js').to_i
@cssmtime = File.mtime('public/secmail.css').to_i
@@ -119,11 +125,15 @@ end
# posted actions
post '/actions/:file' do
+ return [503, UNAVAILABLE] if UNAVAILABLE unless params[:file] == 'check-mail'
+
_json :"actions/#{params[:file]}"
end
# mark a single message as deleted
delete %r{/(\d+)/(\w+)/} do |month, hash|
+ return [503, UNAVAILABLE] if UNAVAILABLE
+
success = false
Mailbox.update(month) do |headers|
@@ -139,6 +149,8 @@ end
# update a single message
patch %r{/(\d{6})/(\w+)/} do |month, hash|
+ return [503, UNAVAILABLE] if UNAVAILABLE
+
success = false
Mailbox.update(month) do |headers|