[Proposal] Gitea repository storage abstract #10961

Closed
opened 2025-11-02 09:23:22 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @lunny on GitHub (Jun 4, 2023).

Current status

Gitea's repositories are stored in a single directory that is configured via app.ini.

#24783 would like hot/cold storage. i.e. repo archived repository will be stored in a HDD but the hot repository will be stored in SSD

#22532 would like to store the repository in different directories with a hash

#13791 request a distributed git storages like gitaly

The problems

  • setting.Repository.RepoRootPath has been used by many places which fixed the usage to visit the repository
  • modules/git.Command has an option Dir which fixed the git command run directory

Resolution

  • First step, build an abstract level to visit repositories and avoid visit setting.Repository.RepoRootPath directly
  • Most function will accept a relative repository path
  • Refactor git.Command to visit the abstract level

Others

Some ideas are storing git repositories with repository id but not username/reponame, how to handle it?

Originally created by @lunny on GitHub (Jun 4, 2023). # Current status Gitea's repositories are stored in a single directory that is configured via app.ini. #24783 would like hot/cold storage. i.e. repo archived repository will be stored in a HDD but the hot repository will be stored in SSD #22532 would like to store the repository in different directories with a hash #13791 request a distributed git storages like gitaly # The problems - [ ] `setting.Repository.RepoRootPath` has been used by many places which fixed the usage to visit the repository - [ ] `modules/git.Command` has an option `Dir` which fixed the git command run directory # Resolution - First step, build an abstract level to visit repositories and avoid visit `setting.Repository.RepoRootPath` directly - Most function will accept a relative repository path - Refactor `git.Command` to visit the abstract level # Others Some ideas are storing git repositories with repository id but not `username/reponame`, how to handle it?
GiteaMirror added the type/proposaltype/refactoringtype/summary labels 2025-11-02 09:23:22 -06:00
Author
Owner

@6543 commented on GitHub (Jul 7, 2023):

to have nice proxy-pattern and can switch between different git backend's ...

TODO:

  • 1. move current implementation in subpackage
  • 2. move types into own subpackage
  • 3. define an engine
  • 4. migrate to engine in steps
@6543 commented on GitHub (Jul 7, 2023): to have nice proxy-pattern and can switch between different git backend's ... TODO: - [ ] 1. move current implementation in subpackage - [ ] 2. move types into own subpackage - [ ] 3. define an engine - [ ] 4. migrate to engine in steps
Author
Owner

@6543 commented on GitHub (Jul 7, 2023):

this also might enable to use https://gitlab.com/gitlab-org/gitaly for us ... or split gitea int microservices ... (as one option)

@6543 commented on GitHub (Jul 7, 2023): this also might enable to use https://gitlab.com/gitlab-org/gitaly for us ... or split gitea int microservices ... (as one option)
Author
Owner

@6543 commented on GitHub (Jul 7, 2023):

  • instead of individual git version checks all over the code - save capabilitis and let it report the engine
@6543 commented on GitHub (Jul 7, 2023): - [ ] instead of individual git version checks all over the code - save capabilitis and let it report the engine
Author
Owner

@6543 commented on GitHub (Jun 13, 2024):

Sorry somebody else might pick it up befor me ... i still intent to pick it up again if not addressed later :)

@6543 commented on GitHub (Jun 13, 2024): Sorry somebody else might pick it up befor me ... i still intent to pick it up again if not addressed later :)
Author
Owner

@lunny commented on GitHub (Jun 13, 2024):

I think this could be replaced by #29033

@lunny commented on GitHub (Jun 13, 2024): I think this could be replaced by #29033
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#10961