mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-06-01 02:33:35 -07:00
Revert "Compress the web frontend using brotli"
This reverts commit 00e4cb7a75.
This commit is contained in:
committed by
Will Greenberg
parent
a3e7d0ef43
commit
da4e723eff
@@ -631,7 +631,7 @@ jobs:
|
|||||||
- name: Build rayhunter-daemon openapi docs
|
- name: Build rayhunter-daemon openapi docs
|
||||||
run: |
|
run: |
|
||||||
mkdir -p daemon/web/build
|
mkdir -p daemon/web/build
|
||||||
touch daemon/web/build/{favicon.png,index.html.br,rayhunter_orca_only.png,rayhunter_text.png}
|
touch daemon/web/build/{favicon.png,index.html.gz,rayhunter_orca_only.png,rayhunter_text.png}
|
||||||
cargo run --bin gen_api --features apidocs -- ./rayhunter-openapi.json
|
cargo run --bin gen_api --features apidocs -- ./rayhunter-openapi.json
|
||||||
- name: Make swagger folder
|
- name: Make swagger folder
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -112,9 +112,9 @@ pub async fn serve_static(
|
|||||||
"index.html" => (
|
"index.html" => (
|
||||||
[
|
[
|
||||||
(header::CONTENT_TYPE, HeaderValue::from_static("text/html")),
|
(header::CONTENT_TYPE, HeaderValue::from_static("text/html")),
|
||||||
(header::CONTENT_ENCODING, HeaderValue::from_static("br")),
|
(header::CONTENT_ENCODING, HeaderValue::from_static("gzip")),
|
||||||
],
|
],
|
||||||
include_bytes!("../web/build/index.html.br"),
|
include_bytes!("../web/build/index.html.gz"),
|
||||||
)
|
)
|
||||||
.into_response(),
|
.into_response(),
|
||||||
path => {
|
path => {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite dev",
|
"dev": "vite dev",
|
||||||
"build": "vite build && node ./scripts/compress-index.js",
|
"build": "vite build && gzip -9 ./build/index.html",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
||||||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
import { readFileSync, writeFileSync, unlinkSync } from 'node:fs';
|
|
||||||
import { brotliCompressSync, constants } from 'node:zlib';
|
|
||||||
|
|
||||||
const input = './build/index.html';
|
|
||||||
const output = './build/index.html.br';
|
|
||||||
|
|
||||||
const compressed = brotliCompressSync(readFileSync(input), {
|
|
||||||
params: { [constants.BROTLI_PARAM_QUALITY]: constants.BROTLI_MAX_QUALITY },
|
|
||||||
});
|
|
||||||
writeFileSync(output, compressed);
|
|
||||||
unlinkSync(input);
|
|
||||||
Reference in New Issue
Block a user