fix(site): validate alias domain names on site create - #114
Merged
mrrobot47 merged 2 commits intoSep 25, 2026
Merged
Conversation
`ee site create --type=php --alias-domains='a.com,,b.com,'` stored empty alias domains, which ended up in VIRTUAL_HOST and the nginx server_name. The list is now split with site-command's `split_alias_domains()`, which trims the names and drops blank entries. A flag passed without a value no longer becomes the alias domain `1`.
`ee site create --type=php --alias-domains` accepted names like `../evil`, `a..b`, `a.com.` or `default`, which reach VIRTUAL_HOST and the per-domain proxy files. The alias domains are now checked with site-command's `validate_alias_domains()`, and the command exits with an error listing the invalid names before anything is created.
This was referenced Sep 24, 2026
Merged
Merged
mrrobot47
marked this pull request as ready for review
September 25, 2026 05:13
mrrobot47
added a commit
to mrrobot47/site-type-php
that referenced
this pull request
Sep 25, 2026
…ngine#114) The blank-entry and invalid-hostname alias scenarios pass on develop now, so they are regular regression scenarios (the @destructive tags stay: a regression would break the proxy config for every site).
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.
Summary
ee site create --type=php --alias-domainsstored the list as given: blank entries (a.com,,b.com,) ended up inVIRTUAL_HOSTand the nginxserver_name, and names like../evil,a..b,a.com.ordefaultreached the per-domain proxy files, wheredefaultmaps onto the global auth and ACL files. Alias domains are now split and validated with the helpers from site-command, the same way html sites andee site updatedo.Changes
--alias-domainswith site-command'ssplit_alias_domains(), which trims the names and drops blank entries. A flag passed without a value no longer becomes the alias domain1.validate_alias_domains()and exit with an error listing the invalid names before anything is created.Release / merge order
These PRs ship together in one core release:
easyengine/nginx-proxytemplate (needs a new dockerfiles tag)Order:
easyengine/nginx-proxyimage is on Docker Hub.dev-developof every package) and tag each package.easyengine/nginx-proxyinimg-versions.jsontogether.Why they are coupled:
_wildcard.Xfile to sibling sites too (e.g.shop.example.compicks up_wildcard.example.com).site_alias_domains_before_update,site_alias_domains_updatedandsite_alias_domains_update_failedhooks, which only the new site-command fires.site_cleanuphook (autoloaded since feat(auth): support http auth and ip whitelist on wildcard subdomains and alias domains auth-command#57) does it.split_alias_domains()andvalidate_alias_domains(); with an older site-command, site create fails with a fatal "undefined function" error._wildcard.Xfiles that were also relied on to protectXitself:Xnow needs its ownhtpasswd/X(andvhost.d/X_acl) file.Testing
*.aliases, multiple users, global auth, IP whitelists, alias add/remove, site delete, self-signed SSL and Let's Encrypt.