Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ inputs:
description: "Enable automatic HTTPS forwarding with Let's Encrypt (format: service:port, e.g. web:80)"
required: false
default: ""
proxy_tls_hosts:
description: "Additional public hostnames served by the Helm Caddy gateway, comma-separated"
required: false
default: ""
pre_script:
description: "Path to a local bash script (relative to app_path) executed inline over SSH on the instance before docker compose"
required: false
Expand Down Expand Up @@ -196,6 +200,7 @@ runs:
--deployment-variant "${{ inputs.deployment_variant }}" \
--registries "${{ inputs.registries }}" \
--proxy-tls "${{ inputs.proxy_tls }}" \
--proxy-tls-hosts "${{ inputs.proxy_tls_hosts }}" \
--pre-script "${{ inputs.pre_script }}" \
--ttl "${{ inputs.ttl }}" \
--templated-url "${{ inputs.templated_url }}"
Expand Down
3 changes: 3 additions & 0 deletions cmd/pullpreview/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ type commonFlagValues struct {
chartRepository string
chartValues string
chartSet string
proxyTLSHosts string
tags multiValue
options pullpreview.CommonOptions
}
Expand All @@ -208,6 +209,7 @@ func registerCommonFlags(fs *flag.FlagSet) *commonFlagValues {
fs.StringVar(&values.registries, "registries", "", "URIs of docker registries to authenticate against")
fs.StringVar((*string)(&values.options.DeploymentTarget), "deployment-target", string(pullpreview.DeploymentTargetCompose), "Deployment target to use: compose or helm")
fs.StringVar(&values.options.ProxyTLS, "proxy-tls", "", "Enable automatic HTTPS proxying with Let's Encrypt (format: service:port, e.g. web:80)")
fs.StringVar(&values.proxyTLSHosts, "proxy-tls-hosts", "", "Additional public hostnames served by the Helm proxy, comma-separated")
fs.StringVar(&values.options.DNS, "dns", "my.preview.run", "DNS suffix to use")
fs.StringVar(&values.ports, "ports", "80/tcp,443/tcp", "Ports to open for external access")
fs.StringVar(&values.options.InstanceType, "instance-type", "small", "Instance type to use")
Expand Down Expand Up @@ -240,6 +242,7 @@ func (c *commonFlagValues) ToOptions(ctx context.Context) pullpreview.CommonOpti
opts.ChartRepository = strings.TrimSpace(c.chartRepository)
opts.ChartValues = splitCommaList(c.chartValues)
opts.ChartSet = splitCommaList(c.chartSet)
opts.ProxyTLSHosts = splitCommaList(c.proxyTLSHosts)
opts.Tags = parseTags(c.tags)
return opts
}
Expand Down
4 changes: 4 additions & 0 deletions cmd/pullpreview/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ func TestRegisterCommonFlagsParsesHelmOptions(t *testing.T) {
"--chart-repository", "https://charts.bitnami.com/bitnami",
"--chart-values", "values.yaml,values.preview.yaml",
"--chart-set", "image.tag=123,ingress.host={{ release_name }}.preview.run",
"--proxy-tls-hosts", "nextcloud.{{ pullpreview_public_dns }},keycloak.{{ pullpreview_public_dns }}",
}); err != nil {
t.Fatalf("Parse() error: %v", err)
}
Expand All @@ -91,6 +92,9 @@ func TestRegisterCommonFlagsParsesHelmOptions(t *testing.T) {
if len(opts.ChartSet) != 2 {
t.Fatalf("unexpected chart set values: %#v", opts.ChartSet)
}
if len(opts.ProxyTLSHosts) != 2 {
t.Fatalf("unexpected proxy tls hosts: %#v", opts.ProxyTLSHosts)
}
}

func TestRegisterCommonFlagsDefaultsToCompose(t *testing.T) {
Expand Down
Binary file modified dist/pullpreview-linux-amd64
Binary file not shown.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ require (
github.com/hetznercloud/hcloud-go/v2 v2.36.0
golang.org/x/crypto v0.48.0
golang.org/x/oauth2 v0.34.0
gopkg.in/yaml.v3 v3.0.1
)

require (
Expand Down
2 changes: 1 addition & 1 deletion internal/providers/hetzner/hetzner.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const (
// Hardcoded to a location with the highest server-type availability (snapshot: 2026-02-13).
defaultHetznerLocation = "nbg1"
defaultHetznerImage = "ubuntu-24.04"
defaultHetznerServerType = "cpx21"
defaultHetznerServerType = "cpx22"
defaultHetznerSSHUser = "root"
defaultHetznerSSHRetries = 10
defaultHetznerSSHInterval = 15 * time.Second
Expand Down
2 changes: 1 addition & 1 deletion internal/providers/hetzner/hetzner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ func mustNewProviderWithContext(t *testing.T, cfg Config) *Provider {

func makeTestServer(name, ip string, status hcloud.ServerStatus, serverType *hcloud.ServerType) *hcloud.Server {
if serverType == nil {
serverType = &hcloud.ServerType{Name: "cpx21"}
serverType = &hcloud.ServerType{Name: "cpx22"}
}
return &hcloud.Server{
Name: name,
Expand Down
Loading
Loading