Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow creation of deploy keys #16

Open
zeidlos opened this issue Jan 27, 2025 · 2 comments
Open

Allow creation of deploy keys #16

zeidlos opened this issue Jan 27, 2025 · 2 comments
Labels
enhancement New feature or request go Pull requests that update Go code good first issue Good for newcomers

Comments

@zeidlos
Copy link

zeidlos commented Jan 27, 2025

I am currently trying to bootstrap a new kubernetes cluster, using terraform.
Within this process I also want to install fluxcd onto the cluster.
Fluxcd is allowing for a helm deployment.

What do I need?

In order for flux to reconcile the project, I need to give it ssh-keys, so it can pull from the repository.
I want to be able to create a new ssh-keypair from within terraform and then, using the forgejo-provider, upload the deploy key onto the repository with read/write permissions.

If you want a beta-tester for this, please hit me up.
Sadly I believe to lack the necessary skills to create this feature within this provider myself. :)

@stdevel stdevel added enhancement New feature or request good first issue Good for newcomers go Pull requests that update Go code labels Jan 28, 2025
@stdevel
Copy link
Collaborator

stdevel commented Jan 28, 2025

That's an interesting idea! Sounds like it would be required to implement a Terraform provisioner. Looks like the Forgejo API offers a call for this:

Image

What do you think, @acch?

@acch
Copy link
Member

acch commented Jan 28, 2025

Thanks @zeidlos for bringing up this idea! Makes a ton of sense, and I guess it would provide value to many users...

I've briefly checked the forgejo-sdk. Looks like this is the function we would need to use:

... which requires these options (link):

type CreateKeyOption struct {
	// Title of the key to add
	Title string `json:"title"`
	// An armored SSH key to add
	Key string `json:"key"`
	// Describe if the key has only read access or read/write
	ReadOnly bool `json:"read_only"`
}

Hence, looks totally doable!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request go Pull requests that update Go code good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants