diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-15 06:09:49 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-15 06:09:49 +0000 |
commit | 00a8c64ffd18e74df4b1cdeda7776b5221fddafe (patch) | |
tree | 3a5262df3df89455384809bbd45dfb696c48ecde /lib | |
parent | b71a496c7a3e109f7c85ad7ac453e6f7bf7cda45 (diff) | |
download | gitlab-ce-00a8c64ffd18e74df4b1cdeda7776b5221fddafe.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/git_access_wiki.rb | 8 | ||||
-rw-r--r-- | lib/tasks/gitlab/x509/update.rake | 27 |
2 files changed, 29 insertions, 6 deletions
diff --git a/lib/gitlab/git_access_wiki.rb b/lib/gitlab/git_access_wiki.rb index aad46937c32..3c0dbba64bf 100644 --- a/lib/gitlab/git_access_wiki.rb +++ b/lib/gitlab/git_access_wiki.rb @@ -2,8 +2,6 @@ module Gitlab class GitAccessWiki < GitAccess - prepend_if_ee('EE::Gitlab::GitAccessWiki') # rubocop: disable Cop/InjectEnterpriseEditionModule - ERROR_MESSAGES = { read_only: "You can't push code to a read-only GitLab instance.", write_to_wiki: "You are not allowed to write to this project's wiki." @@ -33,10 +31,8 @@ module Gitlab ERROR_MESSAGES[:read_only] end - private - - def repository - project.wiki.repository + def container + project.wiki end end end diff --git a/lib/tasks/gitlab/x509/update.rake b/lib/tasks/gitlab/x509/update.rake new file mode 100644 index 00000000000..eaba9196acf --- /dev/null +++ b/lib/tasks/gitlab/x509/update.rake @@ -0,0 +1,27 @@ +require 'logger' + +desc "GitLab | X509 | Update signatures when certificate store has changed" +namespace :gitlab do + namespace :x509 do + task update_signatures: :environment do + update_certificates + end + + def update_certificates + logger = Logger.new(STDOUT) + + unless X509CommitSignature.exists? + logger.info("Unable to find any x509 commit signatures. Exiting.") + return + end + + logger.info("Start to update x509 commit signatures") + + X509CommitSignature.find_each do |sig| + sig.x509_commit&.update_signature!(sig) + end + + logger.info("End update x509 commit signatures") + end + end +end |