neon_arch commited on
Commit
4dd44ae
2 Parent(s): 66669a0 68a2b95

Merge branch 'rolling' into FIX/375_improve-the-stylint-checks-in-the-pre-commit-hook

Browse files
.github/workflows/contributors.yml CHANGED
@@ -32,7 +32,7 @@ jobs:
32
  noCommit: true
33
 
34
  - name: Commit & PR
35
- uses: peter-evans/create-pull-request@38e0b6e68b4c852a5500a94740f0e535e0d7ba54 # v4.2.4
36
  with:
37
  token: ${{ secrets.GITHUB_TOKEN }}
38
  add-paths: .github/assets/CONTRIBUTORS.svg
 
32
  noCommit: true
33
 
34
  - name: Commit & PR
35
+ uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5.0.2
36
  with:
37
  token: ${{ secrets.GITHUB_TOKEN }}
38
  add-paths: .github/assets/CONTRIBUTORS.svg
.github/workflows/labels.yml CHANGED
@@ -12,7 +12,7 @@ jobs:
12
  runs-on: ubuntu-latest
13
 
14
  steps:
15
- - uses: actions/setup-node@v3
16
  with:
17
  node-version: '14'
18
  - uses: EddieHubCommunity/gh-action-open-source-labels@main
 
12
  runs-on: ubuntu-latest
13
 
14
  steps:
15
+ - uses: actions/setup-node@v4
16
  with:
17
  node-version: '14'
18
  - uses: EddieHubCommunity/gh-action-open-source-labels@main
.github/workflows/mega-linter.yml CHANGED
@@ -63,7 +63,7 @@ jobs:
63
  - name: Create Pull Request with applied fixes
64
  id: cpr
65
  if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix')
66
- uses: peter-evans/create-pull-request@v5
67
  with:
68
  token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
69
  commit-message: "[MegaLinter] Apply linters automatic fixes"
@@ -81,7 +81,7 @@ jobs:
81
  run: sudo chown -Rc $UID .git/
82
  - name: Commit and push applied linter fixes
83
  if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/main' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix')
84
- uses: stefanzweifel/git-auto-commit-action@v4
85
  with:
86
  branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }}
87
  commit_message: "[MegaLinter] Apply linters fixes"
 
63
  - name: Create Pull Request with applied fixes
64
  id: cpr
65
  if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix')
66
+ uses: peter-evans/create-pull-request@v5.0.2
67
  with:
68
  token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
69
  commit-message: "[MegaLinter] Apply linters automatic fixes"
 
81
  run: sudo chown -Rc $UID .git/
82
  - name: Commit and push applied linter fixes
83
  if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/main' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix')
84
+ uses: stefanzweifel/git-auto-commit-action@v5
85
  with:
86
  branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }}
87
  commit_message: "[MegaLinter] Apply linters fixes"
Cargo.lock CHANGED
@@ -59,9 +59,9 @@ dependencies = [
59
 
60
  [[package]]
61
  name = "actix-governor"
62
- version = "0.4.1"
63
  source = "registry+https://github.com/rust-lang/crates.io-index"
64
- checksum = "46ff2d40f2bc627b8054c5e20fa6b0b0cf9428699b54bd41634e9ae3098ad555"
65
  dependencies = [
66
  "actix-http",
67
  "actix-web",
@@ -79,7 +79,7 @@ dependencies = [
79
  "actix-rt",
80
  "actix-service",
81
  "actix-utils",
82
- "ahash",
83
  "base64 0.21.5",
84
  "bitflags 2.4.1",
85
  "brotli",
@@ -194,7 +194,7 @@ dependencies = [
194
  "actix-service",
195
  "actix-utils",
196
  "actix-web-codegen",
197
- "ahash",
198
  "bytes 1.5.0",
199
  "bytestring",
200
  "cfg-if 1.0.0",
@@ -246,6 +246,17 @@ version = "1.0.2"
246
  source = "registry+https://github.com/rust-lang/crates.io-index"
247
  checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
248
 
 
 
 
 
 
 
 
 
 
 
 
249
  [[package]]
250
  name = "ahash"
251
  version = "0.8.6"
@@ -259,6 +270,15 @@ dependencies = [
259
  "zerocopy",
260
  ]
261
 
 
 
 
 
 
 
 
 
 
262
  [[package]]
263
  name = "aho-corasick"
264
  version = "1.1.2"
@@ -375,6 +395,15 @@ version = "0.21.5"
375
  source = "registry+https://github.com/rust-lang/crates.io-index"
376
  checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9"
377
 
 
 
 
 
 
 
 
 
 
378
  [[package]]
379
  name = "bit-set"
380
  version = "0.5.3"
@@ -402,6 +431,18 @@ version = "2.4.1"
402
  source = "registry+https://github.com/rust-lang/crates.io-index"
403
  checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07"
404
 
 
 
 
 
 
 
 
 
 
 
 
 
405
  [[package]]
406
  name = "block-buffer"
407
  version = "0.10.4"
@@ -448,6 +489,28 @@ version = "3.14.0"
448
  source = "registry+https://github.com/rust-lang/crates.io-index"
449
  checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec"
450
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
451
  [[package]]
452
  name = "bytecount"
453
  version = "0.6.7"
@@ -629,6 +692,26 @@ dependencies = [
629
  "tokio-util",
630
  ]
631
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
632
  [[package]]
633
  name = "convert_case"
634
  version = "0.4.0"
@@ -858,6 +941,28 @@ dependencies = [
858
  "smallvec 1.11.1",
859
  ]
860
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
861
  [[package]]
862
  name = "cssparser-macros"
863
  version = "0.6.1"
@@ -881,6 +986,21 @@ dependencies = [
881
  "parking_lot_core 0.9.9",
882
  ]
883
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
884
  [[package]]
885
  name = "deranged"
886
  version = "0.3.9"
@@ -1130,6 +1250,12 @@ version = "0.3.3"
1130
  source = "registry+https://github.com/rust-lang/crates.io-index"
1131
  checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
1132
 
 
 
 
 
 
 
1133
  [[package]]
1134
  name = "futf"
1135
  version = "0.1.5"
@@ -1287,7 +1413,7 @@ checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427"
1287
  dependencies = [
1288
  "cfg-if 1.0.0",
1289
  "libc",
1290
- "wasi 0.11.0+wasi-snapshot-preview1",
1291
  ]
1292
 
1293
  [[package]]
@@ -1304,9 +1430,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
1304
 
1305
  [[package]]
1306
  name = "governor"
1307
- version = "0.5.1"
1308
  source = "registry+https://github.com/rust-lang/crates.io-index"
1309
- checksum = "c390a940a5d157878dd057c78680a33ce3415bcd05b4799509ea44210914b4d5"
1310
  dependencies = [
1311
  "cfg-if 1.0.0",
1312
  "dashmap",
@@ -1383,6 +1509,19 @@ name = "hashbrown"
1383
  version = "0.12.3"
1384
  source = "registry+https://github.com/rust-lang/crates.io-index"
1385
  checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
 
 
 
 
 
 
 
 
 
 
 
 
 
1386
 
1387
  [[package]]
1388
  name = "hashbrown"
@@ -1728,6 +1867,30 @@ dependencies = [
1728
  "libc",
1729
  ]
1730
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1731
  [[package]]
1732
  name = "linux-raw-sys"
1733
  version = "0.4.10"
@@ -1802,10 +1965,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
1802
  checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4"
1803
 
1804
  [[package]]
1805
- name = "mach"
1806
- version = "0.3.2"
1807
  source = "registry+https://github.com/rust-lang/crates.io-index"
1808
- checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa"
1809
  dependencies = [
1810
  "libc",
1811
  ]
@@ -1923,6 +2086,16 @@ dependencies = [
1923
  "triomphe",
1924
  ]
1925
 
 
 
 
 
 
 
 
 
 
 
1926
  [[package]]
1927
  name = "miniz_oxide"
1928
  version = "0.7.1"
@@ -1969,7 +2142,7 @@ checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0"
1969
  dependencies = [
1970
  "libc",
1971
  "log",
1972
- "wasi 0.11.0+wasi-snapshot-preview1",
1973
  "windows-sys",
1974
  ]
1975
 
@@ -2148,6 +2321,42 @@ dependencies = [
2148
  "vcpkg",
2149
  ]
2150
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2151
  [[package]]
2152
  name = "parking_lot"
2153
  version = "0.9.0"
@@ -2197,12 +2406,31 @@ dependencies = [
2197
  "windows-targets",
2198
  ]
2199
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2200
  [[package]]
2201
  name = "paste"
2202
  version = "1.0.14"
2203
  source = "registry+https://github.com/rust-lang/crates.io-index"
2204
  checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c"
2205
 
 
 
 
 
 
 
2206
  [[package]]
2207
  name = "percent-encoding"
2208
  version = "1.0.1"
@@ -2480,6 +2708,26 @@ dependencies = [
2480
  "unicode-ident",
2481
  ]
2482
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2483
  [[package]]
2484
  name = "publicsuffix"
2485
  version = "1.5.6"
@@ -2503,16 +2751,16 @@ dependencies = [
2503
 
2504
  [[package]]
2505
  name = "quanta"
2506
- version = "0.9.3"
2507
  source = "registry+https://github.com/rust-lang/crates.io-index"
2508
- checksum = "20afe714292d5e879d8b12740aa223c6a88f118af41870e8b6196e39a02238a8"
2509
  dependencies = [
2510
  "crossbeam-utils 0.8.16",
2511
  "libc",
2512
- "mach",
2513
  "once_cell",
2514
  "raw-cpuid",
2515
- "wasi 0.10.2+wasi-snapshot-preview1",
2516
  "web-sys",
2517
  "winapi 0.3.9",
2518
  ]
@@ -2535,6 +2783,12 @@ dependencies = [
2535
  "proc-macro2 1.0.69",
2536
  ]
2537
 
 
 
 
 
 
 
2538
  [[package]]
2539
  name = "rand"
2540
  version = "0.6.5"
@@ -2754,7 +3008,7 @@ version = "1.10.2"
2754
  source = "registry+https://github.com/rust-lang/crates.io-index"
2755
  checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343"
2756
  dependencies = [
2757
- "aho-corasick",
2758
  "memchr",
2759
  "regex-automata",
2760
  "regex-syntax",
@@ -2766,7 +3020,7 @@ version = "0.4.3"
2766
  source = "registry+https://github.com/rust-lang/crates.io-index"
2767
  checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f"
2768
  dependencies = [
2769
- "aho-corasick",
2770
  "memchr",
2771
  "regex-syntax",
2772
  ]
@@ -2777,6 +3031,15 @@ version = "0.8.2"
2777
  source = "registry+https://github.com/rust-lang/crates.io-index"
2778
  checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
2779
 
 
 
 
 
 
 
 
 
 
2780
  [[package]]
2781
  name = "reqwest"
2782
  version = "0.9.24"
@@ -2807,7 +3070,7 @@ dependencies = [
2807
  "tokio-threadpool",
2808
  "tokio-timer",
2809
  "url 1.7.2",
2810
- "uuid",
2811
  "winreg 0.6.2",
2812
  ]
2813
 
@@ -2865,6 +3128,34 @@ dependencies = [
2865
  "windows-sys",
2866
  ]
2867
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2868
  [[package]]
2869
  name = "rustc-demangle"
2870
  version = "0.1.23"
@@ -2983,18 +3274,17 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
2983
 
2984
  [[package]]
2985
  name = "scraper"
2986
- version = "0.17.1"
2987
  source = "registry+https://github.com/rust-lang/crates.io-index"
2988
- checksum = "c95a930e03325234c18c7071fd2b60118307e025d6fff3e12745ffbf63a3d29c"
2989
  dependencies = [
2990
- "ahash",
2991
- "cssparser",
2992
  "ego-tree",
2993
  "getopts",
2994
  "html5ever 0.26.0",
2995
  "once_cell",
2996
  "selectors",
2997
- "smallvec 1.11.1",
2998
  "tendril",
2999
  ]
3000
 
@@ -3008,6 +3298,12 @@ dependencies = [
3008
  "untrusted",
3009
  ]
3010
 
 
 
 
 
 
 
3011
  [[package]]
3012
  name = "security-framework"
3013
  version = "2.9.2"
@@ -3048,7 +3344,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
3048
  checksum = "4eb30575f3638fc8f6815f448d50cb1a2e255b0897985c8c59f4d37b72a07b06"
3049
  dependencies = [
3050
  "bitflags 2.4.1",
3051
- "cssparser",
3052
  "derive_more",
3053
  "fxhash",
3054
  "log",
@@ -3185,6 +3481,21 @@ dependencies = [
3185
  "libc",
3186
  ]
3187
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3188
  [[package]]
3189
  name = "siphasher"
3190
  version = "0.2.3"
@@ -3422,6 +3733,12 @@ version = "0.2.0"
3422
  source = "registry+https://github.com/rust-lang/crates.io-index"
3423
  checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417"
3424
 
 
 
 
 
 
 
3425
  [[package]]
3426
  name = "tempfile"
3427
  version = "3.8.1"
@@ -3902,6 +4219,12 @@ dependencies = [
3902
  "rand 0.6.5",
3903
  ]
3904
 
 
 
 
 
 
 
3905
  [[package]]
3906
  name = "vcpkg"
3907
  version = "0.2.15"
@@ -3914,6 +4237,12 @@ version = "0.9.4"
3914
  source = "registry+https://github.com/rust-lang/crates.io-index"
3915
  checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
3916
 
 
 
 
 
 
 
3917
  [[package]]
3918
  name = "walkdir"
3919
  version = "2.4.0"
@@ -3944,12 +4273,6 @@ dependencies = [
3944
  "try-lock",
3945
  ]
3946
 
3947
- [[package]]
3948
- name = "wasi"
3949
- version = "0.10.2+wasi-snapshot-preview1"
3950
- source = "registry+https://github.com/rust-lang/crates.io-index"
3951
- checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
3952
-
3953
  [[package]]
3954
  name = "wasi"
3955
  version = "0.11.0+wasi-snapshot-preview1"
@@ -4055,10 +4378,12 @@ dependencies = [
4055
  "fake-useragent",
4056
  "futures 0.3.29",
4057
  "handlebars",
 
4058
  "log",
4059
  "md5",
4060
  "mimalloc",
4061
  "mini-moka",
 
4062
  "mlua",
4063
  "rand 0.8.5",
4064
  "redis",
@@ -4223,6 +4548,15 @@ dependencies = [
4223
  "winapi-build",
4224
  ]
4225
 
 
 
 
 
 
 
 
 
 
4226
  [[package]]
4227
  name = "zerocopy"
4228
  version = "0.7.23"
 
59
 
60
  [[package]]
61
  name = "actix-governor"
62
+ version = "0.5.0"
63
  source = "registry+https://github.com/rust-lang/crates.io-index"
64
+ checksum = "a2e7b88f3804e01bd4191fdb08650430bbfcb43d3d9b2890064df3551ec7d25b"
65
  dependencies = [
66
  "actix-http",
67
  "actix-web",
 
79
  "actix-rt",
80
  "actix-service",
81
  "actix-utils",
82
+ "ahash 0.8.6",
83
  "base64 0.21.5",
84
  "bitflags 2.4.1",
85
  "brotli",
 
194
  "actix-service",
195
  "actix-utils",
196
  "actix-web-codegen",
197
+ "ahash 0.8.6",
198
  "bytes 1.5.0",
199
  "bytestring",
200
  "cfg-if 1.0.0",
 
246
  source = "registry+https://github.com/rust-lang/crates.io-index"
247
  checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
248
 
249
+ [[package]]
250
+ name = "ahash"
251
+ version = "0.8.6"
252
+ source = "registry+https://github.com/rust-lang/crates.io-index"
253
+ checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd"
254
+ dependencies = [
255
+ "getrandom",
256
+ "once_cell",
257
+ "version_check",
258
+ ]
259
+
260
  [[package]]
261
  name = "ahash"
262
  version = "0.8.6"
 
270
  "zerocopy",
271
  ]
272
 
273
+ [[package]]
274
+ name = "aho-corasick"
275
+ version = "0.7.20"
276
+ source = "registry+https://github.com/rust-lang/crates.io-index"
277
+ checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac"
278
+ dependencies = [
279
+ "memchr",
280
+ ]
281
+
282
  [[package]]
283
  name = "aho-corasick"
284
  version = "1.1.2"
 
395
  source = "registry+https://github.com/rust-lang/crates.io-index"
396
  checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9"
397
 
398
+ [[package]]
399
+ name = "base64-simd"
400
+ version = "0.7.0"
401
+ source = "registry+https://github.com/rust-lang/crates.io-index"
402
+ checksum = "781dd20c3aff0bd194fe7d2a977dd92f21c173891f3a03b677359e5fa457e5d5"
403
+ dependencies = [
404
+ "simd-abstraction",
405
+ ]
406
+
407
  [[package]]
408
  name = "bit-set"
409
  version = "0.5.3"
 
431
  source = "registry+https://github.com/rust-lang/crates.io-index"
432
  checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07"
433
 
434
+ [[package]]
435
+ name = "bitvec"
436
+ version = "1.0.1"
437
+ source = "registry+https://github.com/rust-lang/crates.io-index"
438
+ checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c"
439
+ dependencies = [
440
+ "funty",
441
+ "radium",
442
+ "tap",
443
+ "wyz",
444
+ ]
445
+
446
  [[package]]
447
  name = "block-buffer"
448
  version = "0.10.4"
 
489
  source = "registry+https://github.com/rust-lang/crates.io-index"
490
  checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec"
491
 
492
+ [[package]]
493
+ name = "bytecheck"
494
+ version = "0.6.11"
495
+ source = "registry+https://github.com/rust-lang/crates.io-index"
496
+ checksum = "8b6372023ac861f6e6dc89c8344a8f398fb42aaba2b5dbc649ca0c0e9dbcb627"
497
+ dependencies = [
498
+ "bytecheck_derive",
499
+ "ptr_meta",
500
+ "simdutf8",
501
+ ]
502
+
503
+ [[package]]
504
+ name = "bytecheck_derive"
505
+ version = "0.6.11"
506
+ source = "registry+https://github.com/rust-lang/crates.io-index"
507
+ checksum = "a7ec4c6f261935ad534c0c22dbef2201b45918860eb1c574b972bd213a76af61"
508
+ dependencies = [
509
+ "proc-macro2 1.0.69",
510
+ "quote 1.0.33",
511
+ "syn 1.0.109",
512
+ ]
513
+
514
  [[package]]
515
  name = "bytecount"
516
  version = "0.6.7"
 
692
  "tokio-util",
693
  ]
694
 
695
+ [[package]]
696
+ name = "const-str"
697
+ version = "0.3.2"
698
+ source = "registry+https://github.com/rust-lang/crates.io-index"
699
+ checksum = "21077772762a1002bb421c3af42ac1725fa56066bfc53d9a55bb79905df2aaf3"
700
+ dependencies = [
701
+ "const-str-proc-macro",
702
+ ]
703
+
704
+ [[package]]
705
+ name = "const-str-proc-macro"
706
+ version = "0.3.2"
707
+ source = "registry+https://github.com/rust-lang/crates.io-index"
708
+ checksum = "5e1e0fdd2e5d3041e530e1b21158aeeef8b5d0e306bc5c1e3d6cf0930d10e25a"
709
+ dependencies = [
710
+ "proc-macro2 1.0.69",
711
+ "quote 1.0.33",
712
+ "syn 1.0.109",
713
+ ]
714
+
715
  [[package]]
716
  name = "convert_case"
717
  version = "0.4.0"
 
941
  "smallvec 1.11.1",
942
  ]
943
 
944
+ [[package]]
945
+ name = "cssparser"
946
+ version = "0.33.0"
947
+ source = "registry+https://github.com/rust-lang/crates.io-index"
948
+ checksum = "9be934d936a0fbed5bcdc01042b770de1398bf79d0e192f49fa7faea0e99281e"
949
+ dependencies = [
950
+ "cssparser-macros",
951
+ "dtoa-short",
952
+ "itoa 1.0.9",
953
+ "phf 0.11.2",
954
+ "smallvec 1.11.1",
955
+ ]
956
+
957
+ [[package]]
958
+ name = "cssparser-color"
959
+ version = "0.1.0"
960
+ source = "registry+https://github.com/rust-lang/crates.io-index"
961
+ checksum = "556c099a61d85989d7af52b692e35a8d68a57e7df8c6d07563dc0778b3960c9f"
962
+ dependencies = [
963
+ "cssparser 0.33.0",
964
+ ]
965
+
966
  [[package]]
967
  name = "cssparser-macros"
968
  version = "0.6.1"
 
986
  "parking_lot_core 0.9.9",
987
  ]
988
 
989
+ [[package]]
990
+ name = "data-encoding"
991
+ version = "2.4.0"
992
+ source = "registry+https://github.com/rust-lang/crates.io-index"
993
+ checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308"
994
+
995
+ [[package]]
996
+ name = "data-url"
997
+ version = "0.1.1"
998
+ source = "registry+https://github.com/rust-lang/crates.io-index"
999
+ checksum = "3a30bfce702bcfa94e906ef82421f2c0e61c076ad76030c16ee5d2e9a32fe193"
1000
+ dependencies = [
1001
+ "matches",
1002
+ ]
1003
+
1004
  [[package]]
1005
  name = "deranged"
1006
  version = "0.3.9"
 
1250
  source = "registry+https://github.com/rust-lang/crates.io-index"
1251
  checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
1252
 
1253
+ [[package]]
1254
+ name = "funty"
1255
+ version = "2.0.0"
1256
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1257
+ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c"
1258
+
1259
  [[package]]
1260
  name = "futf"
1261
  version = "0.1.5"
 
1413
  dependencies = [
1414
  "cfg-if 1.0.0",
1415
  "libc",
1416
+ "wasi",
1417
  ]
1418
 
1419
  [[package]]
 
1430
 
1431
  [[package]]
1432
  name = "governor"
1433
+ version = "0.6.0"
1434
  source = "registry+https://github.com/rust-lang/crates.io-index"
1435
+ checksum = "821239e5672ff23e2a7060901fa622950bbd80b649cdaadd78d1c1767ed14eb4"
1436
  dependencies = [
1437
  "cfg-if 1.0.0",
1438
  "dashmap",
 
1509
  version = "0.12.3"
1510
  source = "registry+https://github.com/rust-lang/crates.io-index"
1511
  checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
1512
+ dependencies = [
1513
+ "ahash 0.7.7",
1514
+ ]
1515
+
1516
+ [[package]]
1517
+ name = "hashbrown"
1518
+ version = "0.13.2"
1519
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1520
+ checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e"
1521
+ dependencies = [
1522
+ "ahash 0.8.6",
1523
+ "bumpalo",
1524
+ ]
1525
 
1526
  [[package]]
1527
  name = "hashbrown"
 
1867
  "libc",
1868
  ]
1869
 
1870
+ [[package]]
1871
+ name = "lightningcss"
1872
+ version = "1.0.0-alpha.50"
1873
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1874
+ checksum = "c2999490cc10a59ad8a87d731791a5d438d2d025e3f137aa7d4c23e1827985b0"
1875
+ dependencies = [
1876
+ "ahash 0.7.7",
1877
+ "bitflags 2.4.1",
1878
+ "const-str",
1879
+ "cssparser 0.33.0",
1880
+ "cssparser-color",
1881
+ "dashmap",
1882
+ "data-encoding",
1883
+ "itertools",
1884
+ "lazy_static",
1885
+ "parcel_selectors",
1886
+ "parcel_sourcemap",
1887
+ "paste",
1888
+ "pathdiff",
1889
+ "rayon",
1890
+ "serde",
1891
+ "smallvec 1.11.1",
1892
+ ]
1893
+
1894
  [[package]]
1895
  name = "linux-raw-sys"
1896
  version = "0.4.10"
 
1965
  checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4"
1966
 
1967
  [[package]]
1968
+ name = "mach2"
1969
+ version = "0.4.1"
1970
  source = "registry+https://github.com/rust-lang/crates.io-index"
1971
+ checksum = "6d0d1830bcd151a6fc4aea1369af235b36c1528fe976b8ff678683c9995eade8"
1972
  dependencies = [
1973
  "libc",
1974
  ]
 
2086
  "triomphe",
2087
  ]
2088
 
2089
+ [[package]]
2090
+ name = "minify-js"
2091
+ version = "0.5.6"
2092
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2093
+ checksum = "22d6c512a82abddbbc13b70609cb2beff01be2c7afff534d6e5e1c85e438fc8b"
2094
+ dependencies = [
2095
+ "lazy_static",
2096
+ "parse-js",
2097
+ ]
2098
+
2099
  [[package]]
2100
  name = "miniz_oxide"
2101
  version = "0.7.1"
 
2142
  dependencies = [
2143
  "libc",
2144
  "log",
2145
+ "wasi",
2146
  "windows-sys",
2147
  ]
2148
 
 
2321
  "vcpkg",
2322
  ]
2323
 
2324
+ [[package]]
2325
+ name = "outref"
2326
+ version = "0.1.0"
2327
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2328
+ checksum = "7f222829ae9293e33a9f5e9f440c6760a3d450a64affe1846486b140db81c1f4"
2329
+
2330
+ [[package]]
2331
+ name = "parcel_selectors"
2332
+ version = "0.26.4"
2333
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2334
+ checksum = "05d74befe2d076330d9a58bf9ca2da424568724ab278adf15fb5718253133887"
2335
+ dependencies = [
2336
+ "bitflags 2.4.1",
2337
+ "cssparser 0.33.0",
2338
+ "fxhash",
2339
+ "log",
2340
+ "phf 0.10.1",
2341
+ "phf_codegen 0.10.0",
2342
+ "precomputed-hash",
2343
+ "smallvec 1.11.1",
2344
+ ]
2345
+
2346
+ [[package]]
2347
+ name = "parcel_sourcemap"
2348
+ version = "2.1.1"
2349
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2350
+ checksum = "485b74d7218068b2b7c0e3ff12fbc61ae11d57cb5d8224f525bd304c6be05bbb"
2351
+ dependencies = [
2352
+ "base64-simd",
2353
+ "data-url",
2354
+ "rkyv",
2355
+ "serde",
2356
+ "serde_json",
2357
+ "vlq",
2358
+ ]
2359
+
2360
  [[package]]
2361
  name = "parking_lot"
2362
  version = "0.9.0"
 
2406
  "windows-targets",
2407
  ]
2408
 
2409
+ [[package]]
2410
+ name = "parse-js"
2411
+ version = "0.17.0"
2412
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2413
+ checksum = "9ec3b11d443640ec35165ee8f6f0559f1c6f41878d70330fe9187012b5935f02"
2414
+ dependencies = [
2415
+ "aho-corasick 0.7.20",
2416
+ "bumpalo",
2417
+ "hashbrown 0.13.2",
2418
+ "lazy_static",
2419
+ "memchr",
2420
+ ]
2421
+
2422
  [[package]]
2423
  name = "paste"
2424
  version = "1.0.14"
2425
  source = "registry+https://github.com/rust-lang/crates.io-index"
2426
  checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c"
2427
 
2428
+ [[package]]
2429
+ name = "pathdiff"
2430
+ version = "0.2.1"
2431
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2432
+ checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd"
2433
+
2434
  [[package]]
2435
  name = "percent-encoding"
2436
  version = "1.0.1"
 
2708
  "unicode-ident",
2709
  ]
2710
 
2711
+ [[package]]
2712
+ name = "ptr_meta"
2713
+ version = "0.1.4"
2714
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2715
+ checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1"
2716
+ dependencies = [
2717
+ "ptr_meta_derive",
2718
+ ]
2719
+
2720
+ [[package]]
2721
+ name = "ptr_meta_derive"
2722
+ version = "0.1.4"
2723
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2724
+ checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac"
2725
+ dependencies = [
2726
+ "proc-macro2 1.0.69",
2727
+ "quote 1.0.33",
2728
+ "syn 1.0.109",
2729
+ ]
2730
+
2731
  [[package]]
2732
  name = "publicsuffix"
2733
  version = "1.5.6"
 
2751
 
2752
  [[package]]
2753
  name = "quanta"
2754
+ version = "0.11.1"
2755
  source = "registry+https://github.com/rust-lang/crates.io-index"
2756
+ checksum = "a17e662a7a8291a865152364c20c7abc5e60486ab2001e8ec10b24862de0b9ab"
2757
  dependencies = [
2758
  "crossbeam-utils 0.8.16",
2759
  "libc",
2760
+ "mach2",
2761
  "once_cell",
2762
  "raw-cpuid",
2763
+ "wasi",
2764
  "web-sys",
2765
  "winapi 0.3.9",
2766
  ]
 
2783
  "proc-macro2 1.0.69",
2784
  ]
2785
 
2786
+ [[package]]
2787
+ name = "radium"
2788
+ version = "0.7.0"
2789
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2790
+ checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09"
2791
+
2792
  [[package]]
2793
  name = "rand"
2794
  version = "0.6.5"
 
3008
  source = "registry+https://github.com/rust-lang/crates.io-index"
3009
  checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343"
3010
  dependencies = [
3011
+ "aho-corasick 1.1.2",
3012
  "memchr",
3013
  "regex-automata",
3014
  "regex-syntax",
 
3020
  source = "registry+https://github.com/rust-lang/crates.io-index"
3021
  checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f"
3022
  dependencies = [
3023
+ "aho-corasick 1.1.2",
3024
  "memchr",
3025
  "regex-syntax",
3026
  ]
 
3031
  source = "registry+https://github.com/rust-lang/crates.io-index"
3032
  checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
3033
 
3034
+ [[package]]
3035
+ name = "rend"
3036
+ version = "0.4.1"
3037
+ source = "registry+https://github.com/rust-lang/crates.io-index"
3038
+ checksum = "a2571463863a6bd50c32f94402933f03457a3fbaf697a707c5be741e459f08fd"
3039
+ dependencies = [
3040
+ "bytecheck",
3041
+ ]
3042
+
3043
  [[package]]
3044
  name = "reqwest"
3045
  version = "0.9.24"
 
3070
  "tokio-threadpool",
3071
  "tokio-timer",
3072
  "url 1.7.2",
3073
+ "uuid 0.7.4",
3074
  "winreg 0.6.2",
3075
  ]
3076
 
 
3128
  "windows-sys",
3129
  ]
3130
 
3131
+ [[package]]
3132
+ name = "rkyv"
3133
+ version = "0.7.42"
3134
+ source = "registry+https://github.com/rust-lang/crates.io-index"
3135
+ checksum = "0200c8230b013893c0b2d6213d6ec64ed2b9be2e0e016682b7224ff82cff5c58"
3136
+ dependencies = [
3137
+ "bitvec",
3138
+ "bytecheck",
3139
+ "hashbrown 0.12.3",
3140
+ "ptr_meta",
3141
+ "rend",
3142
+ "rkyv_derive",
3143
+ "seahash",
3144
+ "tinyvec",
3145
+ "uuid 1.5.0",
3146
+ ]
3147
+
3148
+ [[package]]
3149
+ name = "rkyv_derive"
3150
+ version = "0.7.42"
3151
+ source = "registry+https://github.com/rust-lang/crates.io-index"
3152
+ checksum = "b2e06b915b5c230a17d7a736d1e2e63ee753c256a8614ef3f5147b13a4f5541d"
3153
+ dependencies = [
3154
+ "proc-macro2 1.0.69",
3155
+ "quote 1.0.33",
3156
+ "syn 1.0.109",
3157
+ ]
3158
+
3159
  [[package]]
3160
  name = "rustc-demangle"
3161
  version = "0.1.23"
 
3274
 
3275
  [[package]]
3276
  name = "scraper"
3277
+ version = "0.18.1"
3278
  source = "registry+https://github.com/rust-lang/crates.io-index"
3279
+ checksum = "585480e3719b311b78a573db1c9d9c4c1f8010c2dee4cc59c2efe58ea4dbc3e1"
3280
  dependencies = [
3281
+ "ahash 0.8.6",
3282
+ "cssparser 0.31.2",
3283
  "ego-tree",
3284
  "getopts",
3285
  "html5ever 0.26.0",
3286
  "once_cell",
3287
  "selectors",
 
3288
  "tendril",
3289
  ]
3290
 
 
3298
  "untrusted",
3299
  ]
3300
 
3301
+ [[package]]
3302
+ name = "seahash"
3303
+ version = "4.1.0"
3304
+ source = "registry+https://github.com/rust-lang/crates.io-index"
3305
+ checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b"
3306
+
3307
  [[package]]
3308
  name = "security-framework"
3309
  version = "2.9.2"
 
3344
  checksum = "4eb30575f3638fc8f6815f448d50cb1a2e255b0897985c8c59f4d37b72a07b06"
3345
  dependencies = [
3346
  "bitflags 2.4.1",
3347
+ "cssparser 0.31.2",
3348
  "derive_more",
3349
  "fxhash",
3350
  "log",
 
3481
  "libc",
3482
  ]
3483
 
3484
+ [[package]]
3485
+ name = "simd-abstraction"
3486
+ version = "0.7.1"
3487
+ source = "registry+https://github.com/rust-lang/crates.io-index"
3488
+ checksum = "9cadb29c57caadc51ff8346233b5cec1d240b68ce55cf1afc764818791876987"
3489
+ dependencies = [
3490
+ "outref",
3491
+ ]
3492
+
3493
+ [[package]]
3494
+ name = "simdutf8"
3495
+ version = "0.1.4"
3496
+ source = "registry+https://github.com/rust-lang/crates.io-index"
3497
+ checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a"
3498
+
3499
  [[package]]
3500
  name = "siphasher"
3501
  version = "0.2.3"
 
3733
  source = "registry+https://github.com/rust-lang/crates.io-index"
3734
  checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417"
3735
 
3736
+ [[package]]
3737
+ name = "tap"
3738
+ version = "1.0.1"
3739
+ source = "registry+https://github.com/rust-lang/crates.io-index"
3740
+ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369"
3741
+
3742
  [[package]]
3743
  name = "tempfile"
3744
  version = "3.8.1"
 
4219
  "rand 0.6.5",
4220
  ]
4221
 
4222
+ [[package]]
4223
+ name = "uuid"
4224
+ version = "1.5.0"
4225
+ source = "registry+https://github.com/rust-lang/crates.io-index"
4226
+ checksum = "88ad59a7560b41a70d191093a945f0b87bc1deeda46fb237479708a1d6b6cdfc"
4227
+
4228
  [[package]]
4229
  name = "vcpkg"
4230
  version = "0.2.15"
 
4237
  source = "registry+https://github.com/rust-lang/crates.io-index"
4238
  checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
4239
 
4240
+ [[package]]
4241
+ name = "vlq"
4242
+ version = "0.5.1"
4243
+ source = "registry+https://github.com/rust-lang/crates.io-index"
4244
+ checksum = "65dd7eed29412da847b0f78bcec0ac98588165988a8cfe41d4ea1d429f8ccfff"
4245
+
4246
  [[package]]
4247
  name = "walkdir"
4248
  version = "2.4.0"
 
4273
  "try-lock",
4274
  ]
4275
 
 
 
 
 
 
 
4276
  [[package]]
4277
  name = "wasi"
4278
  version = "0.11.0+wasi-snapshot-preview1"
 
4378
  "fake-useragent",
4379
  "futures 0.3.29",
4380
  "handlebars",
4381
+ "lightningcss",
4382
  "log",
4383
  "md5",
4384
  "mimalloc",
4385
  "mini-moka",
4386
+ "minify-js",
4387
  "mlua",
4388
  "rand 0.8.5",
4389
  "redis",
 
4548
  "winapi-build",
4549
  ]
4550
 
4551
+ [[package]]
4552
+ name = "wyz"
4553
+ version = "0.5.1"
4554
+ source = "registry+https://github.com/rust-lang/crates.io-index"
4555
+ checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed"
4556
+ dependencies = [
4557
+ "tap",
4558
+ ]
4559
+
4560
  [[package]]
4561
  name = "zerocopy"
4562
  version = "0.7.23"
Cargo.toml CHANGED
@@ -17,7 +17,7 @@ reqwest = {version="0.11.21",default-features = false,features = ["json", "rustl
17
  tokio = {version="1.32.0",features=["rt-multi-thread","macros"]}
18
  serde = {version="1.0.188",features=["derive"]}
19
  handlebars = { version = "4.4.0", features = ["dir_source"] }
20
- scraper = {version="0.17.1"}
21
  actix-web = {version="4.4.0", features = ["cookies"]}
22
  actix-files = {version="0.6.2"}
23
  actix-cors = {version="0.6.4"}
@@ -37,7 +37,7 @@ futures = {version="0.3.28"}
37
  dhat = {version="0.3.2", optional = true}
38
  mimalloc = { version = "0.1.38", default-features = false }
39
  async-once-cell = {version="0.5.3"}
40
- actix-governor = {version="0.4.1"}
41
  mini-moka = { version="0.10", optional = true}
42
 
43
  [dev-dependencies]
@@ -45,6 +45,10 @@ rusty-hook = "^0.11.2"
45
  criterion = "0.5.1"
46
  tempfile = "3.8.0"
47
 
 
 
 
 
48
  [profile.dev]
49
  opt-level = 0
50
  debug = true
 
17
  tokio = {version="1.32.0",features=["rt-multi-thread","macros"]}
18
  serde = {version="1.0.188",features=["derive"]}
19
  handlebars = { version = "4.4.0", features = ["dir_source"] }
20
+ scraper = {version="0.18.1"}
21
  actix-web = {version="4.4.0", features = ["cookies"]}
22
  actix-files = {version="0.6.2"}
23
  actix-cors = {version="0.6.4"}
 
37
  dhat = {version="0.3.2", optional = true}
38
  mimalloc = { version = "0.1.38", default-features = false }
39
  async-once-cell = {version="0.5.3"}
40
+ actix-governor = {version="0.5.0"}
41
  mini-moka = { version="0.10", optional = true}
42
 
43
  [dev-dependencies]
 
45
  criterion = "0.5.1"
46
  tempfile = "3.8.0"
47
 
48
+ [build-dependencies]
49
+ lightningcss = "1.0.0-alpha.50"
50
+ minify-js = "0.5.6"
51
+
52
  [profile.dev]
53
  opt-level = 0
54
  debug = true
build.rs ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ //! A build module of the application which minifies the project's css and js files on build which
2
+ //! helps reduce the initial page by loading the files faster.
3
+
4
+ #![forbid(unsafe_code, clippy::panic)]
5
+ #![deny(missing_docs, clippy::missing_docs_in_private_items, clippy::perf)]
6
+ #![warn(clippy::cognitive_complexity, rust_2018_idioms)]
7
+
8
+ // ------- Imports -------
9
+ use lightningcss::stylesheet::{MinifyOptions, ParserOptions, PrinterOptions, StyleSheet};
10
+ use minify_js::{minify, Session, TopLevelMode};
11
+ use std::{
12
+ fs::{read_dir, read_to_string, File, OpenOptions},
13
+ io::{Read, Write},
14
+ };
15
+
16
+ // ------- Constants -------
17
+ /// A constant for the path to the public/theme folder in the codebase.
18
+ const COMMON_STATIC_SOURCE_CODE_FOLDER: &str = "./public/static/";
19
+ /// A constant for the names of the folders located in the "/public/static/"
20
+ /// folder in the codebase which contains the css files to be minified.
21
+ const STYLE_FOLDERS: [&str; 2] = ["themes", "colorschemes"];
22
+ /// A constant for the environment variable name.
23
+ const PACKAGE_ENVIRONMENT_VARIABLE: &str = "PKG_ENV";
24
+ /// A constant for the `prod` value of the `pkg_env` environment variable.
25
+ const PRODUCTION_PKG_ENV_VARIABLE_VALUE: &str = "prod";
26
+
27
+ /// A main function which minifies both css and js files using `lightningcss` and `minify_js` when
28
+ /// the `PKG_ENV` environment and it is set to the value of `prod`.
29
+ ///
30
+ /// # Error
31
+ ///
32
+ /// This function returns the unit type when the minification process runs successfully otherwise
33
+ /// it returns a standard error.
34
+ fn main() -> Result<(), Box<dyn std::error::Error>> {
35
+ if let Ok(pkg_env_var) = std::env::var(PACKAGE_ENVIRONMENT_VARIABLE) {
36
+ if pkg_env_var.to_lowercase() == PRODUCTION_PKG_ENV_VARIABLE_VALUE {
37
+ // A for loop that loops over each file name containing in the `colorschemes` and `themes` folders
38
+ // and minifies it using the `lightningcss` minifier.
39
+ for folder_name in STYLE_FOLDERS {
40
+ for file in read_dir(format!("{COMMON_STATIC_SOURCE_CODE_FOLDER}{folder_name}/"))? {
41
+ let file_path = file?.path();
42
+ let source = read_to_string(file_path.clone())?;
43
+
44
+ let mut stylesheet = StyleSheet::parse(&source, ParserOptions::default())
45
+ .map_err(|err| format!("{err}\n{:?}", file_path.file_name().unwrap()))?;
46
+
47
+ stylesheet.minify(MinifyOptions::default())?;
48
+ let minified_css = stylesheet.to_css(PrinterOptions::default())?;
49
+
50
+ let mut old_css_file = OpenOptions::new()
51
+ .write(true)
52
+ .truncate(true)
53
+ .open(file_path)?;
54
+ old_css_file.write_all(minified_css.code.as_bytes())?;
55
+ old_css_file.flush()?;
56
+ }
57
+ }
58
+
59
+ // A for loop that loops over each file name containing in the `public/static` folder and minifies
60
+ // it using the `minify-js` minifier.
61
+ for file in read_dir(COMMON_STATIC_SOURCE_CODE_FOLDER)? {
62
+ let file_path = file?.path();
63
+ if file_path.is_file() {
64
+ let mut code = Vec::new();
65
+ let mut js_file = File::open(file_path.clone())?;
66
+ js_file.read_to_end(&mut code)?;
67
+
68
+ drop(js_file);
69
+
70
+ let mut out = Vec::new();
71
+ minify(&Session::new(), TopLevelMode::Global, &code, &mut out)
72
+ .map_err(|err| format!("{err}\n{:?}", file_path.file_name().unwrap()))?;
73
+
74
+ let mut old_js_file = OpenOptions::new()
75
+ .write(true)
76
+ .truncate(true)
77
+ .open(file_path)?;
78
+ old_js_file.write_all(&out)?;
79
+ old_js_file.flush()?;
80
+ }
81
+ }
82
+ }
83
+ }
84
+ Ok(())
85
+ }
docs/configuration.md CHANGED
@@ -2,14 +2,14 @@
2
 
3
  ## Installed From Source
4
 
5
- If you have built `websurfx` from source then the configuration file will be located under project directory (codebase) at `websurfx/`
6
 
7
  > **Note**
8
- > If you have built websurfx with unstable/rolling/edge branch then you can copy the configuration file from `websurfx/config.lua` located under project directory (codebase) to `~/.config/websurfx/` and make the changes there and rerun the websurfx server. _This is only available from unstable/rolling/edge version_.
9
 
10
  ## Installed From Package
11
 
12
- If you have installed `websurfx` using the package manager of your Linux distro then the default configuration file will be located at `/etc/xdg/websurfx/`. You can copy the default config to `~/.config/websurfx/` and make the changes there and rerun the websurfx server.
13
 
14
  Some of the configuration options provided in the file are stated below. These are subdivided into the following categories:
15
 
@@ -42,13 +42,13 @@ Some of the configuration options provided in the file are stated below. These a
42
  >
43
  > - Level 0 - With this level no search filtering occurs.
44
  > - Level 1 - With this level some search filtering occurs.
45
- > - Level 2 - With this level the upstream search engines are restricted to send sensitive contents like NSFW search results, etc.
46
- > - Level 3 - With this level the regex based filter lists is used alongside level 2 to filter more search results that have slipped in or custom results that needs to be filtered using the filter lists.
47
- > - Level 4 - This level is similar to level 3 except in this level the regex based filter lists are used to disallow users to search sensitive or disallowed content. This level could be useful if you are parent or someone who wants to completely disallow their kids or yourself from watching sensitive content.
48
 
49
  ## Website
50
 
51
- - **colorscheme:** The colorscheme name which should be used for the website theme (the name should be in accordance to the colorscheme file name present in `public/static/colorschemes` folder).
52
 
53
  > By Default we provide 12 colorschemes to choose from these are:
54
  >
@@ -65,7 +65,7 @@ Some of the configuration options provided in the file are stated below. These a
65
  > 11. tokyo-night
66
  > 12. tomorrow-night
67
 
68
- - **theme:** The theme name which should be used for the website (again, the name should be in accordance to the theme file name present in `public/static/themes` folder).
69
 
70
  > By Default we provide 1 theme to choose from these are:
71
  >
@@ -73,7 +73,7 @@ Some of the configuration options provided in the file are stated below. These a
73
 
74
  ## Cache
75
 
76
- - **redis_url:** Redis connection url address on which the client should connect on.
77
 
78
  > **Note**
79
  > This option can be commented out if you have compiled the app without the `redis-cache` feature. For more information, See [**building**](./building.md).
 
2
 
3
  ## Installed From Source
4
 
5
+ If you have built `websurfx` from the source then the configuration file will be located under the project directory (codebase) at `websurfx/`
6
 
7
  > **Note**
8
+ > If you have built websurfx with an unstable/rolling/edge branch then you can copy the configuration file from `websurfx/config.lua` located under the project directory (codebase) to `~/.config/websurfx/` and make the changes there and rerun the websurfx server. _This is only available from unstable/rolling/edge version_.
9
 
10
  ## Installed From Package
11
 
12
+ If you have installed `websurfx` using the package manager of your Linux distro then the default configuration file will be located at `/etc/xdg/websurfx/`. You can copy the default config to `~/.config/websurfx/` make the changes there and rerun the websurfx server.
13
 
14
  Some of the configuration options provided in the file are stated below. These are subdivided into the following categories:
15
 
 
42
  >
43
  > - Level 0 - With this level no search filtering occurs.
44
  > - Level 1 - With this level some search filtering occurs.
45
+ > - Level 2 - With this level the upstream search engines are restricted to sending sensitive content like NSFW search results, etc.
46
+ > - Level 3 - With this level the regex-based filter lists are used alongside level 2 to filter more search results that have slipped in or custom results that need to be filtered using the filter lists.
47
+ > - Level 4 - This level is similar to level 3 except in this level the regex-based filter lists are used to disallow users to search sensitive or disallowed content. This level could be useful if you are a parent or someone who wants to completely disallow their kids or yourself from watching sensitive content.
48
 
49
  ## Website
50
 
51
+ - **colorscheme:** The colorscheme name which should be used for the website theme (the name should be by the colorscheme file name present in the `public/static/colorschemes` folder).
52
 
53
  > By Default we provide 12 colorschemes to choose from these are:
54
  >
 
65
  > 11. tokyo-night
66
  > 12. tomorrow-night
67
 
68
+ - **theme:** The theme name that should be used for the website (again, the name should be by the theme file name present in the `public/static/themes` folder).
69
 
70
  > By Default we provide 1 theme to choose from these are:
71
  >
 
73
 
74
  ## Cache
75
 
76
+ - **redis_url:** Redis connection URL address on which the client should connect.
77
 
78
  > **Note**
79
  > This option can be commented out if you have compiled the app without the `redis-cache` feature. For more information, See [**building**](./building.md).
docs/introduction.md CHANGED
@@ -4,10 +4,10 @@ A modern-looking, lightning-fast, privacy-respecting, secure [meta search engine
4
 
5
  # Motivation
6
 
7
- Most meta search engines tend to be slow, lack high level of customization and missing many features and all of them like security as they are written in unsafe languages like python, javascript, etc which tend to open a wide variety of vulnerabilities which can also sometimes pose a threat to privacy as sometimes this can be exploited and can be used to leveraged to leak out sensitive information which is never good.
8
 
9
  # Solution
10
 
11
- Websurfx is a project which seeks to provide privacy, security, speed and all the features which the user wants.
12
 
13
  [⬅️ Go back to Home](./README.md)
 
4
 
5
  # Motivation
6
 
7
+ Most meta search engines tend to be slow, lack a high level of customization, and miss many features, and all of them lack security as they are written in unsafe languages like Python, JavaScript, etc., which tend to open a wide variety of vulnerabilities, which can also sometimes pose a threat to privacy as sometimes this can be exploited and can be used to leak out sensitive information, which is never good.
8
 
9
  # Solution
10
 
11
+ Websurfx is a project that seeks to provide privacy, security, speed, and all the features that the user wants.
12
 
13
  [⬅️ Go back to Home](./README.md)