Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

CAD Provisioning

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.

Capabilities

  • 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.

Safety and operation

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.

Requirements

  • Go 1.26 for building and development.
  • Unix/Linux flock support; native Windows builds are currently unsupported.
  • Gitea API access and GITEA_TOKEN supplied through secure environment/secret management.
  • For serve, a separate GITEA_WEBHOOK_SECRET and a persistent, writable state directory.
  • Nix package and development shell outputs target x86_64-linux.

Build

From the repository root, using Go:

CGO_ENABLED=0 go build -o /tmp/cad-provisioning ./cmd/cad-provisioning

Or build with Nix; the binary is result/bin/cad-provisioning:

nix build path:.#default

See development for nix develop and local verification.

Read-only quick start

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.json

ExampleEngineering 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.

Documentation

  • 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.

License

This project is licensed under the Apache License 2.0.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages