Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Oct 1, 2024

Conversation

HebaruSan
Copy link
Member

@HebaruSan HebaruSan commented Oct 1, 2024

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
3 checks passed
@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