gitea/routers/web
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 +07:00
..
admin Enable addtional linters (#34085) 2025-04-01 10:14:01 +07:00
auth Enable addtional linters (#34085) 2025-04-01 10:14:01 +07:00
devtest Enable addtional linters (#34085) 2025-04-01 10:14:01 +07:00
events Move context from modules to services (#29440) 2024-02-27 08:12:22 +07:00
explore Improve issue & code search (#33860) 2025-03-13 11:07:48 +07:00
feed Enable addtional linters (#34085) 2025-04-01 10:14:01 +07:00
healthcheck Always enable caches (#28527) 2023-12-19 09:29:05 +07:00
misc Refactor cache-control (#33861) 2025-03-13 07:04:50 +07:00
org Fix team permission (#34128) 2025-04-08 04:15:15 +07:00
repo Uniform all temporary directories and allow customizing temp path (#32352) 2025-04-08 16:15:28 +07:00
shared Allow filtering issues by any assignee (#33343) 2025-03-21 04:25:36 +07:00
user Add new CLI flags to set name and scopes when creating a user with access token (#34080) 2025-04-02 22:00:54 +07:00
base.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +07:00
githttp.go Fix git client accessing renamed repo (#34034) 2025-03-28 07:28:58 +07:00
goget.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +07:00
home.go Refactor error system (#33610) 2025-02-16 22:13:17 +07:00
metrics.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +07:00
nodeinfo.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +07:00
passkey.go Move context from modules to services (#29440) 2024-02-27 08:12:22 +07:00
swagger_json.go Move context from modules to services (#29440) 2024-02-27 08:12:22 +07:00
web.go Remove dead code: RepoRef (#34131) 2025-04-06 20:08:10 +07:00
webfinger.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +07:00