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

Use a list of restricted ports instead of allowing ports > 1023. #908

Merged
merged 2 commits into from
May 15, 2023

Conversation

TylerAldrich
Copy link
Contributor

Related to the issue here: https://gitlab.com/architect-io/architect-cli/-/issues/662 and an update of #895.

Restricting ports to 80, 443, and > 1023 wasn't quite doing what we wanted because there's still restricted ports above 1024 (like 6000, which TJ ran into when randomly choosing a port).

Instead of limiting ports based on range, instead use Chrome/FF's restricted port list and don't allow those specifically.

validate: (value) => {
const port = Number.parseInt(value);
if (!this.isValidPort(port)) {
return 'Port must be 80, 443, or any port between 1024 and 66535.';
if (!port || port <= 0 || port > 65535) {
Copy link
Member

Choose a reason for hiding this comment

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

We also need the restricted port check here I believe.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do this question in a loop https://github.com/architect-team/architect-cli/pull/908/files#diff-c803da602bbb1783595bc04de6a99e122c48269d8c8eb1c6df6397bf5360f91bR495 so technically it still works if you type a restricted port (and asks the question again), though better UX to specifically say "Yo this port is restricted" - will update that 👍

@TylerAldrich TylerAldrich requested a review from mueschm May 15, 2023 14:54
@mueschm mueschm merged commit 121d0b8 into rc May 15, 2023
@mueschm mueschm deleted the 662-dev-port-update branch May 15, 2023 15:35
@github-actions
Copy link

github-actions bot commented Jun 5, 2023

🎉 This PR is included in version 1.41.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

2 participants