gitea/models
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
..
actions Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
activities Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
admin Fix omitempty bug (#33663) 2025-02-20 12:39:21 -08:00
asymkey Uniform all temporary directories and allow customizing temp path (#32352) 2025-04-08 16:15:28 +00:00
auth Add new CLI flags to set name and scopes when creating a user with access token (#34080) 2025-04-02 22:00:54 +08:00
avatars Replace 10 more gt- classes with tw- (#29945) 2024-03-22 13:45:10 +00:00
db Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
dbfs Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
fixtures Refactor Branch struct in package modules/git (#33980) 2025-04-02 17:31:32 +00:00
git Rework create/fork/adopt/generate repository to make sure resources will be cleanup once failed (#31035) 2025-04-07 22:12:54 -07:00
issues Uniform all temporary directories and allow customizing temp path (#32352) 2025-04-08 16:15:28 +00:00
migrations Uniform all temporary directories and allow customizing temp path (#32352) 2025-04-08 16:15:28 +00:00
organization Check user/org repo limit instead of doer (#34147) 2025-04-07 23:45:31 -07:00
packages Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
perm Fix team permission (#34128) 2025-04-08 04:15:15 +00:00
project Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
pull Automerge supports deleting branch automatically after merging (#32343) 2025-01-10 03:51:03 +08:00
renderhelper Fix markdown render behaviors (#34122) 2025-04-05 11:56:48 +08:00
repo Uniform all temporary directories and allow customizing temp path (#32352) 2025-04-08 16:15:28 +00:00
secret Added Description Field for Secrets and Variables (#33526) 2025-03-17 19:24:54 +00:00
shared/types Refactor locale&string&template related code (#29165) 2024-02-14 21:48:45 +00:00
system Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
unit Fix team permission (#34128) 2025-04-08 04:15:15 +00:00
unittest Uniform all temporary directories and allow customizing temp path (#32352) 2025-04-08 16:15:28 +00:00
user Check user/org repo limit instead of doer (#34147) 2025-04-07 23:45:31 -07:00
webhook Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
main_test.go make writing main test easier (#27270) 2023-09-28 01:38:53 +00:00
repo_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
repo.go Fix issue comment number (#30556) 2024-12-30 14:35:46 -08:00