Skip to main content
Version: 0.4.x

Gitea Resources

Four Crossplane XRs provision Gitea resources via the Gitea REST API. They are used by the portal scaffold flow to create repositories and ensure the tenant organisation structure exists before any code or GitOps manifest is committed.

All four XRs share the same credentialsSecretRef pattern — a Secret in tfvars format:

gitea_token = "your-gitea-admin-api-token"

No password field is needed. Initial user passwords are auto-generated.

KindProvisionsPackage
XGiteaOrgGitea organisationgitea-org
XGiteaTeamTeam within an org, with managed membershipgitea-team
XGiteaUserGitea user accountgitea-user
XGiteaRepositoryRepository owned by an orggitea-repository

All kinds are in group platform.wxops.cloud/v1alpha1, cluster-scoped.

XGiteaOrg

Manages a Gitea organisation with visibility and metadata.

KindXGiteaOrg
Pluralxgiteaorgs

spec.parameters

FieldTypeRequiredDefaultDescription
giteaUrlstringyesBase URL of the Gitea instance (e.g. https://gitea.example.com).
insecurebooleanfalseSkip TLS verification. Use only for local/dev instances.
orgNamestringyesOrganisation login name. Immutable after creation.
fullNamestring""Display name shown in the Gitea UI.
descriptionstring""Organisation description.
websitestring""Organisation website URL.
locationstring""Organisation location.
visibilitystring"public"One of public, limited, private.
repoAdminChangeTeamAccessbooleanfalseAllow repository admins (non-org-admins) to add and remove teams from repositories.
credentialsSecretRef.namestringyesSecret holding the Gitea admin token.
credentialsSecretRef.namespacestringyesNamespace of the Secret.

Example

apiVersion: platform.wxops.cloud/v1alpha1
kind: XGiteaOrg
metadata:
name: rocket-team-org
spec:
parameters:
giteaUrl: https://gitea.example.com
orgName: rocket-team
fullName: Rocket Team
description: Rocket Team - W'xOps tenant org
visibility: private
credentialsSecretRef:
name: gitea-admin-credentials
namespace: crossplane-system

XGiteaTeam

Manages a team inside a Gitea organisation, including managed membership reconciliation.

KindXGiteaTeam
Pluralxgiteateams

spec.parameters

FieldTypeRequiredDefaultDescription
giteaUrlstringyesBase URL of the Gitea instance.
insecurebooleanfalseSkip TLS verification.
orgNamestringyesOrganisation this team belongs to.
teamNamestringyesTeam name within the organisation.
descriptionstring""Team description.
permissionstring"read"Base permission for all team members: none, read, write, admin, owner.
unitsstring"repo.code,repo.issues,repo.pulls"Comma-separated repository feature units. Valid values: repo.code, repo.issues, repo.ext_issues, repo.wiki, repo.pulls, repo.releases, repo.projects, repo.ext_wiki. Do not include repo.actions or repo.packages here — use enableActions/enablePackages instead.
enableActionsbooleanfalseGrant access to the Actions (CI/CD) unit. Applied via direct Gitea API because the Terraform provider does not support this unit.
actionsReadOnlybooleanfalseCap repo.actions to read permission, regardless of the base permission. Only effective when enableActions: true.
enablePackagesbooleanfalseGrant access to the Packages (container/artifact registry) unit. Applied via direct Gitea API.
packagesReadOnlybooleanfalseCap repo.packages to read permission. Only effective when enablePackages: true.
includeAllRepositoriesbooleanfalseAutomatically grant access to all org repositories.
canCreateReposbooleanfalseAllow team members to create repositories in the org.
membersstring""Comma-separated Gitea usernames. Membership is reconciled on every sync — removing a name removes the user from the team. Works for both managed (XGiteaUser) and pre-existing users.
credentialsSecretRef.namestringyesSecret holding the Gitea admin token.
credentialsSecretRef.namespacestringyesNamespace of the Secret.

Example

apiVersion: platform.wxops.cloud/v1alpha1
kind: XGiteaTeam
metadata:
name: rocket-team-developers
spec:
parameters:
giteaUrl: https://gitea.example.com
orgName: rocket-team
teamName: developers
permission: write
enableActions: true
enablePackages: true
packagesReadOnly: true
members: "alice,bob,carol"
credentialsSecretRef:
name: gitea-admin-credentials
namespace: crossplane-system

XGiteaUser

Manages a single Gitea user account lifecycle (create / update / delete).

KindXGiteaUser
Pluralxgiteausers

The initial password is auto-generated and emailed to the user via Gitea SMTP — no password field is needed in the credentials Secret. mustChangePassword defaults to true so users set their own password on first login.

spec.parameters

FieldTypeRequiredDefaultDescription
giteaUrlstringyesBase URL of the Gitea instance.
insecurebooleanfalseSkip TLS verification.
usernamestringyesLogin username for the Gitea account.
emailstringyesEmail address. Gitea sends the welcome notification here.
fullNamestring""Display name shown in the Gitea UI.
adminbooleanfalseGrant site administrator privileges.
mustChangePasswordbooleantrueRequire a new password on first login. Recommended when auto-generated passwords are used.
visibilitystring"private"One of public, limited, private. A private user won't appear in org member lists.
passwordLengthinteger (16–128)24Length of the auto-generated initial password.
passwordSpecialbooleantrueInclude special characters in the auto-generated password.
allowCreateOrganizationbooleanfalseAllow the user to create organisations.
credentialsSecretRef.namestringyesSecret holding the Gitea admin token.
credentialsSecretRef.namespacestringyesNamespace of the Secret.

Example

apiVersion: platform.wxops.cloud/v1alpha1
kind: XGiteaUser
metadata:
name: alice
spec:
parameters:
giteaUrl: https://gitea.example.com
username: alice
email: alice@example.com
fullName: Alice Smith
visibility: limited
mustChangePassword: true
credentialsSecretRef:
name: gitea-admin-credentials
namespace: crossplane-system

XGiteaRepository

Manages a Gitea repository owned by an organisation.

KindXGiteaRepository
Pluralxgitearepos

spec.parameters

FieldTypeRequiredDefaultDescription
giteaUrlstringyesBase URL of the Gitea instance.
insecurebooleanfalseSkip TLS verification.
orgNamestringyesOrganisation that owns the repository.
repoNamestringyesRepository name. Immutable after creation.
descriptionstring""Repository description.
privatebooleanfalseMake the repository private.
autoInitbooleantrueInitialize with a README commit.
defaultBranchstring"main"Default branch name.
hasIssuesbooleantrueEnable the issue tracker.
hasWikibooleanfalseEnable the wiki.
hasProjectsbooleanfalseEnable projects.
hasPullRequestsbooleantrueEnable pull requests.
credentialsSecretRef.namestringyesSecret holding the Gitea admin token.
credentialsSecretRef.namespacestringyesNamespace of the Secret.

Example

apiVersion: platform.wxops.cloud/v1alpha1
kind: XGiteaRepository
metadata:
name: rocket-team-payment-api
spec:
parameters:
giteaUrl: https://gitea.example.com
orgName: rocket-team
repoName: payment-api
description: Payment API service for rocket-team
private: true
autoInit: true
defaultBranch: main
hasIssues: true
hasPullRequests: true
credentialsSecretRef:
name: gitea-admin-credentials
namespace: crossplane-system

Provisioning order

The portal scaffold flow creates these resources in dependency order:

XGiteaOrg → XGiteaTeam → XGiteaUser → add to XGiteaTeam.members
→ XGiteaRepository

All four XRs reference the same credentialsSecretRef Secret. The Secret must exist in the target namespace before any XR reconciles.

See also