Change the custom public port ENV variable name to HTTP_PORT#9598
Merged
verarojman merged 2 commits intodecidim:developfrom Aug 12, 2022
Merged
Change the custom public port ENV variable name to HTTP_PORT#9598verarojman merged 2 commits intodecidim:developfrom
verarojman merged 2 commits intodecidim:developfrom
Conversation
This was referenced Jul 21, 2022
entantoencuanto
added a commit
that referenced
this pull request
Aug 25, 2022
* develop: Redesign: pages (#9457) Add "no-reply" notification at the email footers (#9668) merge layout center into one-col, allowing 3 variations (#9755) Fix form error overlap with character counter in the admin panel (#9683) Change the custom public port ENV variable name to HTTP_PORT (#9598) Redesign: login & signup (#9455) Fix redundant notification on comments with linked proposals (#9676)
eliegaboriau
pushed a commit
to eliegaboriau/decidim
that referenced
this pull request
Oct 25, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎩 What? Why?
As described at #9559, the asset URLs are pointing to the correct host with an incorrect port name. Actually this concerns all URLs generated using the
EngineRouteras described at #9558.This happens when Puma is running separately in a separate port which is forwarded to the public internet using an HTTP server in front which forwards all requests to a specific domain to this port on the local machine.
This causes e.g. Heroku to produce incorrect asset URLs or any other URLs created using
EngineRouter.This fixes the issue by renaming the
PORTENV variable (introduced in #9403) toHTTP_PORTwhich is not defined at Heroku.📌 Related Issues
Testing
RAILS_ENV=production(and configure it accordingly):80(see configuration example for nginx)For testing the favicon/asset URLs
:80For testing the other URLs generated through EngineRouter
PORT=1234 RAILS_ENV=production bundle exec rails c(make sure spring is restarted if you're using it, runspring stopbefore starting the console)Decidim::ResourceLocatorPresenter.new(Decidim::Proposals::Proposal.first).url1234and the issue described at Notifications link doesn't work on Push Notifications #9558 no longer existsOr alternatively, find one of these routes through the UI, these should be all over, e.g. in notifications, emails, exports, etc.