You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -315,6 +315,20 @@ Exit codes:
315
315
-`LTP_DOWNLOAD_SHA256_<VERSION>`: version-specific expected SHA-256 for the downloaded LanguageTool archive, for example `LTP_DOWNLOAD_SHA256_6_9_SNAPSHOT`.
316
316
-`LTP_DOWNLOAD_SHA256`: fallback expected SHA-256 for the downloaded LanguageTool archive.
317
317
-`LTP_BYPASS_VERIFIED_DOWNLOADS`: set to `true` to skip SHA-256 verification.
318
+
-`LTP_MAX_DOWNLOAD_BYTES`: maximum downloaded ZIP size in bytes.
319
+
- default: `536870912` (512 MiB)
320
+
-`LTP_SAFE_ZIP_MAX_ARCHIVE_BYTES`: maximum total compressed member size in bytes.
321
+
- default: `536870912` (512 MiB)
322
+
-`LTP_SAFE_ZIP_MAX_EXTRACTED_BYTES`: maximum total extracted size in bytes.
323
+
- default: `805306368` (768 MiB)
324
+
-`LTP_SAFE_ZIP_MAX_MEMBERS`: maximum ZIP member count.
325
+
- default: `5000`
326
+
-`LTP_SAFE_ZIP_MAX_MEMBER_EXTRACTED_BYTES`: maximum extracted size for a single ZIP member in bytes.
327
+
- default: `134217728` (128 MiB)
328
+
-`LTP_SAFE_ZIP_MAX_MEMBER_COMPRESSION_RATIO`: maximum compression ratio for a single ZIP member.
329
+
- default: `100.0`
330
+
-`LTP_SAFE_ZIP_MAX_TOTAL_COMPRESSION_RATIO`: maximum compression ratio for the whole ZIP archive.
331
+
- default: `10.0`
318
332
319
333
Downloaded zips are verified with SHA-256 when a checksum is available. Checksums are resolved in this order:
320
334
1.`LTP_DOWNLOAD_SHA256_<VERSION>`, where non-alphanumeric characters in the version are replaced with `_` and the name is uppercased.
"""Get the expected SHA-256 hash for a given version of LanguageTool.
81
92
This function checks for environment variables that may specify the expected hash for the given version. It normalizes the version name to construct the environment variable name. If no specific environment variable is found for the version, it falls back to a general environment variable or a manifest lookup. If the bypass environment variable is set, it will skip verification and return None.
0 commit comments