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

fix: remove nginx proxy router, fixes #5940 #6739

Merged
merged 13 commits into from
Nov 22, 2024

Conversation

rfay
Copy link
Member

@rfay rfay commented Nov 18, 2024

The Issue

Remove the deprecated nginx proxy router

Manual Testing Instructions

Try setting router to nginx-proxy router
Make sure ordinary things work

@github-actions github-actions bot added bugfix dependencies Pull requests that update a dependency file labels Nov 18, 2024
@rfay rfay marked this pull request as ready for review November 19, 2024 01:20
@rfay rfay requested review from a team as code owners November 19, 2024 01:20
@rfay rfay requested a review from stasadev November 19, 2024 01:20
Copy link
Member

@stasadev stasadev left a comment

Choose a reason for hiding this comment

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

We shouldn't have containers/ddev-nginx-proxy-router, right?

@@ -318,7 +298,6 @@ func init() {
configGlobalCommand.Flags().String("xdebug-ide-location", "", "For less usual IDE locations specify where the IDE is running for Xdebug to reach it")
configGlobalCommand.Flags().Bool("use-traefik", true, "If true, use Traefik for ddev-router")
_ = configGlobalCommand.Flags().MarkDeprecated("use-traefik", "please use --router instead")
configGlobalCommand.Flags().String("router", globalconfigTypes.RouterTypeTraefik, fmt.Sprintf("Valid router types are %s, default is %s", strings.Join(globalconfigTypes.GetValidRouterTypes(), ", "), globalconfigTypes.RouterTypeDefault))
Copy link
Member

Choose a reason for hiding this comment

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

I think we'd better mark the --router flag as deprecated, just like we did for --use-traefik above.
Or make it accept traefik only.

docs/content/users/configuration/config.md Outdated Show resolved Hide resolved
@rfay
Copy link
Member Author

rfay commented Nov 19, 2024

We shouldn't have containers/ddev-nginx-proxy-router, right?

I was reluctant to just remove it right away. Do you disagree? It would be reasonable either way. It's obviously there in the source code.

@rfay rfay force-pushed the 20241118_rfay_remove_nginx_proxy branch from 2a0e7b7 to 5683c16 Compare November 19, 2024 19:25
@stasadev
Copy link
Member

I was reluctant to just remove it right away. Do you disagree? It would be reasonable either way. It's obviously there in the source code.

I'm okay with it, just asked if this was intentional to leave it there.

@rfay rfay force-pushed the 20241118_rfay_remove_nginx_proxy branch from 5683c16 to 609634e Compare November 20, 2024 05:08
@rfay rfay requested a review from stasadev November 20, 2024 05:36
Copy link
Member

@stasadev stasadev left a comment

Choose a reason for hiding this comment

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

When I use nginx-proxy with v1.23.5, and then switch to this PR:

$ ddev version
FATA[0000] unable to read global config: invalid router: nginx-proxy, valid router types are [traefik]

I guess we should change nginx-proxy to traefik automatically?

@rfay
Copy link
Member Author

rfay commented Nov 20, 2024

I agree.

@rfay rfay force-pushed the 20241118_rfay_remove_nginx_proxy branch 2 times, most recently from c0f5aa9 to 43b3bb3 Compare November 20, 2024 19:34
return fmt.Errorf("invalid router: %s, valid router types are %v", DdevGlobalConfig.Router, types.GetValidRouterTypes())
output.UserOut.Printf("\nThe only valid router type is %s, but you have router: %s in your global configuration, using %s instead.\n", types.RouterTypeTraefik, DdevGlobalConfig.Router, types.RouterTypeTraefik)
DdevGlobalConfig.Router = types.RouterTypeTraefik
return nil
Copy link
Member

Choose a reason for hiding this comment

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

Return was added here to show a warning for the user each time, but when I tested it with:

router: nginx-proxy
xdebug_ide_location: "blablabla"

DDEV didn't complain about wrong xdebug_ide_location.

I don't think it's worth skipping all the further validation checks here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed, thanks for catching the erroneous return there.

@rfay rfay force-pushed the 20241118_rfay_remove_nginx_proxy branch from 3c3669a to abd08ec Compare November 22, 2024 14:14
@rfay rfay force-pushed the 20241118_rfay_remove_nginx_proxy branch from abd08ec to f6c9506 Compare November 22, 2024 14:15
@rfay rfay requested a review from stasadev November 22, 2024 17:48
Copy link
Member

@stasadev stasadev left a comment

Choose a reason for hiding this comment

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

Thank you.

I tested upgrade/downgrade. DDEV did a great job in all cases.

Regarding the code in containers/ddev-nginx-proxy-router:
We need to keep it because we still use this image for versions 1.23.5 and earlier, and we are required to provide the source code (as requested by Docker-Sponsored Open Source Program). So, until the Docker image is available, we should keep it.

@rfay rfay merged commit 877f095 into ddev:master Nov 22, 2024
23 checks passed
@rfay rfay deleted the 20241118_rfay_remove_nginx_proxy branch November 22, 2024 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants