From 1f536c12bd2366084bd782d3ab7f042f8462d767 Mon Sep 17 00:00:00 2001 From: Arjan H Date: Thu, 12 May 2022 07:33:50 +0200 Subject: [PATCH] Bump boulder version to release-2022-05-09 --- install | 3 ++- mail-tester.go | 7 +++-- patch.sh | 2 ++ patches/docker-compose.patch | 2 +- patches/expiration-mailer_main.patch | 14 +++++----- patches/mail_mailer.patch | 38 ++++++++++++++++++---------- patches/makefile.patch | 13 ++++++++++ 7 files changed, 52 insertions(+), 27 deletions(-) create mode 100644 patches/makefile.patch diff --git a/install b/install index 733d98c..4954be9 100755 --- a/install +++ b/install @@ -24,7 +24,7 @@ dockerComposeVersion="v2.5.0" labcaUrl="https://github.com/hakwerk/labca/" boulderUrl="https://github.com/letsencrypt/boulder/" -boulderTag="release-2022-05-02" +boulderTag="release-2022-05-09" # Feature flags flag_skip_redis=true @@ -571,6 +571,7 @@ config_boulder() { cp errors/errors.go "$boulderLabCADir/.backup/" cp log/log.go "$boulderLabCADir/.backup/" cp sa/_db/migrations/20210223140000_CombinedSchema.sql "$boulderLabCADir/.backup/" + cp Makefile "$boulderLabCADir/.backup/" sudo -u labca -H patch -p1 -o "$boulderLabCADir/entrypoint.sh" < $cloneDir/patches/entrypoint.patch &>>$installLog cp test/startservers.py "$boulderLabCADir/startservers.py" &>>$installLog diff --git a/mail-tester.go b/mail-tester.go index 1768da1..15024b7 100644 --- a/mail-tester.go +++ b/mail-tester.go @@ -136,14 +136,13 @@ func main() { 1*time.Second, 5*60*time.Second) - conn, err := mailClient.Connect() - cmd.FailOnError(err, "mail-tester failed to connect") - defer conn.Close() + mailClient.Connect() + defer mailClient.Close() recipients := []string{} recipients = append(recipients, recipient) - err = conn.SendMail(recipients, "Test Email from LabCA", "Test sending email from the LabCA server") + err = mailClient.SendMail(recipients, "Test Email from LabCA", "Test sending email from the LabCA server") cmd.FailOnError(err, "mail-tester has failed") } diff --git a/patch.sh b/patch.sh index fab3369..f05df79 100755 --- a/patch.sh +++ b/patch.sh @@ -39,3 +39,5 @@ cp $cloneDir/mail-tester.go cmd/mail-tester/main.go perl -i -p0e "s/(\n\t\"github.com\/letsencrypt\/boulder\/cmd\")/\t_ \"github.com\/letsencrypt\/boulder\/cmd\/mail-tester\"\n\1/igs" cmd/boulder/main.go $SUDO patch -p1 < $cloneDir/patches/db_migrations.patch + +$SUDO patch -p1 < $cloneDir/patches/makefile.patch diff --git a/patches/docker-compose.patch b/patches/docker-compose.patch index 71ce0a2..6f82111 100644 --- a/patches/docker-compose.patch +++ b/patches/docker-compose.patch @@ -3,7 +3,7 @@ index 0cd8c8dd..36619190 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,7 @@ services: - image: &boulder_image letsencrypt/boulder-tools:${BOULDER_TOOLS_TAG:-go1.17.9_2022-04-12} + image: &boulder_image letsencrypt/boulder-tools:${BOULDER_TOOLS_TAG:-go1.18.1_2022-04-12} environment: FAKE_DNS: 10.77.77.77 - BOULDER_CONFIG_DIR: test/config diff --git a/patches/expiration-mailer_main.patch b/patches/expiration-mailer_main.patch index 0bda999..c2d17b1 100644 --- a/patches/expiration-mailer_main.patch +++ b/patches/expiration-mailer_main.patch @@ -1,8 +1,8 @@ diff --git a/cmd/expiration-mailer/main.go b/cmd/expiration-mailer/main.go -index 5debf63c..c2c411e3 100644 +index 0ea463a8..1c7c6931 100644 --- a/cmd/expiration-mailer/main.go +++ b/cmd/expiration-mailer/main.go -@@ -23,6 +23,7 @@ import ( +@@ -22,6 +22,7 @@ import ( "github.com/jmhodges/clock" "google.golang.org/grpc" @@ -10,7 +10,7 @@ index 5debf63c..c2c411e3 100644 "github.com/letsencrypt/boulder/cmd" "github.com/letsencrypt/boulder/core" corepb "github.com/letsencrypt/boulder/core/proto" -@@ -39,7 +40,7 @@ import ( +@@ -38,7 +39,7 @@ import ( const ( defaultNagCheckInterval = 24 * time.Hour @@ -19,7 +19,7 @@ index 5debf63c..c2c411e3 100644 ) type regStore interface { -@@ -442,6 +443,9 @@ type Config struct { +@@ -415,6 +416,9 @@ type Config struct { TLS cmd.TLSConfig SAService *cmd.GRPCClientConfig @@ -29,7 +29,7 @@ index 5debf63c..c2c411e3 100644 // Path to a file containing a list of trusted root certificates for use // during the SMTP connection (as opposed to the gRPC connections). SMTPTrustedRootFile string -@@ -451,6 +455,12 @@ type Config struct { +@@ -424,6 +428,12 @@ type Config struct { Syslog cmd.SyslogConfig Beeline cmd.BeelineConfig @@ -42,7 +42,7 @@ index 5debf63c..c2c411e3 100644 } func initStats(stats prometheus.Registerer) mailerStats { -@@ -553,6 +563,32 @@ func main() { +@@ -542,6 +552,32 @@ func main() { cmd.FailOnError(err, "Failed to load credentials and create gRPC connection to SA") sac := sapb.NewStorageAuthorityClient(conn) @@ -75,7 +75,7 @@ index 5debf63c..c2c411e3 100644 var smtpRoots *x509.CertPool if c.Mailer.SMTPTrustedRootFile != "" { pem, err := ioutil.ReadFile(c.Mailer.SMTPTrustedRootFile) -@@ -588,6 +624,7 @@ func main() { +@@ -577,6 +613,7 @@ func main() { c.Mailer.Username, smtpPassword, smtpRoots, diff --git a/patches/mail_mailer.patch b/patches/mail_mailer.patch index 0df700e..54c60d1 100644 --- a/patches/mail_mailer.patch +++ b/patches/mail_mailer.patch @@ -1,5 +1,5 @@ diff --git a/mail/mailer.go b/mail/mailer.go -index 4249108e..ee8b6fb4 100644 +index b20de949..91979e9c 100644 --- a/mail/mailer.go +++ b/mail/mailer.go @@ -21,10 +21,14 @@ import ( @@ -17,7 +17,7 @@ index 4249108e..ee8b6fb4 100644 ) type idGenerator interface { -@@ -139,6 +143,7 @@ func New( +@@ -122,6 +126,7 @@ func New( username, password string, rootCAs *x509.CertPool, @@ -25,24 +25,34 @@ index 4249108e..ee8b6fb4 100644 from mail.Address, logger blog.Logger, stats prometheus.Registerer, -@@ -159,6 +164,7 @@ func New( - server: server, - port: port, - rootCAs: rootCAs, -+ dnsClient: resolver, - }, - log: logger, - from: from, -@@ -202,7 +208,7 @@ func (c config) generateMessage(to []string, subject, body string) ([]byte, erro +@@ -136,11 +141,12 @@ func New( + + return &MailerImpl{ + dialer: &dialerImpl{ +- username: username, +- password: password, +- server: server, +- port: port, +- rootCAs: rootCAs, ++ username: username, ++ password: password, ++ server: server, ++ port: port, ++ rootCAs: rootCAs, ++ dnsClient: resolver, + }, + log: logger, + from: from, +@@ -181,7 +187,7 @@ func (m *MailerImpl) generateMessage(to []string, subject, body string) ([]byte, fmt.Sprintf("To: %s", strings.Join(addrs, ", ")), - fmt.Sprintf("From: %s", c.from.String()), + fmt.Sprintf("From: %s", m.from.String()), fmt.Sprintf("Subject: %s", subject), - fmt.Sprintf("Date: %s", now.Format(time.RFC822)), + fmt.Sprintf("Date: %s", now.Format(time.RFC1123Z)), - fmt.Sprintf("Message-Id: <%s.%s.%s>", now.Format("20060102T150405"), mid.String(), c.from.Address), + fmt.Sprintf("Message-Id: <%s.%s.%s>", now.Format("20060102T150405"), mid.String(), m.from.Address), "MIME-Version: 1.0", "Content-Type: text/plain; charset=UTF-8", -@@ -259,23 +265,32 @@ func (m *mailerImpl) Connect() (Conn, error) { +@@ -238,23 +244,32 @@ func (m *MailerImpl) Connect() error { type dialerImpl struct { username, password, server, port string rootCAs *x509.CertPool diff --git a/patches/makefile.patch b/patches/makefile.patch new file mode 100644 index 0000000..49254d2 --- /dev/null +++ b/patches/makefile.patch @@ -0,0 +1,13 @@ +diff --git a/Makefile b/Makefile +index 6427367f..54055e74 100644 +--- a/Makefile ++++ b/Makefile +@@ -37,7 +37,7 @@ $(CMD_BINS): build_cmds + + build_cmds: | $(OBJDIR) + echo $(OBJECTS) +- GOBIN=$(OBJDIR) GO111MODULE=on go install -mod=vendor $(GO_BUILD_FLAGS) ./... ++ GOBIN=$(OBJDIR) GO111MODULE=on go install -mod=vendor -buildvcs=false $(GO_BUILD_FLAGS) ./... + ./link.sh + + # Building an RPM requires `fpm` from https://github.com/jordansissel/fpm