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

perf(gravatar): support both sha256 and md5 hash algorithm for gravatar #912

Merged
merged 1 commit into from
Jun 8, 2024

Conversation

qwqcode
Copy link
Member

@qwqcode qwqcode commented Jun 8, 2024

This PR includes the following changes:

  • Replaces the default gravatar mirror for zh-CN configuration with WeAvatar
    • The reason is that Cravatar currently does not support the more secure SHA256 encryption
  • Supports both md5 and sha256 encryption algorithms, with md5 as the default (for compatibility with older version users).

To enable SHA256 encryption, add sha256=1 to frontend.gravatar.params.

# UI Settings
frontend:
  # Gravatar
  gravatar:
    # API parameters
-   params: d=mp&s=240
+   params: sha256=1&d=mp&s=240

[Chinese]

此 PR 包括以下更改:

  • 将 zh-CN 配置中的默认 Gravatar 镜像替换为 WeAvatar
    • 原因是 Cravatar 当前不支持更安全的 SHA256 加密
  • 同时支持 md5 和 sha256 加密算法,默认使用 md5(为兼容旧版用户)

要启用 SHA256 加密,请在 frontend.gravatar.params 中添加 sha256=1

fixes #874

Copy link

codecov bot commented Jun 8, 2024

Codecov Report

Attention: Patch coverage is 71.42857% with 6 lines in your changes missing coverage. Please review.

Project coverage is 31.69%. Comparing base (c3558b7) to head (70cece7).

Files Patch % Lines
internal/core/base.go 66.66% 2 Missing and 1 partial ⚠️
internal/dao/cook.go 40.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #912      +/-   ##
==========================================
+ Coverage   31.56%   31.69%   +0.12%     
==========================================
  Files         203      204       +1     
  Lines        8654     8668      +14     
==========================================
+ Hits         2732     2747      +15     
  Misses       5771     5771              
+ Partials      151      150       -1     
Flag Coverage Δ
go 31.69% <71.42%> (+0.12%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@qwqcode qwqcode merged commit 7093e7e into master Jun 8, 2024
12 checks passed
@qwqcode qwqcode deleted the perf/gravatar branch June 8, 2024 08:22
@qwqcode qwqcode linked an issue Jun 8, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: nighly 版本头像源不生效 [建议] Gravatar 头像使用 SHA256 哈希
1 participant