Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/release-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ jobs:
working-directory: rustmail_panel
run: trunk build --release --dist ../rustmail/static --config Trunk.toml

- name: Optimize WASM
run: |
cargo install wasm-opt --locked
for f in rustmail/static/*.wasm; do
wasm-opt -Oz "$f" -o "$f.tmp"
mv "$f.tmp" "$f"
done

- name: Build Rust backend
run: cargo build --verbose -p rustmail

Expand Down Expand Up @@ -100,6 +108,15 @@ jobs:
working-directory: rustmail_panel
run: trunk build --release --dist ../rustmail/static --config Trunk.toml

- name: Optimize WASM
run: |
cargo install wasm-opt --locked
for f in rustmail/static/*.wasm; do
wasm-opt -Oz "$f" -o "$f.tmp"
mv "$f.tmp" "$f"
done
shell: bash

- name: Verify static files were created
run: ls rustmail/static
shell: bash
Expand Down
76 changes: 74 additions & 2 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 rustmail/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ subtle = "2.6.1"
sha2 = "0.10.8"
hex = "0.4.3"
moka = { version = "0.12", features = ["future"] }
tower-http = { version = "0.6.7", features = ["compression-gzip", "compression-br"] }

[dependencies.uuid]
version = "1.18.1"
Expand Down
4 changes: 3 additions & 1 deletion rustmail/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use rust_embed::RustEmbed;
use std::borrow::Cow;
use std::net::SocketAddr;
use tokio::signal;
use tower_http::compression::CompressionLayer;

mod api;
mod bot;
Expand Down Expand Up @@ -85,7 +86,8 @@ async fn main() {
let server_task = tokio::spawn(async move {
let app = create_api_router(bot_state_clone)
.route("/", axum::routing::get(static_handler))
.route("/{*path}", axum::routing::get(static_handler));
.route("/{*path}", axum::routing::get(static_handler))
.layer(CompressionLayer::new());

let bind_address = config
.bot
Expand Down