Add an `airgapped?` configuration state
Context
As discussed in #381422 (comment 1190062828)
We do have Gitlab::Database.read_only?
exposing when the main database is in read_only?
state (for example in a Geo secondary).
This allows code to be executed in a certain way in order to avoid operations that would otherwise fail.
With Air-Gapped environments, we have a similar limitation.
Proposal
We should create an airgapped
configuration setting to allow the Administrator to flag an installation as being "Airgapped" (and therefore expect limited or no access to the outside world).
An initial use-case for that would be how Geo handles NTP checks in the system check rake task.
By knowing that Gitlab.config.airgapped?
is true
, we can instead of displaying an error message, tell the user they need to provide a different way of making sure the clocks are in sync.
Another possible use case is for it to help enable something similar to "active silent mode":
When the flag is active, we try to avoid making external requests.