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

Configurable dev ports #16736

Open
wants to merge 15 commits into
base: dev
Choose a base branch
from
Open

Configurable dev ports #16736

wants to merge 15 commits into from

Conversation

toy
Copy link
Contributor

@toy toy commented Sep 16, 2024

What are you trying to accomplish?

Make it possible to configure both backend and frontend host/port using environment variables (or .env file).

Merge checklist

  • Added/updated tests
  • Added/updated documentation in Lookbook (patterns, previews, etc)
  • Tested major browsers (Chrome, Firefox, Edge, ...)

@machisuji machisuji self-assigned this Sep 17, 2024
Copy link
Member

@cbliard cbliard left a comment

Choose a reason for hiding this comment

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

I love it 👏

I will happily replace my crappy aliases to use these variables instead when starting my dev servers

frontend/cli_to_rails_proxy.js Show resolved Hide resolved
@machisuji
Copy link
Member

@toy

On this branch when accessing localhost:4200 - which usually works just fine just the same as localhost:3000 - I get a proxy error:

11:17:20 angular.1 | <e> [webpack-dev-server] [HPM] Error occurred while proxying request localhost:4200/ to http://localhost:3100/ [ECONNREFUSED] (https://nodejs.org/api/errors.html#errors_common_system_errors)

I'm not sure how the localhost:3100 comes about, but this seems to be specific to this branch as it still works perfectly fine on the dev branch.

@machisuji
Copy link
Member

@toy

On this branch when accessing localhost:4200 - which usually works just fine just the same as localhost:3000 - I get a proxy error:

11:17:20 angular.1 | <e> [webpack-dev-server] [HPM] Error occurred while proxying request localhost:4200/ to http://localhost:3100/ [ECONNREFUSED] (https://nodejs.org/api/errors.html#errors_common_system_errors)

I'm not sure how the localhost:3100 comes about, but this seems to be specific to this branch as it still works perfectly fine on the dev branch.

I have fixed the proxy issue by amending the .env.example file. It must use the FE_PORT in the OPENPROJECT_DEV_URL.

I have also amended the docker-compose.yml to expose the backend and frontend ports. This is technically unrelated to the PR and a separate bug that we ever removed the exposed ports which made it impossible to use the docker setup locally with http directly.

Either way this fix needed to align with your PR, however, which is why I made it on this branch.

I've tested both the direct and docker setups and they both work as expected for me now. So from my perspective this is good to be merged.

But it would indeed be a good idea to ask someone from the @opf/titan team to double check their docker setup with TLS is still working with these changes.

Copy link
Member

@machisuji machisuji left a comment

Choose a reason for hiding this comment

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

👍

@akabiru akabiru requested a review from a team September 18, 2024 14:49
docker-compose.yml Outdated Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
frontend/cli_to_rails_proxy.js Outdated Show resolved Hide resolved
@akabiru akabiru requested review from apfohl and Kharonus and removed request for a team September 19, 2024 10:22
@akabiru
Copy link
Member

akabiru commented Sep 19, 2024

Looking great - Please hold merging until @Kharonus / @apfohl have a look as they're more familiar with the Titan docker setup.

I couldn't get this PR to work with the Docker TLS setup out of the box with the following env: I'm likely missing sth obvious.

# Local backend development host and port
HOST=openproject.local
PORT=3000
# Local frontend development host and port
FE_HOST=openproject.local
FE_PORT=4200
Kapture.2024-09-19.at.13.25.30.mp4

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

Successfully merging this pull request may close these issues.

4 participants