https://github.com/tbxark/gitea-mirror-reauth
Quickly modify the authorization information of a Gitea mirror repository.
https://github.com/tbxark/gitea-mirror-reauth
git gitea gitea-mirror golang
Last synced: 4 months ago
JSON representation
Quickly modify the authorization information of a Gitea mirror repository.
- Host: GitHub
- URL: https://github.com/tbxark/gitea-mirror-reauth
- Owner: TBXark
- License: mit
- Created: 2024-05-10T12:42:01.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-05-11T05:56:33.000Z (about 1 year ago)
- Last Synced: 2025-01-19T21:43:20.255Z (6 months ago)
- Topics: git, gitea, gitea-mirror, golang
- Language: Go
- Homepage:
- Size: 31.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gitea-mirror-reauth
As Gitea does not provide a simple way to modify the authorization information of mirrored repositories, I wrote this tool to solve this problem.
## Installation
```bash
go install github.com/TBXark/gitea-mirror-reauth@latest
```## Usage
```
gitea-mirror-reauth
expected 'preview', 'auto-replace' or 'token-replace' subcommands
Usage:
preview preview all gitea repositories
auto-replace auto replace gitea repositories token by config
token-replace replace gitea repositories token manually```
### preview
Check all the repositories in gitea-repositories and output the repository information
```
Usage of preview:
-gitea-dir string
gitea repositories dir (default "/home/git/data/gitea-repositories")
-help
help
```### auto-replace
Replace the token in the repository according to the configuration file
```
Usage of auto-replace:
-config string
config file path
-confirm
confirm
-gitea-dir string
gitea repositories dir (default "/home/git/data/gitea-repositories")
-help
help
```
Configuration file is json format, key is regular expression, value is new token.
```json
{
"regex": "NEW_TOKEN",
"tbxark/private_repo_name": "NEW_PRIVATE_SCOPE_TOKEN",
"tbxark/.*": "NEW_PUBLIC_SCOPE_TOKEN"
}
```### token-replace
Find all the tokens in the repository and replace them
```
Usage of token-replace:
-gitea-dir string
gitea repositories dir (default "/home/git/data/gitea-repositories")
-help
help
```## License
**gitea-mirror-reauth** is released under the MIT license. See [LICENSE](LICENSE) for details.