-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[30] Proxy Static Pages #317
Conversation
Map a proxy such that URLs attempt to load jekyll content from the static pages content.
one smaller issue is that the login and sign up button in the header go to the production login.gov site, so devs will need to log in to localhost via the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe this is a dumb question or I don't understand how it works, but if the rails app is hosted on www.challenge.gov
, and we reverse proxy to that same domain, won't it just create an infinite loop? are we migrating the jekyll server to a different domain?
spec/requests/pages_spec.rb
Outdated
|
||
RSpec.describe "PagesController" do | ||
it "get new renders successfully" do | ||
stub_request(:get, PagesController::HOST + PagesController::BASE_URL). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The links to the active challenges on the homepage are broken. The URL path it is constructing is basically doubled up (see path=
in the log output). Seems like the gsub for rewriting the links on the page isn't working on the BASE_URL gsub correctly because the links include that in the path still. Another issue is that it's not including the params in the request but I think the jekyll server needs the challenge param, e.g. ?challenge=eval-challenge-test
, to fetch the correct challenge.
Here are some request logs where I put in some debug logging:
13:55:17 web.1 | Started GET "/preview/gsa/challenges-and-prizes/eval-dev/?challenge=eval-challenge-test" for ::1 at 2024-12-13 13:55:17 -0800
13:55:17 web.1 | Processing by PagesController#index as HTML
13:55:17 web.1 | Parameters: {"challenge"=>"eval-challenge-test", "path"=>"preview/gsa/challenges-and-prizes/eval-dev"}
13:55:18 web.1 | path=/preview/gsa/challenges-and-prizes/eval-dev/preview/gsa/challenges-and-prizes/eval-dev/
13:55:18 web.1 | Redirected to http://localhost:3000/dashboard
13:55:18 web.1 | Completed 302 Found in 352ms (ActiveRecord: 0.0ms (0 queries, 0 cached) | GC: 0.2ms)
FYI, this URL is working locally: http://localhost:3000/?challenge=eval-challenge-test |
oh it's because the react app is loading those from the data API after the initial page load 🫤 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Map a proxy such that URLs attempt to load jekyll content from the static pages content.
Implements #30