docs: Update DDEV usage - set .ddev.site explicitly for server.cors.origin, add support for custom https_router_port for server.origin #99
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.
Description
Changes:
use
\.ddev\.site
explicitly for regex forserver.cors.origin
, as proposed by vitejs core maintainer - otherwise the attack surface is still open via sites with.site
TLDsupport custom
router-https-port
(test viaddev config --router-https-port 8443 && ddev restart
-process.env.DDEV_PRIMARY_URL
will then output "https://my-project.ddev.site:8443". Therefore we need to strip out 8443 first, before setting theserver.origin
setting. This is also relevant because DDEV auto-selects a router port if 80/443 is already occupied since last year (https://ddev.com/blog/release-v1235-auto-port-assignment/). This needs a tiny change inconfig/vite.php
as well.add info about official article about Vite on ddev.com (https://ddev.com/blog/working-with-vite-in-ddev/) where users find out more information and where DDEV maintainers try to keep all further infos up-to-date.
Hope this will be it, fingers crossed. Thanks very much for providing this plugin!
(Demo repo with this config is available here: https://github.com/mandrasch/ddev-craftcms-vite)
Related issues