fixed authentication for destroy-all-user-dbs master
authorelijah <elijah@riseup.net>
Mon, 5 Sep 2016 21:11:14 +0000 (14:11 -0700)
committerelijah <elijah@riseup.net>
Mon, 5 Sep 2016 21:11:14 +0000 (14:11 -0700)
destroy-all-user-dbs

index 84cec56..0985dc6 100755 (executable)
@@ -1,14 +1,22 @@
 #!/usr/bin/ruby
 
-require 'couchrest'
+unless ARGV.grep('--force').any?
+  puts
+  puts "DANGER!"
+  puts
+  puts "Are you sure you want to entirely delete all per-user storage dbs?"
+  puts "Run with --force if you really want to do this."
+  puts "Note: this script will not clean up the `users` db or the `identities` db."
+  puts
+end
 
-server = CouchRest::Server.new
+require_relative "lib/leap"
 
+server   = LEAP::Server.new
 server.databases.each do |db_name|
   if db_name =~ /^user-[a-f0-9]{32}$/
+    puts 'destroying %s' % db_name
     server.database(db_name).delete!
   end
 end
 
-
-