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 Distinst.validate_hostname to check generated hostname #600

Closed
davidmhewitt opened this issue Aug 16, 2021 · 2 comments · Fixed by #604
Closed

Use Distinst.validate_hostname to check generated hostname #600

davidmhewitt opened this issue Aug 16, 2021 · 2 comments · Fixed by #604
Labels
Priority: High To be addressed after any critical issues
Projects

Comments

@davidmhewitt
Copy link
Member

Problem

Issues like #599 look like we're managing to generate an invalid hostname on certain hardware.

Proposal

Distinst has a built in method to check a hostname is valid, so we should use that and fall back to just elementary-os or something if it's not valid.

@davidmhewitt davidmhewitt added the Priority: High To be addressed after any critical issues label Aug 16, 2021
@meisenzahl
Copy link
Member

I think that we should also use this in elementary/initial-setup#113

@davidmhewitt
Copy link
Member Author

davidmhewitt commented Aug 16, 2021

I don't think initial-setup should depend on distinst just for that. But it's obviously a nice easy thing to use in the installer. It would be pretty simple to re-implement the specification for hostname checking. It's essentially:

  • Can only contain alphanumeric characters, periods (.) and hyphens (-)
  • Must not start or end with a period or hyphen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: High To be addressed after any critical issues
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants