Skip to content

Commit

Permalink
Add TLS support for trunk serve
Browse files Browse the repository at this point in the history
Use clippy, improve error handling

Improve tls example

Rename TLS options, improve path resolution

Move Rustls config parsing into rt.rs
  • Loading branch information
lukaselmer committed Apr 19, 2023
1 parent cb691cc commit 5c06dd2
Show file tree
Hide file tree
Showing 22 changed files with 1,081 additions and 22 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,14 @@ jobs:
restore-keys: |
wasm32-example-yew-tailwindcss
- name: Setup | Cache | Example yew-tls
uses: actions/cache@v2
with:
path: examples/yew-tls/target
key: wasm32-example-yew-tls
restore-keys: |
wasm32-example-yew-tls
- name: Setup | Rust
uses: actions-rs/toolchain@v1
with:
Expand Down Expand Up @@ -181,5 +189,7 @@ jobs:
run: ${{ matrix.binPath }} --config=examples/yew/Trunk.toml build
- name: Build | Examples | yew-tailwindcss
run: ${{ matrix.binPath }} --config=examples/yew-tailwindcss/Trunk.toml build
- name: Build | Examples | yew-tls
run: ${{ matrix.binPath }} --config=examples/yew-tls/Trunk.toml build
- name: Build | Examples | no-rust
run: ${{ matrix.binPath }} --config=examples/no-rust/Trunk.toml build
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Subheadings to categorize changes are `added, changed, deprecated, removed, fixe
- Added tailwindcss support via `rel="tailwind-css"`.
- Added support for `svg` files when using `rel="inline"`
- Print all acessible addresses if `0.0.0.0` is used.
- Added TLS support for `trunk serve` via `tls_key_path`/`tls_cert_path`.

### changed
- Updated gloo-worker example to use gloo-worker crate v2.1.
Expand Down
27 changes: 27 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ panic = "abort"
ansi_term = "0.12"
anyhow = "1"
axum = { version = "0.6", features = ["ws"] }
axum-server = { version = "0.4.7", features = ["tls-rustls"] }
bytes = "1"
cargo-lock = "8"
cargo_metadata = "0.15"
Expand Down
3 changes: 3 additions & 0 deletions Trunk.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ port = 8080
open = false
# Disable auto-reload of the web app.
no_autoreload = false
# The certificate/private key pair to use for TLS, which is enabled if both are set.
# tls_key_path = "self_signed_certs/key.pem"
# tls_cert_path = "self_signed_certs/cert.pem"

[clean]
# The output dir for all final assets.
Expand Down
Loading

0 comments on commit 5c06dd2

Please sign in to comment.