Skip to content

Commit

Permalink
Add storage.albinvass.se, fix pulumi virtualhosts deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Albin Vass committed Jun 7, 2024
1 parent ad6b2ed commit 62b86b4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 4 additions & 0 deletions nixos/hosts/reverse-proxy/nginx.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
forceSSL = true;
enableACME = true;
};
"storage.albinvass.se" = {
forceSSL = true;
enableACME = true;
};
};
};
}
11 changes: 5 additions & 6 deletions pulumi/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand All @@ -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
}

0 comments on commit 62b86b4

Please sign in to comment.