GitLab Shell handles git SSH sessions for GitLab and modifies the list of authorized keys. GitLab Shell is not a Unix shell nor a replacement for Bash or Zsh.
When you access the GitLab server over SSH then GitLab Shell will:
If you access a GitLab server over HTTP(S) you end up in gitlab-workhorse.
An overview of the four cases described above:
The gitlab-shell repository used to also contain the Git hooks that allow GitLab to validate Git pushes (e.g. "is this user allowed to push to this protected branch"). These hooks also trigger events in GitLab (e.g. to start a CI pipeline after a push).
We are in the process of moving these hooks to Gitaly, because Git hooks require direct disk access to Git repositories, and that is only possible on Gitaly servers. It makes no sense to have to install gitlab-shell on Gitaly servers.
As of GitLab 11.10 the actual Git hooks are in the Gitaly repository, but gitlab-shell must still be installed on Gitaly servers because the hooks rely on configuration data (e.g. the GitLab internal API URL) that is not yet available in Gitaly itself. Also see the transition plan.
GitLab shell will always use your system ruby (normally located at /usr/bin/ruby) and will not use the ruby your installed with a ruby version manager (such as RVM). It requires ruby 2.0 or higher. Please uninstall any old ruby versions from your system:
sudo apt-get remove ruby1.8
Download Ruby and compile it with:
mkdir /tmp/ruby && cd /tmp/ruby
curl -L --progress http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.5.tar.gz | tar xz
cd ruby-2.1.5
./configure --disable-install-rdoc
make
sudo make install
To install gitlab-shell you also need a Go compiler version 1.8 or newer. https://golang.org/dl/
./bin/install
./bin/compile
./bin/check
Add key:
./bin/gitlab-keys add-key key-782 "ssh-rsa AAAAx321..."
Remove key:
./bin/gitlab-keys rm-key key-23 "ssh-rsa AAAAx321..."
List all keys:
./bin/gitlab-keys list-keys
Remove all keys from authorized_keys file:
./bin/gitlab-keys clear
Starting with GitLab 8.12, GitLab supports Git LFS authentication through ssh.
We are starting to migrate some features from Ruby to Go. To be able to do this incrementally, we hide the Go implementation behind a feature flag.
To enable a feature, modify migration
option in config.yml
and ensure enabled
is set to true
and feature to be enabled is added to features
.
It should look something like this:
migration:
enabled: true
features: ['discover']
Here are the following features that can be enabled:
discover
2fa_recovery_codes
If you're using Omnibus, these features can be enabled by adding something like this to gitlab.rb
:
gitlab_shell['migration'] = { enabled: true, features: ['discover', '2fa_recovery_codes'] }
This is equivalent to having this in config.yml
:
migration:
enabled: true
features: ['discover', '2fa_recovery_codes']
GitLab Shell is versioned by git tags, and the version used by the Rails
application is stored in
GITLAB_SHELL_VERSION
.
For each version, there is a raw version and a tag version:
15.2.8
.v
. For instance, v15.2.8
.To release a new version of GitLab Shell and have that version available to the Rails application:
CHANGELOG
with the tag version and the
VERSION
file with the raw version.GITLAB_SHELL_VERSION
in the Rails application to the raw
version. (Note: this can be done as a separate MR to that, or in and MR
that will make use of the latest GitLab Shell changes.)In order to generate new VCR fixtures you need to have a local GitLab instance running and have next data:
You also need to modify secret
variable at spec/gitlab_net_spec.rb
so tests
can connect to your local instance.
See CONTRIBUTING.md.
See LICENSE.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。