Skip to content

Commit

Permalink
propose features upstream (#2)
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-on: https://gitea.com/gitea/terraform-provider-gitea/pulls/2
Co-authored-by: lerentis <[email protected]>
Co-committed-by: lerentis <[email protected]>
  • Loading branch information
2 people authored and techknowlogick committed Aug 22, 2022
1 parent 6879c07 commit 7ba385d
Show file tree
Hide file tree
Showing 27 changed files with 2,375 additions and 5 deletions.
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor)

GOFMT ?= gofmt -s

VERSION = 0.6.1

test: fmt-check
go test -i $(TEST) || exit 1
echo $(TEST) | \
Expand All @@ -28,3 +30,12 @@ fmt-check:
echo "$${diff}"; \
exit 1; \
fi;
build:
go build -o terraform-provider-gitea_${VERSION}
install: build
@echo installing to
@echo ~/.terraform.d/plugins/terraform.local/local/gitea/${VERSION}/linux_amd64/terraform-provider-gitea_${VERSION}
@mkdir -p ~/.terraform.d/plugins/terraform.local/local/gitea/${VERSION}/linux_amd64
@mv terraform-provider-gitea_${VERSION} ~/.terraform.d/plugins/terraform.local/local/gitea/${VERSION}/linux_amd64/terraform-provider-gitea_${VERSION}
doc:
tfplugindocs
32 changes: 32 additions & 0 deletions docs/data-sources/org.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "gitea_org Data Source - terraform-provider-gitea"
subcategory: ""
description: |-
---

# gitea_org (Data Source)





<!-- schema generated by tfplugindocs -->
## Schema

### Optional

- `name` (String)

### Read-Only

- `avatar_url` (String)
- `description` (String)
- `full_name` (String)
- `id` (Number) The ID of this resource.
- `location` (String)
- `visibility` (String)
- `website` (String)


47 changes: 47 additions & 0 deletions docs/data-sources/repo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "gitea_repo Data Source - terraform-provider-gitea"
subcategory: ""
description: |-
---

# gitea_repo (Data Source)





<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `name` (String)
- `username` (String)

### Read-Only

- `clone_url` (String)
- `created` (String)
- `default_branch` (String)
- `description` (String)
- `fork` (Boolean)
- `forks` (Number)
- `full_name` (String)
- `html_url` (String)
- `id` (String) The ID of this resource.
- `mirror` (Boolean)
- `open_issue_count` (Number)
- `permission_admin` (Boolean)
- `permission_pull` (Boolean)
- `permission_push` (Boolean)
- `private` (Boolean)
- `size` (Number)
- `ssh_url` (String)
- `stars` (Number)
- `updated` (String)
- `watchers` (Number)
- `website` (String)


33 changes: 33 additions & 0 deletions docs/data-sources/user.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "gitea_user Data Source - terraform-provider-gitea"
subcategory: ""
description: |-
---

# gitea_user (Data Source)





<!-- schema generated by tfplugindocs -->
## Schema

### Optional

- `username` (String)

### Read-Only

- `avatar_url` (String)
- `created` (String)
- `email` (String)
- `full_name` (String)
- `id` (Number) The ID of this resource.
- `is_admin` (Boolean)
- `language` (String)
- `last_login` (String)


52 changes: 52 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "gitea Provider"
subcategory: ""
description: |-
---

# gitea Provider



## Example Usage

```terraform
terraform {
required_providers {
gitea = {
source = "gitea/gitea"
version = "0.6.1"
}
}
}
provider "gitea" {
base_url = var.gitea_url # optionally use GITEA_BASE_URL env var
token = var.gitea_token # optionally use GITEA_TOKEN env var
# Username/Password authentication is mutally exclusive with token authentication
# username = var.username # optionally use GITEA_USERNAME env var
# password = var.password # optionally use GITEA_PASSWORD env var
# A file containing the ca certificate to use in case ssl certificate is not from a standard chain
cacert_file = var.cacert_file
# If you are running a gitea instance with self signed TLS certificates
# and you want to disable certificate validation you can deactivate it with this flag
insecure = false
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Optional

- `base_url` (String) The Gitea Base API URL
- `cacert_file` (String) A file containing the ca certificate to use in case ssl certificate is not from a standard chain
- `insecure` (Boolean) Disable SSL verification of API calls
- `password` (String) Password in case of using basic auth
- `token` (String) The application token used to connect to Gitea.
- `username` (String) Username in case of using basic auth
29 changes: 29 additions & 0 deletions docs/resources/oauth2_app.md
Original file line number Diff line number Diff line change
@@ -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 changes: 50 additions & 0 deletions docs/resources/org.md
Original file line number Diff line number Diff line change
@@ -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.


52 changes: 52 additions & 0 deletions docs/resources/public_key.md
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]"
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)


Loading

0 comments on commit 7ba385d

Please sign in to comment.