fix(blog): add missing description and made a few edits
All checks were successful
/ all (push) Successful in 38s

This commit is contained in:
Julien Dessaux 2025-06-11 13:53:24 +02:00
parent 263bc80328
commit 8354360aaf
Signed by: adyxax
GPG key ID: F92E51B86E07177E

View file

@ -1,6 +1,6 @@
--- ---
title: Writing an OpenTofu/terraform provider for Forgejo title: Writing an OpenTofu/Terraform provider for Forgejo
description: description: My second open source provider
date: 2025-05-28 date: 2025-05-28
tags: tags:
- Forgejo - Forgejo
@ -10,36 +10,35 @@ tags:
## Introduction ## Introduction
Last month I started writing an OpenTofu/terraform provider for Last month I started writing an OpenTofu/Terraform provider for
[Forgejo](https://forgejo.org/). I wanted to automate this forge the same as I [Forgejo](https://forgejo.org/). I wanted to automate this forge in the same way
automate github already: create and manage repositories, provision actions I already automate GitHub: create and manage repositories, provision actions
secrets and variables, configure issue labels, manage mirrors, etc. secrets and variables, configure issue labels, manage mirrors, etc.
A community provider already existed but it is really barebones and missing A community provider already existed but it is really barebones and missing
almost all the resources I need. I could have tried to contribute to it, but almost all the resources I need. I could have tried to contribute to it, but
after looking at the code I decided not to bother. after looking at the code I decided to start from scratch.
I wrote providers before so could get right to it. I wrote providers before so I could get right to it.
## Writing a terraform provider ## Writing a Terraform provider
My notes from [writing a terraform provider for eventline]({{< ref My notes from [writing a Terraform provider for eventline]({{< ref
"eventline.md" >}}) still apply. With a few previous experiences, this is really "eventline.md" >}}) still apply. With a few previous experiences writing
straightforward work. providers, this has become straightforward work.
The difficulty and frustration only came from the Forgejo's API which is pretty The only significant difficulties and frustrations arose from the Forgejo API
inconsistent to say it nicely. A community SDK forked from Gitea exists but I which is pretty inconsistent to say it nicely. A community SDK forked from Gitea
admit that I did not like its code much either and decided to write my own small exists but after looking at its code I decided to write my own small API client.
API client.
## Conclusion ## Conclusion
Writing a terraform provider is still a lot of fun, I recommend it! If you have Writing a Terraform provider is a lot of fun, I recommend it! If you have a
a piece of software that you wish had a terraform provider, know that it is not piece of software that you wish had a Terraform provider, know that it is not
hard to make it a reality. It is also a great learning project, being bounded in hard to make it a reality. It is also a great learning project, being
scope and immediately useful. well-bounded in scope and immediately useful.
Here is [the repository of my forgejo Here is [the repository of my Forgejo
provider](https://git.adyxax.org/adyxax/terraform-provider-forgejo/) for provider](https://git.adyxax.org/adyxax/terraform-provider-forgejo/) for
reference and here is [the reference and here is [the
documentation](https://registry.terraform.io/providers/adyxax/forgejo/latest/docs). documentation](https://registry.terraform.io/providers/adyxax/forgejo/latest/docs).