Skip to content

Use SHA256 for archive.org fallback if SHA1 absent - #4216

Merged
HebaruSan merged 1 commit into
KSP-CKAN:masterfrom
HebaruSan:feature/optional-sha1
Oct 1, 2024
Merged

HebaruSan merged 1 commit into
KSP-CKAN:masterfrom
HebaruSan:feature/optional-sha1

Conversation

@HebaruSan

@HebaruSan HebaruSan commented Oct 1, 2024 •

Copy link
Copy Markdown
Member

Motivation

Currently we always calculate both the SHA1 and the SHA256 for all mods. This is redundant and wastes CPU time.

#4135 began the process of making the SHA1 optional; the client now ignores download_hash.sha1 for purposes of validating downloads if download_hash.sha256 is set (which is always). However, it still uses the SHA1 in the archive.org fallback URLs.

Changes

Now if download_hash.sha1 is not set, then the client uses download_hash.sha256 for archive.org fallback URLs instead, as in KSP-CKAN/NetKAN-Infra#344.

This should be the last piece required to make it possible to drop SHA1 from the metadata completely, but note that it will still be calculated for any module with spec_version less than v1.35. We will need to make additional changes later for Netkan to actually stop generating it, and that should wait until most users have updated to clients that can handle it.

@HebaruSan HebaruSan added Enhancement New features or functionality Easy This is easy to fix Core (ckan.dll) Issues affecting the core part of CKAN Network Issues affecting internet connections of CKAN labels Oct 1, 2024
@HebaruSan
HebaruSan merged commit cc28793 into KSP-CKAN:master Oct 1, 2024
@HebaruSan
HebaruSan deleted the feature/optional-sha1 branch October 1, 2024 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Core (ckan.dll) Issues affecting the core part of CKAN Easy This is easy to fix Enhancement New features or functionality Network Issues affecting internet connections of CKAN

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant