Terraform Gitea Provider
Go to file
tobiasbp 167ce6ed80 add-scope-to-token (#33)
This PR adds the ability to set scopes for tokens (they can not be used for much without). Removed the _username_ from the _token resource_ as the owner can not be configured, as it will be owned by the user creating the resource.

As far as I can tell, it's not possible to modify the scopes for a existing token using the API, so a token created by the provider will be recreated if the list of scopes is updated. This reflects what is possible using the GUI.

This PR fixes this issue: https://gitea.com/gitea/terraform-provider-gitea/issues/32

Reviewed-on: https://gitea.com/gitea/terraform-provider-gitea/pulls/33
Co-authored-by: tobiasbp <tobiasbp@noreply.gitea.com>
Co-committed-by: tobiasbp <tobiasbp@noreply.gitea.com>
2023-11-16 00:52:35 +00:00
.gitea/workflows Add ci (#8) 2023-04-19 14:35:42 +08:00
.github chore(deps): update crazy-max/ghaction-import-gpg action to v6 (#24) 2023-09-25 03:41:01 +00:00
docs add-scope-to-token (#33) 2023-11-16 00:52:35 +00:00
examples add-scope-to-token (#33) 2023-11-16 00:52:35 +00:00
gitea add-scope-to-token (#33) 2023-11-16 00:52:35 +00:00
scripts chore(deps): update gitea/gitea docker tag to v1.21.0 (#38) 2023-11-14 21:09:29 +00:00
tools lerentis's changes (#12) 2023-09-06 01:44:01 +00:00
.gitignore Add repository webhook resource (#28) 2023-10-24 19:46:11 +00:00
.goreleaser.yaml add goreleaser 2023-03-31 14:09:43 -04:00
LICENSE lerentis's changes (#12) 2023-09-06 01:44:01 +00:00
Makefile readding install command (#14) 2023-09-07 21:47:00 +00:00
README.md Add repository webhook resource (#28) 2023-10-24 19:46:11 +00:00
go.mod fix(deps): update module github.com/hashicorp/terraform-plugin-sdk/v2 to v2.29.0 (#17) 2023-09-07 21:50:38 +00:00
go.sum fix(deps): update module github.com/hashicorp/terraform-plugin-sdk/v2 to v2.29.0 (#17) 2023-09-07 21:50:38 +00:00
main.go lerentis's changes (#12) 2023-09-06 01:44:01 +00:00
renovate.json5 Configure Renovate (#15) 2023-09-07 21:40:26 +00:00
terraform-registry-manifest.json Add 'terraform-registry-manifest.json' 2023-03-31 03:57:18 +08:00

README.md

terraform-provider-gitea

Terraform Gitea Provider

This repo is mirrored from https://gitea.com/gitea/terraform-provider-gitea please send all issues and pull requests there.

Usage

This is not a 1.0 release, so usage is subject to change!

terraform {
  required_providers {
    gitea = {
      source = "go-gitea/gitea"
      version = "0.3.0"
    }
  }
}

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 
}

resource "gitea_repository" "test" {
  username     = "lerentis"
  name         = "test"
  private      = true
  issue_labels = "Default"
  license      = "MIT"
  gitignores   = "Go"
}

resource "gitea_repository" "mirror" {
  username                     = "lerentis"
  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
}

resource "gitea_org" "test_org" {
  name = "test-org"
}

resource "gitea_repository" "org_repo" {
  username = gitea_org.test_org.name
  name = "org-test-repo"
}

License

This project is licensed under the MIT License - see the LICENSE file for details.

History

This codebase was created at https://gitea.com/gitea/terraform-provider-gitea, was forked by @lerentis, and then their changes were merged back into the original repo. Thank you to everyone who contributed!