diff options
author | GitLab Release Tools Bot <robert+release-tools@gitlab.com> | 2019-08-26 10:43:05 +0300 |
---|---|---|
committer | GitLab Release Tools Bot <robert+release-tools@gitlab.com> | 2019-08-26 10:43:05 +0300 |
commit | 785ddcb2a47c53d22b5b7694f5b0bc14ca9cd2fb (patch) | |
tree | 85d0cfc0e241c770b08e6f695b98f0f3fa89f02e /config | |
parent | a9ff1532818814fd9645fa8c673b3018ea1f91c6 (diff) | |
parent | 228608c2a226d777b32c129369f6b0b4329b31cf (diff) |
Merge branch 'security-12-1-enable-image-proxy' into '12-1-stable'
Use image proxy to mitigate stealing ip addresses
See merge request gitlab/gitlabhq!3231
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/asset_proxy_settings.rb | 6 | ||||
-rw-r--r-- | config/initializers/fill_shards.rb | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/config/initializers/asset_proxy_settings.rb b/config/initializers/asset_proxy_settings.rb new file mode 100644 index 00000000000..92247aba1b8 --- /dev/null +++ b/config/initializers/asset_proxy_settings.rb @@ -0,0 +1,6 @@ +# +# Asset proxy settings +# +ActiveSupport.on_load(:active_record) do + Banzai::Filter::AssetProxyFilter.initialize_settings +end diff --git a/config/initializers/fill_shards.rb b/config/initializers/fill_shards.rb index 18e067c8854..cad662e12f3 100644 --- a/config/initializers/fill_shards.rb +++ b/config/initializers/fill_shards.rb @@ -1,3 +1,5 @@ -if Shard.connected? && !Gitlab::Database.read_only? +# The `table_exists?` check is needed because during our migration rollback testing, +# `Shard.connected?` could be cached and return true even though the table doesn't exist +if Shard.connected? && Shard.table_exists? && !Gitlab::Database.read_only? Shard.populate! end |