As we reevaluate how to best support and maintain Staging Ref in the future, we encourage development teams using this environment to highlight their use cases in the following issue: https://gitlab.com/gitlab-com/gl-infra/software-delivery/framework/software-delivery-framework-issue-tracker/-/issues/36.

Skip to content
Snippets Groups Projects
  1. Aug 30, 2024
  2. Aug 14, 2024
  3. Sep 01, 2023
  4. Jul 10, 2023
  5. Jul 04, 2023
  6. Jul 05, 2022
    • Patrick Steinhardt's avatar
      go: Bump major version to v14 · 822e49b3
      Patrick Steinhardt authored
      While gitlab-shell currently has a major version of v14, the module path
      it exposes is not using that major version like it is required by the Go
      standard. This makes it impossible for dependents to import gitlab-shell
      as a dependency without using a commit as version.
      
      Fix this by changing the module path of gitlab-shell to instead be
      `gitlab.com/gitlab-org/gitlab-shell/v14` and adjust all imports
      accordingly.
      
      Changelog: fixed
      822e49b3
  7. Sep 08, 2021
  8. Aug 04, 2021
    • Nick Thomas's avatar
      Switch to labkit for logging system setup · 1274858f
      Nick Thomas authored
      - 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
      1274858f
  9. May 17, 2021
    • Nick Thomas's avatar
      Fix opentracing setup for gitlab-sshd · de13980f
      Nick Thomas authored
      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
      de13980f
  10. Mar 15, 2021
  11. Jan 18, 2021
  12. Sep 21, 2020
    • Stan Hu's avatar
      Make it possible to propagate correlation ID across processes · a487572a
      Stan Hu authored
      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
      a487572a
  13. Mar 11, 2020
  14. Oct 18, 2019
  15. Oct 08, 2019
  16. Sep 20, 2019
  17. Aug 15, 2019
    • Patrick Bajao's avatar
      Replace symlinks with actual binaries · 41f919eb
      Patrick Bajao authored
      We had `gitlab-shell-authorized-keys-check` and
      `gitlab-shell-authorized-principals-check` as symlinks to
      `gitlab-shell` before.
      
      We determine the `Command` and `CommandArgs` that we build based
      on the `Name` of the `Executable`. We also use that to know which
      fallback ruby executable should we fallback to. We use
      `os.Executable()` to do that.
      
      `os.Executable()` behaves differently depending on OS. It may
      return the symlink or the target's name. That can result to a
      buggy behavior.
      
      The fix is to create binaries for each instead of using a symlink.
      That way we don't need to rely on `os.Executable()` to get the name.
      We pass the `Name` of the executable instead.
      41f919eb
  18. Aug 02, 2019
    • Patrick Bajao's avatar
      Add Executable struct · 3b6f9f75
      Patrick Bajao authored
      This struct is responsible for determining the name and
      root dir of the executable.
      
      The `RootDir` property will be used to find the config.
      
      The `Name` property will be used to determine what `Command`
      and `CommandArgs` to be built.
      3b6f9f75
  19. Jul 29, 2019
    • Patrick Bajao's avatar
      Support falling back to ruby version of checkers · aab85f36
      Patrick Bajao authored
      Rename the ruby scripts to have `-ruby` suffix and add a symlink
      for both to `./gitlab-shell`. The executable name will be used to
      determine how args will be parsed.
      
      For now, we only parse the arguments for gitlab-shell commands. If
      the executable is `gitlab-shell-authorized-keys-check` or
      `gitlab-shell-authorized-principals-check`, it'll always fallback
      to the ruby version.
      
      Ruby specs test the ruby script, the fallback from go to ruby and
      go implementation of both (still pending).
      aab85f36
  20. Jun 04, 2019
  21. May 20, 2019
  22. Apr 12, 2019
  23. Mar 21, 2019
  24. Mar 15, 2019
  25. Jan 15, 2019
    • Bob Van Landuyt's avatar
      Don't fall back to ruby for non SSH connections · d762f4ec
      Bob Van Landuyt authored
      When SSH_CONNECTION is not set, we don't fall back to ruby, but
      instead fail directly in go writing the error to stderr.
      d762f4ec
    • Bob Van Landuyt's avatar
      Allow enabling gitlab-shell "discover"-feature · 7215126b
      Bob Van Landuyt authored
      This adds the possibility to enable features for GitLab shell.
      
      The first feature being recognized is "Discover": It's the command
      that is executed when running `ssh git@gitlab.example.com` and is
      called without a command.
      
      The gitlab key id or username is already parsed from the command line
      arguments.
      
      Currently we only support communicating with GitLab-rails using unix
      sockets. So features will not be enabled if the GitLab-url is using a
      different protocol. The url for this read from the config yaml.
      
      Pending ruby-specs have been added for the gitlab-shell command.
      
      Refactor to have separate command packages
      7215126b
  26. Sep 28, 2018
Loading