summaryrefslogtreecommitdiff
path: root/internal/command/command.go
Commit message (Collapse)AuthorAgeFilesLines
* refactor: rearchitect command and executable Go modulesfeistel2021-09-081-83/+0
|
* refactor: add acceptargs field to executablefeistel2021-09-081-3/+7
| | | | | parse logic will only run if the executable accept args. healthcheck is the only one not accepting arguments.
* Fix opentracing setup for gitlab-sshdNick Thomas2021-05-171-13/+28
| | | | | | | | | | | | | | | | | | | | 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
* Merge branch '516-handle-ssl-cert-dir-correctly' into 'main'Nick Thomas2021-05-041-5/+0
|\ | | | | | | | | | | | | gitlab-sshd: Respect the ssl_cert_dir config Closes #516 See merge request gitlab-org/gitlab-shell!467
| * gitlab-sshd: Respect the ssl_cert_dir config516-handle-ssl-cert-dir-correctlyNick Thomas2021-04-301-5/+0
| | | | | | | | Changelog: fixed
* | Don't finish the opentracing span earlydont-close-span-earlyNick Thomas2021-04-301-1/+0
|/ | | | | | | | | 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.
* chore: Refactor env introspection to rely on command initialization496-move-env-introspection-to-sshenvLucas Charles2021-03-151-2/+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-2/+2
|
* Add 2fa_verify commandImre Farkas2020-12-101-0/+3
|
* Set SSL_CERT_DIR env var when building commandashmckenzie/set-ssl-cert-dir-env-varAsh McKenzie2020-10-191-0/+5
|
* Drop "generated random correlation ID" log messagesh-suppress-random-correlation-id-logStan Hu2020-10-131-1/+0
| | | | | | This message happens all the time and doesn't add a lot of value. Relates to https://gitlab.com/gitlab-com/gl-infra/delivery/-/issues/1275
* Make it possible to propagate correlation ID across processesStan Hu2020-09-201-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add support obtaining personal access tokens via SSHTaylan Develioglu2020-08-171-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Implements the feature requested in gitlab-org/gitlab#19672 This requires the internal api counterpart in gitlab-org/gitlab!36302 to be merged first. It can be used as follows: ``` censored@censored-VirtualBox:~/git/gitlab$ ssh git@gitlab-2004 personal_access_token remote: remote: ======================================================================== remote: remote: Usage: personal_access_token <name> <scope1[,scope2,...]> [ttl_days] remote: remote: ======================================================================== remote: censored@censored-VirtualBox:~/git/gitlab$ ssh git@gitlab-2004 personal_access_token newtoken read_api,read_repository 30 Token: aAY1G3YPeemECgUvxuXY Scopes: read_api,read_repository Expires: 2020-08-07 ```
* Rename import pathsNick Thomas2019-10-181-14/+14
|
* Move go code up one levelNick Thomas2019-10-181-0/+81