Skip to content

Commit 177cea7

Browse files
authored
Make offline mode as default to no connect external avatar service by default (#28548)
To keep user's privacy, make offline mode as true by default. Users can still change it from installation ui and app.ini
1 parent fe5a616 commit 177cea7

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

custom/conf/app.example.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ RUN_USER = ; git
234234
;MINIMUM_KEY_SIZE_CHECK = false
235235
;;
236236
;; Disable CDN even in "prod" mode
237-
;OFFLINE_MODE = false
237+
;OFFLINE_MODE = true
238238
;;
239239
;; TLS Settings: Either ACME or manual
240240
;; (Other common TLS configuration are found before)

docs/content/administration/config-cheat-sheet.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a
357357
- `SSH_PER_WRITE_PER_KB_TIMEOUT`: **10s**: Timeout per Kb written to SSH connections.
358358
- `MINIMUM_KEY_SIZE_CHECK`: **true**: Indicate whether to check minimum key size with corresponding type.
359359

360-
- `OFFLINE_MODE`: **false**: Disables use of CDN for static files and Gravatar for profile pictures.
360+
- `OFFLINE_MODE`: **true**: Disables use of CDN for static files and Gravatar for profile pictures.
361361
- `CERT_FILE`: **https/cert.pem**: Cert file path used for HTTPS. When chaining, the server certificate must come first, then intermediate CA certificates (if any). This is ignored if `ENABLE_ACME=true`. Paths are relative to `CUSTOM_PATH`.
362362
- `KEY_FILE`: **https/key.pem**: Key file path used for HTTPS. This is ignored if `ENABLE_ACME=true`. Paths are relative to `CUSTOM_PATH`.
363363
- `STATIC_ROOT_PATH`: **_`StaticRootPath`_**: Upper level of template and static files path.

docs/content/administration/config-cheat-sheet.zh-cn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ menu:
346346
- `SSH_PER_WRITE_TIMEOUT`: **30s**:对 SSH 连接的任何写入设置超时。(将其设置为 -1 可以禁用所有超时。)
347347
- `SSH_PER_WRITE_PER_KB_TIMEOUT`: **10s**:对写入 SSH 连接的每 KB 设置超时。
348348
- `MINIMUM_KEY_SIZE_CHECK`: **true**:指示是否检查最小密钥大小与相应类型。
349-
- `OFFLINE_MODE`: **false**:禁用 CDN 用于静态文件和 Gravatar 用于个人资料图片。
349+
- `OFFLINE_MODE`: **true**:禁用 CDN 用于静态文件和 Gravatar 用于个人资料图片。
350350
- `CERT_FILE`: **https/cert.pem**:用于 HTTPS 的证书文件路径。在链接时,服务器证书必须首先出现,然后是中间 CA 证书(如果有)。如果 `ENABLE_ACME=true`,则此设置会被忽略。路径相对于 `CUSTOM_PATH`
351351
- `KEY_FILE`: **https/key.pem**:用于 HTTPS 的密钥文件路径。如果 `ENABLE_ACME=true`,则此设置会被忽略。路径相对于 `CUSTOM_PATH`
352352
- `STATIC_ROOT_PATH`: **_`StaticRootPath`_**:模板和静态文件路径的上一级。

modules/repository/commits_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,10 @@ func TestPushCommits_AvatarLink(t *testing.T) {
126126
}
127127

128128
setting.GravatarSource = "https://secure.gravatar.com/avatar"
129+
setting.OfflineMode = true
129130

130131
assert.Equal(t,
131-
"https://secure.gravatar.com/avatar/ab53a2911ddf9b4817ac01ddcd3d975f?d=identicon&s="+strconv.Itoa(28*setting.Avatar.RenderedSizeFactor),
132+
"/avatars/avatar2?size="+strconv.Itoa(28*setting.Avatar.RenderedSizeFactor),
132133
pushCommits.AvatarLink(db.DefaultContext, "[email protected]"))
133134

134135
assert.Equal(t,

modules/setting/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ func loadServerFrom(rootCfg ConfigProvider) {
315315
RedirectOtherPort = sec.Key("REDIRECT_OTHER_PORT").MustBool(false)
316316
PortToRedirect = sec.Key("PORT_TO_REDIRECT").MustString("80")
317317
RedirectorUseProxyProtocol = sec.Key("REDIRECTOR_USE_PROXY_PROTOCOL").MustBool(UseProxyProtocol)
318-
OfflineMode = sec.Key("OFFLINE_MODE").MustBool()
318+
OfflineMode = sec.Key("OFFLINE_MODE").MustBool(true)
319319
if len(StaticRootPath) == 0 {
320320
StaticRootPath = AppWorkPath
321321
}

0 commit comments

Comments
 (0)