diff options
author | George Koltsov <gkoltsov@gitlab.com> | 2019-07-26 13:21:52 +0300 |
---|---|---|
committer | George Koltsov <gkoltsov@gitlab.com> | 2019-08-02 17:39:18 +0300 |
commit | e5e1c907c01b53194f77e8d8de53554ba1824e7c (patch) | |
tree | 5f9602f3abf48056d4258a749cd9c756981d5abd /db/migrate | |
parent | eb2d4adf38726da62f62e850d181cedf12c64c5e (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')
2 files changed, 33 insertions, 0 deletions
diff --git a/db/migrate/20190726101050_rename_allow_local_requests_from_hooks_and_services_application_setting.rb b/db/migrate/20190726101050_rename_allow_local_requests_from_hooks_and_services_application_setting.rb new file mode 100644 index 00000000000..f1ba7da9fc7 --- /dev/null +++ b/db/migrate/20190726101050_rename_allow_local_requests_from_hooks_and_services_application_setting.rb @@ -0,0 +1,15 @@ +class RenameAllowLocalRequestsFromHooksAndServicesApplicationSetting < ActiveRecord::Migration[5.2] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + rename_column :application_settings, :allow_local_requests_from_hooks_and_services, :allow_local_requests_from_web_hooks_and_services + end + + def down + rename_column :application_settings, :allow_local_requests_from_web_hooks_and_services, :allow_local_requests_from_hooks_and_services + end +end 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 |