1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-11-29 09:31:11 -05:00
forgejo/services
wxiaoguang 5d77691d42
Improve template system and panic recovery (#24461)
Partially for #24457

Major changes:

1. The old `signedUserNameStringPointerKey` is quite hacky, use
`ctx.Data[SignedUser]` instead
2. Move duplicate code from `Contexter` to `CommonTemplateContextData`
3. Remove incorrect copying&pasting code `ctx.Data["Err_Password"] =
true` in API handlers
4. Use one unique `RenderPanicErrorPage` for panic error page rendering
5. Move `stripSlashesMiddleware` to be the first middleware
6. Install global panic recovery handler, it works for both `install`
and `web`
7. Make `500.tmpl` only depend minimal template functions/variables,
avoid triggering new panics

Screenshot:

<details>

![image](https://user-images.githubusercontent.com/2114189/235444895-cecbabb8-e7dc-4360-a31c-b982d11946a7.png)

</details>
2023-05-04 14:36:34 +08:00
..
actions Handle canceled workflow as a warning instead of a fail (#24282) 2023-04-23 14:41:55 -04:00
agit add user rename endpoint to admin api (#22789) 2023-03-14 03:45:21 -04:00
asymkey Add context cache as a request level cache (#22294) 2023-02-15 21:37:34 +08:00
attachment Preserve file size when creating attachments (#23406) 2023-03-12 03:48:07 -04:00
auth Improve template system and panic recovery (#24461) 2023-05-04 14:36:34 +08:00
automerge Add force_merge to merge request and fix checking mergable (#23010) 2023-02-21 08:42:07 -06:00
context Use User.ID instead of User.Name in ActivityPub API for Person IRI (#23823) 2023-04-04 10:08:23 +08:00
convert Display when a repo was archived (#22664) 2023-04-26 10:46:26 -04:00
cron Add Cargo package registry (#21888) 2023-02-05 18:12:31 +08:00
externalaccount Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
forms Add Debian package registry (#24426) 2023-05-02 12:31:35 -04:00
gitdiff Update go tool dependencies, restructure lint targets (#24239) 2023-04-22 14:53:00 -04:00
issue Use more specific test methods (#24265) 2023-04-22 17:56:27 -04:00
lfs Fix auth check bug (#24382) 2023-04-27 22:43:27 +02:00
mailer Add ntlm authentication support for mail (#23811) 2023-05-02 17:40:46 -04:00
markup Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
migrations Improve test logger (#24235) 2023-04-21 16:32:25 -04:00
mirror Fill head commit to in payload when notifying push commits for mirroring (#23215) 2023-03-03 23:45:53 -05:00
org Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
packages Implement Cargo HTTP index (#24452) 2023-05-03 16:58:43 -04:00
pull Make more functions use ctx instead of db.DefaultContext (#24068) 2023-04-14 14:18:28 -04:00
release Delete deleted release attachments immediately from storage (#23913) 2023-04-06 18:01:36 -04:00
repository Fix unclear IsRepositoryExist logic (#24374) 2023-04-28 14:14:26 -04:00
task Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
user add user rename endpoint to admin api (#22789) 2023-03-14 03:45:21 -04:00
webhook Merge setting.InitXXX into one function with options (#24389) 2023-05-04 11:55:35 +08:00
wiki Fix bug when deleting wiki with no code write permission (#24274) 2023-04-23 17:22:16 -04:00