This repository has been archived on 2025-04-03. You can view files and clone it, but cannot push or open issues or pull requests.
linux-bash-scripts/gitea/auto_mapper
2024-08-06 21:21:20 +02:00
..
auto_mapper.py Fixed copy error when a team does not exist in target organization 2024-08-06 21:21:20 +02:00
README.md Added new script: gitlab teams auto mapper 2024-08-01 18:02:50 +02:00
requirements.txt Added new script: gitlab teams auto mapper 2024-08-01 18:02:50 +02:00

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)

License

MIT License. For more details, refer to the LICENSE file.

Usage

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

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.