gitea/modules/markup
Lunny Xiao 32b97b3ce8
Uniform all temporary directories and allow customizing temp path (#32352)
This PR uniform all temporary directory usage so that it will be easier
to manage.

Relate to #31792 

- [x] Added a new setting to allow users to configure the global
temporary directory.
- [x] Move all temporary files and directories to be placed under
os.Temp()/gitea.
- [x] `setting.Repository.Local.LocalCopyPath` now will be
`setting.TempPath/local-repo` and the customized path is removed.
```diff
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;[repository.local]
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; Path for local repository copy. Defaults to  TEMP_PATH + `local-repo`, this is deprecated and cannot be changed
-;LOCAL_COPY_PATH = local-repo
```

- [x] `setting.Repository.Upload.TempPath` now will be
`settting.TempPath/uploads` and the customized path is removed.
```diff
;[repository.upload]
-;;
-;; Path for uploads. Defaults to TEMP_PATH + `uploads`
-;TEMP_PATH = uploads
```

- [x] `setting.Packages.ChunkedUploadPath` now will be
`settting.TempPath/package-upload` and the customized path is removed.
```diff
;[packages]
-;;
-;; Path for chunked uploads. Defaults it's `package-upload` under `TEMP_PATH` unless it's an absolute path.
-;CHUNKED_UPLOAD_PATH = package-upload
```

- [x] `setting.SSH.KeyTestPath` now will be
`settting.TempPath/ssh_key_test` and the customized path is removed.
```diff
[server]
-;;
-;; Directory to create temporary files in when testing public keys using ssh-keygen,
-;; default is the system temporary directory.
-;SSH_KEY_TEST_PATH =
```

TODO:
- [ ] setting.PprofDataPath haven't been changed because it may need to
be kept until somebody read it but temp path may be clean up any time.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-04-08 16:15:28 +00:00
..
asciicast Refactor context repository (#33202) 2025-01-12 03:39:46 +00:00
common Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
console Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
csv Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
external Uniform all temporary directories and allow customizing temp path (#32352) 2025-04-08 16:15:28 +00:00
internal Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
markdown Fix markdown render behaviors (#34122) 2025-04-05 11:56:48 +08:00
mdstripper Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
orgmode Refactor markup render to fix various path problems (#34114) 2025-04-04 23:45:23 +08:00
camo_test.go Use camo.Always instead of camo.Allways (#32097) 2024-09-21 12:50:54 +03:00
camo.go Use camo.Always instead of camo.Allways (#32097) 2024-09-21 12:50:54 +03:00
html_codepreview_test.go Refactor markup render system (#32612) 2024-11-24 16:18:57 +08:00
html_codepreview.go Refactor markup render system (#32612) 2024-11-24 16:18:57 +08:00
html_commit.go Refactor markup render to fix various path problems (#34114) 2025-04-04 23:45:23 +08:00
html_email.go Refactor markup render system (#32533) 2024-11-18 13:25:42 +08:00
html_emoji.go Refactor markup render system (#32533) 2024-11-18 13:25:42 +08:00
html_internal_test.go Refactor markup render to fix various path problems (#34114) 2025-04-04 23:45:23 +08:00
html_issue_test.go Refactor markup render to fix various path problems (#34114) 2025-04-04 23:45:23 +08:00
html_issue.go Refactor markup render to fix various path problems (#34114) 2025-04-04 23:45:23 +08:00
html_link.go Refactor markup render to fix various path problems (#34114) 2025-04-04 23:45:23 +08:00
html_mention.go Refactor markup render to fix various path problems (#34114) 2025-04-04 23:45:23 +08:00
html_node.go Refactor markup render to fix various path problems (#34114) 2025-04-04 23:45:23 +08:00
html_test.go Make markdown render match GitHub's behavior (#34129) 2025-04-06 17:34:59 +00:00
html.go Make markdown render match GitHub's behavior (#34129) 2025-04-06 17:34:59 +00:00
main_test.go Refactor markup render system (#32612) 2024-11-24 16:18:57 +08:00
render_helper.go Refactor markup render to fix various path problems (#34114) 2025-04-04 23:45:23 +08:00
render_link_test.go Use test context in tests and new loop system in benchmarks (#33648) 2025-02-20 09:57:40 +00:00
render_link.go Refactor markup render to fix various path problems (#34114) 2025-04-04 23:45:23 +08:00
render.go Fix markdown render behaviors (#34122) 2025-04-05 11:56:48 +08:00
renderer.go Refactor markup render system (#32612) 2024-11-24 16:18:57 +08:00
sanitizer_custom.go Refactor markup render system (#32533) 2024-11-18 13:25:42 +08:00
sanitizer_default_test.go Refactor global init code and add more comments (#33755) 2025-03-03 10:57:28 +08:00
sanitizer_default.go Fix "stop time tracking button" on navbar (#33084) 2025-01-03 04:01:05 +08:00
sanitizer_description_test.go Split sanitizer functions and fine-tune some tests (#31192) 2024-05-31 13:26:01 +00:00
sanitizer_description.go Split sanitizer functions and fine-tune some tests (#31192) 2024-05-31 13:26:01 +00:00
sanitizer.go Split sanitizer functions and fine-tune some tests (#31192) 2024-05-31 13:26:01 +00:00