浏览代码

制作本地补丁:88A780671C3EB0DE.patch

SongZihuan 1 月之前
父节点
当前提交
9496f00c4c

+ 4 - 4
patch/REDME.md

@@ -4,15 +4,15 @@
 
 
 ### 补丁文件命名规则
 ### 补丁文件命名规则
 
 
-补丁区分为上游(upstream)和本地(downstream)两种。 目前上游指的是`Gogs`对`Huan-Gogs`的补丁,本地则指的是`Huan-Gogs`对`Gogs`的补丁。
+补丁区分为上游(`upstream`)和本地(`localstream`)两种。 目前上游指的是`Gogs`对`Huan-Gogs`的补丁,本地则指的是`Huan-Gogs`对`Gogs`的补丁。
 
 
 上游补丁文件夹下(`upstream`)记录下每天获取的上游补丁(以`YYYYMMDD`命名,例如20250318表示2025年03月18日)。
 上游补丁文件夹下(`upstream`)记录下每天获取的上游补丁(以`YYYYMMDD`命名,例如20250318表示2025年03月18日)。
 
 
 每个补丁文件夹(例如:`20250318`)下有`README.md`,记录每个补丁是来自哪里的,什么时候注入程序的。
 每个补丁文件夹(例如:`20250318`)下有`README.md`,记录每个补丁是来自哪里的,什么时候注入程序的。
 
 
-补丁文件命名方式:补丁对应的"u/l-上游(本地)commit(前)-补丁对应的上游(本地)commit-注入到项目的commit-YYYYMMDD日期-随机数3位(防止冲突)",对前面所属内容进行MD5后采用16位大写。
+补丁文件命名方式:补丁对应的"u/l-即将注入的上游(本地)commit(前)-补丁对应的上游(本地)的最后一个commit-YYYYMMDD日期-随机数3位(防止冲突)",对前面所属内容进行MD5后采用16位大写。
 
 
-例如:u-3a637bd2-8acqqbc8-fb722406-20250320-022,得到结果如下:7257BD9350D5531C
+例如:u-3a637bd2-8acqqbc8-20250320-022,得到结果如下:EA9AF3120CB3C57D
 
 
-因此`patch`文件就叫做:`7257BD9350D5531C.patch`
+因此`patch`文件就叫做:`EA9AF3120CB3C57D.patch`
 
 

+ 0 - 0
patch/downstream/20250320/9F1436E39C95D59E.patch → patch/localstream/20250320/9F1436E39C95D59E.patch


+ 0 - 0
patch/downstream/20250320/B4A9891AC46BFD81.patch → patch/localstream/20250320/B4A9891AC46BFD81.patch


+ 42 - 0
patch/localstream/20250328/88A780671C3EB0DE.patch

@@ -0,0 +1,42 @@
+Subject: [PATCH] 更新 SMTP 认证错误处理逻辑
+---
+Index: internal/auth/smtp/provider.go
+IDEA additional info:
+Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
+<+>UTF-8
+===================================================================
+diff --git a/internal/auth/smtp/provider.go b/internal/auth/smtp/provider.go
+--- a/internal/auth/smtp/provider.go	(revision 2c11c2ff9b24f536e84add7d415c7f601453833f)
++++ b/internal/auth/smtp/provider.go	(revision b9cf06c505c122da0f63a7c0be5ac3f27f8f6e75)
+@@ -66,8 +66,9 @@
+ 
+ 		// Check standard error format first, then fallback to the worse case.
+ 		tperr, ok := err.(*textproto.Error)
+-		if (ok && tperr.Code == 535) ||
+-			strings.Contains(err.Error(), "Username and Password not accepted") {
++		if (ok && (tperr.Code == 526 || tperr.Code == 530 || tperr.Code == 534 || tperr.Code == 535 || tperr.Code == 536)) ||
++			strings.Contains(err.Error(), "Username and Password not accepted") ||
++			strings.Contains(err.Error(), "Authentication failure") {
+ 			return nil, auth.ErrBadCredentials{Args: map[string]any{"login": login}}
+ 		}
+ 		return nil, err
+Index: internal/route/user/auth.go
+IDEA additional info:
+Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
+<+>UTF-8
+===================================================================
+diff --git a/internal/route/user/auth.go b/internal/route/user/auth.go
+--- a/internal/route/user/auth.go	(revision 2c11c2ff9b24f536e84add7d415c7f601453833f)
++++ b/internal/route/user/auth.go	(revision b9cf06c505c122da0f63a7c0be5ac3f27f8f6e75)
+@@ -171,9 +171,9 @@
+ 		case database.IsErrLoginSourceMismatch(err):
+ 			c.FormErr("LoginSource")
+ 			c.RenderWithErr(c.Tr("form.auth_source_mismatch"), LOGIN, &f)
+-
+ 		default:
+-			c.Error(err, "authenticate user")
++			c.FormErr("UserName", "Password", "LoginSource")
++			c.RenderWithErr(err.Error(), LOGIN, &f)
+ 		}
+ 		for i := range loginSources {
+ 			if loginSources[i].IsDefault {

+ 11 - 2
patch/downstream/20250320/README.md → patch/localstream/README.md

@@ -1,14 +1,23 @@
 ## 本地补丁
 ## 本地补丁
 
 
+### 日期 2025年03月28日
+
+#### 补丁 [88A780671C3EB0DE.patch](20250328/88A780671C3EB0DE.patch)
+
+本地([Huan Gogs](https://github.com/SongZihuan/huan-gogs))补丁:[#b9cf06c5](https://github.com/SongZihuan/huan-gogs/commit/b9cf06c505c122da0f63a7c0be5ac3f27f8f6e75) -> [#b9cf06c5](https://github.com/SongZihuan/huan-gogs/commit/b9cf06c505c122da0f63a7c0be5ac3f27f8f6e75)
+
+补丁注入上游([Gogs](https://github.com/SongZihuan/gogs)):[#ea7fab18](https://github.com/gogs/gogs/commit/ea7fab180d7d6e8a7cbd96a210c1e65ca876e01b)
+
+
 ### 日期 2025年03月20日
 ### 日期 2025年03月20日
 
 
-### 补丁 [B4A9891AC46BFD81.patch](B4A9891AC46BFD81.patch)
+#### 补丁 [B4A9891AC46BFD81.patch](20250320/B4A9891AC46BFD81.patch)
 
 
 本地([Huan Gogs](https://github.com/SongZihuan/huan-gogs))补丁:[#d695c022](https://github.com/SongZihuan/huan-gogs/commit/d695c02223bfe98a6fb2f329d25f2a9c06ea53d6) -> [#ed742206](https://github.com/SongZihuan/huan-gogs/commit/ed74220689f27d4eaabf40ca8ae27d960ba217cb)
 本地([Huan Gogs](https://github.com/SongZihuan/huan-gogs))补丁:[#d695c022](https://github.com/SongZihuan/huan-gogs/commit/d695c02223bfe98a6fb2f329d25f2a9c06ea53d6) -> [#ed742206](https://github.com/SongZihuan/huan-gogs/commit/ed74220689f27d4eaabf40ca8ae27d960ba217cb)
 
 
 补丁注入上游([Gogs](https://github.com/SongZihuan/gogs)):[#4acaaac8](https://github.com/SongZihuan/gogs/commit/4acaaac85aca427771030ab2e9a1465e9517ba1d)
 补丁注入上游([Gogs](https://github.com/SongZihuan/gogs)):[#4acaaac8](https://github.com/SongZihuan/gogs/commit/4acaaac85aca427771030ab2e9a1465e9517ba1d)
 
 
-### 补丁 [9F1436E39C95D59E.patch](9F1436E39C95D59E.patch)
+#### 补丁 [9F1436E39C95D59E.patch](20250320/9F1436E39C95D59E.patch)
 
 
 本地([Huan Gogs](https://github.com/SongZihuan/huan-gogs))补丁:[#193cebe0](https://github.com/SongZihuan/huan-gogs/commit/193cebe00479c3552913912b04f045f5bdc22b2a) -> [#193cebe0](https://github.com/SongZihuan/huan-gogs/commit/193cebe00479c3552913912b04f045f5bdc22b2a)
 本地([Huan Gogs](https://github.com/SongZihuan/huan-gogs))补丁:[#193cebe0](https://github.com/SongZihuan/huan-gogs/commit/193cebe00479c3552913912b04f045f5bdc22b2a) -> [#193cebe0](https://github.com/SongZihuan/huan-gogs/commit/193cebe00479c3552913912b04f045f5bdc22b2a)
 
 

+ 1 - 1
patch/upstream/20250320/README.md → patch/upstream/README.md

@@ -2,7 +2,7 @@
 
 
 ### 日期 2025年03月20日
 ### 日期 2025年03月20日
 
 
-### 补丁 [40EE6750AED2E6EA.patch](40EE6750AED2E6EA.patch)
+#### 补丁 [40EE6750AED2E6EA.patch](20250320/40EE6750AED2E6EA.patch)
 
 
 上游([Gogs](https://github.com/SongZihuan/gogs))补丁:[#3a952bd2](https://github.com/SongZihuan/gogs/commit/3a952bd248cd2877edbeca3e6fed0e7ce33ce32d) -> [#4acaaac8](https://github.com/SongZihuan/gogs/commit/4acaaac85aca427771030ab2e9a1465e9517ba1d)
 上游([Gogs](https://github.com/SongZihuan/gogs))补丁:[#3a952bd2](https://github.com/SongZihuan/gogs/commit/3a952bd248cd2877edbeca3e6fed0e7ce33ce32d) -> [#4acaaac8](https://github.com/SongZihuan/gogs/commit/4acaaac85aca427771030ab2e9a1465e9517ba1d)