From 62b86b493d409d5517d81680b92cca7313666fb5 Mon Sep 17 00:00:00 2001 From: Albin Vass Date: Sat, 8 Jun 2024 00:28:48 +0200 Subject: [PATCH] Add storage.albinvass.se, fix pulumi virtualhosts deployment --- nixos/hosts/reverse-proxy/nginx.nix | 4 ++++ pulumi/node.go | 11 +++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/nixos/hosts/reverse-proxy/nginx.nix b/nixos/hosts/reverse-proxy/nginx.nix index 76a90fb..67f77ad 100644 --- a/nixos/hosts/reverse-proxy/nginx.nix +++ b/nixos/hosts/reverse-proxy/nginx.nix @@ -12,6 +12,10 @@ forceSSL = true; enableACME = true; }; + "storage.albinvass.se" = { + forceSSL = true; + enableACME = true; + }; }; }; } diff --git a/pulumi/node.go b/pulumi/node.go index 2785459..1c80118 100644 --- a/pulumi/node.go +++ b/pulumi/node.go @@ -242,15 +242,14 @@ func (n *Node) provisionTunnels(ctx *pulumi.Context, zone *cloudflare.Zone) erro } func (n *Node) provisionFromCerts(ctx *pulumi.Context, server *hcloud.Server, zone *cloudflare.Zone) error { - for _, certRecord := range n.VirtualHosts { - zone.Zone.ApplyT(func(zoneName string) error { + zone.Zone.ApplyT(func(zoneName string) error { + for _, certRecord := range n.VirtualHosts { recordName := "" if certRecord != zoneName { recordName = strings.TrimPrefix(certRecord, fmt.Sprintf(".%s", zoneName)) } else { recordName = "@" } - ctx.Log.Info(recordName, nil) recordArgs := &cloudflare.RecordArgs{ Name: pulumi.String(recordName), Type: pulumi.String("A"), @@ -266,8 +265,8 @@ func (n *Node) provisionFromCerts(ctx *pulumi.Context, server *hcloud.Server, zo if err != nil { return fmt.Errorf("failed to create record: %v", err) } - return nil - }) - } + } + return nil + }) return nil }