docs: translate gitlab-ops to en-gb, enhance gravatar article, fix heading levels
- Translate GitLab Operations article from Chinese to British English - Add comprehensive Gravatar usage guide with code examples in both locales - Fix heading levels on notification pages (h1 -> h2) - Enable line numbers in code blocks via rspress config
This commit is contained in:
@@ -0,0 +1,50 @@
|
|||||||
|
---
|
||||||
|
title: GitLab Operations
|
||||||
|
---
|
||||||
|
|
||||||
|
## Setting the Default Language to Chinese in GitLab
|
||||||
|
|
||||||
|
GitLab filters out languages with less than 90% translation coverage via the `SWITCHER_MINIMUM_TRANSLATION_LEVEL` variable in the code. Simplified Chinese sits at 84% and Traditional Chinese at 83%.
|
||||||
|
|
||||||
|
Navigate to `/path/to/gitlab/embedded/service/gitlab-rails/app/helpers/preferred_language_switcher_helper.rb` and modify the code as follows:
|
||||||
|
|
||||||
|
```diff title="/path/to/gitlab/embedded/service/gitlab-rails/app/helpers/preferred_language_switcher_helper.rb"
|
||||||
|
- SWITCHER_MINIMUM_TRANSLATION_LEVEL = 90
|
||||||
|
+ SWITCHER_MINIMUM_TRANSLATION_LEVEL = 80
|
||||||
|
```
|
||||||
|
|
||||||
|
Then restart GitLab with `gitlab-ctl restart`.
|
||||||
|
|
||||||
|
## Adding ICP Filing Information to the Homepage
|
||||||
|
|
||||||
|
Navigate to `/path/to/gitlab/embedded/service/gitlab-rails/app/views/devise/shared/_footer.html.haml` and add the following:
|
||||||
|
|
||||||
|
```diff
|
||||||
|
+ = link_to _("Your ICP Filing Number"), "https://beian.miit.gov.cn/", target: '_blank', class: 'text-nowrap', rel: 'noopener noreferrer'
|
||||||
|
```
|
||||||
|
|
||||||
|
## Upgrading GitLab
|
||||||
|
|
||||||
|
### Downloading the GitLab CE Package
|
||||||
|
|
||||||
|
Download the deb package from the [GitLab Package page](https://packages.gitlab.com/gitlab/gitlab-ce) and transfer it to the server using `scp` or a similar tool.
|
||||||
|
|
||||||
|
### Stopping Memory-Intensive Services
|
||||||
|
|
||||||
|
```shell
|
||||||
|
gitlab-ctl stop puma
|
||||||
|
gitlab-ctl stop sidekiq
|
||||||
|
```
|
||||||
|
|
||||||
|
### Running a Backup
|
||||||
|
|
||||||
|
```shell
|
||||||
|
# Example: skip build artefacts and container registry, backing up only the database and repositories
|
||||||
|
sudo gitlab-backup create SKIP=artifacts,registry
|
||||||
|
```
|
||||||
|
|
||||||
|
### Installing
|
||||||
|
|
||||||
|
```shell
|
||||||
|
sudo dpkg -i gitlab-package.deb
|
||||||
|
```
|
||||||
@@ -2,4 +2,78 @@
|
|||||||
title: Use Gravatar in First-party Systems
|
title: Use Gravatar in First-party Systems
|
||||||
---
|
---
|
||||||
|
|
||||||
Insert a `<img src="https://gravatar.com/avatar/$SHA256(email)/?d=identicon">`.
|
[Gravatar](https://gravatar.com) (Globally Recognised Avatar) is a service that associates avatar images with email
|
||||||
|
addresses. When a user registers on your platform with their email, you can display their Gravatar as a default avatar
|
||||||
|
without building your own image upload and storage pipeline.
|
||||||
|
|
||||||
|
## How It Works
|
||||||
|
|
||||||
|
Gravatar exposes a simple HTTP endpoint. You compute the SHA256 hash of the user's **lowercased and trimmed** email
|
||||||
|
address, then embed it in an image URL:
|
||||||
|
|
||||||
|
```
|
||||||
|
https://gravatar.com/avatar/<hash>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Generating the Hash
|
||||||
|
|
||||||
|
### Node.js
|
||||||
|
|
||||||
|
```js
|
||||||
|
import { createHash } from "node:crypto";
|
||||||
|
|
||||||
|
const email = "user@example.com".trim().toLowerCase();
|
||||||
|
const hash = createHash("sha256").update(email).digest("hex");
|
||||||
|
const url = `https://gravatar.com/avatar/${hash}`;
|
||||||
|
```
|
||||||
|
|
||||||
|
### Python
|
||||||
|
|
||||||
|
```python
|
||||||
|
import hashlib
|
||||||
|
|
||||||
|
email = "user@example.com".strip().lower()
|
||||||
|
hash = hashlib.sha256(email.encode()).hexdigest()
|
||||||
|
url = f"https://gravatar.com/avatar/{hash}"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Shell
|
||||||
|
|
||||||
|
```shell
|
||||||
|
echo -n "user@example.com" | tr '[:upper:]' '[:lower:]' | sha256sum | cut -d ' ' -f1
|
||||||
|
```
|
||||||
|
|
||||||
|
## URL Parameters
|
||||||
|
|
||||||
|
The `/avatar/` endpoint accepts several query parameters to customise the result:
|
||||||
|
|
||||||
|
| Parameter | Description | Example |
|
||||||
|
|-----------|-----------------------------------------|----------------|
|
||||||
|
| `s` | Size in pixels (default: 80) | `?s=200` |
|
||||||
|
| `d` | Default image when no Gravatar is found | `?d=identicon` |
|
||||||
|
| `r` | Content rating (`g`, `pg`, `r`, `x`) | `?r=g` |
|
||||||
|
|
||||||
|
### Default Image Options (`d`)
|
||||||
|
|
||||||
|
- `identicon` — a geometric pattern based on the hash
|
||||||
|
- `robohash` — a generated robot image
|
||||||
|
- `retro` — an 8-bit style pixelated face
|
||||||
|
- `monsterid` — a generated monster cartoon
|
||||||
|
- `wavatar` — a generated face
|
||||||
|
- `mp` — a generic silhouette (Mystery Person)
|
||||||
|
- `blank` — a transparent PNG
|
||||||
|
- A custom URL (must be URL-encoded)
|
||||||
|
|
||||||
|
### Putting It Together
|
||||||
|
|
||||||
|
```html
|
||||||
|
<img
|
||||||
|
src="https://gravatar.com/avatar/a3b4c5d6e7f8?s=160&d=robohash&r=g"
|
||||||
|
alt="User avatar"
|
||||||
|
width="160"
|
||||||
|
height="160"
|
||||||
|
/>
|
||||||
|
```
|
||||||
|
|
||||||
|
Always pass the `d` parameter to avoid broken images for users who have not set up a Gravatar. `identicon` and
|
||||||
|
`robohash` are popular choices because they generate a unique, recognisable image for every hash.
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
title: Notifications
|
title: Notifications
|
||||||
---
|
---
|
||||||
|
|
||||||
# Microsoft Email Delivery Issues (@outlook, @hotmail, @live, @msn and custom domain emails hosted on Microsoft)
|
## Microsoft Email Delivery Issues (@outlook, @hotmail, @live, @msn and custom domain emails hosted on Microsoft)
|
||||||
|
|
||||||
> Updated at *19 May 2026*.
|
> Updated at *19 May 2026*.
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@ Please be advised that our automated email service is currently experiencing sev
|
|||||||
|
|
||||||
To ensure uninterrupted service, please follow the guidance below based on your account status:
|
To ensure uninterrupted service, please follow the guidance below based on your account status:
|
||||||
|
|
||||||
- For Prospective Users (Before Registration): Please **do not** use a Microsoft-hosted email address to register your account. You will not receive the essential activation link. Kindly use an alternative email service provider, such as your corporate email, QQ Mail, or NetEase (163) Mail to complete your registration.
|
- For Prospective Users (Before Registration): Please **do not** use a Microsoft-hosted email address to register your account. You will not receive the essential activation link. Kindly use an alternative email service provider, such as your corporate email, Gmail, etc. to complete your registration.
|
||||||
- For Existing Registered Users: If your profile is currently linked to an Outlook or Hotmail address, please log in immediately and update your primary email address. You can change this by navigating to your **[User Settings -> Preferences -> Emails](https://git.onixbyte.cn/-/profile/emails)** page. Failing to do so will result in missing critical repository updates, CI/CD pipeline failure logs, and Merge Request notifications.
|
- For Existing Registered Users: If your profile is currently linked to an Outlook or Hotmail address, please log in immediately and update your primary email address. You can change this by navigating to your **[User Settings -> Preferences -> Emails](https://git.onixbyte.cn/-/profile/emails)** page. Failing to do so will result in missing critical repository updates, CI/CD pipeline failure logs, and Merge Request notifications.
|
||||||
|
|
||||||
We are actively working to appeal this block with the Microsoft Postmaster Centre. We sincerely apologise for any inconvenience caused and appreciate your prompt cooperation in updating your contact details.
|
We are actively working to appeal this block with the Microsoft Postmaster Centre. We sincerely apologise for any inconvenience caused and appreciate your prompt cooperation in updating your contact details.
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
---
|
||||||
|
title: GitLab 运维
|
||||||
|
---
|
||||||
|
|
||||||
|
## 在国际版 GitLab 中设置默认语言为中文
|
||||||
|
|
||||||
|
GitLab 在代码中通过 `SWITCHER_MINIMUM_TRANSLATION_LEVEL` 变量将翻译程度低于 90% 的语言过滤了,简体中文为 84%,繁体中文为 83%
|
||||||
|
|
||||||
|
可以前往 `/path/to/gitlab/embedded/service/gitlab-rails/app/helpers/preferred_language_switcher_helper.rb` 中将代码修改如下:
|
||||||
|
|
||||||
|
```diff title="/path/to/gitlab/embedded/service/gitlab-rails/app/helpers/preferred_language_switcher_helper.rb"
|
||||||
|
- SWITCHER_MINIMUM_TRANSLATION_LEVEL = 90
|
||||||
|
+ SWITCHER_MINIMUM_TRANSLATION_LEVEL = 80
|
||||||
|
```
|
||||||
|
|
||||||
|
随后通过指令 `gitlab-ctl restart` 重启 GitLab 即可。
|
||||||
|
|
||||||
|
## 在首页添加备案信息
|
||||||
|
|
||||||
|
前往 `/path/to/gitlab/embedded/service/gitlab-rails/app/views/devise/shared/_footer.html.haml` 中,添加如下代码:
|
||||||
|
|
||||||
|
```diff
|
||||||
|
+ = link_to _("你的备案号"), "https://beian.miit.gov.cn/", target: '_blank', class: 'text-nowrap', rel: 'noopener noreferrer'
|
||||||
|
```
|
||||||
|
|
||||||
|
## 升级 GitLab
|
||||||
|
|
||||||
|
### 下载 GitLab Global CE 版安装包
|
||||||
|
|
||||||
|
从 [GitLab Package 下载页](https://packages.gitlab.com/gitlab/gitlab-ce) 下载 deb 工具包,并使用 scp 等工具将其上传到服务器中。
|
||||||
|
|
||||||
|
### 停用内存大户
|
||||||
|
|
||||||
|
```shell
|
||||||
|
gitlab-ctl stop puma
|
||||||
|
gitlab-ctl stop sidekiq
|
||||||
|
```
|
||||||
|
|
||||||
|
### 执行备份
|
||||||
|
|
||||||
|
```shell
|
||||||
|
# 示例:跳过构建附件和容器镜像仓库,仅备份数据库和代码仓库
|
||||||
|
sudo gitlab-backup create SKIP=artifacts,registry
|
||||||
|
```
|
||||||
|
|
||||||
|
### 进行安装
|
||||||
|
|
||||||
|
```shell
|
||||||
|
sudo dpkg -i gitlab-package.deb
|
||||||
|
```
|
||||||
@@ -2,4 +2,76 @@
|
|||||||
title: 在第一方系统中使用 Gravatar
|
title: 在第一方系统中使用 Gravatar
|
||||||
---
|
---
|
||||||
|
|
||||||
使用链接 https://gravatar.com/avatar/$SHA256(email)/?d=identicon 即可。
|
[Gravatar](https://gravatar.com)(Globally Recognised Avatar)是一项将头像图片与邮箱地址关联的服务。当用户使用邮箱在你的平台上注册时,你可以直接展示其
|
||||||
|
Gravatar 作为默认头像,而无需自行搭建图片上传和存储服务。
|
||||||
|
|
||||||
|
## 工作原理
|
||||||
|
|
||||||
|
Gravatar 提供了一个简单的 HTTP 端点。你只需计算用户**小写并去除首尾空格后**的邮箱地址的 SHA256 哈希值,然后将其嵌入图片
|
||||||
|
URL:
|
||||||
|
|
||||||
|
```
|
||||||
|
https://gravatar.com/avatar/<hash>
|
||||||
|
```
|
||||||
|
|
||||||
|
## 生成哈希
|
||||||
|
|
||||||
|
### Node.js
|
||||||
|
|
||||||
|
```js
|
||||||
|
import { createHash } from "node:crypto";
|
||||||
|
|
||||||
|
const email = "user@example.com".trim().toLowerCase();
|
||||||
|
const hash = createHash("sha256").update(email).digest("hex");
|
||||||
|
const url = `https://gravatar.com/avatar/${hash}`;
|
||||||
|
```
|
||||||
|
|
||||||
|
### Python
|
||||||
|
|
||||||
|
```python
|
||||||
|
import hashlib
|
||||||
|
|
||||||
|
email = "user@example.com".strip().lower()
|
||||||
|
hash = hashlib.sha256(email.encode()).hexdigest()
|
||||||
|
url = f"https://gravatar.com/avatar/{hash}"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Shell
|
||||||
|
|
||||||
|
```shell
|
||||||
|
echo -n "user@example.com" | tr '[:upper:]' '[:lower:]' | sha256sum | cut -d ' ' -f1
|
||||||
|
```
|
||||||
|
|
||||||
|
## URL 参数
|
||||||
|
|
||||||
|
`/avatar/` 端点接受以下查询参数来定制结果:
|
||||||
|
|
||||||
|
| 参数 | 描述 | 示例 |
|
||||||
|
|-----|------------------------|----------------|
|
||||||
|
| `s` | 图片尺寸(像素,默认 80) | `?s=200` |
|
||||||
|
| `d` | 未找到 Gravatar 时的默认图片 | `?d=identicon` |
|
||||||
|
| `r` | 内容分级(`g`、`pg`、`r`、`x`) | `?r=g` |
|
||||||
|
|
||||||
|
### 默认图片选项(`d`)
|
||||||
|
|
||||||
|
- `identicon` — 基于哈希值的几何图案
|
||||||
|
- `robohash` — 自动生成的机器人图片
|
||||||
|
- `retro` — 8-bit 风格的像素化人脸
|
||||||
|
- `monsterid` — 自动生成的怪物卡通
|
||||||
|
- `wavatar` — 自动生成的人脸
|
||||||
|
- `mp` — 通用剪影(Mystery Person)
|
||||||
|
- `blank` — 透明 PNG
|
||||||
|
- 自定义 URL(需经过 URL 编码)
|
||||||
|
|
||||||
|
### 完整示例
|
||||||
|
|
||||||
|
```html
|
||||||
|
<img
|
||||||
|
src="https://gravatar.com/avatar/a3b4c5d6e7f8?s=160&d=robohash&r=g"
|
||||||
|
alt="用户头像"
|
||||||
|
width="160"
|
||||||
|
height="160"
|
||||||
|
/>
|
||||||
|
```
|
||||||
|
|
||||||
|
始终传入 `d` 参数以避免未设置 Gravatar 的用户出现裂图。`identicon` 和 `robohash` 是常用的选择,因为它们能为每个哈希值生成唯一且易于辨识的图片。
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
title: 通知
|
title: 通知
|
||||||
---
|
---
|
||||||
|
|
||||||
# Microsoft 邮件投递问题(@outlook、@hotmail、@live、@msn 以及托管在 Microsoft 的自定义域名邮箱)
|
## Microsoft 邮件投递问题(@outlook、@hotmail、@live、@msn 以及托管在 Microsoft 的自定义域名邮箱)
|
||||||
|
|
||||||
> 更新于 *2026 年 5 月 19 日*
|
> 更新于 *2026 年 5 月 19 日*
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,9 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
markdown: {
|
||||||
|
showLineNumbers: true
|
||||||
|
},
|
||||||
lang: "en-gb",
|
lang: "en-gb",
|
||||||
locales: [
|
locales: [
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user