Skip to content
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

Update domain fronting to use new Lantern Cloud domain #1416

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

hwh33
Copy link
Contributor

@hwh33 hwh33 commented Sep 24, 2024

This domain will accept fronted requests as well as direct requests.

This is part 1 of the work outlined in https://github.com/getlantern/engineering/issues/1429#issuecomment-2350136738. A follow-up PR will address the lantern-client changes.

This domain will accept fronted requests as well as direct requests.
Comment on lines +161 to +163
if strings.HasPrefix(r.URL.Path, "/pro/") {
r.URL.Path = r.URL.Path[4:]
}
Copy link
Contributor Author

@hwh33 hwh33 Sep 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drive-by / fix: adding a guard here to avoid indiscriminately modifying path prefixes.

@@ -22,12 +22,12 @@ var (
maxLogSize = 10247680

client = &http.Client{
Transport: proxied.Fronted(0),
Transport: proxied.ChainedThenFronted(),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will allow clients to try sending issue reports through their proxies.

@hwh33
Copy link
Contributor Author

hwh33 commented Sep 24, 2024

I'll look at the failed tests later today.

Copy link
Contributor

@WendelHime WendelHime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just one small suggestion for using http.NoBody

pro/client/client.go Outdated Show resolved Hide resolved
Copy link
Contributor

@garmr-ulfr garmr-ulfr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@myleshorton myleshorton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@hwh33
Copy link
Contributor Author

hwh33 commented Sep 26, 2024

There is only a single test failing now: TestGenerateConfigshould_generate_config_with_success_even_with_cloudfront_disabled. The failure is unrelated to these changes and we are working on a fix (see the discussion on Slack here).

I'm going to go ahead and merge. Thanks for the reviews everyone!

Co-authored-by: Wendel Hime <[email protected]>
@hwh33
Copy link
Contributor Author

hwh33 commented Sep 27, 2024

I'm going to go ahead and merge. Thanks for the reviews everyone!

Forgot to comment about this, but I'm actually holding off on merging until I can get the lantern-client changes done and thoroughly tested. These changes affect much of the client's ability to communicate with the back-end. I want to be sure to catch any bugs before merging this into main on flashlight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants