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

🚀 Feature Request: Load dev https certificate and key from environment variables #5997

Closed
kansson opened this issue Jun 7, 2024 · 2 comments · Fixed by #6479 or #6490
Closed

🚀 Feature Request: Load dev https certificate and key from environment variables #5997

kansson opened this issue Jun 7, 2024 · 2 comments · Fixed by #6479 or #6490
Labels
enhancement New feature or request

Comments

@kansson
Copy link

kansson commented Jun 7, 2024

Describe the solution

I use Tailscale for https during development and have a common certificate and key for all projects. It would be convenient to load these using environment variables like WRANGLER_HTTPS_{CERT|_KEY}_PATH.

@kansson kansson added the enhancement New feature or request label Jun 7, 2024
@petebacondarwin
Copy link
Contributor

petebacondarwin commented Jun 10, 2024

We discussed this in #4475 (comment).
It was decided, at that time, that it was more flexible to use a command line argument.
But we could consider ENV vars too??
Would the CLI args approach be enough for you?

@kansson
Copy link
Author

kansson commented Jun 10, 2024

But we could consider ENV vars too?? Would the CLI args approach be enough for you?

Command line arguments works fine but environment variables would be far more convenient. Also with the latter you don't need to add args to the package.json script and potentiality break for other users who don't have the certificate and key. Maybe these options also can be added to the dev section in the wrangler config?

petebacondarwin added a commit that referenced this issue Aug 13, 2024
…nment variables

As well as providing paths to custom HTTPS certificate files, it is now possible to use WRANGLER_HTTPS_KEY_PATH and WRANGLER_HTTPS_CERT_PATH environment variables.

Specifying the file paths at the command line overrides specifying in environment variables.

Fixes #5997
petebacondarwin added a commit that referenced this issue Aug 14, 2024
…iables (#6479)

* test: add http-options tests for providing explicit paths to files

* feat: allow HTTPS custom certificate paths to be provided by a environment variables

As well as providing paths to custom HTTPS certificate files, it is now possible to use WRANGLER_HTTPS_KEY_PATH and WRANGLER_HTTPS_CERT_PATH environment variables.

Specifying the file paths at the command line overrides specifying in environment variables.

Fixes #5997

* test: use `vi.stubEnv()` rather than manually hacking `process.env` in Wrangler tests

This helper from Vitest will automatically revert to the original process.env values after each test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
2 participants