summaryrefslogtreecommitdiff
path: root/cmd/gitlab-shell
Commit message (Collapse)AuthorAgeFilesLines
* Log command invocation499-log-command-invocationNick Thomas2021-10-071-1/+11
| | | | | | | | Use reflection to log the command we are about to execute, both in gitlab-shell and gitlab-sshd. Include the environment, which has all the context we need to understand what the command is expected to do. Changelog: added
* Don't swallow an error parsing SSH_ORIGINAL_COMMANDNick Thomas2021-09-271-1/+1
|
* refactor: unify instantiation of command.Shellfeistel2021-09-201-0/+14
|
* refactor: cleanup func signature and remove unused argsfeistel2021-09-083-9/+8
|
* refactor: rearchitect command and executable Go modulesfeistel2021-09-083-2/+349
|
* refactor: add acceptargs field to executablefeistel2021-09-081-1/+1
| | | | | parse logic will only run if the executable accept args. healthcheck is the only one not accepting arguments.
* Switch to labkit for logging system setupNick Thomas2021-08-041-1/+2
| | | | | | | | | | | - We start supporting the "color" format for logs. - We now respond to SIGHUP by reopening the log file. - We now respect the log format when no log filename is specified. Output to syslog in the event of logging system setup is preserved in OpenSSH mode. Changelog: added
* Fix opentracing setup for gitlab-sshdNick Thomas2021-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | 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
* chore: Refactor env introspection to rely on command initialization496-move-env-introspection-to-sshenvLucas Charles2021-03-151-1/+3
| | | | | | | 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
* RFC: Simple built-in SSH serverLorenz Brun2021-01-181-1/+1
|
* Add support for -version argumentStan Hu2020-10-151-0/+14
| | | | | This will help determine the version of the binary particularly on Cloud Native GitLab, where VERSION may not be shipped with the binaries.
* Make it possible to propagate correlation ID across processesStan Hu2020-09-201-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, gitlab-shell did not pass a context through the application. Correlation IDs were generated down the call stack instead of passed around from the start execution. This has several potential downsides: 1. It's easier for programming mistakes to be made in future that lead to multiple correlation IDs being generated for a single request. 2. Correlation IDs cannot be passed in from upstream requests 3. Other advantages of context passing, such as distributed tracing is not possible. This commit changes the behavior: 1. Extract the correlation ID from the environment at the start of the application. 2. If no correlation ID exists, generate a random one. 3. Pass the correlation ID to the GitLabNet API requests. This change also enables other clients of GitLabNet (e.g. Gitaly) to pass along the correlation ID in the internal API requests (https://gitlab.com/gitlab-org/gitaly/-/issues/2725). Fixes https://gitlab.com/gitlab-org/gitlab-shell/-/issues/474
* Log internal HTTP requestsStan Hu2020-03-101-0/+3
| | | | | | | This restores the previous behavior of logging the success and failures of internal HTTP requests. Part of https://gitlab.com/gitlab-org/gitlab/issues/207916
* More consistent console messages (golang)Ash McKenzie2019-10-231-1/+2
|
* Rename import pathsNick Thomas2019-10-181-4/+4
|
* Move go code up one levelNick Thomas2019-10-181-0/+44