Description
- Gitea version (or commit ref): 1.3.2-1
I have been trying to configure my gitea server and have been thoroughly confused by all of the path settings. I started digging through the code and figured out many of the settings but soon felt like I was trying to consume a big bowl of spaghetti. Here's a table that I started to try to make sense of it all. I tried to use curly braces {} to denote variables and square brackets to indicate an app.ini value.
gitea-path-settings.csv.txt
Questions to help my own understanding:
-
Can all of these directories be considered "cache data" such that the directory could be deleted and gitea will be able to rebuild the data (at the expense of time/performance)? Are there others that should be included?
Repository.Local.LocalCopyPath
Repository.Local.LocalWikiPath
Repository.Upload.TempPath
Indexer.IssuePath
Indexer.RepoPath
SessionConfig.Provider (when using "file" provider)
StaticRootPath -
Architecturally, what is the difference between AppWorkPath and AppDataPath? (other than the default setting that AppDataPath is a subdirectory "data" of AppWorkPath) It seems that if there was a difference, it has been lost. For example are these defaults intentional: SessionConfig.Provider = {AppDataPath}/session vs. LogRootPath = {AppWorkPath}/log?
-
Is there an intentional design decision to use AppDataPath in the default path but to try to prepend AppWorkPath if the app.ini setting is not an absolute path?
Ideas for changes:
- Leave code as is and simply expand documentation
- "Bug fixes"/minimal changes
- Change Repository.Upload.TempPath to be consistent with Repository.Local.LocalCopyPath (AppWorkPath vs AppDataPath)
- Expose AppWorkPath and CustomPath via app.ini (they are currently set internally or by environment variables)
- Refactor
- Create a single "LocalCache" path setting and remove the options for LocalCopyPath, LocalWikiPath, Indexer.IssuePath, etc. and simply make those subdirectories of LocalCache. I wonder if there is a use case which really wants control of each of those paths individually?
- Create a function that accepts a path setting (or the app.ini key), a path expansion (to prepend if needed) and the default setting as inputs and returns the valid path. This would consolidate many instances of repeated code and would eliminate unintentional design decisions.