42 lines
2.9 KiB
Markdown
42 lines
2.9 KiB
Markdown
# Gitea Teams auto mapping
|
|
|
|
## Description
|
|
This script will copy / update all teams (excluding `Owners`) from a specified source organization to all other organizations (except for excluded ones). It can be used to achieve a more controllable permissions hierarchy within Gitea, similar to sub-groups as being available in Gitlab.
|
|
|
|
## Author(s)
|
|
- [Enrico Ludwig](https://git.zion-networks.de/eludwig) <[enrico.ludwig@zion-networks.de](mailto:enrico.ludwig@zion-networks.de?subject=Gitlab%20to%20Gitea%20migration%20script)>
|
|
|
|
## License
|
|
MIT License. For more details, refer to the [LICENSE](https://git.zion-networks.de/ZionNetworks/linux-bash-scripts/src/branch/main/LICENSE) file.
|
|
|
|
## Usage
|
|
```sh
|
|
pip install -r requirements.txt
|
|
python3 auto_mapper.py [options]
|
|
```
|
|
|
|
## Available script arguments
|
|
|
|
| Argument | Type | Description | Valid values |
|
|
| --------------- | --------------- | ----------------------------------------------- | ----------------------------------------------------------------- |
|
|
| `--host` | Key-Value | Specify the Gitea instance host | An IP address or hostname |
|
|
| `--port` | Key-Value | Specify the Gitea instance port | A valid port from 1 to 65535 |
|
|
| `--token` | Key-Value | Specify the Gitea instance token | A valid Gitea user token string |
|
|
| `--source-orga` | Key-Value | Specify the source organization | The name of the source organization |
|
|
| `--exclude` | Multi Key-Value | Specify organizations to exclude | Can be used multiple times to exclude specific organizations |
|
|
| `--ssl` | Switch | Specify if the Gitea instance uses SSL | Enable SSL support (https) |
|
|
| `--debug` | Switch | Enable debug logging | Enable debug output |
|
|
| `--dry-run` | Switch | Enable dry-run mode, no changes will be made | Enable dry-run mode to prevent changes |
|
|
| `--update` | Switch | Updates existing teams in target organizations | Enable to update already existing teams at target organizations |
|
|
| `--override` | Switch | Override existing teams in target organizations | Enable to override already existing teams at target organizations |
|
|
|
|
## Example
|
|
```sh
|
|
python3 auto_mapper.py \
|
|
--host "127.0.0.1" \
|
|
--port 3000 \
|
|
--token "your-secret-user-token" \
|
|
--source-orga "MyTemplateOrga"
|
|
```
|
|
|
|
For any issues, please refer to the contact details provided in the author's contact information section. |