fix: validate nginx website name - #23
Conversation
There was a problem hiding this comment.
๐ก Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c5f793269a
โน๏ธ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with ๐.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| case "$value" in | ||
| "_") return 0 ;; | ||
| ""|*[!a-zA-Z0-9.-]*|.*|*..*|*.) |
There was a problem hiding this comment.
Reject labels that start or end with dashes
When WEBSITE_NAME contains a label like -odoo.example.com or odoo-.example.com, this pattern accepts it even though that is not a valid DNS hostname for the Certbot path below. In an Nginx + SSL install, the installer therefore proceeds through package installation and Nginx setup before failing at certificate issuance, which defeats the new early validation for mistyped DNS-style names.
Useful? React with ๐ย / ๐.
Summary
WEBSITE_NAMEbefore Nginx/Certbot paths are used_as the documented placeholder, otherwise allow DNS-style names with letters, numbers, dots, and dashesDependency
fix/bound-certbot-execution, because this builds on the same Nginx/SSL hardening path.Test Plan
python3 -m unittest tests.test_installer_features.InstallerFeatureTests.test_nginx_website_name_is_validated_before_file_paths_are_used -v-> passedpython3 -m unittest tests/test_installer_features.py -v-> passedbash -n odoo_install.sh-> passedscripts/validate.sh-> passedgit diff --check-> passed