rails_pwnerer 0.6.15 → 0.6.16

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ v0.6.16. Require enable_db_reset configuration flag for db_reset (dangerous operation).
2
+
1
3
  v0.6.15. Running hooks ending in _su as super-user. Fixed base bug that didn't reload nginx configs.
2
4
 
3
5
  v0.6.14. Cheating to get rpwn on the system path even on restrictive Debians.
data/README CHANGED
@@ -84,6 +84,8 @@ sudo rpwn go down
84
84
 
85
85
  * Reset your database (drops and re-creates, useful in staging instances):
86
86
  sudo rpwn db_reset your_application
87
+ (you need to read the next section on instances and configuration, and set
88
+ the 'enable_db_reset' key on your staging instance)
87
89
 
88
90
  * Uninstall your application
89
91
  sudo rpwn uninstall your_application
@@ -41,6 +41,8 @@ class RailsPwnage::App::Config
41
41
  app_db[:writable_dirs] ||= ''
42
42
  # comma-separated gems that should be installed for the application
43
43
  app_db[:gems] ||= ''
44
+ # set to disable accidental db resets (on production vs. staging instances)
45
+ app_db[:enable_db_reset] ||= false
44
46
  end
45
47
 
46
48
  # allocates room for the application and creates the application configuration database
@@ -96,6 +96,13 @@ module RailsPwnage::App
96
96
  when :db_console
97
97
  Svn.new.manage app, instance, action
98
98
  when :db_reset
99
+ app_config = RailsPwnage::Config[app, instance]
100
+ unless app_config[:enable_db_reset]
101
+ print "Database resets are disabled for this instance.\n"
102
+ print "If you truly want to reset, add the :enable_db_reset configuration key.\n"
103
+ return
104
+ end
105
+
99
106
  self.update_app app, instance do
100
107
  Scripts.new.pre_reset app, instance
101
108
  Database.new.manage app, instance, action
@@ -1,11 +1,11 @@
1
1
 
2
- # Gem::Specification for Rails_pwnerer-0.6.15
2
+ # Gem::Specification for Rails_pwnerer-0.6.16
3
3
  # Originally generated by Echoe
4
4
 
5
5
  --- !ruby/object:Gem::Specification
6
6
  name: rails_pwnerer
7
7
  version: !ruby/object:Gem::Version
8
- version: 0.6.15
8
+ version: 0.6.16
9
9
  platform: ruby
10
10
  authors:
11
11
  - Victor Costan
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_pwnerer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.15
4
+ version: 0.6.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Costan