Skip to content

feat: add Hetzner Cloud server template and configuration files #254

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

brymut
Copy link

@brymut brymut commented Jul 25, 2025

Closes #209
/claim #209

Description

Added template for Hetzner cloud. Video of template setting up a workspace and connecting using VScode

hetzner.mp4

Type of Change

  • Feature/enhancement

Testing & Validation

  • Tests pass (bun test)
  • Code formatted (bun run fmt)
  • Changes tested locally

Related Issues

#209

@brymut brymut force-pushed the brymut/add-hetzner-template branch from a70dd7c to ca222c3 Compare July 25, 2025 18:48
@brymut brymut force-pushed the brymut/add-hetzner-template branch 2 times, most recently from dacec3a to 6866f01 Compare July 25, 2025 19:34
@brymut brymut marked this pull request as ready for review July 25, 2025 19:34
@matifali matifali requested a review from DevelopmentCats July 29, 2025 03:01
@brymut brymut force-pushed the brymut/add-hetzner-template branch from ba8b12c to 536aca0 Compare July 29, 2025 15:07
@brymut
Copy link
Author

brymut commented Jul 30, 2025

Hi @DevelopmentCats, could you please have a quick look when you have a chance?

@matifali
Copy link
Member

@brymut, can you fix the failing CI? You may need to add an exception to the typos config.

https://github.com/coder/registry/actions/runs/16600024993/job/46963017795?pr=254#step:7:41

@brymut
Copy link
Author

brymut commented Jul 30, 2025

@matifali Failing CI is because of a variable being mistaken for a spelling mistake. Please check again

@matifali
Copy link
Member

@brymut you need to add an exception to this in .github/typos.toml

@brymut brymut force-pushed the brymut/add-hetzner-template branch from 536aca0 to 5ff1c7d Compare July 30, 2025 15:09
@brymut
Copy link
Author

brymut commented Jul 30, 2025

@brymut you need to add an exception to this in .github/typos.toml

Sorry, I missed that exception handling, I've added the word to the list. Please re-run CI and have a look @matifali

Copy link
Contributor

@DevelopmentCats DevelopmentCats left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I re-ran the CI but its still detecting it as a typo though. You might have to try setting the typo as just hel

@brymut brymut force-pushed the brymut/add-hetzner-template branch from ba2771b to 19e11a4 Compare July 31, 2025 07:17
@brymut
Copy link
Author

brymut commented Jul 31, 2025

I re-ran the CI but its still detecting it as a typo though. You might have to try setting the typo as just hel

Thanks for the feedback, I've tested locally and changing the typo exception to "hel" works. @matifali / @DevelopmentCats could you please re-run the CI

Copy link
Member

@matifali matifali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few suggestions but looks good to me. I will approve after another review.

}

locals {
username = data.coder_workspace_owner.me.name
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
username = data.coder_workspace_owner.me.name
username = lower(data.coder_workspace_owner.me.name)

display_name = "Home Usage"
interval = 600 # every 10 minutes
timeout = 30 # df can take a while on large filesystems
script = "coder stat disk --path /home/${lower(data.coder_workspace_owner.me.name)}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
script = "coder stat disk --path /home/${lower(data.coder_workspace_owner.me.name)}"
script = "coder stat disk --path /home/${local.username}"

Comment on lines 130 to 140
data "coder_provisioner" "me" {
}

provider "coder" {
}

data "coder_workspace" "me" {
}

data "coder_workspace_owner" "me" {
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
data "coder_provisioner" "me" {
}
provider "coder" {
}
data "coder_workspace" "me" {
}
data "coder_workspace_owner" "me" {
}
data "coder_provisioner" "me" {}
provider "coder" {}
data "coder_workspace" "me" {}
data "coder_workspace_owner" "me" {}

}
}

data "coder_parameter" "hcloud_server_type" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you put a link as a comment on where to get these all machine types?

token = var.hcloud_token
}

data "coder_parameter" "hcloud_location" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. Put a comment and link to docs where a user can see all available regions. Will make it easy to maintain.

Comment on lines 27 to 28
> **Note**
> This template is designed to be a starting point! Edit the Terraform to extend the template to support your use case.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use GFM style alerts.

display_name: Hetzner Cloud Server
description: Provision Hetzner Cloud servers as Coder workspaces
icon: ../../../../.icons/hetzner.svg
maintainer_github: brymut
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
maintainer_github: brymut

@DevelopmentCats can we add a linter to check the front matter? It could be in go linter too. I keep seeing the use of deprecated resources in new submissions.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about that, I had seen it in other templates, didn't notice that it was removed in the Contributor guidelines

@brymut brymut force-pushed the brymut/add-hetzner-template branch from 19e11a4 to 96c431c Compare July 31, 2025 07:54
@brymut
Copy link
Author

brymut commented Jul 31, 2025

Left a few suggestions but looks good to me. I will approve after another review.

Applied requested changes @matifali

@brymut
Copy link
Author

brymut commented Jul 31, 2025

Hi @bpmct could you please have a look at this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hetzner Cloud server template example
3 participants