CAD Provisioning is a standalone Go CLI for auditing and applying CAD repository policies in Gitea organizations. It also provisions eligible repositories automatically through signed Gitea webhooks.
audit: Report policy differences through read-only API calls.apply: Preview changes by default; write only with--execute.serve: Accept signed repository creation events durably and provision eligible repositories.
The application manages repository settings, Team attachments, direct collaborators, and branch/tag protections. It leaves CAD files, Git history, issue content, organization Project boards, and organization Team definitions unchanged.
Repository identity, organization, visibility, default branch, and non-template status are prerequisites for writes. Changes are independently read back and checked by a final audit. Unexpected Team attachments or protection rules require manual review.
Use writing modes only on explicitly authorized targets. Webhook provisioning requires a marker file on the policy default branch and persistent job storage. Operations can leave partial settings or temporary access after failure; there is no automatic rollback. Read the operations guide before enabling automatic provisioning.
- Go 1.26 for building and development.
- Unix/Linux
flocksupport; native Windows builds are currently unsupported. - Gitea API access and
GITEA_TOKENsupplied through secure environment/secret management. - For
serve, a separateGITEA_WEBHOOK_SECRETand a persistent, writable state directory. - Nix package and development shell outputs target
x86_64-linux.
From the repository root, using Go:
CGO_ENABLED=0 go build -o /tmp/cad-provisioning ./cmd/cad-provisioningOr build with Nix; the binary is result/bin/cad-provisioning:
nix build path:.#defaultSee development for nix develop and local verification.
Adapt the repository policy to your target and supply GITEA_TOKEN securely, then run:
/tmp/cad-provisioning audit \
--url https://gitea.example.org \
--repo ExampleEngineering/ornek-cad \
--policy policy/gitea-cad-repository.jsonExampleEngineering is an example organization configured by target.organization in the policy; replace it with your organization.
The organization in --repo must match the policy. The URL and repository name are also examples.
For a Nix build, substitute ./result/bin/cad-provisioning for /tmp/cad-provisioning.
- Configuration: JSON schemas, repository policy, Teams, Units, and protections.
- CLI reference: Modes, flags, examples, exit codes, and execution checks.
- Webhooks: Gitea setup, signatures, filtering, responses, and marker validation.
- Operations: Durable jobs, retention, security, verification, and recovery.
- Development: Go and Nix builds, tests, and platform limitations.
This project is licensed under the Apache License 2.0.