The initializers including this were doing so at the top level, so every object
loaded after them had a `current_application_settings` method. However, if
someone had rack-attack enabled (which was loaded before these initializers), it
would try to load the API, and fail, because `Gitlab::CurrentSettings` didn't
have that method.
To fix this:
1. Don't include `Gitlab::CurrentSettings` at the top level. We do not need
`Object.new.current_application_settings` to work.
2. Make `Gitlab::CurrentSettings` explicitly `extend self`, as we already use it
like that in several places.
3. Change the initializers to use that new form.
`allowed_key_types` is removed and the `minimum_<type>_bits` fields are
renamed to `<tech>_key_restriction`. A special sentinel value (`-1`) signifies
that the key type is disabled.
This also feeds through to the UI - checkboxes per key type are out, inline
selection of "forbidden" and "allowed" (i.e., no restrictions) are in.
As with the previous model, unknown key types are disallowed, even if the
underlying ssh daemon happens to support them. The defaults have also been
changed from the lowest known bit size to "no restriction". So if someone
does happen to have a 768-bit RSA key, it will continue to work on upgrade, at
least until the administrator restricts them.
This is an amalgamation of:
* Cory Hinshaw: Initial implementation !5552
* Rémy Coutable: Updates !9350
* Nick Thomas: Resolve conflicts and add ED25519 support !13712
The number of forks of a project doesn't change very frequently and
running a COUNT(*) every time this information is requested can be quite
expensive. We also end up running such a COUNT(*) query at least twice
on the homepage of a project.
By caching this data and refreshing it when necessary we can reduce
project homepage loading times by around 60 milliseconds (based on the
timings of https://gitlab.com/gitlab-org/gitlab-ce).
* master: (66 commits)
fix confidential border issue as well as confidential styles leaking on new MR
Migrate force push check to Gitaly
Add option to disable project export on instance
Better categorize test coverage results
Add option to disable project export on instance - db changes
Better caching and indexing of broadcast messages
Include the `is_admin` field in the `GET /users/:id` API when current user is an admin
Document rspec-retry and rspec-flaky
Fix cop description
Retrieve and sync flaky specs report from and to S3
Use a new RspecFlakyListener to detect flaky specs
Fix formatting of patch_versions.md [skip ci]
Enable Timecop safe mode
Show error message for API 500 error in tests, and
Fix merge request diff deserialisation when too_large was absent
Delete correct key from `session` after authenticating using U2F
Bumps omniauth-ldap gem version to 2.0.4
Pending delete projects no longer return 500 error in Admins projects view
Do not run the `ee_compat_check` job for stableish branches
Update gitlab.po: Missing 'r' in "Fouché" that comes from "Fourcher" verb.
...