Skip to content
代码片段 群组 项目
该项目从 https://gitlab.com/gitlab-org/gitlab.git 镜像。 拉取镜像更新于
  1. 9月 14, 2020
  2. 12月 06, 2019
    • Stan Hu's avatar
      Log duration_ms when Workhorse hits a bad gateway · 43ce41ec
      Stan Hu 创作于
      Previously when the upstream application (e.g. Unicorn) timed out,
      Workhorse would report an error message of the form:
      
      ```json
      {
        "correlation_id": "k4mKg0snXG3",
        "error": "badgateway: failed after 61s: EOF",
        "level": "error",
        "method": "GET",
        "msg": "error",
        "time": "2019-12-02T22:05:09-08:00",
        "uri": "/admin"
      }
      ```
      
      Since Sentry attempts to group similar events by some fingerprint that
      includes the message, the changes in timings would trick Sentry into
      creating a new event. To avoid that, the new log message now looks like:
      
      ```json
      {
        "correlation_id": "k4mKg0snXG3",
        "duration_ms": 60599,
        "error": "badgateway: failed to receive response: EOF",
        "level": "error",
        "method": "GET",
        "msg": "error",
        "time": "2019-12-02T22:05:09-08:00",
        "uri": "/admin"
      }
      ```
      
      The inclusion of `duration_ms` and the standardized `error` message makes
      it easier for users to filter and parse this error.
      43ce41ec
  3. 11月 20, 2019
    • Nick Thomas's avatar
      Set a time limit on git upload-pack requests · f2ad577a
      Nick Thomas 创作于
      When a client does a git fetch over HTTP, workhorse performs an access
      check based on the HTTP request header, then reads the entire request
      body into a temporary file before handing off to Gitaly to service it.
      However, the client has control over how long it takes to read the
      request body. Since the Gitaly RPC only happens once the request body
      is read, people can set up a connection before their access is revoked
      and use it to gain access to code committed days or weeks later.
      
      To resolve this, we place an overall limit of 10 minutes on receiving
      the `upload-pack` request body. Since this is over HTTP, the client is
      using the `--stateless-rpc` mode, and there is no negotiation between
      client and server. The time limit is chosen fairly arbitrarily, but it
      fits well with the existing 10MiB limit on request body size, implying
      a transfer speed of just 17KiB/sec to be able to fill that buffer and
      get a "request too large" error instead of "request too slow".
      
      Workhorse does not expose the `upload-archive` endpoint directly to the
      user; the client in that case is always gitlab-rails, so there is no
      vulnerability there.
      
      The `receive-pack` endpoint is theoretically vulnerable, but Gitaly
      performs a second access check in the pre-receive hook which defeats
      the attack, so no changes are needed.
      
      The SSH endpoints are similarly vulnerable, but since those RPCs are
      bidirectional, a different approach is needed.
      f2ad577a
  4. 7月 31, 2019
  5. 7月 24, 2019
  6. 6月 19, 2019
  7. 4月 10, 2019
    • Stan Hu's avatar
      Remove duplicate X-Request-Id response header · d44f2fb6
      Stan Hu 创作于
      This fixes performance bar not working with AJAX requests.
      
      Both LabKit and Rails were injecting duplicate X-Request-Id headers into
      the response stream, which caused the frontend to be interpret the value
      as a comma-separated value (e.g. LdEgVXsp1R4, LdEgVXsp1R4).
      
      The new flow behaves as the following:
      
      1. Workhorse injects X-Request-Id to the inbound HTTP request to Rails
      2. Rails looks up this value in its RequestId middleware. Since the
      value exists, Rails sets the X-Request-Id response header to this value.
      3. Workhorse doesn't append another header in the response.
      
      Distributed tracing should still work fine because Workhorse still
      generates the correlation ID.
      
      Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/60111
      d44f2fb6
  8. 4月 02, 2019
  9. 2月 25, 2019
  10. 12月 04, 2018
  11. 11月 23, 2018
  12. 11月 14, 2018
  13. 11月 06, 2018
  14. 7月 28, 2018
  15. 7月 11, 2018
  16. 4月 06, 2018
  17. 3月 07, 2018
  18. 3月 02, 2018
  19. 2月 22, 2018
  20. 7月 06, 2017
  21. 5月 26, 2017
  22. 5月 05, 2017
  23. 5月 04, 2017
  24. 4月 14, 2017
  25. 3月 09, 2017
  26. 3月 03, 2017
  27. 3月 02, 2017
  28. 3月 01, 2017
  29. 2月 21, 2017
加载中