| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| |
| | |
# Conflicts:
# internal/command/twofactorverify/twofactorverify.go
|
| |
| |
| |
| |
| |
| |
| |
| | |
When gitlab-sshd has been introduced we've started running our
own SSH server. In this case we're able to cache and reuse
Gitaly connections and Registry.
It helps to reduce memory usage.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Currently, we don't process the results of this execution,
because it's not really imprortant
Let's at least log the err if the execution went wrong
That will also make Vulnerability report happy
|
| |
| |
| |
| |
| |
| |
| | |
If the GitLab API returns an allowed response with use_sidechannel set
to true, gitlab-shell will establish a sidechannel connection and use
SSHUploadPackWithSidechannel instead of SSHUploadPack. This is an
efficiency improvement.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Due to the way sshd works, gitlab-shell could be called with a single
string in the form:
```
/path/to/gitlab-shell -c key-id
```
However, due to the tightening of the regular expressions in fcff692b
this string no longer matches, so logins would fail with:
```
Failed to get username: who='' is invalid
```
This can be reproduced by changing the user's shell to point to
gitlab-shell. For example:
```
usermod git -s /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-shell
```
While setting gitlab-shell as the user's shell isn't officially
supported, gitlab-shell still should be able to cope with the key being
specified as the last argument. We now split the argument list and use
the last value.
Relates to https://gitlab.com/gitlab-org/gitlab-shell/-/issues/530
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Several of our commands only touch the internal API, and go nowhere
near Gitaly. Improve logging for each of these in a single MR. In
general, we want to be able to tell what happened in the execution of
each command, and to track failures down to a specific line of code.
Changelog: added
|
| | |
|
| | |
|
| |
| |
| |
| | |
It adds correlation ids wherever possible
|
| | |
|
| |\
| | |
| | |
| | |
| | |
| | |
| | | |
refactor: remove commandargs.GenericArgs
Closes #212
See merge request gitlab-org/gitlab-shell!506
|
| | |
| | |
| | |
| | |
| | | |
parse logic will only run if the executable accept args.
healthcheck is the only one not accepting arguments.
|
| | | |
|
| | | |
|
| |/ |
|
| |\
| | |
| | |
| | |
| | | |
Modify regex to prevent partial matches
See merge request gitlab-org/security/gitlab-shell!6
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Logrus buffers its output internally, which makes these tests fail
intermittently. They're also not a good example to follow generally.
We now have acceptance tests that exercise this functionality so I'm
pretty relaxed about losing the expectations. However, we can test
them by inspecting the server-received metadata too, so there's no loss
of coverage here.
The move from logrus to labkit for logging also makes these tests hard
to justify keeping.
|
| | | |
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Geo SSH proxy push currently impossible when the only
action that happens is branch removal. This fix
works in a way that it waits for flush packet from git
and then checks pkt lines to determine is pack data is expected.
The thing is that git doesnt send pack data when only
branch removal happens. Explanation is in
https://gitlab.com/gitlab-org/gitlab/-/issues/330494
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Gitaly project now properly respects module release flow
and includes a module suffix in the package name. It requires
to re-write all non-suffixed imports with suffixed of a specific
version of tha module. With proper module versioning we don't
need to use a 'replace' directive to point to specific commit
and can use semantic versioning for the gitaly dependency.
Part of: https://gitlab.com/gitlab-org/gitaly/-/issues/3177
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously, opentracing (if configured) was initialized late in the
gitlab-shell process's lifespan, coming just before making a gRPC
call to Gitaly.
By moving the opentracing initialization to be at process startup, we
make it available for the whole process lifecycle, which is very useful
to gitlab-sshd, as it means we'll only call tracing.Initialize() once
on process startup, rather than once per SSH connection.
To get this working, we need to introduce a context to gitlab-sshd.
This carries the client/service name, but also carries an initial
correlation ID. The main outcome of this is that all calls to the
authorized_keys endpoint from a given gitlab-sshd process will now
share a correlation ID. I don't have a strong opinion about this either
way.
Changelog: fixed
|
| |\
| | |
| | |
| | |
| | | |
Respect parent context for Gitaly calls
See merge request gitlab-org/gitlab-shell!469
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Without these changes, Gitaly calls would not be linked to a parent
context. This means that they would have an unassociated correlationID,
and Gitaly RPC calls would not be cancel()ed by parent context
cancellation.
Changelog: fixed
|
| |\ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
gitlab-sshd: Respect the ssl_cert_dir config
Closes #516
See merge request gitlab-org/gitlab-shell!467
|
| | |/
| | |
| | |
| | | |
Changelog: fixed
|
| |/
| |
| |
| |
| |
| |
| |
| |
| | |
Calling finished() in `ContextWithCorrelationID` breaks opentracing,
since it expects us to call it just before exiting, and this defer
runs on function completion.
All existing users of ContextWithCorrelationID already `defer finish()`
themselves, so this call is entirely surplus to requirements.
|
| |
| |
| |
| |
| | |
In this case we don't need to propagate cleanup
function. It simplifies the code.
|
| |
| |
| |
| |
| |
| |
| | |
Refactors introspection of execution environment to rely on
per-connection state (`gitlab-shell`) or per request (`gitlab-sshd`)
Relates to https://gitlab.com/gitlab-org/gitlab-shell/-/issues/496
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
|/ |
|
| |
|