Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Koltsov <gkoltsov@gitlab.com>2019-07-26 13:21:52 +0300
committerGeorge Koltsov <gkoltsov@gitlab.com>2019-08-02 17:39:18 +0300
commite5e1c907c01b53194f77e8d8de53554ba1824e7c (patch)
tree5f9602f3abf48056d4258a749cd9c756981d5abd /db/migrate/20190726101133_add_allow_local_requests_from_system_hooks_to_application_settings.rb
parenteb2d4adf38726da62f62e850d181cedf12c64c5e (diff)
Add outbound requests setting for system hooks
This MR adds new application setting to network section `allow_local_requests_from_system_hooks`. Prior to this change system hooks were allowed to do local network requests by default and we are adding an ability for admins to control it.
Diffstat (limited to 'db/migrate/20190726101133_add_allow_local_requests_from_system_hooks_to_application_settings.rb')
-rw-r--r--db/migrate/20190726101133_add_allow_local_requests_from_system_hooks_to_application_settings.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/db/migrate/20190726101133_add_allow_local_requests_from_system_hooks_to_application_settings.rb b/db/migrate/20190726101133_add_allow_local_requests_from_system_hooks_to_application_settings.rb
new file mode 100644
index 00000000000..ed58d4e57fc
--- /dev/null
+++ b/db/migrate/20190726101133_add_allow_local_requests_from_system_hooks_to_application_settings.rb
@@ -0,0 +1,18 @@
+class AddAllowLocalRequestsFromSystemHooksToApplicationSettings < ActiveRecord::Migration[5.2]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ add_column_with_default(:application_settings, :allow_local_requests_from_system_hooks,
+ :boolean,
+ default: true,
+ allow_null: false)
+ end
+
+ def down
+ remove_column(:application_settings, :allow_local_requests_from_system_hooks)
+ end
+end