Commit graph

49 commits

Author SHA1 Message Date
d7ff673261
chore(main): release hcloudimages 1.3.0 (#145)
🤖 I have created a release *beep* *boop*
---


## [1.3.0](https://github.com/apricote/hcloud-upload-image/compare/hcloudimages/v1.2.0...hcloudimages/v1.3.0) (2025-12-22)


### Features

* add --location flag to specify datacenter region
([#141](https://github.com/apricote/hcloud-upload-image/issues/141))
([fcbc14a](fcbc14aab6)),
closes
[#142](https://github.com/apricote/hcloud-upload-image/issues/142)
2025-12-22 15:00:04 +01:00
renovate[bot]
0280f677e0
chore(deps): update module github.com/hetznercloud/hcloud-go/v2 to v2.33.0 (#133) 2025-12-22 14:50:53 +01:00
renovate[bot]
c4c86073ae
chore(deps): update dependency go to v1.25.5 (#139) 2025-12-22 14:50:13 +01:00
Malthe Poulsen
fcbc14aab6
feat: add --location flag to specify datacenter region (#141)
Allow users to specify which Hetzner datacenter location to use for the
temporary server during image upload. Defaults to fsn1 for backward
compatibility.

Available locations: fsn1, nbg1, hel1, ash, hil, sin

Implements: #142
2025-12-22 13:36:50 +01:00
5bbd840ea7
chore(main): release hcloudimages 1.2.0 (#127)
## [1.2.0](https://github.com/apricote/hcloud-upload-image/compare/hcloudimages/v1.1.0...hcloudimages/v1.2.0) (2025-11-06)


### Features

* change minimum required Go version to 1.24
([#130](https://github.com/apricote/hcloud-upload-image/issues/130))
([5eba2d5](5eba2d52fe))
* support zstd compression
([#125](https://github.com/apricote/hcloud-upload-image/issues/125))
([37ebbce](37ebbce517)),
closes
[#122](https://github.com/apricote/hcloud-upload-image/issues/122)
* update default x86 server type to cx23
([#129](https://github.com/apricote/hcloud-upload-image/issues/129))
([a205619](a20561944d))
2025-11-06 21:09:44 +01:00
renovate[bot]
92e0397f7c
chore(deps): update module github.com/hetznercloud/hcloud-go/v2 to v2.29.0 (#120) 2025-11-06 21:05:52 +01:00
5eba2d52fe
feat: change minimum required Go version to 1.24 (#130)
Required for some dependency updates (#88, #120)
2025-11-06 21:03:08 +01:00
a20561944d
feat: update default x86 server type to cx23 (#129)
`cx22` is deprecated and will be removed in January 2026.

Changelog:
https://docs.hetzner.cloud/changelog#2025-10-16-server-types-deprecated
2025-11-06 21:02:59 +01:00
renovate[bot]
04bfe9bcfa
chore(deps): update dependency go to v1.25.4 (#124) 2025-11-06 20:56:21 +01:00
Peter Fern
37ebbce517
feat: support zstd compression (#125)
Closes #122
2025-11-06 20:48:58 +01:00
renovate[bot]
fbd639ba59
chore(deps): update dependency go to v1.25.1 (#106) 2025-09-13 10:25:46 +02:00
renovate[bot]
cbcfd7d007
chore(deps): update module github.com/hetznercloud/hcloud-go/v2 to v2.23.0 (#105) 2025-09-11 13:30:13 +02:00
03f08da8a3
chore(main): release hcloudimages 1.1.0 (#100)
## 1.1.0 (2025-05-10)

### Features

* smaller snapshots by zeroing disk first (#101) (fdfb284)

### Bug Fixes

* upload from local image generates broken command (#98) (420dcf9)
2025-05-10 14:24:05 +02:00
fdfb284533
feat: smaller snapshots by zeroing disk first (#101)
The base image used requires ~0.42Gi. Even if the uploaded image is
smaller, those bytes are currently not overwritten and still part of the
stored snapshot.

By zeroing the root disk first, those unwanted bytes are removed and not
stored with the snapshot.

This has two benefits:

1. Snapshots are billed by their compressed (shown) size, so small
images are now a bit cheaper.
2. The time it takes to create a server from the snapshot scales with
the snapshot size, so smaller snapshots means the server can start more
quickly.

This reduces the size of an example Talos x86 image from 0.42Gi before,
to 0.2Gi afterwards. An example Flatcar image was 0.47Gi before, and
still has that size with this patch.

There are two ways to zero out the disk:

- `dd if=/dev/zero of=/dev/sda` actually writes zeroes to every block on
the device. This takes around a minute to do.
- `blkdiscard /dev/sda` talks to the disk direclty and instructs it to
discard all blocks. This only takes around 5 seconds.

As both have the same effect on image size, but `blkdiscard` is SO MUCH
faster, I have decided to use it.

Even though only small images benefit from this, this is now enabled by
default as the downside (5 second slower upload) does not justify
additional flags or options to enable/disable this.

Closes #96
2025-05-10 14:21:31 +02:00
420dcf94c9
fix: upload from local image generates broken command (#98)
While adding support for qcow2 images in #69 I broke support for local
images. Building a shell pipeline through string concatenation is not a
good idea...

The specific issue was fixed and I also moved building the shell
pipeline to a separate function and added unit tests for all cases, so
it should be easier to spot these issues in the future.

Closes #97
2025-05-09 21:22:24 +00:00
7f10f7b253
chore(main): release hcloudimages 1.0.1 (#94)
## 1.0.1 (2025-05-09)

### Bug Fixes

* timeout while waiting for SSH to become available (#92) (e490b9a)
2025-05-09 16:17:27 +02:00
e490b9a7f3
fix: timeout while waiting for SSH to become available (#92)
In #68 I reduced the general limits for the back off, thinking that it
would speed up the upload on average because it was retrying faster. But
because it was retrying faster, the 10 available retries were used up
before SSH became available.

The new 100 retries match the 3 minutes of total timeout that the
previous solution had, and should fix all issues.

In addition, I discovered that my implementation in
`hcloudimages/backoff.ExponentialBackoffWithLimit` has a bug where the
calculated offset could overflow before the limit was applied, resulting
in negative durations. I did not fix the issue because `hcloud-go`
provides such a method natively nowadays. Instead, I marked the method
as deprecated, to be removed in a later release.
2025-05-09 16:15:07 +02:00
renovate[bot]
19f1e085e9
chore(deps): update dependency go to v1.24.3 (#91) 2025-05-09 16:03:07 +02:00
9611d091a8
chore(main): release hcloudimages 1.0.0 (#78)
🤖 I have created a release *beep* *boop*
---


## 1.0.0[0] (2025-05-04)

### Features

* upload qcow2 images (#69[1])

[0] https://github.com/apricote/hcloud-upload-image/compare/hcloudimages/v0.3.1...hcloudimages/v1.0.0
[1] https://github.com/apricote/hcloud-upload-image/issues/69
2025-05-04 02:30:16 +02:00
renovate[bot]
2df6fdd850
chore(deps): update module golang.org/x/crypto to v0.37.0 (#72) 2025-05-04 00:49:36 +02:00
renovate[bot]
4829843c2e
chore(deps): update dependency golangci/golangci-lint to v2 (#66) 2025-05-04 00:40:35 +02:00
renovate[bot]
df19de506c
chore(deps): update module golang.org/x/net to v0.38.0 [security] (#63) 2025-05-04 00:31:44 +02:00
renovate[bot]
099ae2d061
chore(deps): update module github.com/hetznercloud/hcloud-go/v2 to v2.21.0 (#62) 2025-05-04 00:28:39 +02:00
ac3e9dd7ec
feat: upload qcow2 images (#69)
It is now possible to upload qcow2 images. These images will be
converted to raw disk images on the cloud server.

In the CLI you can use the new `--format=qcow2` flag to upload qcow2
images. In the library you can set `UploadOptions.ImageFormat` to
`FormatQCOW2`.

Because of the underlying process, qcow2 images need to be written to a
file first. This limits their size to 960 MB at the moment. The CLI
automatically checks the file size (if possible) and shows a warning if
this limit would be triggered. The library accepts an input with the
file size and logs a warning if the limit would be triggered.

Closes #44
2025-05-04 00:28:11 +02:00
021787a9c3
chore: lower ssh retry exponential backoff limit (#68)
The process is already slow enough, no need to waste so much time
between SSH attempts.
2025-05-04 00:01:50 +02:00
b328867f6b
chore(main): release 0.3.1 (#48)
🤖 I have created a release *beep* *boop*
---


<details><summary>0.3.1</summary>

##
[0.3.1](https://github.com/apricote/hcloud-upload-image/compare/v0.3.0...v0.3.1)
(2024-12-07)


### Bug Fixes

* **cli:** local install fails because of go.mod replace
([#47](https://github.com/apricote/hcloud-upload-image/issues/47))
([66dc5f7](66dc5f70b6))
</details>

<details><summary>hcloudimages: 0.3.1</summary>

##
[0.3.1](https://github.com/apricote/hcloud-upload-image/compare/hcloudimages/v0.3.0...hcloudimages/v0.3.1)
(2024-12-07)


### Bug Fixes

* **cli:** local install fails because of go.mod replace
([#47](https://github.com/apricote/hcloud-upload-image/issues/47))
([66dc5f7](66dc5f70b6))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
2024-12-07 01:57:59 +01:00
renovate[bot]
d5ddab06f2
chore(deps): update module golang.org/x/crypto to v0.30.0 (#55) 2024-12-07 00:56:34 +00:00
renovate[bot]
5032760cea
chore(deps): update module github.com/stretchr/testify to v1.10.0 (#53) 2024-12-07 00:50:40 +00:00
renovate[bot]
83c9e043f9
chore(deps): update module github.com/hetznercloud/hcloud-go/v2 to v2.17.0 (#52) 2024-12-07 01:48:38 +01:00
renovate[bot]
f8b953466b
chore(deps): update module golang.org/x/crypto to v0.29.0 (#42) 2024-11-16 23:24:45 +01:00
renovate[bot]
6cc128ffe9
chore(deps): update module github.com/hetznercloud/hcloud-go/v2 to v2.16.0 (#49) 2024-11-16 23:20:05 +01:00
66dc5f70b6
fix(cli): local install fails because of go.mod replace (#47)
Remove the replace directive in `go.mod`. It does not apply on `go
install github.com/apricote/hcloud-upload-image` and is otherwise
covered by `go.work`.
2024-11-02 22:21:38 +01:00
renovate[bot]
489ece1798
chore(deps): update module github.com/hetznercloud/hcloud-go/v2 to v2.15.0 (#41) 2024-11-02 22:10:18 +01:00
99d5396435
refactor: drop custom package in favor of hcloud-go (#39) 2024-06-23 14:49:33 +00:00
a07856317d
chore(main): release 0.3.0 (#35) 2024-06-23 16:28:07 +02:00
renovate[bot]
32a82ffc6f
chore(deps): update module golang.org/x/crypto to v0.24.0 (#28)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-23 14:27:41 +00:00
ebe08b345c
feat: update default x86 server type to cx22 (#38)
`cx11` is deprecated and will be removed in September.

Changelog:
https://docs.hetzner.cloud/changelog#2024-06-06-old-server-types-with-shared-intel-vcpus-are-deprecated
2024-06-23 14:25:58 +00:00
42eeb00a07
feat: set server type explicitly (#36)
- **CLI**: New flag `--server-type` that overrides the `--architecture`
flag and allows users to specify the server type they want
- **Lib**: New field in `UploadOptions`: `ServerType *hcloud.ServerType`
that overrides the `Architecture` field and allows users to specify the
server type they want

Closes #30
2024-06-23 16:21:14 +02:00
256989f4a3
fix: error early when the image write fails (#34)
Closes #33
2024-06-23 16:13:52 +02:00
renovate[bot]
8347e4ef16
chore(deps): update module github.com/hetznercloud/hcloud-go/v2 to v2.9.0 (#27)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-23 16:13:35 +02:00
renovate[bot]
1f70099302
chore(deps): update module golang.org/x/crypto to v0.23.0 (#12)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-05-09 18:40:48 +00:00
1c943e4480
feat: upload xz compressed images (#16)
Required for Talos images:
https://www.talos.dev/v1.7/talos-guides/install/cloud-platforms/hetzner/#rescue-mode
2024-05-09 19:15:54 +02:00
fcea3e3c6e
feat: upload local disk images (#15)
The new options/flag enables users to use a local file as the image,
instead of a publicly available file from a web server.
2024-05-09 16:16:37 +00:00
renovate[bot]
1a37a300b6
chore(deps): update module github.com/hetznercloud/hcloud-go/v2 to v2.8.0 (#11)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-05-08 22:25:29 +02:00
renovate[bot]
5300a596a2
chore(deps): update module google.golang.org/protobuf to v1.33.0 [security] (#7)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-05-05 01:13:59 +02:00
c9ab40b539 feat: documentation and cleanup command 2024-05-04 22:13:33 +02:00
27d4e3240e chore: add license info for code taken from other repos 2024-05-04 22:12:19 +02:00
d0729e1cb5 chore: cleanup before publishing 2024-05-02 22:12:29 +02:00
4b77b81689 refactor: change package names 2024-05-02 21:42:36 +02:00