From 4d7abab4d4e2bc68b7365335af52b8da393fa72b Mon Sep 17 00:00:00 2001 From: "Felipe M." Date: Mon, 27 Jan 2025 21:12:50 +0100 Subject: [PATCH] fix: bundle ca-certs directly in the binary --- Containerfile | 1 + cmd/smtp2shoutrrr/main.go | 2 ++ go.mod | 1 + go.sum | 2 ++ 4 files changed, 6 insertions(+) diff --git a/Containerfile b/Containerfile index 9fa3ce9..2284c9e 100644 --- a/Containerfile +++ b/Containerfile @@ -1,5 +1,6 @@ # This file is used directly by the goreleaser build # It is used to build the final container image FROM scratch +WORKDIR / COPY /smtp2shoutrrr /usr/bin/smtp2shoutrrr ENTRYPOINT ["/usr/bin/smtp2shoutrrr"] diff --git a/cmd/smtp2shoutrrr/main.go b/cmd/smtp2shoutrrr/main.go index ff48845..0d92081 100644 --- a/cmd/smtp2shoutrrr/main.go +++ b/cmd/smtp2shoutrrr/main.go @@ -9,6 +9,8 @@ import ( "git.nakama.town/fmartingr/gotoolkit/model" "git.nakama.town/fmartingr/gotoolkit/service" "git.nakama.town/fmartingr/smtp2shoutrrr" + + _ "golang.org/x/crypto/x509roots/fallback" ) func main() { diff --git a/go.mod b/go.mod index a1ed44d..992c159 100644 --- a/go.mod +++ b/go.mod @@ -7,6 +7,7 @@ require ( github.com/containrrr/shoutrrr v0.8.0 github.com/emersion/go-sasl v0.0.0-20200509203442-7bfe0ed36a21 github.com/emersion/go-smtp v0.21.3 + golang.org/x/crypto/x509roots/fallback v0.0.0-20250118192723-a8ea4be81f07 ) require ( diff --git a/go.sum b/go.sum index 49bbf13..889b388 100644 --- a/go.sum +++ b/go.sum @@ -37,6 +37,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +golang.org/x/crypto/x509roots/fallback v0.0.0-20250118192723-a8ea4be81f07 h1:Tuk3hxOkRoX4Xwph6/tRU1wGumEsVYM2TZfvAC6MllM= +golang.org/x/crypto/x509roots/fallback v0.0.0-20250118192723-a8ea4be81f07/go.mod h1:kNa9WdvYnzFwC79zRpLRMJbdEFlhyM5RPFBBZp/wWH8= golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=