gitea/models/migrations
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
..
base Uniform all temporary directories and allow customizing temp path (#32352) 2025-04-08 16:15:28 +00:00
fixtures Remove If Exist check on migration for mssql because that syntax required SQL server 2016 (#30894) 2024-05-11 22:16:09 +08:00
v1_6 Enable more revive linter rules (#30608) 2024-04-22 11:48:42 +00:00
v1_7 Rename Sync2 -> Sync (#26479) 2023-08-13 21:17:21 +02:00
v1_8 Rename Sync2 -> Sync (#26479) 2023-08-13 21:17:21 +02:00
v1_9 Enable more revive linter rules (#30608) 2024-04-22 11:48:42 +00:00
v1_10 Rename Sync2 -> Sync (#26479) 2023-08-13 21:17:21 +02:00
v1_11 Enable more revive linter rules (#30608) 2024-04-22 11:48:42 +00:00
v1_12 Remove context from git struct (#33793) 2025-03-04 11:56:11 -08:00
v1_13 Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
v1_14 Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
v1_15 Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
v1_16 Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
v1_17 Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
v1_18 Fix wrong table name (#30557) 2024-04-23 03:00:57 +00:00
v1_19 Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
v1_20 Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
v1_21 Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
v1_22 Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
v1_23 Issue time estimate, meaningful time tracking (#23113) 2024-12-05 13:07:53 +00:00
v1_24 Add anonymous access support for private repositories (backend) (#33257) 2025-03-28 22:42:29 +08:00
migrations_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
migrations.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00