diff --git a/Cargo.lock b/Cargo.lock index b68ac7b74..87c741c80 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -405,6 +405,12 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" +[[package]] +name = "adler32" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" + [[package]] name = "aead" version = "0.5.2" @@ -1544,6 +1550,15 @@ version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" +[[package]] +name = "core2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505" +dependencies = [ + "memchr", +] + [[package]] name = "cpufeatures" version = "0.2.16" @@ -1762,6 +1777,12 @@ dependencies = [ "syn 2.0.93", ] +[[package]] +name = "dary_heap" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04d2cd9c18b9f454ed67da600630b021a8a80bf33f8c95896ab33aaf1c26b728" + [[package]] name = "data-encoding" version = "2.6.0" @@ -3243,6 +3264,30 @@ version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +[[package]] +name = "libflate" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45d9dfdc14ea4ef0900c1cddbc8dcd553fbaacd8a4a282cf4018ae9dd04fb21e" +dependencies = [ + "adler32", + "core2", + "crc32fast", + "dary_heap", + "libflate_lz77", +] + +[[package]] +name = "libflate_lz77" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e0d73b369f386f1c44abd9c570d5318f55ccde816ff4b562fa452e5182863d" +dependencies = [ + "core2", + "hashbrown 0.14.5", + "rle-decode-fast", +] + [[package]] name = "libfuzzer-sys" version = "0.4.8" @@ -4331,12 +4376,14 @@ dependencies = [ "actix-web", "argon2", "base64 0.22.1", + "brotli 7.0.0", "chacha20poly1305", "chrono", "cidr", "flume", "gethostname", "lazy_static", + "libflate", "once_cell", "pretty_assertions", "rand", @@ -4851,6 +4898,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "rle-decode-fast" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3582f63211428f83597b51b2ddb88e2a91a9d52d12831f9d08f5e624e8977422" + [[package]] name = "rocksdb" version = "0.22.0" diff --git a/Cargo.toml b/Cargo.toml index 20a700da7..5290c3a34 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,6 +38,7 @@ askama_actix = "0.14" async-trait = "0.1.74" base64 = "0.22.0" bincode = "1" +brotli = "7.0.0" cached = "0.54" chacha20poly1305 = { version = "0.10", features = ["std"] } chrono = { version = "0.4", default-features = false, features = ["clock", "serde", "std"] } @@ -65,6 +66,7 @@ lazy_static = "1" lettre = { version = "0.11", default-features = false, features = [ "builder", "smtp-transport", "tokio1-rustls-tls", "tracing" ] } +libflate = "2.1.0" mime = "0.3.17" mime_guess = "2" num_cpus = "1" diff --git a/frontend/build.sh b/frontend/build.sh deleted file mode 100755 index 472a57ff4..000000000 --- a/frontend/build.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -rm -rf ../static/v1/* -rm -rf ../templates/html/* - -folders=( -"../templates/html" -"../static/v1" -) -for folder in "${folders[@]}"; do - if [ ! -d "$folder" ]; then - mkdir -p "$directory" - fi -done - -npm run build - -pages=( -"../templates/html/*.html" -"../templates/html/oidc/*.html" -"../templates/html/users/*.html" -"../templates/html/users/{id}/reset/*.html" -) -for folder in "${pages[@]}"; do - for html in $folder; do - # for pre-rendering colors - sed -i 's/#6b3d99;/{{ col_act1 }};/g' "$html" - sed -i 's/#714d99;/{{ col_act1a }};/g' "$html" - sed -i 's/#388c51;/{{ col_act2 }};/g' "$html" - sed -i 's/#4d8c62;/{{ col_act2a }};/g' "$html" - sed -i 's/#3d5d99;/{{ col_acnt }};/g' "$html" - sed -i 's/#36486b;/{{ col_acnta }};/g' "$html" - sed -i 's/#43993d;/{{ col_ok }};/g' "$html" - sed -i 's/#993d49;/{{ col_err }};/g' "$html" - sed -i 's/#545454;/{{ col_glow }};/g' "$html" - sed -i 's/#b2b2b2;/{{ col_gmid }};/g' "$html" - sed -i 's/#f2f2f2;/{{ col_ghigh }};/g' "$html" - sed -i 's/#383838;/{{ col_text }};/g' "$html" - sed -i 's/#f7f7f7;/{{ col_bg }};/g' "$html" - # for the nonce in the CSP for script files - sed -i 's//