Replace Valet cert path with Vite env vars#56
Merged
munezaclovis merged 8 commits intomainfrom Apr 5, 2026
Merged
Conversation
Replace Valet cert path with VITE_DEV_SERVER_* env vars and pv-native cert storage at ~/.pv/data/certs/.
6 tasks: rewrite cert storage, update callers, add SetViteTLSStep, wire settings/pipeline, update tests, final verification.
Replace Valet-specific cert functions with pv-native storage. Remove EnsureValetConfig, ValetConfigDir, ValetCertsDir, RemoveConfig, and all config.json management.
EnsureValetConfig and RemoveConfig are gone. GenerateTLSCertStep now calls GenerateSiteTLS directly. RemoveLinkedCerts still used in uninstall (points to new cert dir).
Writes VITE_DEV_SERVER_KEY and VITE_DEV_SERVER_CERT to .env pointing to pv's cert storage. Runs for Laravel projects with .env files.
New automation gate 'set_vite_tls' defaults to on. Step runs after SetAppURLStep in the link pipeline.
No Valet references remain — filename now reflects its purpose.
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
~/.config/valet/Certificates/to~/.pv/data/certs/VITE_DEV_SERVER_KEYandVITE_DEV_SERVER_CERTto.envduringpv link(newSetViteTLSStep)EnsureValetConfig,RemoveConfig,config.jsonmanagement)--nameflag mismatch: Vite plugin'sbasename(cwd)detection is bypassed entirely — env vars point directly to the correct certWhy
The Vite plugin resolves hostnames from
basename(cwd), not the link name. Whenpv link --name=customis used, the old Valet auto-detection couldn't find certs. The plugin's second detection path (VITE_DEV_SERVER_*env vars) is explicit and immune to this mismatch.Also: pv no longer pretends to be Valet by maintaining
~/.config/valet/.Changes
internal/certs/valet.go— Rewritten:CertsDir(),CertPath(),KeyPath(),GenerateSiteTLS(),RemoveSiteTLS(),RemoveLinkedCerts()internal/laravel/steps.go— NewSetViteTLSStepautomation stepinternal/config/settings.go— NewSetViteTLSautomation gateinternal/automation/pipeline.go— New"set_vite_tls"gate casecmd/link.go—SetViteTLSStepadded to pipelineinternal/automation/steps/generate_tls_cert.go— RemovedEnsureValetConfigcallcmd/setup.go— RemovedEnsureValetConfigcallcmd/uninstall.go— RemovedRemoveConfigcallTest plan
gofmtandgo vetclean