Skip to content
Snippets Groups Projects

Add Workhorse support for HTTPS backend

Merged Michael Kozono requested to merge mk/add-workhorse-support-for-https-backend into master

What does this MR do?

I can't tell why this panic was added way back when, but it is now blocking a new Geo feature #325732 (comment 644501257)

Resolves #337794 (closed)

How to setup and validate locally (strongly suggested)

How to enable the feature on your local Geo secondary site

  1. Checkout this branch on your local Geo secondary site
  2. cd <path to gdk-geo directory>
  3. Edit Procfile
  4. Find the line that begins gitlab-workhorse: exec /usr/bin/env PATH=
  5. Add GEO_SECONDARY_PROXY=1 so the line looks like gitlab-workhorse: exec /usr/bin/env GEO_SECONDARY_PROXY=1 PATH=
  6. make gitlab-workhorse-update && gdk restart gitlab-workhorse && gdk tail gitlab-workhorse
  7. In another Terminal: cd <path to gdk directory (the primary)>/gitlab
  8. bin/rails runner "Feature.enable(:geo_secondary_proxy)"

When you visit http://gdk.test:3001 (your Geo secondary site), it should appear as though you are visiting the primary site. You can search your Workhorse log for messages containing the string Geo Proxy to see some related info. You can change your Workhorse log level to debug to see a more related messages. Your primary site's Workhorse log should show requests coming from the secondary site.

How to validate the feature

The idea is that we want to change the Geo primary site's Internal URL to be an https URL so that you can observe the Geo secondary site's Workhorse proxying to that https URL without a problem.

  1. Visit http://gdk.test:3000 (your Geo primary site)
  2. Navigate to Admin > Geo > Nodes
  3. Click Edit on the Geo primary site
  4. Get https://ngrok.com/
  5. Run ./ngrok http 3000
  6. Copy the https ngrok URL, let's say it's https://8c921afabba4.ngrok.io
  7. Paste it into the Internal URL field
  8. Click Save
  9. Within a minute, the secondary site's workhorse log should say e.g.:
    2021-08-06_22:21:18.82125 gitlab-workhorse      : {"level":"info","msg":"Geo Proxy: URL changed","newGeoProxyURL":{"Scheme":"https","Opaque":"","User":null,"Host":"8c921afabba4.ngrok.io","Path":"/","RawPath":"","ForceQuery":false,"RawQuery":"","Fragment":"","RawFragment":""},"oldGeoProxyURL":{"Scheme":"http","Opaque":"","User":null,"Host":"gdk.test:3000","Path":"/","RawPath":"","ForceQuery":false,"RawQuery":"","Fragment":"","RawFragment":""},"time":"2021-08-06T15:21:18-07:00"}

You should be able to visit the secondary (and get proxied to the primary). Your ngrok log should show the requests as well.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by Michael Kozono

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Michael Kozono changed the description

    changed the description

  • Michael Kozono requested review from @vsizov

    requested review from @vsizov

  • Valery Sizov approved this merge request

    approved this merge request

    • Resolved by Michael Kozono

      :wave: @vsizov, thanks for approving this merge request.

      Please consider starting a new pipeline if:

      • This is the first time the merge request is approved, or
      • The merge request is ready to be merged, and there has not been a merge request pipeline in the last 2 hours.

      For more info, refer to the guideline.

  • requested review from @jacobvosmaer-gitlab

  • Michael Kozono added 18 commits

    added 18 commits

    Compare with previous version

  • Michael Kozono added 348 commits

    added 348 commits

    Compare with previous version

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading