propose features upstream (#2)

Hi @techknowlogick 👋

as discussed on twitter the changes i made on my fork 😃

not sure if you are aware of this but currently hashicorp only allows publishing via github, so if you want to publish this provider to the terraform registry as well, feel free to also take a look at my goreleaser config and drone/github actions usage her: https://git.uploadfilter24.eu/lerentis/terraform-provider-gitea

Co-authored-by: Tobias Trabelsi <lerentis@uploadfilter24.eu>
Reviewed-on: https://gitea.com/gitea/terraform-provider-gitea/pulls/2
Co-authored-by: lerentis <lerentis@noreply.gitea.io>
Co-committed-by: lerentis <lerentis@noreply.gitea.io>
This commit is contained in:
lerentis
2022-08-22 23:54:13 +08:00
committed by techknowlogick
parent 6879c07e9f
commit 7ba385d44a
27 changed files with 2375 additions and 5 deletions

View File

@ -0,0 +1,29 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "gitea_oauth2_app Resource - terraform-provider-gitea"
subcategory: ""
description: |-
Handling gitea oauth application https://docs.gitea.io/en-us/oauth2-provider/ resources
---
# gitea_oauth2_app (Resource)
Handling [gitea oauth application](https://docs.gitea.io/en-us/oauth2-provider/) resources
<!-- schema generated by tfplugindocs -->
## Schema
### Required
- `name` (String) OAuth Application name
- `redirect_uris` (Set of String) Accepted redirect URIs
### Read-Only
- `client_id` (String) OAuth2 Application client id
- `client_secret` (String, Sensitive) Oauth2 Application client secret
- `id` (String) The ID of this resource.

50
docs/resources/org.md Normal file
View File

@ -0,0 +1,50 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "gitea_org Resource - terraform-provider-gitea"
subcategory: ""
description: |-
gitea_org manages a gitea organisation.
Organisations are a way to group repositories and abstract permission management in a gitea instance.
---
# gitea_org (Resource)
`gitea_org` manages a gitea organisation.
Organisations are a way to group repositories and abstract permission management in a gitea instance.
## Example Usage
```terraform
resource "gitea_org" "test_org" {
name = "test-org"
}
resource "gitea_repository" "org_repo" {
username = gitea_org.test_org.name
name = "org-test-repo"
}
```
<!-- schema generated by tfplugindocs -->
## Schema
### Required
- `name` (String) The name of the organisation without spaces.
### Optional
- `description` (String) A description of this organisation.
- `full_name` (String) The display name of the organisation. Defaults to the value of `name`.
- `location` (String)
- `repo_admin_change_team_access` (Boolean)
- `visibility` (String) Flag is this organisation should be publicly visible or not.
- `website` (String) A link to a website with more information about this organisation.
### Read-Only
- `avatar_url` (String)
- `id` (String) The ID of this resource.

View File

@ -0,0 +1,52 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "gitea_public_key Resource - terraform-provider-gitea"
subcategory: ""
description: |-
gitea_public_key manages ssh key that are associated with users.
---
# gitea_public_key (Resource)
`gitea_public_key` manages ssh key that are associated with users.
## Example Usage
```terraform
resource "gitea_user" "test" {
username = "test"
login_name = "test"
password = "Geheim1!"
email = "test@user.dev"
must_change_password = false
}
resource "gitea_public_key" "test_user_key" {
title = "test"
key = file("${path.module}/id_ed25519.pub")
username = gitea_user.test.username
}
```
<!-- schema generated by tfplugindocs -->
## Schema
### Required
- `key` (String, Sensitive) An armored SSH key to add
- `title` (String) Title of the key to add
- `username` (String) User to associate with the added key
### Optional
- `read_only` (Boolean) Describe if the key has only read access or read/write
### Read-Only
- `created` (String)
- `fingerprint` (String)
- `id` (String) The ID of this resource.
- `type` (String)

View File

@ -0,0 +1,109 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "gitea_repository Resource - terraform-provider-gitea"
subcategory: ""
description: |-
gitea_repository manages a gitea repository.
Per default this repository will be initializiled with the provided configuration (gitignore, License etc.).
If the username property is set to a organisation name, the provider will try to look if this organisation exists and create the repository under the organisation scope.
Repository migrations have some properties that are not available to regular repositories. These are all prefixed with migration_.
---
# gitea_repository (Resource)
`gitea_repository` manages a gitea repository.
Per default this repository will be initializiled with the provided configuration (gitignore, License etc.).
If the `username` property is set to a organisation name, the provider will try to look if this organisation exists and create the repository under the organisation scope.
Repository migrations have some properties that are not available to regular repositories. These are all prefixed with `migration_`.
## Example Usage
```terraform
resource "gitea_user" "test" {
username = "test"
login_name = "test"
password = "Geheim1!"
email = "test@user.dev"
must_change_password = false
}
resource "gitea_repository" "test" {
username = resource.gitea_user.test.name
name = "test"
private = true
issue_labels = "Default"
license = "MIT"
gitignores = "Go"
}
resource "gitea_repository" "mirror" {
username = resource.gitea_user.test.name
name = "terraform-provider-gitea-mirror"
description = "Mirror of Terraform Provider"
mirror = true
migration_clone_addresse = "https://git.uploadfilter24.eu/lerentis/terraform-provider-gitea.git"
migration_service = "gitea"
migration_service_auth_token = var.gitea_mirror_token
}
```
<!-- schema generated by tfplugindocs -->
## Schema
### Required
- `name` (String) The Name of the repository
- `username` (String) The Owner of the repository
### Optional
- `allow_manual_merge` (Boolean)
- `allow_merge_commits` (Boolean)
- `allow_rebase` (Boolean)
- `allow_rebase_explicit` (Boolean)
- `allow_squash_merge` (Boolean)
- `archived` (Boolean)
- `auto_init` (Boolean) Flag if the repository should be initiated with the configured values
- `autodetect_manual_merge` (Boolean)
- `default_branch` (String) The default branch of the repository. Defaults to `main`
- `description` (String) The description of the repository.
- `gitignores` (String) A specific gitignore that should be commited to the repositoryon creation if `auto_init` is set to `true`
Need to exist in the gitea instance
- `has_issues` (Boolean) A flag if the repository should have issue management enabled or not.
- `has_projects` (Boolean) A flag if the repository should have the native project management enabled or not.
- `has_pull_requests` (Boolean) A flag if the repository should acceppt pull requests or not.
- `has_wiki` (Boolean) A flag if the repository should have the native wiki enabled or not.
- `ignore_whitespace_conflicts` (Boolean)
- `issue_labels` (String) The Issue Label configuration to be used in this repository.
Need to exist in the gitea instance
- `license` (String) The license under which the source code of this repository should be.
Need to exist in the gitea instance
- `migration_clone_addresse` (String)
- `migration_issue_labels` (Boolean)
- `migration_lfs` (Boolean)
- `migration_lfs_endpoint` (String)
- `migration_milestones` (Boolean)
- `migration_mirror_interval` (String) valid time units are 'h', 'm', 's'. 0 to disable automatic sync
- `migration_releases` (Boolean)
- `migration_service` (String) git/github/gitlab/gitea/gogs
- `migration_service_auth_password` (String, Sensitive)
- `migration_service_auth_token` (String, Sensitive)
- `migration_service_auth_username` (String)
- `mirror` (Boolean)
- `private` (Boolean) Flag if the repository should be private or not.
- `readme` (String)
- `repo_template` (Boolean)
- `website` (String) A link to a website with more information.
### Read-Only
- `created` (String)
- `id` (String) The ID of this resource.
- `permission_admin` (Boolean)
- `permission_pull` (Boolean)
- `permission_push` (Boolean)
- `updated` (String)

62
docs/resources/team.md Normal file
View File

@ -0,0 +1,62 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "gitea_team Resource - terraform-provider-gitea"
subcategory: ""
description: |-
gitea_team manages Team that are part of an organisation.
---
# gitea_team (Resource)
`gitea_team` manages Team that are part of an organisation.
## Example Usage
```terraform
resource "gitea_org" "test_org" {
name = "test-org"
}
resource "gitea_user" "test" {
username = "test"
login_name = "test"
password = "Geheim1!"
email = "test@user.dev"
must_change_password = false
admin = true
}
resource "gitea_team" "test_team" {
name = "Devs"
organisation = gitea_org.test_org.name
description = "Devs of Test Org"
permission = "write"
members = [gitea_user.test.username]
}
```
<!-- schema generated by tfplugindocs -->
## Schema
### Required
- `name` (String) Name of the Team
- `organisation` (String) The organisation which this Team is part of.
### Optional
- `can_create_repos` (Boolean) Flag if the Teams members should be able to create Rpositories in the Organisation
- `description` (String) Description of the Team
- `include_all_repositories` (Boolean) Flag if the Teams members should have access to all Repositories in the Organisation
- `members` (List of String) List of Users that should be part of this team
- `permission` (String) Permissions associated with this Team
Can be `none`, `read`, `write`, `admin` or `owner`
- `units` (String) List of types of Repositories that should be allowed to be created from Team members.
Can be `repo.code`, `repo.issues`, `repo.ext_issues`, `repo.wiki`, `repo.pulls`, `repo.releases`, `repo.projects` and/or `repo.ext_wiki`
### Read-Only
- `id` (String) The ID of this resource.

60
docs/resources/user.md Normal file
View File

@ -0,0 +1,60 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "gitea_user Resource - terraform-provider-gitea"
subcategory: ""
description: |-
gitea_user manages a native gitea user.
If you are using OIDC or other kinds of authentication mechanisms you can still try to managessh keys or other ressources this way
---
# gitea_user (Resource)
`gitea_user` manages a native gitea user.
If you are using OIDC or other kinds of authentication mechanisms you can still try to managessh keys or other ressources this way
## Example Usage
```terraform
resource "gitea_user" "test" {
username = "test"
login_name = "test"
password = "Geheim1!"
email = "test@user.dev"
must_change_password = false
}
```
<!-- schema generated by tfplugindocs -->
## Schema
### Required
- `email` (String) E-Mail Address of the user
- `login_name` (String) The login name can differ from the username
- `password` (String, Sensitive) Password to be set for the user
- `username` (String) Username of the user to be created
### Optional
- `active` (Boolean) Flag if this user should be active or not
- `admin` (Boolean) Flag if this user should be an administrator or not
- `allow_create_organization` (Boolean)
- `allow_git_hook` (Boolean)
- `allow_import_local` (Boolean)
- `description` (String) A description of the user
- `force_password_change` (Boolean) Flag if the user defined password should be overwritten or not
- `full_name` (String) Full name of the user
- `location` (String)
- `max_repo_creation` (Number)
- `must_change_password` (Boolean) Flag if the user should change the password after first login
- `prohibit_login` (Boolean) Flag if the user should not be allowed to log in (bot user)
- `restricted` (Boolean)
- `send_notification` (Boolean) Flag to send a notification about the user creation to the defined `email`
- `visibility` (String) Visibility of the user. Can be `public`, `limited` or `private`
### Read-Only
- `id` (String) The ID of this resource.