Commit 132443cf authored by Sean McGivern's avatar Sean McGivern

Disallow Pages NFS access in web server

Previously this was controlled by the `GITLAB_PAGES_DENY_DISK_ACCESS`
environment variable. As we have been running with that variable enabled
on GitLab.com with no issues for a while now, we can remove this check
entirely.
parent cbb49c97
......@@ -6,7 +6,7 @@ module Gitlab
DiskAccessDenied = Class.new(StandardError)
def path
if ::Gitlab::Runtime.web_server? && ENV['GITLAB_PAGES_DENY_DISK_ACCESS'] == '1'
if ::Gitlab::Runtime.web_server? && !::Gitlab::Runtime.test_suite?
raise DiskAccessDenied
end
......
......@@ -10,21 +10,14 @@ RSpec.describe Gitlab::Pages::Settings do
it { is_expected.to eq('the path') }
context 'when running under a web server' do
context 'when running under a web server outside of test mode' do
before do
allow(::Gitlab::Runtime).to receive(:test_suite?).and_return(false)
allow(::Gitlab::Runtime).to receive(:web_server?).and_return(true)
end
it { is_expected.to eq('the path') }
context 'with the env var' do
before do
stub_env('GITLAB_PAGES_DENY_DISK_ACCESS', '1')
end
it 'raises a DiskAccessDenied exception' do
expect { subject }.to raise_error(described_class::DiskAccessDenied)
end
it 'raises a DiskAccessDenied exception' do
expect { subject }.to raise_error(described_class::DiskAccessDenied)
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment