blob: 0e77259a0dedab8d4b1982f53ff61cbb6dca7564 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# frozen_string_literal: true
module Gitlab
module Pages
class Settings < ::SimpleDelegator
DiskAccessDenied = Class.new(StandardError)
def path
::Gitlab::ErrorTracking.track_exception(DiskAccessDenied.new) if disk_access_denied?
super
end
def local_store
@local_store ||= ::Gitlab::Pages::Stores::LocalStore.new(super)
end
private
def disk_access_denied?
return true unless ::Settings.pages.local_store&.enabled
::Gitlab::Runtime.web_server? && !::Gitlab::Runtime.test_suite?
end
end
end
end
|