-
Notifications
You must be signed in to change notification settings - Fork 259
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
Added https support for trunk serve
.
#458
Conversation
Hi, Is there anyway to try this before it gets merged at all? |
Cargo.toml
Outdated
@@ -1,6 +1,6 @@ | |||
[package] | |||
name = "trunk" | |||
version = "0.16.0" | |||
version = "0.17.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not bump the version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reverted version.
|
||
// Block this routine on the server's completion. | ||
tracing::info!("{} server listening at http://{}", SERVER, addr); | ||
let server = Server::bind(&addr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this come before the tracing log?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed comment position just before server.await.
src/config/rt.rs
Outdated
@@ -218,6 +218,10 @@ pub struct RtcServe { | |||
pub proxies: Option<Vec<ConfigOptsProxy>>, | |||
/// Whether to disable auto-reload of the web page when a build completes. | |||
pub no_autoreload: bool, | |||
/// Path to crt file. | |||
pub crt: PathBuf, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Option<PathBuf>
or OsStr
for these types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrapped key/crt member with Option.
Please add an example with HTTPS, so we may test this. |
@simbleau Thankyou for reviewing. I made a sample here. run sample as https
|
@peteringram0 Sorry for the late reply. |
Is it possible to assist here? |
Note that this development version can also be installed using:
|
Note: I can not close the dev-server using Ctrl-C. Is the signal correctly handled? I am using an M1 mac, Trunk config contains an active proxy section. Also worth noting: I generated a self-signed certificate using a custom ca. That ca is part of my machines keychain. Chrome accepts the generated certificate perfectly. But: I had to set |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One item so far, I'll finish up review on src/serve.rs
shortly.
@@ -127,6 +127,10 @@ pub struct ConfigOptsServe { | |||
#[clap(long = "no-autoreload")] | |||
#[serde(default)] | |||
pub no_autoreload: bool, | |||
#[clap(parse(from_os_str))] | |||
pub crt: Option<PathBuf>, | |||
#[clap(parse(from_os_str))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add these to an arg group to ensure that it is clear to users that both must be declared together.
Self signed certificates are officially invalid, by definition, and need insecure acceptance, for sure. |
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
This PR was closed because it has been stalled for 10 days with no activity. |
I do believe this was part of trunk-ng. With the merge of trunk-ng into trunk as part of PR #623, that should be part of the next trunk release. If that's not the case, please let us know. |
This allows users to serve with https. To enable this, add path to the cert files as below in Trunk.toml. If it failed to read cert files, it will start in http as usual.
Checklist
site
content with pertinent info (may not always apply).